:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #f7f8f6;
  --ink: #15211b;
  --muted: #66736c;
  --line: #dce2de;
  --line-strong: #bdc9c1;
  --brand: #146c43;
  --brand-dark: #0b4b2d;
  --brand-soft: #e3f3e9;
  --on-brand: #ffffff;
  --accent: #d7a63c;
  --danger: #b42318;
  --danger-soft: #fef0ed;
  --warning: #93601a;
  --warning-soft: #fff6df;
  --success: #176b43;
  --success-soft: #e8f5ed;
  --shadow: 0 18px 50px rgba(24, 45, 34, .08);
  --radius-lg: 24px;
  --radius-md: 15px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
/* Native focus/anchor scrolling stays immediate; intentional flow transitions
   use the reduced-motion-aware JS helper rather than animating every focus. */
html { scroll-behavior: auto; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, rgba(215, 166, 60, .13), transparent 25rem),
    radial-gradient(circle at -5% 10%, rgba(20, 108, 67, .1), transparent 28rem),
    var(--bg);
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -5rem;
  padding: .7rem 1rem;
  color: white;
  background: var(--brand-dark);
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 13px 13px 13px 4px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(20, 108, 67, .22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; letter-spacing: .015em; }
.brand small { color: var(--muted); font-size: .72rem; }

.site-header nav { display: flex; align-items: center; gap: .35rem; }
.site-header nav a {
  padding: .6rem .85rem;
  color: var(--muted);
  border-radius: 9px;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--brand-dark); background: var(--surface); }
.theme-toggle {
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  padding: .45rem .72rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.public-shell, .guide-shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 64px; }
/* 两个公开页面共用一套标题与导语尺度：标题不再使用展示级字号。 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .8fr); align-items: start; gap: 1.6rem 2rem; margin: 16px 0 28px; }
.hero h1, .guide-hero h1 { max-width: 26ch; margin: .45rem 0 .7rem; font-size: clamp(1.8rem, 4.2vw, 2.4rem); line-height: 1.26; letter-spacing: -.018em; font-weight: 730; }
.hero-lead, .guide-hero > p.guide-lead { max-width: 62ch; margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.75; }
.eyebrow { margin: 0; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.trust-note { display: flex; align-items: flex-start; gap: .7rem; padding: .95rem 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.trust-note strong { display: block; margin-bottom: .15rem; font-size: .87rem; }
.trust-note span:not(.trust-icon) { display: block; color: var(--muted); font-size: .79rem; line-height: 1.65; }
.availability-note { display: flex; align-items: flex-start; gap: .6rem; padding: .9rem 1.1rem; margin: 0 0 22px; color: var(--muted); background: #fdf9ef; border: 1px solid #e9dec3; border-left: 3px solid var(--warning); border-radius: var(--radius-md); font-size: .85rem; line-height: 1.7; }
.availability-note strong { color: var(--ink); margin-right: .35rem; }
.availability-note .note-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: .5rem; border-radius: 50%; background: var(--warning); }
.trust-note .text-link { display: inline-block; margin-top: .4rem; }
.trust-icon { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; color: var(--on-brand); background: var(--brand); border-radius: 50%; font-size: .82rem; font-weight: 800; }

.card { background: var(--surface); border: 1px solid rgba(97, 116, 105, .17); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.workspace { padding: 18px 32px 32px; }
.workspace.is-collapsed { padding-bottom: 14px; }
.workspace.is-collapsed .tablist { margin-bottom: 0; }
.tablist { display: flex; gap: .25rem; margin: 0 0 26px; padding: 6px; background: var(--surface-soft); border-radius: 14px; }
.tab { flex: 1; min-height: 42px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; cursor: pointer; font-size: .88rem; font-weight: 700; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand-dark); background: var(--surface); box-shadow: 0 1px 3px rgba(23, 54, 37, .1); }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 26px; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
.stepper li:not(:last-child)::after { content: ""; height: 1px; flex: 1; margin: 0 .7rem; background: var(--line); }
.stepper span { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 50%; font-size: .74rem; font-variant-numeric: tabular-nums; }
.stepper .is-current { color: var(--ink); }
.stepper .is-current span { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.stepper .is-complete { color: var(--brand-dark); }
.stepper .is-complete span { color: transparent; background: var(--brand-soft); border-color: transparent; }
.stepper .is-complete span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand-dark); }

/* One screen per step: only the active step's fields are in the layout, so a
   pasted Session never sits next to the next step's inputs. */
