/* DreamGate · /support/ help layer (W-014, D-057)
   Typeset to docs/design/support-layer.md (G-011); its mock's CSS is the reference. A lighter variant
   of the document layer: paper and ink by day, pure red on black at night, bronze never carries text.
   Controls follow the button system (G-005). Colours come only from docs/design/tokens.json. */

:root { --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --gutter: clamp(16px, 4vw, 32px); }
[data-theme="support"] {
  color-scheme: light; --bg: #F5F3EF; --fg: #111111; --muted: #4B4B50; --accent: #6E5220; --accent-ink: #FFFFFF;
  --line: rgba(0, 0, 0, .08); --line-strong: rgba(17, 17, 17, .4); --cell: rgba(255, 255, 255, .72); --card: rgba(0, 0, 0, .03);
}
html[data-night="on"] [data-theme="support"] {
  color-scheme: dark; --bg: #000000; --fg: #FF0000; --muted: #FF0000; --accent: #FF0000; --accent-ink: #000000;
  --line: #330000; --line-strong: #FF0000; --cell: rgba(255, 0, 0, .06); --card: rgba(255, 0, 0, .04);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: #F5F3EF; }
html[data-night="on"] { background: #000000; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
[data-theme] { background: var(--bg); color: var(--fg); }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.skip { position: absolute; left: 12px; top: -64px; z-index: 10; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }

/* Bar: the same as the document layer, with "/ Support" */
.bar { border-bottom: 1px solid var(--line); }
.bar .in { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); height: 56px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--fg); }
.brand svg { display: block; flex: none; fill: currentColor; }
.brand .mark { width: 24px; height: 24px; }
.brand .word { width: 105.3px; height: 15px; }    /* 15 px tall at the wordmark's 455 × 64.81 ratio */
.crumb { font-size: 14px; color: var(--muted); white-space: nowrap; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }   /* 44 px tap target (G-002 §6) */
.spacer { flex: 1; }
.night-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--fg); font: 400 14px/1.2 var(--font-sans); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .12s ease, border-color .12s ease;
}
.night-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@media (hover: hover) { .night-toggle:hover { border-color: var(--accent); background: var(--card); } }
.night-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--card); }
.night-toggle[aria-pressed="true"] svg { fill: currentColor; }
@media (prefers-reduced-motion: reduce) { .night-toggle { transition: none; } }
@media (max-width: 480px) {
  .night-toggle { width: 44px; padding: 0; justify-content: center; }
  .night-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* The pre-release note: one slim line, not a banner */
.note { max-width: 1040px; margin: 0 auto; padding: 10px var(--gutter) 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.note b { font-weight: 600; color: var(--fg); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.5vw, 2.75rem); line-height: 1.12; font-weight: 700; letter-spacing: -.027em; margin: 30px 0 8px; text-wrap: balance; }
.lede { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); line-height: 1.55; color: var(--muted); margin: 0 0 26px; max-width: 34em; }
.lede a { color: var(--fg); }

/* Hub: topic groups as inset lists, the same rhythm as the app's Settings (G-009) */
.topics { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.topic h2 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0 4px 8px; }
.rows { background: var(--cell); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.rowlink { display: grid; grid-template-columns: minmax(0, 1fr) 10px; gap: 12px; align-items: center; min-height: 56px; padding: 12px 16px; text-decoration: none; position: relative; }
.rowlink + .rowlink::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.rowlink .q { font-size: 16px; line-height: 21px; font-weight: 600; }
.rowlink .a { display: block; font-size: 14px; line-height: 20px; color: var(--muted); margin-top: 2px; }
.rowlink svg { width: 8px; height: 13px; color: var(--muted); }
@media (hover: hover) { .rowlink:hover { background: var(--card); } .rowlink:hover .q { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; } }
/* The late-night group: chosen only by the night-mode state on this device. Nothing is tracked. */
.late { display: none; margin: 0 0 30px; }
html[data-night="on"] .late { display: block; }
.late .rows { border-color: var(--accent); }
.ph { background: var(--card); border-bottom: 1px dashed var(--accent); padding: 0 3px; }

/* Article: one question, a short answer first, steps, related, still stuck */
.article { max-width: 64ch; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; font-size: 14px; color: var(--muted); text-decoration: none; min-height: 44px; }
@media (hover: hover) { .back:hover { text-decoration: underline; } }   /* no sticky underline after a tap */
.article h1 { margin-top: 6px; }
.short { background: var(--cell); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 4px 0 28px; font-size: 17px; line-height: 27px; }
.short .label { display: block; font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.article p, .article li { font-size: 17px; line-height: 28px; }
.article p { margin: 0 0 16px; }
.article ul { margin: 0 0 16px; padding-left: 1.3em; }
.article ul li { margin: 0 0 8px; }
.article ul li::marker { color: var(--muted); }
.article h2 { font-size: 20px; line-height: 26px; font-weight: 600; margin: 32px 0 12px; }
.article strong { font-weight: 600; }
ol.steps { list-style: none; counter-reset: s; margin: 0 0 20px; padding: 0; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 0 14px; }
ol.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 28px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.callout { background: var(--card); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 14px 18px; margin: 20px 0 24px; }
.callout p { font-size: 16px; line-height: 26px; }
.callout p:last-child { margin-bottom: 0; }
.callout .label { display: block; font-size: 12px; line-height: 18px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.callout.note { border-left-color: var(--line-strong); border-left-width: 2px; }
.stuck { margin-top: 40px; padding: 20px 22px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stuck h2 { margin: 0 0 6px; font-size: 18px; line-height: 24px; }
.stuck p { margin: 0 0 6px; font-size: 16px; line-height: 25px; color: var(--muted); }
.stuck p:last-child { margin-bottom: 0; }
.stuck a strong { color: var(--fg); }

.foot { border-top: 1px solid var(--line); font-size: 14px; line-height: 22px; color: var(--muted); }
.foot .in { max-width: 1040px; margin: 0 auto; padding: 24px var(--gutter) 36px; display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot .in > span { flex-basis: 100%; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }

@media print {
  .bar .spacer, .night-toggle, .late, .skip { display: none !important; }
  html, html[data-night="on"] { background: #FFFFFF; }
  html[data-night] [data-theme="support"], [data-theme="support"] { --bg: #FFF; --fg: #111; --muted: #4B4B50; --accent: #6E5220; --line: rgba(0, 0, 0, .2); --line-strong: #111; --cell: transparent; --card: transparent; }
  .article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #4B4B50; }
}
