/* The feature guide (docs.html). Same palette as style.css: the app's own (ui/theme/Color.kt). */
:root {
  --bg: #121619;
  --surface: #1b2126;
  --surface-2: #242c32;
  --divider: #2c353c;
  --accent: #2ec4a6;
  --accent-strong: #1fa88e;
  --on-accent: #04211b;
  --premium: #e8b04a;
  --text: #e8edf0;
  --text-2: #8d99a3;
  --text-3: #65717b;
  --top: #182025;
  --link-hover: #5fe0c6;
  --card-edge: transparent;
  --on-premium: #1d1505;
  color-scheme: dark;
}

/* Light: the app's Mint Mist palette (LightEtPalette in ui/theme/Color.kt). It follows the
   visitor's system setting, or the theme button in the top bar (js/theme.js). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f7f6;
    --surface: #ffffff;
    --surface-2: #eef4f2;
    --divider: #e2eae7;
    --accent: #0b7a66;
    --accent-strong: #0b7a66;
    --on-accent: #ffffff;
    --text: #10231f;
    --text-2: #5b6b67;
    --text-3: #8a9894;
    --top: #ffffff;
    --link-hover: #075e4f;
    --card-edge: #e2eae7;
    --premium: #8f6400;
    --on-premium: #ffffff;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --divider: #e2eae7;
  --accent: #0b7a66;
  --accent-strong: #0b7a66;
  --on-accent: #ffffff;
  --text: #10231f;
  --text-2: #5b6b67;
  --text-3: #8a9894;
  --top: #ffffff;
  --link-hover: #075e4f;
  --card-edge: #e2eae7;
  --premium: #8f6400;
  --on-premium: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, kbd {
  font: 14px ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 0 4px;
  /* Long commands and addresses wrap instead of pushing the page sideways on a phone. */
  overflow-wrap: anywhere;
}

/* The AI assistant demo (img/ai-demo.svg), scaled to the card. */
.demo { margin: 1rem 0; }
.demo img { display: block; width: 100%; height: auto; border-radius: 14px; }
.demo figcaption { color: var(--text-3); font-size: 13px; margin-top: .4rem; }

/* Top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 16px;
  background: var(--top);
  border-bottom: 1px solid var(--divider);
}
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.brand span { color: var(--text-2); font-weight: 400; }
.top nav { display: flex; gap: 16px; margin-left: auto; font-size: 14px; }
.top nav a { text-decoration: none; white-space: nowrap; }
.top nav .short { display: none; }
.theme-toggle {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 32px;
  padding: 4px 8px;
  font: 16px/1 system-ui, sans-serif;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: 8px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--text-3); }

/* A phone: the bar stays one line. "Web reports" is shortened and the gaps tightened; on a very
   narrow screen the title gives way, cut short with an ellipsis, before the links do. */
@media (max-width: 420px) {
  .top { flex-wrap: nowrap; gap: 12px; padding: 12px 14px; }
  .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top nav { flex-shrink: 0; gap: 12px; }
  .top nav .long { display: none; }
  .top nav .short { display: inline; }
}

/* Layout: contents against the window's left edge, the guide beside them filling the rest of
   the window's width, so a wide screen has no bare strip down its right side; one column on a
   phone. */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
  padding: 32px 24px 64px;
}
.toc {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  font-size: 14px;
}
/* The drawer's head, its backdrop and the button that opens it are for a phone only (see the
   media query). */
.toc-head, .toc-backdrop, .to-contents { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { margin-bottom: 14px; }
.toc .group {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 4px;
}
.toc ol ol a {
  display: block;
  padding: 3px 0 3px 10px;
  border-left: 2px solid var(--divider);
  color: var(--text);
  text-decoration: none;
}
.toc ol ol a:hover { border-left-color: var(--accent); color: var(--accent); }

main { min-width: 0; }

/* Intro */
.intro h1 { font-size: 32px; line-height: 1.2; margin: 0 0 12px; }
.intro p { color: var(--text-2); margin: 0 0 12px; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 20px 0 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-2);
}

