/* WayForge house theme. App colours: lib/app/theme/app_theme.dart.
   Neutral surfaces; brand green is reserved for actions, focus and selection. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --wf-canvas: #f5f7f8;
  --wf-surface: #ffffff;
  --wf-surface-alt: #edf0f2;
  --wf-ink: #20272d;
  --wf-muted: #5e6972;
  --wf-border: #dce2e6;
  --wf-accent: #146356;
  --wf-on-accent: #ffffff;
  --wf-danger: #b42332;
  --wf-success: #146356;
  --wf-shadow: 0 16px 44px #14212b12;
  --wf-radius: 12px;
  --wf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Compatibility tokens for existing data-rendered components. */
  --bg: var(--wf-canvas); --bg-soft: var(--wf-surface-alt);
  --panel: var(--wf-surface); --panel-strong: var(--wf-surface);
  --surface-card: var(--wf-surface); --text: var(--wf-ink);
  --muted: var(--wf-muted); --ink-muted: var(--wf-muted);
  --accent: var(--wf-accent); --accent-strong: var(--wf-accent);
  --line: var(--wf-border); --line-soft: var(--wf-border);
  --ok: var(--wf-success); --error: var(--wf-danger);
  --shadow: #14212b12; --body-bg: var(--wf-canvas);
  --kpi-bg: var(--wf-surface-alt); --kpi-bg-hover: var(--wf-surface-alt);
  --kpi-label: var(--wf-muted); --route-star-icon: #8c6810;
  --chip-bg: var(--wf-surface-alt); --chip-bg-strong: var(--wf-surface-alt);
  --surface-elevated: var(--wf-surface); --surface-elevated-soft: var(--wf-surface-alt);
  --copyright: var(--wf-muted); --placeholder: var(--wf-muted);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --wf-canvas: #0f1418; --wf-surface: #192025;
  --wf-surface-alt: #232c33; --wf-ink: #edf1f3;
  --wf-muted: #aab5bd; --wf-border: #344048;
  --wf-accent: #33b59d; --wf-on-accent: #0f1418;
  --wf-danger: #ff9aa5; --wf-success: #33b59d;
  --wf-shadow: 0 16px 44px #00000030; --shadow: #00000030;
  --route-star-icon: #e5c96d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body.wf-app, body.wf-public {
  margin: 0; background: var(--wf-canvas); color: var(--wf-ink);
  font: 15px/1.6 var(--wf-font); overflow-x: clip;
}
body.wf-app::before, body.wf-public::before { content: none; }
body :focus-visible { outline: 3px solid var(--wf-accent); outline-offset: 4px; }
body :is(button,input,select,textarea) { font-family: inherit; }
body input[type="checkbox"] { accent-color: var(--wf-accent); }
body :is(h1,h2,h3,h4,p) { overflow-wrap: anywhere; }
body :is(h1,h2,h3,h4) { color: var(--wf-ink); line-height: 1.2; }
body h1 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.045em; font-weight: 650; }
body h2 { font-size: 22px; letter-spacing: -.025em; font-weight: 600; }
body h3 { font-size: 18px; font-weight: 600; }
body a { color: var(--wf-accent); text-underline-offset: 4px; }
body .muted { color: var(--wf-muted); }
body .eyebrow, .wf-eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--wf-muted); }
body .panel { background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: var(--wf-radius); box-shadow: none; backdrop-filter: none; }
body :is(.btn,.button,.nav-theme-toggle) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 16px; border: 1px solid var(--wf-border);
  border-radius: 7px; background: var(--wf-surface); color: var(--wf-ink);
  font: 600 13px/1.35 var(--wf-font); text-decoration: none; cursor: pointer;
  box-shadow: none; transition: background .15s, border-color .15s;
}
body :is(.btn,.button,.nav-theme-toggle):hover { background: var(--wf-surface-alt); border-color: var(--wf-muted); transform: none; }
body :is(.btn-primary,.button-solid) { background: var(--wf-accent); border-color: var(--wf-accent); color: var(--wf-on-accent); }
body :is(.btn-primary,.button-solid):hover { background: color-mix(in srgb, var(--wf-accent) 88%, var(--wf-ink)); border-color: var(--wf-accent); }
body :is(.btn-ghost,.button-outline) { background: transparent; }
body :is(.button-danger,.route-editor-action-danger) { color: var(--wf-danger); border-color: color-mix(in srgb, var(--wf-danger) 40%, var(--wf-border)); }
body :is(button,input,select):disabled { opacity: .5; cursor: not-allowed; }
body :is(.input,.textarea,.select,input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) {
  max-width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--wf-border);
  border-radius: 7px; padding: 10px 12px; color: var(--wf-ink); background: var(--wf-surface);
  font: 400 14px/1.5 var(--wf-font); box-shadow: none;
}
body textarea { resize: vertical; }
body input::placeholder, body textarea::placeholder { color: var(--wf-muted); opacity: 1; }
body .form-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--wf-ink); }
body .form-help { color: var(--wf-muted); font-size: 12px; }
body .theme-toggle-btn { padding: 9px 11px; }
body .theme-toggle-btn__icon { border: 0; background: transparent; color: var(--wf-muted); width: 20px; height: 20px; }
body .theme-toggle-btn__icon svg { width: 18px; height: 18px; }
body .theme-toggle-btn__label { font-size: 12px; }
body .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--wf-ink); text-decoration: none; flex-shrink: 0; }
body .brand img { width: 34px; height: 34px; border-radius: 9px; }
body .brand span, body .brand-wordmark { font: 650 22px/1 var(--wf-font); letter-spacing: -.8px; }
body .brand strong, body .brand em { color: inherit; font: inherit; }
body .brand-mark { background: none; box-shadow: none; border: 0; width: 34px; height: 34px; padding: 0; }
.wf-skip { position: absolute; top: 8px; left: 16px; transform: translateY(-180%); z-index: 3000; padding: 10px 16px; border-radius: 7px; color: var(--wf-on-accent); background: var(--wf-accent); }
.wf-skip:focus { transform: none; }
.wf-page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 0 0 28px; }
.wf-page-intro h1 { margin: 7px 0 9px; }
.wf-page-intro p { margin: 0; max-width: 60ch; color: var(--wf-muted); }
.wf-page-intro .eyebrow { margin: 0; }
.wf-back { display: inline-flex; gap: 8px; font-size: 12px; text-decoration: none; margin-bottom: 14px; color: var(--wf-muted); }
.wf-empty { padding: 34px 24px; border: 1px dashed var(--wf-border); border-radius: var(--wf-radius); text-align: center; background: var(--wf-surface); }
.wf-empty h3 { margin: 0 0 8px; }
.wf-empty p { margin: 0 auto 18px; max-width: 45ch; color: var(--wf-muted); }
body .status { font-size: 13px; line-height: 1.55; }
body .status:empty { display: none; }
body .status.err { color: var(--wf-danger); }
body .status.ok { color: var(--wf-success); }
body .wf-dialog { width: min(540px,calc(100% - 32px)); padding: 28px; color: var(--wf-ink); background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: 14px; box-shadow: var(--wf-shadow); }
body dialog::backdrop { background: #07101885; }
.wf-dialog h2 { margin: 0 0 10px; }
.wf-dialog .form-label { margin-top: 18px; }
.wf-dialog :is(input,textarea,select) { width: 100%; }
.wf-dialog footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.wf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  body .wf-page-intro { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  body .theme-toggle-btn__label { display: none; }
  body :is(input,select,textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Visibility is a behavioural contract used by the existing page modules. */
body .hidden, [hidden] { display: none !important; }
