/* Runwise's shared foundation: editorial composition with a blue brand accent. */
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  --color-obsidian: #17191c;
  --color-graphite: var(--color-obsidian);
  --color-slate: #27272a;
  --color-iron: #3f3f46;
  --color-steel: #52525b;
  --color-fog: #686872;
  --color-ash: #a1a1aa;
  --color-mist: #d4d4d8;
  --color-cloud: #ececee;
  --color-snow: #ffffff;
  --color-paper: var(--color-snow);
  --brand-primary: #2449e9;
  --brand-tint: #edf3ff;
  --brand-ink: #173f9f;
  --brand-line: #d7e3fb;
  --surface-mist: #f2f2f3;
  --surface-subtle: #fafafb;
  --font-ui: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, ui-serif, serif;
  /* Radius scale: numeric tokens carry the exact values in use; the semantic names below point at them. */
  --radius-4: 4px;
  --radius-6: 6px;
  --radius-7: 7px;
  --radius-8: 8px;
  --radius-10: 10px;
  --radius-12: 12px;
  --radius-14: 14px;
  --radius-16: 16px;
  --radius-20: 20px;
  --radius-24: 24px;
  --radius-28: 28px;
  --radius-round: 50%;
  --radius-pill: 9999px;
  --radius-card: var(--radius-24);
  --radius-control: var(--radius-16);
  --radius-panel: var(--radius-24);
  --radius-compact: var(--radius-10);
  --radius-tag: var(--radius-8);
  --surface-workspace: var(--surface-subtle);
  --surface-navigation: var(--color-snow);
  --surface-selected: var(--surface-mist);
  --border-ui: #e5e5e8;
  --border-control: var(--color-mist);
  --border-soft: var(--border-ui);
  --text-muted: #63656d;
  --badge-accent-soft: var(--brand-tint);
  --status-success-surface: #dcfce7;
  --status-success-text: #166534;
  --status-review-surface: #fef3c7;
  --status-review-text: #92400e;
  --status-blocked-surface: #fee2e2;
  --status-blocked-text: #991b1b;
  --text-on-dark: var(--color-cloud);
  --text-muted-on-dark: #b9b9c5;
  --focus-ring: var(--color-steel);
  --text-caption: 12px;
  --text-small: 13px;
  --text-ui: 14px;
  --text-body: 15px;
  /* Fixed sizes already used by existing layouts. Prefer the semantic sizes above for new work;
     tests/token-ratchet.test.js stops this list and the literal count from growing. */
  --text-10: 10px;
  --text-11: 11px;
  --text-16: 16px;
  --text-17: 17px;
  --text-18: 18px;
  --text-20: 20px;
  --text-21: 21px;
  --text-22: 22px;
  --text-23: 23px;
  --text-24: 24px;
  --text-25: 25px;
  --text-27: 27px;
  --text-28: 28px;
  --text-30: 30px;
  --text-32: 32px;
  --text-34: 34px;
  --text-36: 36px;
  --text-38: 38px;
  --text-40: 40px;
  --control-height: 44px;
  --icon-gap: 8px;
  --space-unit: 4px;
  --space-1: calc(var(--space-unit) * 1);
  --space-2: calc(var(--space-unit) * 2);
  --space-3: calc(var(--space-unit) * 3);
  --space-4: calc(var(--space-unit) * 4);
  --space-5: calc(var(--space-unit) * 5);
  --space-6: calc(var(--space-unit) * 6);
  --space-7: calc(var(--space-unit) * 7);
  --space-8: calc(var(--space-unit) * 8);
  --space-9: calc(var(--space-unit) * 9);
  --space-10: calc(var(--space-unit) * 10);
  --space-11: calc(var(--space-unit) * 11);
  --space-12: calc(var(--space-unit) * 12);
  --space-16: calc(var(--space-unit) * 16);
  --space-card: var(--space-7);
  --space-section: calc(var(--space-unit) * 20);
  /* Motion: durations in use, and the one easing curve the motion layer shares. */
  --duration-150: .15s;
  --duration-160: .16s;
  --duration-180: .18s;
  --duration-200: .2s;
  --duration-250: .25s;
  --duration-300: .3s;
  --duration-350: .35s;
  --duration-400: .4s;
  --duration-450: .45s;
  --duration-550: .55s;
  --duration-700: .7s;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  /* Focus halo used by selected and focused cards and fields. */
  --shadow-ring: 0 0 0 4px var(--brand-tint);
  --shadow-ring-strong: 0 0 0 5px var(--brand-tint);
  --page-width: 1200px;
  --ink: var(--color-obsidian);
  --muted: var(--color-steel);
  --line: var(--color-cloud);
  --paper: var(--color-paper);
  --soft: var(--surface-subtle);
  --radius: var(--radius-card);
  color: var(--color-graphite);
  font-family: var(--font-ui);
  font-synthesis: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: var(--text-body); font-weight: 400; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--color-fog); opacity: 1; }
