:root {
  --accent: #0f9d8a;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eceee9;
  --text: #1b1f1d;
  --muted: #66706b;
  --line: #dcdfd9;
  --danger: #c2412d;
  --warn: #b7791f;
  --ok: #2f855a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --surface: #1a1e1c; --surface-2: #232826; --text: #eef1ee;
    --muted: #9aa49f; --line: #2e3431; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f0e; --surface: #151918; --surface-2: #1f2422; --text: #f2f5f2;
  --muted: #95a09a; --line: #2a302d; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.code { font-family: var(--mono); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; padding: 12px 16px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.big { font-size: 1.15rem; min-height: 60px; }

label.field { display: block; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 48px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.foot { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 24px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: .8rem; font-weight: 600; color: var(--muted);
}
.pill.accent { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.badge-letter {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  font-weight: 800; font-family: var(--mono); flex: none;
}
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: calc(100% - 32px);
}
.toast.err { background: var(--danger); }
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: var(--warn); color: #fff;
  text-align: center; font-size: .85rem; font-weight: 600; padding: 4px;
}