/* Free / Premium labels */
.tag {
  display: inline-block;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 6px;
  white-space: nowrap;
}
.tag.free { color: var(--accent); border: 1px solid var(--accent-strong); }
.tag.premium { color: var(--on-premium); background: var(--premium); }
.tag.mixed { color: var(--premium); border: 1px solid var(--premium); }
.legend .tag { margin: 0 6px 0 0; }
/* A phone: labels in one column and what they mean in the next, so a description that wraps
   stays beside its label rather than running on under it. */
@media (max-width: 600px) {
  .legend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px; align-items: center; line-height: 1.35; }
  .legend-item { display: contents; }
  .legend .tag { margin: 0; justify-self: start; }
}

/* Groups and features */
.group-head {
  margin: 56px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}
.group-head h2 { font-size: 24px; margin: 0; }
.group-head p { color: var(--text-2); margin: 4px 0 0; }

.feature {
  margin: 24px 0 0;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
}
.feature h3 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
.feature h3 a.anchor { color: var(--text-3); text-decoration: none; margin-left: 6px; font-weight: 400; }
.feature h3 a.anchor:hover { color: var(--accent); }
.feature .lead { color: var(--text-2); margin: 0 0 14px; }
.feature h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 18px 0 6px;
}
.feature p { margin: 0 0 10px; }
.feature ul, .feature ol { margin: 0 0 10px; padding-left: 22px; }
.feature li { margin: 3px 0; }
.feature li::marker { color: var(--text-3); }

/* The place in the app a step goes to, as in the app's Help. */
.path {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 0 7px;
  white-space: nowrap;
}

.note {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-strong);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}
.note.lock { border-left-color: var(--premium); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 4px 0 10px;
}
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: 13px; }
.table-wrap { overflow-x: auto; }

/* Videos: the promo cuts are vertical (9:16), so each is a phone-shaped frame. */
.watch {
  margin: 24px 0 0;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
}
.watch-title { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.muted { color: var(--text-2); }
.watch .muted { margin: 0 0 16px; }
.video-row { display: flex; flex-wrap: wrap; gap: 20px; }
.video { margin: 0 0 14px; width: 100%; max-width: 300px; }
.video-row .video { margin: 0; }
.video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: 12px;
  background: #000;
}
.video figcaption { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.video figcaption strong { color: var(--text); font-weight: 600; }
.group-head .video { margin-top: 16px; }

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  color: var(--text-3);
  font-size: 14px;
}

@media (max-width: 860px) {
  html { scroll-padding-top: 64px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 16px 48px; }
  /* The contents are a drawer from the left, over the page, opened by the floating button. */
  .toc {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    width: min(320px, 85vw);
    /* The screen's height, so the list scrolls inside it. The wide layout's align-self: start
       would otherwise shrink this grid child to the whole list's height, past the screen, with
       nothing left to scroll. */
    align-self: stretch;
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border-right: 1px solid var(--divider);
    box-shadow: 8px 0 24px rgba(0, 0, 0, .4);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s;
  }
  /* Shown at once when opening, so focus can move into it; hidden only once it has slid out. */
  .toc-open .toc { transform: none; visibility: visible; transition: transform .22s ease; }
  .toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    padding: 8px 8px 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--divider);
    font-weight: 600;
    font-size: 16px;
  }
  .toc-close {
    min-width: 44px;
    min-height: 44px;
    font: inherit;
    font-size: 18px;
    color: var(--text-2);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
  }
  .toc-close:hover { color: var(--text); background: var(--surface-2); }
  .toc > ol { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .toc ol ol a { padding: 7px 0 7px 12px; font-size: 15px; }
  .toc-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 4;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
  }
  .toc-open .toc-backdrop { opacity: 1; pointer-events: auto; }
  /* The page stays put under the open drawer. */
  .toc-open { overflow: hidden; }
  .to-contents {
    display: block;
    font: inherit;
    border: 0;
    cursor: pointer;
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 3;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent-strong);
    color: var(--on-accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  }
  .to-contents:hover { color: var(--on-accent); background: var(--accent); }
  footer { padding-bottom: 56px; }
  .intro h1 { font-size: 26px; }
  .feature, .watch { padding: 18px 16px; }
  .video { max-width: 280px; }
  .path { white-space: normal; }
}
