/* The Zibby World guide. One stylesheet for every page. No inline styles anywhere: the site policy is style-src 'self'.
   Light and dark follow the device. Phone first, then tablet and desktop. Print friendly. */
:root {
  --ink: #2b1563; --ink2: #52418a; --deep: #3b1c8a; --purple: #7b4dff; --pink: #ff62b4; --teal: #18d6c6; --sun: #ffc93c; --green: #3fbf6f;
  --bg: #fbf8ff; --card: #ffffff; --tint: #efe8ff; --line: #d9ccf7; --link: #4a22b8; --mark: #fff0a8; --shadow: rgba(43, 21, 99, 0.14);
  --zi-2: #3b1f7a; --zi-3: #ffe98a;
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Varela Round", Nunito, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1ebff; --ink2: #c9bcf0; --deep: #cdb9ff; --bg: #17102e; --card: #221845; --tint: #2d2158; --line: #43357c; --link: #b9a2ff; --mark: #5a4a10; --shadow: rgba(0, 0, 0, 0.4);
    --zi-2: #b79cff; --zi-3: #ffe98a;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.125rem/1.65 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; border-radius: 10px; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); margin-bottom: 0.4rem; }
h2 { font-size: clamp(1.45rem, 4.4vw, 1.9rem); margin: 2.4rem 0 0.7rem; padding-top: 0.4rem; border-top: 3px solid var(--line); }
h3 { font-size: clamp(1.15rem, 3.4vw, 1.35rem); margin: 1.6rem 0 0.5rem; }
p, ul, ol, table, .note { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
.skip { position: absolute; left: 12px; top: -80px; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 12px; z-index: 30; }
.skip:focus { top: 12px; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 3px solid var(--purple); box-shadow: 0 4px 14px var(--shadow); }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; max-width: 1180px; margin: 0 auto; padding: 8px 16px; }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand .logo-dot { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 0.3em; background: var(--purple); box-shadow: inset 0 0 0 0.28em var(--teal), inset 0 0 0 0.5em var(--pink); }
.search { position: relative; flex: 1 1 220px; min-width: 0; }
.search input { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 3px solid var(--line); border-radius: 999px; padding: 0.5rem 1rem; min-height: 48px; }
.search input::placeholder { color: var(--ink2); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 3px solid var(--purple); border-radius: 18px; box-shadow: 0 10px 26px var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; z-index: 40; }
.results[hidden] { display: none; }
.results a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a:focus-visible { background: var(--tint); }
.results b { display: block; }
.results small { display: block; color: var(--ink2); line-height: 1.4; }
.results mark { background: var(--mark); color: inherit; border-radius: 3px; }
.results .none { padding: 12px; color: var(--ink2); }

/* layout */
.shell { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.side { min-width: 0; }
.side details { background: var(--card); border: 3px solid var(--line); border-radius: 18px; padding: 4px 14px; margin-bottom: 12px; }
.side summary { cursor: pointer; font-weight: 800; padding: 10px 0; min-height: 44px; }
.side ul { list-style: none; padding: 0; margin: 0 0 10px; }
.side li { margin: 0; }
.side li a { display: block; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 44px; }
.side li a:hover { background: var(--tint); }
.side li a[aria-current="page"] { background: var(--purple); color: #fff; font-weight: 800; }
.side li.sub a { padding-left: 24px; font-size: 0.98rem; color: var(--ink2); }
main { min-width: 0; background: var(--card); border: 3px solid var(--line); border-radius: 24px; padding: 20px 18px 28px; }
.lead { font-size: 1.25rem; color: var(--ink2); }
.updated { color: var(--ink2); font-size: 0.95rem; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 290px minmax(0, 1fr); align-items: start; padding: 24px 16px; }
  .side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; }
  .side details { border-width: 2px; }
  main { padding: 30px 38px 40px; }
}
@media (min-width: 900px) and (max-height: 700px) { .side { position: static; max-height: none; } }

/* content parts */
.note { background: var(--tint); border-left: 8px solid var(--purple); border-radius: 12px; padding: 12px 16px; }
.note.good { border-left-color: var(--green); }
.note.try { border-left-color: var(--sun); }
.note p:last-child { margin-bottom: 0; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 0 0 1.2rem; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; height: 100%; background: var(--tint); border: 3px solid var(--line); border-radius: 18px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.cards a:hover { border-color: var(--purple); }
.cards b { display: block; font-size: 1.15rem; }
.cards span { color: var(--ink2); font-size: 1rem; line-height: 1.45; display: block; }
.tablewrap { overflow-x: auto; margin: 0 0 1.2rem; border-radius: 14px; border: 2px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 0; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--tint); font-weight: 800; position: sticky; left: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.zi { width: 1.5em; height: 1.5em; vertical-align: -0.38em; fill: currentColor; flex: none; }
.zi-b { fill: var(--zi-2); }
.zi-c { fill: var(--zi-3); }
.zi-sb { stroke: var(--zi-2); }
.zi-sc { stroke: var(--zi-3); }
.hb { display: inline-grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 0.7em; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(43, 21, 99, 0.35); vertical-align: -0.5em; margin-right: 0.35em; color: #fff; --zi-2: #3b1f7a; --zi-3: #ffe98a; }
.hb .zi { width: 1.3em; height: 1.3em; vertical-align: 0; }
.hb.pink { background: #ff62b4; --zi-2: #7d1655; }
.hb.purple { background: #7b4dff; --zi-2: #2c1480; }
.hb.teal { background: #18d6c6; color: #14304b; --zi-2: #0b7f7b; }
.hb.yellow { background: #ffc93c; color: #3b2a00; --zi-2: #b9791a; --zi-3: #fff; }
.hb.green { background: #5fd88a; color: #123a22; --zi-2: #17803a; }
.hb.orange { background: #ff9a3c; color: #3b1c00; --zi-2: #7a3000; }
.pic { display: inline-flex; align-items: center; justify-content: center; width: 2.1em; height: 2.1em; border-radius: 0.7em; background: var(--tint); color: var(--deep); vertical-align: -0.5em; margin-right: 0.35em; --zi-2: var(--pink); --zi-3: var(--sun); }
.pic .zi { width: 1.4em; height: 1.4em; vertical-align: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.btnref { white-space: nowrap; }
.btnref b { font-weight: 700; }
.card { display: inline-block; }
.fact { font-weight: 700; }
.q { color: var(--ink2); }
.where { color: var(--ink2); }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: 0.8rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 800; display: grid; place-items: center; }
.anchor { color: var(--ink2); text-decoration: none; margin-left: 0.4rem; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.totop { position: fixed; right: 14px; bottom: 14px; z-index: 15; background: var(--purple); color: #fff; text-decoration: none; font-weight: 800; padding: 12px 18px; border-radius: 999px; box-shadow: 0 5px 0 var(--deep), 0 10px 18px var(--shadow); min-height: 48px; display: inline-flex; align-items: center; }
.totop[hidden] { display: none; }
.foot { max-width: 1180px; margin: 0 auto; padding: 8px 16px 40px; color: var(--ink2); font-size: 0.98rem; }
.foot a { color: var(--link); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 2rem; }
.pager a { background: var(--tint); border: 3px solid var(--line); border-radius: 999px; padding: 10px 18px; text-decoration: none; font-weight: 800; color: var(--ink); min-height: 48px; display: inline-flex; align-items: center; }
.pager a:hover { border-color: var(--purple); }
.release { border: 3px solid var(--line); border-radius: 18px; padding: 8px 18px 6px; margin: 0 0 1rem; }
.release h3 { margin-top: 0.6rem; }
.release .when { color: var(--ink2); font-size: 0.95rem; margin: 0; }

/* print: plain, black on white, no chrome */
@media print {
  :root { --ink: #000; --ink2: #333; --bg: #fff; --card: #fff; --tint: #fff; --line: #999; --link: #000; --zi-2: #444; --zi-3: #999; }
  body { font-size: 11.5pt; }
  .bar, .side, .totop, .pager, .skip, .anchor { display: none; }
  .shell { display: block; padding: 0; }
  main { border: 0; padding: 0; }
  a { text-decoration: none; }
  h2 { break-after: avoid; }
  tr, .release, .note { break-inside: avoid; }
  .hb { box-shadow: none; border: 2px solid #999; background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