:is(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}
/* Shared interaction states (documented in design/COMPONENTS.md). Pressed and busy are zero-specificity
   defaults that a component can override; `translate` composes with any transform a component animates. */
:where(button, .button, [role="button"]):active:not(:disabled):not([aria-busy="true"]) { translate: 0 1px; }
:where(button, .button, [role="button"])[aria-busy="true"] { cursor: progress; opacity: .7; }
/* A field turns red only after the visitor has interacted with it, or when script marks it invalid. */
:is(input, select, textarea):is(:user-invalid, [aria-invalid="true"]) { border-color: var(--status-blocked-text) !important; }
@media (forced-colors: active) {
  /* High-contrast themes drop background colours, so controls that rely on a fill get an outline. */
  :is(.button, .primary, .outline, .quiet, .send, .icon-button, .badge, .accent-badge, .icon-badge, [role="tab"]) { outline: 1px solid; outline-offset: -1px; }
  :is([role="tab"][aria-selected="true"], [aria-current="page"], [aria-pressed="true"]) { outline: 2px solid Highlight; outline-offset: 1px; }
  :is(button, a, input, textarea, select, summary):focus-visible { outline-color: Highlight; }
}
h1, h2 { color: var(--ink); font-family: var(--font-display); font-weight: 400; letter-spacing: -.025em; }
h3, h4 { color: var(--ink); font-family: var(--font-ui); font-weight: 600; letter-spacing: normal; }
[hidden] { display: none !important; }
.rw-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.rw-icon-sm { width: 16px; height: 16px; }
.rw-icon-lg { width: 24px; height: 24px; }
.label-with-icon { display: inline-flex; align-items: center; gap: var(--icon-gap); min-width: 0; max-width: 100%; }
.icon-label { display: block; min-width: 0; line-height: inherit; overflow-wrap: break-word; }
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--color-steel);
  flex: 0 0 auto;
}
.icon-badge .rw-icon { width: 24px; height: 24px; }
.accent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  border-radius: var(--radius-tag);
  font-size: var(--text-caption);
  font-weight: 500;
  line-height: 1.4;
  max-width: 100%;
  align-self: flex-start;
}
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-tag); background: var(--soft); color: var(--color-iron); font-size: var(--text-caption); font-weight: 500; line-height: 1.4; }
.badge .rw-icon, .accent-badge .rw-icon { width: 14px; height: 14px; }
.badge-soft { background: var(--badge-accent-soft); border-color: transparent; }
.surface-brand {
  --ink: var(--brand-ink);
  --muted: var(--brand-ink);
  --line: var(--brand-line);
  --soft: rgb(255 255 255 / 55%);
  --focus-ring: var(--brand-primary);
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.surface-mist { background: var(--surface-mist); }
.surface-fog { background: var(--surface-subtle); }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Intrinsic sizing and device input defaults shared by every current surface. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(main, section, article, aside, form, fieldset, nav) { min-width: 0; }
:where(h1, h2, h3, h4, .icon-label, .button) { overflow-wrap: anywhere; }
:where(img, video, canvas) { max-width: 100%; }
:where(button, summary, a) { touch-action: manipulation; }
:where(input, select, textarea) { max-width: 100%; }
@media (pointer: coarse), (max-width: 640px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}
