:root {
  --background: #f5f5f2;
  --surface: #ffffff;
  --surface-subtle: #eeeeea;
  --text: #20201e;
  --text-secondary: #66665f;
  --border: #d8d8d1;
  --border-strong: #a8a89f;
  --focus: #1f5eff;
  --danger: #a3271f;
  --danger-subtle: #fff0ee;
  --warning-subtle: #fff7d6;
  --test-subtle: #fff1bd;
  --radius: 0.35rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --sidebar-width: 17rem;
  --test-account-banner-height: 3.4rem;
  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 0.16em; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, p { margin-block-start: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; letter-spacing: -0.04em; }
h2 { font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: 1.1rem; line-height: 1.25; }
p { line-height: 1.55; }
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark__logo { width: auto; height: 2.1rem; display: block; flex: none; }
.button { min-height: 2.5rem; padding: 0.6rem 0.9rem; border: 1px solid transparent; border-radius: var(--radius); display: inline-flex; justify-content: center; align-items: center; gap: var(--space-2); cursor: pointer; font-weight: 750; line-height: 1; text-decoration: none; }
.button--primary { background: var(--text); color: var(--surface); }
.button--secondary { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.button--quiet { background: transparent; color: var(--text); }
.button--destructive { background: var(--danger); color: white; }
.button:hover:not(:disabled) { filter: brightness(0.92); }
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.form-grid > .panel, .form-grid > .action-bar, .field--wide, .error-summary { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: var(--space-2); }
.field:has(textarea), .action-bar { grid-column: 1 / -1; }
.field label, .field__label { font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 2.75rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.field label:has(input, select, textarea) { display: grid; gap: var(--space-2); }
.field textarea { resize: vertical; }
.field input[readonly] { background: var(--surface-subtle); }
.field input:disabled { cursor: not-allowed; opacity: 0.6; }
.field--invalid :is(input, select, textarea) { border-color: var(--danger); }
.field__help, .field__error { margin-bottom: 0; font-size: 0.85rem; }
.field__help { color: var(--text-secondary); }
.field__error { color: var(--danger); font-weight: 650; }
.action-bar { display: flex; gap: var(--space-3); align-items: center; }
.alert { margin-bottom: var(--space-3); padding: var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.alert--warning { background: var(--warning-subtle); }
.alert--error { border-color: var(--danger); background: var(--danger-subtle); }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .action-bar, .field--wide { grid-column: auto; }
  .field:has(textarea), .action-bar { grid-column: auto; }
}
