/* The user guide site — one stylesheet for the five languages.
   Generated pages (tool/build_guide_site.dart) only carry content and the
   class names used here; look and feel is edited in this file. */
:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface-2: #f0efe9;
  --ink: #1b2236; --muted: #5a6277; --line: #e3e0d7;
  --brand: #d32f2f; --navy: #2e3d5c; --accent: #0f766e; --accent-ink: #ffffff;
  --accent-soft: #dff1ee; --link: #1d4f91;
  --tip-bg: #e8f4f2; --tip-line: #0f766e; --warn-bg: #fff3df; --warn-line: #b86e00;
  --role-all: #e9e7df; --role-all-ink: #4a5063;
  --role-member: #dbeafe; --role-member-ink: #1e4a8c;
  --role-admin: #fdebc8; --role-admin-ink: #7a4a00;
  --role-owner: #e9defa; --role-owner-ink: #4a2a8c;
  --role-billing: #d9f2dd; --role-billing-ink: #1d5a2a;
  --role-operator: #dde3ea; --role-operator-ink: #2f3a4a;
  --shadow: 0 1px 2px rgb(20 28 50 / .06), 0 8px 24px rgb(20 28 50 / .07);
  --radius: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151f; --surface: #181e2c; --surface-2: #1f2637;
    --ink: #e9ecf4; --muted: #a2abc0; --line: #2a3246;
    --brand: #ef5350; --navy: #c7d3f2; --accent: #3cc3b4; --accent-ink: #06201d;
    --accent-soft: #16322f; --link: #8ab8f5;
    --tip-bg: #14302d; --tip-line: #3cc3b4; --warn-bg: #3a2c12; --warn-line: #e0a040;
    --role-all: #2a3144; --role-all-ink: #c3cade;
    --role-member: #1d3558; --role-member-ink: #a8c8f7;
    --role-admin: #4a3513; --role-admin-ink: #f1c986;
    --role-owner: #34284f; --role-owner-ink: #cdb8f5;
    --role-billing: #1d3a24; --role-billing-ink: #a6e0b0;
    --role-operator: #2a3340; --role-operator-ink: #b9c4d4;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151f; --surface: #181e2c; --surface-2: #1f2637;
  --ink: #e9ecf4; --muted: #a2abc0; --line: #2a3246;
  --brand: #ef5350; --navy: #c7d3f2; --accent: #3cc3b4; --accent-ink: #06201d;
  --accent-soft: #16322f; --link: #8ab8f5;
  --tip-bg: #14302d; --tip-line: #3cc3b4; --warn-bg: #3a2c12; --warn-line: #e0a040;
  --role-all: #2a3144; --role-all-ink: #c3cade;
  --role-member: #1d3558; --role-member-ink: #a8c8f7;
  --role-admin: #4a3513; --role-admin-ink: #f1c986;
  --role-owner: #34284f; --role-owner-ink: #cdb8f5;
  --role-billing: #1d3a24; --role-billing-ink: #a6e0b0;
  --role-operator: #2a3340; --role-operator-ink: #b9c4d4;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.62 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand-mark::before { content: ""; width: 14px; height: 4px; background: #fff; border-radius: 2px; box-shadow: 0 6px 0 -0.5px #fff; transform: translateY(-3px); }
.brand small { font-weight: 500; color: var(--muted); }
.search { flex: 1; min-width: 0; max-width: 460px; margin-left: auto; position: relative; }
.search input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 14px 0 38px; font: inherit; font-size: 15px; color: var(--ink);
}
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.bar select, .icon-btn {
  height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; padding: 0 12px; cursor: pointer;
}
.icon-btn { width: 40px; padding: 0; display: grid; place-items: center; }
.menu-btn { display: none; }

