@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Design tokens from Flutter app */
:root {
  --background: #F0F2F1;
  --primary: #596D62;
  --primary-dim: #3A463F;
  --primary-foreground: #FFF6EE;
  --font-foreground: #3B4745;
  --font-accent: #DADEDB;
  --card-bg: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #343A38;
    --primary: #889a94;
    --primary-dim: #171E1C;
    --primary-foreground: #ded8d2;
    --font-foreground: #c0cac5;
    --font-accent: #454B48;
    --card-bg: #243028;
  }
}

* {
  box-sizing: border-box;
}

.inline-icon {
  vertical-align: -0.15em;
  opacity: 0.8;
}

body {
  margin: 0;
  padding: 0;
  background: var(--background);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--font-foreground);
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  color: var(--primary-dim);
  text-decoration: underline;
}

#page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 32px 0;
}

/* Header */
#header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 28px;
  border-radius: 0 0 34px 34px;
  background: var(--primary-dim);
  margin-bottom: 20px;
}

#header-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
}

#header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#header-title {
  color: var(--primary-foreground);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin: 0;
}

#header-subtitle {
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
}

/* Content */
#content {
  padding: 0 16px;
}

p {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

p:last-child {
  margin-bottom: 0;
}

p.small {
  font-size: 12px;
  color: var(--font-foreground);
  opacity: 0.6;
  margin-bottom: 12px;
}

hr {
  border: none;
  border-top: 1px solid var(--font-accent);
  margin: 20px 0;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--font-foreground);
  opacity: 0.5;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 28px 0 8px 16px;
}

/* Navigation links (table of contents) */
#nav-links {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

#nav-links a {
  font-size: 14px;
  font-weight: 700;
}

/* Intro section */
.intro-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

/* Intro details */
.intro-details {
  margin-top: -4px;
}

.intro-details summary {
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.intro-details summary::-webkit-details-marker {
  display: none;
}

.intro-details summary::before {
  content: '›';
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}

.intro-details[open] summary::before {
  transform: rotate(90deg);
}

.intro-details p {
  margin-top: 4px;
}

/* Store badges */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 8px 0 4px;
}

.store-badges img {
  height: 48px;
  width: auto;
  display: block;
}

.store-badges a:hover {
  text-decoration: none;
}

/* Help section items */
.help-item {
  background: var(--card-bg);
  border-radius: 4px;
  padding: 12px 20px;
  margin-bottom: 1px;
}

.help-item:first-child {
  border-radius: 12px 12px 4px 4px;
}

.help-item:last-child {
  border-radius: 4px 4px 12px 12px;
  margin-bottom: 0;
}

.help-item h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 4px 0;
}

.help-item p {
  margin-bottom: 4px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

table td {
  padding: 11px 20px;
  vertical-align: top;
  line-height: 1.5;
  border-bottom: 1px solid var(--font-accent);
}

table tr:last-child td {
  border-bottom: none;
}

td.version {
  white-space: nowrap;
  font-weight: 600;
  color: var(--primary);
  width: 140px;
  padding-right: 8px;
}

.table-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4px;
}

.table-card.padded {
  padding: 16px 20px;
}

/* Collapsible older releases */
.older-releases {
  border-top: 1px solid var(--font-accent);
}

.older-releases summary {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.older-releases summary::-webkit-details-marker {
  display: none;
}

.older-releases summary::before {
  content: '›';
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}

.older-releases[open] summary::before {
  transform: rotate(90deg);
}

.older-releases table {
  border-top: 1px solid var(--font-accent);
}

/* Footer */
.footer-links {
  color: var(--font-foreground);
  opacity: 0.5;
  font-size: 12px;
  text-align: center;
  margin-top: 24px;
}

.footer-links a {
  color: var(--font-foreground);
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 600px) {
  #header {
    padding: 20px 20px;
    gap: 12px;
  }

  #header-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  #header-title {
    font-size: 18px;
  }

  #content {
    padding: 0 12px;
  }

  td.version {
    width: 100px;
  }
}
