/* SabaRoute v6 — shared design foundation ("editorial" direction, chosen by the owner).
   Paper background, hairline rules instead of boxes, one strong accent, heavy headings.
   Light theme by default; dark is opt-in. Every page loads this first. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@500;700;900&display=swap");

/* ============ Tokens ============ */
:root {
  --bg: #f5f3ee; --surface: #fbfaf6; --surface-2: #ebe8e0; --line: #d8d4c9; --line-strong: #b4af9f;
  --ink: #101214; --ink-2: #44474c; --ink-3: #62656b;
  --accent: #1c3dff; --accent-ink: #ffffff; --accent-soft: #e3e8ff;
  --r-dns: #3b4852; --r-web: #1c3dff; --r-mail: #d4560f;
  --ok: #17803d; --ok-soft: #e3f1e6; --act: #c3262a; --act-soft: #fbe6e3; --chk: #a85c06; --chk-soft: #f8ecd6;
  --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", YuGothic, "Yu Gothic", Meiryo, sans-serif;
  --sans-bold: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;
  --rs: 2px; --rm: 2px; --rl: 2px;
  --t-fast: 180ms; --t-draw: 700ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --pad: clamp(20px, 5vw, 72px);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113; --surface: #15181b; --surface-2: #1c2024; --line: #2b3035; --line-strong: #3c434a;
    --ink: #eceff2; --ink-2: #bcc3ca; --ink-3: #8f979f;
    --accent: #8499ff; --accent-ink: #0a0f2e; --accent-soft: #1a2144;
    --r-dns: #9aa8b3; --r-web: #8499ff; --r-mail: #ff8a4c;
    --ok: #5bc97f; --ok-soft: #14291c; --act: #ff6b6b; --act-soft: #331618; --chk: #e8a64a; --chk-soft: #2e2312;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113; --surface: #15181b; --surface-2: #1c2024; --line: #2b3035; --line-strong: #3c434a;
  --ink: #eceff2; --ink-2: #bcc3ca; --ink-3: #8f979f;
  --accent: #8499ff; --accent-ink: #0a0f2e; --accent-soft: #1a2144;
  --r-dns: #9aa8b3; --r-web: #8499ff; --r-mail: #ff8a4c;
  --ok: #5bc97f; --ok-soft: #14291c; --act: #ff6b6b; --act-soft: #331618; --chk: #e8a64a; --chk-soft: #2e2312;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; interpolate-size: allow-keywords; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.9 var(--sans); -webkit-font-smoothing: antialiased; text-wrap: pretty; min-height: 100svh; display: flex; flex-direction: column; }
h1, h2, h3, h4, strong, b, .b { font-family: var(--sans-bold); font-weight: 700; }
h1, h2 { font-weight: 900; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-underline-offset: .18em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--rs); }
.mono { font-family: var(--mono); font-size: .875em; letter-spacing: 0; }
.wrap { width: min(1360px, 100% - 2 * var(--pad)); margin-inline: auto; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ============ Typography helpers ============ */
.kicker { font-size: 12px; letter-spacing: .18em; color: var(--accent); font-family: var(--sans-bold); font-weight: 700; margin-bottom: var(--s2); display: block; text-transform: uppercase; }
.h2 { font-family: var(--sans-bold); font-weight: 900; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.25; letter-spacing: -.01em; }
.lead { color: var(--ink-2); font-size: 16px; margin-top: var(--s3); }
.note { font-size: 13px; color: var(--ink-3); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px; border-radius: 0; border: 0; background: var(--ink); color: var(--bg); font-family: var(--sans-bold); font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn.full { width: 100%; }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.linkbtn { border: 0; background: none; color: var(--ink-3); font-size: 13px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.linkbtn:hover { color: var(--ink); }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ============ Certainty chips ============ */
.conf { display: inline-block; font-size: 12px; line-height: 1.5; padding: 2px 8px; border-radius: 0; white-space: nowrap; font-family: var(--sans-bold); font-weight: 700; border: 1px solid currentColor; background: transparent; }
.conf.ext { color: var(--ok); }
.conf.maybe { color: var(--chk); }
.conf.you { color: var(--accent); }
.conf.unk { color: var(--ink-3); border-style: dashed; }
.conf.conflict { color: var(--act); }
.conf.ex { color: var(--ink-2); border-color: var(--line-strong); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1.5; padding: 2px 8px; border-radius: 0; background: var(--surface-2); color: var(--ink-2); }
.tag.pr { background: transparent; color: var(--ink-3); border: 1px solid var(--line-strong); font-family: var(--sans-bold); font-weight: 700; }
.tag.red { background: var(--act-soft); color: var(--act); font-family: var(--sans-bold); font-weight: 700; }

/* ============ Toast ============ */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: var(--s3); background: var(--ink); color: var(--bg); padding: 10px 12px 10px 18px; border-radius: 0; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); transition: transform var(--t-fast) var(--ease), opacity var(--t-fast); max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { border: 1px solid color-mix(in srgb, var(--surface) 40%, transparent); background: transparent; color: var(--bg); border-radius: 0; padding: 4px 10px; font-size: 13px; font-family: var(--sans-bold); font-weight: 700; min-height: 32px; white-space: nowrap; }

/* ============ Motion & print ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 720px) {
  .h2 { font-size: 28px; }
}
