/* Bearing: the readable pages (guide, terms and codes, letters) that
   the website build adds. Same tokens as the app (styles.css), system
   fonts only, no JavaScript. They follow the device's light or dark setting. */

:root {
  --bg: #f4f5f8;
  --surface: #fcfcfd;
  --surface-2: #eef1f5;
  --text: #1b2230;
  --muted: #586172;
  --line: #e0e4eb;
  --line-strong: #c8cfda;
  --accent: #1f3559;
  --accent-hover: #172946;
  --accent-ink: #f6f4ee;
  --accent-soft: #e6ecf6;
  --accent-text: #1f3559;
  --gold: #85601c;
  --radius: 14px;
  --radius-sm: 8px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1a1c20;
    --surface-2: #212429;
    --text: #ececee;
    --muted: #b4b7be;
    --line: #2b2e34;
    --line-strong: #3b3f47;
    --accent: #e2b65c;
    --accent-hover: #ecc677;
    --accent-ink: #1c1406;
    --accent-soft: #2a2416;
    --accent-text: #e9c274;
    --gold: #e2b65c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.012em; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(28px, 5vw, 40px); margin: 8px 0 12px; font-weight: 720; }
h2 { font-size: 22px; margin: 36px 0 10px; font-weight: 660; }
h3 { font-size: 17px; margin: 20px 0 6px; font-weight: 640; }
p { margin: 0 0 14px; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 2; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; }
.brand img { display: block; height: 32px; width: auto; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; flex: 1; font-size: 15px; }
.nav a { color: var(--text); text-decoration: none; padding: 4px 0; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--accent-text); text-decoration: underline; }
.nav .lang { color: var(--muted); margin-left: auto; }
.cta, .button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 620;
  padding: 8px 16px;
  border-radius: 999px;
}
.cta:hover, .button:hover { background: var(--accent-hover); text-decoration: none; }
.button { margin: 8px 0 4px; }

.main { padding-top: 16px; padding-bottom: 48px; }
.lead { font-size: 18px; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; }

.codes { display: flex; gap: 6px; flex-wrap: wrap; }
.code { font: 600 13px/1 var(--mono); background: var(--accent-soft); color: var(--accent-text); padding: 5px 8px; border-radius: 6px; }

.steps { padding-left: 24px; }
.steps li::marker { color: var(--gold); font-weight: 700; }
.steps h3 { margin-top: 16px; }

.links { padding-left: 20px; }
.links li { margin: 6px 0; }

.cards { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.cards a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.cards a:hover { border-color: var(--line-strong); }
.cards strong { color: var(--accent-text); font-weight: 640; }
.cards span { color: var(--muted); font-size: 14px; }

.toc ul { list-style: none; padding: 0; margin: 12px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.toc a { display: inline-block; font-size: 14px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; }

.entry { border-top: 1px solid var(--line); padding-top: 4px; scroll-margin-top: 16px; }
.entry h2 { font-size: 19px; margin-top: 20px; }
.entry .lead { font-size: 16px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0 20px; }
.facts dt { font-weight: 640; }
.facts dd { margin: 0; }
@media (max-width: 640px) {
  .top-row { justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

.related { margin-top: 40px; }
.foot { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 40px; font-size: 14px; }
