:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #5d6470;
  --line: #dcdad3;
  --accent: #16365f;
  --accent-ink: #ffffff;
  --link: #1d4f91;
  --mark: #ffe58a;
  --chip: #e8e6df;
  --radius: 12px;
  --hero: #16365f;
  --hero-ink: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1b1e23;
    --ink: #eceef1;
    --muted: #9aa3ae;
    --line: #2c3139;
    --accent: #7fb0ff;
    --accent-ink: #0d1726;
    --link: #8dbaff;
    --mark: #6b5a12;
    --chip: #252a31;
    --hero: #1a3358;
    --hero-ink: #ffffff;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
main { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }
h1 { font-size: 1.35rem; line-height: 1.25; margin: 14px 0 2px; }
h2 { font-size: 1.1rem; }
.hint, .meta, .en, .pg { color: var(--muted); }
.meta { font-size: .88rem; margin: 6px 0 10px; }
.en { font-size: .88rem; margin: 2px 0; font-style: italic; }
.pg { font-size: .8rem; white-space: nowrap; }

/* top bar used by every inner page */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; align-items: center;
  padding: 8px 12px; background: var(--hero); color: var(--hero-ink);
}
.bar .back {
  display: flex; align-items: center; gap: 2px; flex: none;
  color: var(--hero-ink); text-decoration: none; font-weight: 600; padding: 6px 4px;
}
.bar .back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bar .mini { flex: 1; }
.bar input {
  width: 100%; font-size: 16px; padding: 9px 12px; border-radius: 10px;
  border: 0; background: var(--surface); color: var(--ink);
}
.crumbs { font-size: .85rem; margin-top: 12px; color: var(--muted); }
.crumbs a { text-decoration: none; }

/* page viewer */
.sheet { margin: 0 -16px; background: #fff; }
.sheet img { display: block; width: 100%; height: auto; }
@media (min-width: 700px) { .sheet { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; } }
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  margin: 12px 0;
}
.pager a {
  display: block; text-align: center; padding: 12px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600;
}
.pager .pos { color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.actions a, .actions button {
  font: inherit; font-size: .92rem; padding: 9px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.dtcs { font-size: .9rem; font-weight: 600; }
details.txt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
details.txt summary { cursor: pointer; font-weight: 600; }
.links { font-size: .82rem; color: var(--muted); word-break: break-all; }
.pre { white-space: pre-line; font-size: .92rem; overflow-wrap: anywhere; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: .9rem; z-index: 20; max-width: calc(100% - 32px); text-align: center;
}

/* home */
.hero { background: var(--hero); color: var(--hero-ink); padding: 18px 16px 16px; }
.hero-in { max-width: 860px; margin: 0 auto; }
.hero h1 { margin: 0 0 2px; font-size: 1.3rem; }
.hero p { margin: 0 0 12px; opacity: .85; font-size: .9rem; }
.search { position: relative; }
.search input {
  width: 100%; font-size: 18px; padding: 14px 44px 14px 14px; border-radius: 14px;
  border: 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 2px 10px rgb(0 0 0 / .18);
}
.search button.clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer;
}
.chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.chips span { font-size: .82rem; opacity: .85; margin-right: 2px; }
.chips button {
  font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .45); background: transparent; color: var(--hero-ink);
}
.chips button[aria-pressed="true"] { background: var(--hero-ink); color: var(--hero); font-weight: 600; }
.status { font-size: .85rem; color: var(--muted); margin: 12px 0 6px; min-height: 1.2em; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.results a {
  display: block; padding: 12px 14px; border-radius: var(--radius); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.results .t { font-weight: 650; font-size: 1.02rem; line-height: 1.3; }
.results .en { margin: 2px 0 0; }
.results .m { font-size: .8rem; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--ink); }
.results .s { font-size: .86rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.more { display: block; width: 100%; margin: 12px 0; padding: 12px; font: inherit; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.block h2 { margin: 22px 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shortcuts button {
  font: inherit; font-size: .92rem; text-align: left; padding: 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); line-height: 1.25;
}
.cards { display: grid; gap: 8px; }
.cards a {
  display: block; padding: 12px 14px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.cards b { display: block; }
.cards small { color: var(--muted); }
.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.recent a { text-decoration: none; }
footer.foot { color: var(--muted); font-size: .8rem; margin-top: 28px; }

/* index and section pages */
.doc-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.doc-jump a { padding: 6px 12px; border-radius: 999px; background: var(--chip); text-decoration: none; color: var(--ink); font-size: .88rem; }
section.doc { margin-top: 22px; }
section.doc details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; }
section.doc summary { padding: 11px 12px; cursor: pointer; font-weight: 600; }
section.doc ul { margin: 0; padding: 0 12px 12px 30px; }
section.doc li { margin: 6px 0; }
.eng { font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--chip); }
.sec-link { margin: 0 12px 8px; font-size: .9rem; }
.toc { padding-left: 22px; }
.toc li { margin: 4px 0; }
.section-page section { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 18px; }
.section-page h2 a { text-decoration: none; }

/* gemini page */
.copybox { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.copybox pre { white-space: pre-wrap; font: .9rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 10px; }
.btn { font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block; }
ol.steps li { margin: 6px 0; }

/* install banner and how-to */
.install {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 12px 12px 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.install > div { flex: 1; }
.install b { display: block; }
.install small { display: block; color: var(--muted); margin-top: 2px; }
.install small b { display: inline; color: var(--ink); }
.install .x { border: 0; background: none; color: var(--muted); font-size: 24px; width: 36px; height: 36px; cursor: pointer; flex: none; }
.actions button[aria-pressed="true"] { border-color: var(--accent); font-weight: 600; }
details.howto { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
details.howto summary { cursor: pointer; font-weight: 600; }
details.howto p { font-size: .92rem; }
