:root {
    --bg: #f6f4f1;
    --surface: #ffffff;
    --surface-2: #f0ede8;
    --text: #1c1a17;
    --muted: #6b665e;
    --line: #e2ddd5;
    --accent: #d9480f;
    --accent-ink: #ffffff;
    --accent-soft: #fde8dc;
    --ok: #2b8a3e;
    --ok-soft: #e3f4e6;
    --danger: #c92a2a;
    --radius: 14px;
    --r: 10px;
    --r-box: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
    color-scheme: light dark;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #141312;
      --surface: #1f1d1b;
      --surface-2: #2a2825;
      --text: #f3f0ec;
      --muted: #a39d94;
      --line: #36332f;
      --accent: #ff7a3d;
      --accent-ink: #1a0d05;
      --accent-soft: #3a2216;
      --ok: #69db7c;
      --ok-soft: #1c3322;
      --danger: #ff6b6b;
      --shadow: none;
    }
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 var(--font);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { line-height: 1.2; margin: 0; }
  a { color: var(--accent); }
  .wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
  .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
  .muted { color: var(--muted); }
  .small { font-size: 13px; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
  .stack > * + * { margin-top: 14px; }
  label.field { display: block; }
  label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
  input[type=text], input[type=search], input[type=password], select, textarea {
    width: 100%; font: inherit; font-size: 16px; color: var(--text);
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-box);
    padding: 12px 12px; outline: none; transition: border-color .15s;
  }
  textarea { min-height: 110px; resize: vertical; }
  input:focus, select:focus, textarea:focus { border-color: var(--accent); }
  select { appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 650; font-size: 15px; border-radius: var(--r); border: 1.5px solid var(--line);
    background: var(--surface); color: var(--text); padding: 10px 14px; cursor: pointer; text-decoration: none;
    transition: transform .05s, background .15s;
  }
  .btn:active { transform: scale(.98); }
  .btn:disabled { opacity: .55; cursor: default; }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .btn.block { width: 100%; padding: 14px; font-size: 17px; }
  .btn.ghost { background: transparent; }
  .btn.danger { color: var(--danger); }
  .btn.sm { padding: 6px 10px; font-size: 13px; }
  .pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--accent-soft); color: var(--accent); }
  .pill.ok { background: var(--ok-soft); color: var(--ok); }
  .error { color: var(--danger); font-size: 14px; font-weight: 600; }
  .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .spacer { flex: 1; }
  .hidden { display: none !important; }
  .spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .center { display: flex; align-items: center; justify-content: center; min-height: 40vh; flex-direction: column; gap: 12px; text-align: center; }
  .toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg);
    padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