/* ── layout ──────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 0 32px; max-width: 1280px; margin: 0 auto; padding: 0 20px 96px; }
nav.toc {
  position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; padding: 24px 8px 24px 0;
  font-size: 14.5px; scrollbar-width: thin;
}
nav.toc ol { list-style: none; margin: 0; padding: 0; }
nav.toc > ol > li { margin: 0 0 14px; }
nav.toc .chap { display: block; font-weight: 700; color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 10px; }
nav.toc .chap small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 1px; }
nav.toc ol ol a { display: block; padding: 4px 10px 4px 14px; margin-left: 10px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
nav.toc ol ol a:hover { color: var(--ink); }
nav.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
nav.toc .chap.on { background: var(--accent-soft); color: var(--accent); }
main { min-width: 0; padding-top: 28px; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; color: var(--navy); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 46rem; margin: 0; }
.hero p strong { color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 6px; }
.filters .lbl { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; text-transform: uppercase; letter-spacing: .06em; }
.chip-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.count { color: var(--muted); font-size: 14px; margin-left: auto; }

/* ── chapters and sections ───────────────────────────────────────────── */
.chapter { margin: 56px 0 0; }
.chapter > header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.chapter > header .no { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.chapter > header h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); letter-spacing: -.025em; line-height: 1.12; margin: 0; color: var(--navy); }
.chapter > header .intro { color: var(--muted); max-width: 46rem; }
.chapter > header .intro ul { margin: 8px 0 0; padding-left: 1.2em; }
.section {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 4px 36px;
  grid-template-areas: "head media" "body media";
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 30px; margin: 0 0 20px;
}
.section:target { outline: 3px solid var(--accent); outline-offset: 3px; }
.section[hidden] { display: none; }
.section > header { grid-area: head; }
.section > .body { grid-area: body; min-width: 0; }
.section > .media { grid-area: media; display: flex; flex-direction: column; gap: 18px; align-items: center; align-self: start; position: sticky; top: 84px; }
.section.no-media { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body"; }
.section :is(h2, h3) { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; color: var(--ink); }
.section :is(h2, h3) a.permalink { color: var(--muted); text-decoration: none; margin-left: .35em; opacity: 0; font-weight: 400; }
.section :is(h2, h3):hover a.permalink, .section :is(h2, h3) a.permalink:focus-visible { opacity: 1; }
.roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.role { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .01em; }
.role-all { background: var(--role-all); color: var(--role-all-ink); }
.role-member { background: var(--role-member); color: var(--role-member-ink); }
.role-admin { background: var(--role-admin); color: var(--role-admin-ink); }
.role-owner, .role-coowner { background: var(--role-owner); color: var(--role-owner-ink); }
.role-billing { background: var(--role-billing); color: var(--role-billing-ink); }
.role-operator { background: var(--role-operator); color: var(--role-operator-ink); }
.body p { margin: 0 0 12px; }
.body > p:first-of-type { font-size: 1.06rem; }
.body h4.lbl { margin: 22px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 800; }
.body ol { list-style: none; counter-reset: step; margin: 0 0 12px; padding: 0; }
.body ol > li { counter-increment: step; position: relative; padding: 2px 0 12px 44px; }
.body ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.body ul { margin: 0 0 12px; padding-left: 1.25em; }
.body li { margin: 0 0 6px; }
.body li > p { margin: 0; }
.body strong { font-weight: 650; }
.body code { font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.body table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 15px; }
@media (max-width: 560px) { .body table { display: block; overflow-x: auto; } }
.body th, .body td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.body th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.body blockquote { margin: 14px 0; padding: 12px 16px; border-radius: 12px; border-left: 4px solid var(--tip-line); background: var(--tip-bg); }
.body blockquote p { margin: 0; }
.body blockquote.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.body p.see-also { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
.app-link { white-space: nowrap; font-weight: 600; }
.app-link::after { content: " ↗"; font-size: .85em; }

/* ── screenshots: a phone you can scroll ─────────────────────────────── */
figure.shot { margin: 0; width: 100%; max-width: 300px; }
figure.shot { position: relative; }
figure.shot .zoom {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: var(--navy); color: var(--bg); font-size: 18px; cursor: zoom-in; box-shadow: var(--shadow);
  opacity: .82; transition: opacity .15s;
}
figure.shot .zoom:hover, figure.shot .zoom:focus-visible { opacity: 1; }
figure.shot .screen:focus-visible, figure.shot .zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
figure.shot .screen {
  border-radius: 26px; border: 7px solid var(--navy); background: var(--surface); overflow: hidden auto; max-height: 560px;
  box-shadow: var(--shadow); cursor: zoom-in; scrollbar-width: none;
}
figure.shot .screen::-webkit-scrollbar { display: none; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot.wide { max-width: 100%; }
figure.shot.wide .screen { border-radius: 12px; border-width: 5px; max-height: 420px; }
figure.shot figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.lightbox::backdrop { background: rgb(8 12 22 / .78); backdrop-filter: blur(4px); }
dialog.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 14px; background: var(--surface); display: block; }
dialog.lightbox form { position: absolute; top: 8px; right: 8px; }
dialog.lightbox form .icon-btn { background: var(--surface); color: var(--ink); border-radius: 50%; box-shadow: var(--shadow); }
.empty { display: none; margin: 40px 0; text-align: center; color: var(--muted); }
.empty.on { display: block; }
footer.site { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0; color: var(--muted); font-size: 14px; }
mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; }
.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--navy); color: var(--bg);
  box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; font-size: 18px;
}
.to-top.on { opacity: 1; pointer-events: auto; }

/* ── tablet and phone ────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px 80px; }
  .menu-btn { display: grid; }
  nav.toc {
    position: fixed; inset: 58px 0 0 0; z-index: 25; max-height: none; background: var(--bg); padding: 16px 20px 40px;
    transform: translateX(-100%); transition: transform .25s ease; border-right: 1px solid var(--line);
  }
  body.nav-open nav.toc { transform: none; }
  .section { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "media" "body"; padding: 20px 18px; }
  .section > .media { position: static; }
  figure.shot { max-width: 280px; }
}
@media (max-width: 560px) {
  .brand small { display: none; }
  .bar { gap: 8px; }
  .chip-btn { padding: 6px 11px; font-size: 13.5px; }
  .count { width: 100%; margin: 4px 0 0; }
  .app-link { white-space: normal; overflow-wrap: anywhere; }
}
@media print {
  .bar, nav.toc, .filters, .to-top, figure.shot .zoom { display: none !important; }
  .layout { display: block; padding: 0; }
  .section { box-shadow: none; break-inside: avoid; display: block; }
  figure.shot .screen { max-height: none; overflow: visible; }
}

/* language switch, top of the contents */
.langs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px 10px; }
.chip-btn.lang { padding: 4px 10px; font-size: 12.5px; text-decoration: none; letter-spacing: .04em; }
.chip-btn.lang.cur { background: var(--navy); border-color: var(--navy); color: var(--bg); }

.hero .app-link {
  display: inline-block; margin-top: 4px; padding: 9px 16px; border-radius: 999px; background: var(--navy); color: var(--bg);
  text-decoration: none; font-weight: 650; font-size: 15px; white-space: nowrap;
}
.hero .app-link:hover { filter: brightness(1.12); }

/* the two books: user guide and setup guide */
.books { display: flex; gap: 4px; margin-left: 8px; }
.books a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.books a.cur { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) { .books { display: none; } }

/* the book switch inside the contents (phones, where the top bar hides it) */
.books-m { display: none; margin: 0 0 12px 6px; }
@media (max-width: 760px) { .books-m { display: flex; } }