.wizard-screen { display: grid; gap: 1.25rem; }
.screen-head { display: grid; gap: .3rem; }
.screen-head h2 { margin: 0; font-size: 1.24rem; line-height: 1.4; letter-spacing: -.012em; }
.screen-plan { margin: 0; color: var(--muted); font-size: .84rem; }
.screen-plan .badge { margin-left: .35rem; }
.wizard-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .1rem; }
.wizard-nav .button { flex: 1 1 13rem; min-height: 51px; }
.wizard-nav.split .button.ghost { flex: 0 0 auto; }
.wizard-nav.split .button.primary { flex: 1 1 13rem; padding-inline: 1.15rem; }

.form-stack { display: grid; gap: 1.35rem; }
.form-stack.compact { gap: .8rem; }
.field-grid { display: grid; gap: 1rem; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-group { display: grid; gap: .5rem; }
.field-group.is-locked label { color: var(--muted); }
.field-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
label, .field-heading label { display: block; color: var(--ink); font-size: .9rem; font-weight: 750; }
.field-heading p, .field-hint, .panel-intro p, .consent-row label { margin: .1rem 0 0; color: var(--muted); font-size: .8rem; font-weight: 450; }
.panel-intro { margin-bottom: 1.4rem; }
.panel-intro h2 { margin: 0; font-size: 1.35rem; }
input, textarea, select {
  width: 100%;
  min-height: 48px;
  padding: .75rem .9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}
textarea { min-height: 150px; resize: vertical; font: .84rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; background: #f2f4f2; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* 兑换码是定长大写字母数字串：显示为大写并加一点字距，便于逐个核对。 */
#codeInput { font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; }
.field-footer { display: flex; min-height: 1.2rem; justify-content: space-between; gap: 1rem; }
.counter { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.field-feedback, .form-feedback { min-height: 1.2rem; margin: 0; color: var(--muted); font-size: .8rem; }
.field-feedback[data-type="error"], .form-feedback[data-type="error"] { color: var(--danger); }
.field-feedback[data-type="success"], .form-feedback[data-type="success"] { color: var(--success); }
.field-feedback[data-type="warning"], .form-feedback[data-type="warning"] { color: var(--warning); }
.session-error-notice {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .8rem;
  margin-top: .2rem;
  padding: .95rem 1rem;
  color: var(--ink);
  background: linear-gradient(135deg, var(--danger-soft), var(--surface));
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(180, 35, 24, .08);
  scroll-margin-top: 1.5rem;
}
.session-error-notice:focus-visible { outline: 2px solid var(--danger); outline-offset: 3px; }
.session-error-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #fff;
  background: var(--danger);
  border-radius: 50%;
  font-weight: 850;
  line-height: 1;
}
.session-error-notice strong { display: block; color: var(--danger); font-size: .92rem; }
.session-error-notice p { margin: .2rem 0 0; font-size: .8rem; }
.session-error-safety {
  padding-top: .55rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.session-error-reference { color: var(--muted); font-size: .72rem !important; }
.session-error-reference code {
  color: inherit;
  font-size: .72rem;
  overflow-wrap: anywhere;
}
.text-link { color: var(--brand); font-size: .8rem; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.badge { padding: .25rem .6rem; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; font-size: .75rem; font-weight: 800; }

.password-field { position: relative; }
.password-field input { padding-right: 4.8rem; }
.reveal-button { position: absolute; top: 50%; right: .4rem; transform: translateY(-50%); padding: .42rem .7rem; color: var(--brand); background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: .78rem; font-weight: 750; }
.consent-row { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .65rem; }
.consent-row input { width: 18px; min-height: 18px; margin: .18rem 0 0; accent-color: var(--brand); }
#preSubmitRecovery { margin: 0; }
.recovery-confirm { margin-top: .9rem; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: .6rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: .86rem; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .tab:focus-visible, .reveal-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.button:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: var(--on-brand); background: var(--brand); box-shadow: 0 5px 14px rgba(20,108,67,.14); }
.button.secondary { color: var(--brand-dark); background: var(--surface); border-color: var(--line-strong); }
.button.secondary:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.button.ghost { color: var(--muted); background: transparent; }
.button.wide { width: 100%; min-height: 51px; padding-inline: 1.15rem; }
.button.inline { width: fit-content; margin-top: .7rem; }
.button.is-busy { cursor: wait; }
.button.is-busy::after { content: ''; width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .8s linear infinite; }
.button.is-busy > [aria-hidden="true"] { display: none; }
#refreshOrderButton { min-width: 7.6rem; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
.poll-feedback { min-height: 1.5rem; color: var(--muted); font-size: .8rem; margin: 1rem 0 .5rem; overflow-wrap: anywhere; }
.poll-feedback[data-type="warning"] { color: var(--warning); }
.forget-confirm { padding: 1rem; margin-block: .8rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-soft); }
.forget-confirm p { margin: 0 0 .8rem; font-size: .85rem; color: var(--muted); }
.field-feedback, .form-feedback { overflow-wrap: anywhere; }
.order-panel, .tab-panel { scroll-margin-top: 1.5rem; }
.order-heading h2:focus { outline: none; }
.danger-text { color: var(--danger) !important; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; }

.order-panel { margin-top: 26px; padding: 34px 40px; }
.order-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.order-heading h2 { margin: .25rem 0 0; font-size: 1.7rem; letter-spacing: -.025em; }
.muted { color: var(--muted); font-size: .76rem; }
.recovery-notice { margin: 1.5rem 0; padding: 1.15rem; background: var(--warning-soft); border: 1px solid #ebce8d; border-radius: var(--radius-md); }
.recovery-notice > div:first-child p { margin: .15rem 0 .8rem; color: #75551e; font-size: .82rem; }
.recovery-notice dl { display: grid; gap: .4rem; margin: 0 0 1rem; }
.recovery-notice dl div { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: .75rem; }
.recovery-notice dt { color: #75551e; font-size: .78rem; }
.recovery-notice dd { margin: 0; overflow-wrap: anywhere; font-size: .82rem; font-weight: 700; }
.order-summary { margin-top: 1.4rem; padding: 1rem 1.1rem; background: var(--surface-soft); border-radius: var(--radius-md); }
.order-summary dl { display: grid; grid-template-columns: 1.35fr .65fr 1fr; gap: 1rem; margin: 0; }

/* Identifiers and the four sub-states stay collapsed by default: the status
   screen first answers "充值成功了吗", not "这是哪一单". */
.order-details { margin-top: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.order-details > summary { padding: .85rem 1.05rem; color: var(--brand-dark); cursor: pointer; font-size: .86rem; font-weight: 750; }
.order-details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-md); }
.order-details[open] > summary { border-bottom: 1px solid var(--line); }
.order-details[open] > summary + .order-summary { margin-top: 0; background: transparent; border-radius: 0; }
.order-details .status-grid { margin: 0 1.05rem 1rem; }
.order-details .field-hint { margin: 0 1.05rem 1.05rem; }
.order-summary dt { color: var(--muted); font-size: .72rem; }
.order-summary dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-size: .86rem; font-weight: 700; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1rem 0; }
.status-grid article { position: relative; padding: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.status-grid p { margin: .45rem 0 .15rem; color: var(--muted); font-size: .72rem; }
.status-grid strong { font-size: .86rem; }
.status-dot { display: block; width: 8px; height: 8px; background: #94a098; border-radius: 50%; box-shadow: 0 0 0 4px #edf0ee; }
.status-dot[data-tone="success"] { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.status-dot[data-tone="warning"] { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.status-dot[data-tone="error"] { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status-dot[data-tone="pending"] { background: #4f7198; box-shadow: 0 0 0 4px #eaf0f7; }
.order-message { padding: .85rem 1rem; color: var(--ink); background: var(--surface-soft); border-left: 3px solid var(--line-strong); border-radius: 4px var(--radius-sm) var(--radius-sm) 4px; font-size: .88rem; line-height: 1.7; }
.order-message[data-type="success"] { color: var(--success); background: var(--success-soft); border-color: var(--success); }
.order-message[data-type="warning"] { color: var(--warning); background: var(--warning-soft); border-color: var(--warning); }
.order-message[data-type="error"] { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.action-panel { margin-top: 1rem; padding: 1.15rem; background: #f9faf9; border: 1px solid var(--line); border-radius: var(--radius-md); }
.action-panel h3 { margin: 0 0 .25rem; font-size: 1rem; }
.action-panel p { margin: 0 0 .8rem; color: var(--muted); font-size: .82rem; }
.order-actions { margin-top: 1rem; justify-content: space-between; }

.site-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; border-top: 1px solid rgba(97,116,105,.2); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .75rem; }

/* Session 指南：标题不再使用展示级字号，正文与标题保持同一套层级；
   强调色只有品牌绿一处，提示块用低饱和琥珀，代码改用浅色卡片。 */
.guide-shell { width: min(820px, calc(100% - 40px)); }
.guide-hero { padding: 36px 0 24px; }
.guide-hero .eyebrow { font-size: .72rem; letter-spacing: .16em; }
.guide-hero h1 { max-width: 24ch; margin: .5rem 0 .75rem; }
.guide-hero > p.guide-lead { max-width: 62ch; margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.75; }

.guide-note { padding: 1.05rem 1.2rem; margin: 26px 0 22px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); }
.guide-note.is-caution { background: #fdf9ef; border-color: #e9dec3; border-left-color: var(--warning); }
.guide-note .note-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; color: var(--warning); font-size: .9rem; font-weight: 750; }
.guide-note .note-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; }
.guide-note ul { margin: 0; padding-left: 1.1rem; }
.guide-note li { color: var(--ink); font-size: .88rem; line-height: 1.7; }
.guide-note li + li { margin-top: .3rem; }
.guide-note li::marker { color: var(--warning); }

.guide-panel { padding: 1.15rem 1.25rem; margin: 0 0 30px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius-md); background: var(--surface); }
.guide-panel h2 { margin: 0 0 .45rem; font-size: 1rem; letter-spacing: -.005em; }
.guide-panel p { margin: 0; max-width: 68ch; color: var(--muted); font-size: .89rem; line-height: 1.78; }

.guide-section-title { margin: 0 0 18px; color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.guide-steps { display: grid; margin: 0 0 6px; padding: 0; list-style: none; }
.guide-steps > li { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 1.05rem; padding-bottom: 26px; }
.guide-steps > li:not(:last-child)::before { content: ""; position: absolute; left: 18px; top: 44px; bottom: 2px; width: 1px; background: var(--line-strong); }
.guide-number { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); font-size: .84rem; font-weight: 780; font-variant-numeric: tabular-nums; }
.guide-steps article { padding-top: 5px; }
.guide-steps h3 { margin: 0 0 .35rem; font-size: 1.02rem; line-height: 1.5; letter-spacing: -.005em; }
.guide-steps p { max-width: 68ch; margin: 0 0 .7rem; color: var(--muted); font-size: .89rem; line-height: 1.78; }
.guide-steps p:last-child { margin-bottom: 0; }
.guide-steps .button { min-height: 42px; font-size: .84rem; }
.guide-steps code, .guide-panel code { padding: .08rem .3rem; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); font-size: .86em; }

.code-card { max-width: 100%; margin: .2rem 0 .1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.code-card figcaption { padding: .6rem .95rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.code-card pre { max-width: 100%; margin: 0; padding: .9rem 1rem; overflow: auto; color: var(--ink); background: transparent; font-size: .82rem; line-height: 1.72; }

pre { max-width: 100%; margin: 1rem 0 .4rem; padding: 1rem; overflow: auto; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; font-size: .82rem; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.faq { padding: 22px 26px 8px; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.faq h2 { margin: 0 0 .35rem; font-size: 1rem; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; color: var(--ink); cursor: pointer; font-size: .9rem; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1rem; font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq details p { max-width: 68ch; margin: 0 0 .9rem; color: var(--muted); font-size: .87rem; line-height: 1.75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (max-width: 780px) {
  .site-header { min-height: 72px; }
  .site-header nav a { padding: .45rem; font-size: .78rem; }
  .brand small { display: none; }
  .public-shell, .guide-shell { padding-top: 25px; }
  .guide-hero { padding: 24px 0 18px; }
  .guide-hero h1 { font-size: clamp(1.65rem, 7vw, 2.1rem); }
  .guide-note { padding: .95rem 1rem; }
  .guide-panel { padding: 1rem 1.05rem; }
  .guide-steps > li { grid-template-columns: 32px minmax(0, 1fr); gap: .8rem; }
  .guide-number { width: 32px; height: 32px; font-size: .78rem; }
  .guide-steps > li:not(:last-child)::before { left: 15px; top: 38px; }
  .code-card pre { font-size: .78rem; }
  .faq { padding: 18px 18px 6px; }
  .hero { grid-template-columns: 1fr; align-items: start; gap: 1.2rem; margin-bottom: 24px; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.1rem); }
  .workspace, .order-panel { padding: 16px 20px 24px; }
  .order-panel { padding-top: 22px; }
  .tablist { margin-bottom: 22px; }
  .stepper { margin-bottom: 22px; }
  .stepper li { font-size: .7rem; flex-wrap: wrap; gap: .4rem; }
  .stepper li:not(:last-child)::after { margin-inline: .4rem; }
  .stepper span { font-size: .7rem; }
  .field-grid.two, .order-summary dl { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .recovery-notice dl div { grid-template-columns: 1fr; gap: .1rem; }
  .site-footer { display: grid; }
}

@media (max-width: 440px) {
  .site-header, .public-shell, .guide-shell, .site-footer { width: min(100% - 24px, 1180px); }
  .site-header nav a:first-child { display: none; }
  .site-header { gap: .5rem; }
  .site-header nav { gap: .15rem; }
  .site-header nav a { white-space: nowrap; }
  .brand { gap: .4rem; }
  .brand strong { font-size: .9rem; }
  .theme-toggle { padding-inline: .4rem; min-height: 44px; }
  .brand-mark { width: 37px; height: 37px; }
  .hero h1 { font-size: 1.72rem; }
  .trust-note { padding: .85rem .9rem; }
  .stepper li { flex-direction: column; align-items: flex-start; }
  .stepper li:not(:last-child)::after { display: none; }
  .field-footer { flex-wrap: wrap; gap: .3rem; }
  input, textarea { font-size: 16px; }
  .workspace, .order-panel { border-radius: 18px; }
  .field-heading { display: grid; }
  .status-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .status-grid article { padding: .8rem; }
  .order-heading { display: grid; }
  .order-actions { display: grid; }
  .order-actions .button { width: 100%; }
  .guide-steps > li { grid-template-columns: 30px minmax(0,1fr); gap: .7rem; }
  .guide-number { width: 30px; height: 30px; }
  .faq { padding: 16px 15px 4px; border-radius: var(--radius-md); }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101612;
    --surface: #18201b;
    --surface-soft: #202923;
    --ink: #ecf3ee;
    --muted: #a0afa5;
    --line: #344139;
    --line-strong: #4b5a50;
    --brand: #58b780;
    --brand-dark: #b4e8c8;
    --brand-soft: #173d28;
    --on-brand: #0c2517;
    --danger: #ff8c82;
    --danger-soft: #3b211f;
    --warning: #e6b85b;
    --warning-soft: #382d18;
    --success: #7dd0a0;
    --success-soft: #183525;
    --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  }
  :root:not([data-theme="light"]) body { background: radial-gradient(circle at 85% -5%, rgba(215,166,60,.07), transparent 25rem), radial-gradient(circle at -5% 10%, rgba(88,183,128,.07), transparent 28rem), var(--bg); }
  :root:not([data-theme="light"]) .availability-note { background: #2a2418; border-color: #4c4327; border-left-color: var(--warning); }
  :root:not([data-theme="light"]) input:disabled, :root:not([data-theme="light"]) textarea:disabled, :root:not([data-theme="light"]) select:disabled { background: #1a211d; }
  :root:not([data-theme="light"]) .action-panel { background: #1b241e; }
  :root:not([data-theme="light"]) .recovery-notice { color: #f1d99a; border-color: #604c21; }
  :root:not([data-theme="light"]) .recovery-notice > div:first-child p, :root:not([data-theme="light"]) .recovery-notice dt { color: #d2bb82; }
  :root:not([data-theme="light"]) .guide-note.is-caution { background: #2a2418; border-color: #4c4327; border-left-color: var(--warning); }
  :root:not([data-theme="light"]) .guide-number { border-color: var(--line-strong); }
}

/* Explicit dark mode mirrors the system dark palette when the user chooses it. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101612;
  --surface: #18201b;
  --surface-soft: #202923;
  --ink: #ecf3ee;
  --muted: #a0afa5;
  --line: #344139;
  --line-strong: #4b5a50;
  --brand: #58b780;
  --brand-dark: #b4e8c8;
  --brand-soft: #173d28;
  --on-brand: #0c2517;
  --danger: #ff8c82;
  --danger-soft: #3b211f;
  --warning: #e6b85b;
  --warning-soft: #382d18;
  --success: #7dd0a0;
  --success-soft: #183525;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
:root[data-theme="dark"] body { background: radial-gradient(circle at 85% -5%, rgba(215,166,60,.07), transparent 25rem), radial-gradient(circle at -5% 10%, rgba(88,183,128,.07), transparent 28rem), var(--bg); }
:root[data-theme="dark"] .availability-note { background: #2a2418; border-color: #4c4327; border-left-color: var(--warning); }
:root[data-theme="dark"] input:disabled, :root[data-theme="dark"] textarea:disabled, :root[data-theme="dark"] select:disabled { background: #1a211d; }
:root[data-theme="dark"] .action-panel { background: #1b241e; }
:root[data-theme="dark"] .recovery-notice { color: #f1d99a; border-color: #604c21; }
:root[data-theme="dark"] .recovery-notice > div:first-child p, :root[data-theme="dark"] .recovery-notice dt { color: #d2bb82; }
:root[data-theme="dark"] .guide-note.is-caution { background: #2a2418; border-color: #4c4327; border-left-color: var(--warning); }
:root[data-theme="dark"] .guide-number { border-color: var(--line-strong); }
:root[data-theme="light"] { color-scheme: light; }
