:root {
  --bg: #f3eee5;
  --surface: #fffdf8;
  --surface-2: #f7f1e6;
  --ink: #2a241d;
  --muted: #73685b;
  --line: #e2d8c7;
  --accent: #a4572c;
  --accent-ink: #fff8f0;
  --accent-soft: #f3dfcf;
  --danger: #b3261e;
  --ok: #2f6b45;
  --wood-1: #9a6a42;
  --wood-2: #7a4e2c;
  --wood-3: #5c381d;
  --wall: #e9e1d2;
  --shadow: 0 10px 30px rgba(52, 36, 18, .16);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171411;
    --surface: #221e1a;
    --surface-2: #2a2520;
    --ink: #eee6d8;
    --muted: #a99d8d;
    --line: #3a332b;
    --accent: #e08a55;
    --accent-ink: #1b120b;
    --accent-soft: #3d2a1d;
    --danger: #f2867d;
    --ok: #7fc59a;
    --wood-1: #5e3f26;
    --wood-2: #4a301b;
    --wood-3: #2f1d10;
    --wall: #1d1915;
    --shadow: 0 12px 34px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171411;
  --surface: #221e1a;
  --surface-2: #2a2520;
  --ink: #eee6d8;
  --muted: #a99d8d;
  --line: #3a332b;
  --accent: #e08a55;
  --accent-ink: #1b120b;
  --accent-soft: #3d2a1d;
  --danger: #f2867d;
  --ok: #7fc59a;
  --wood-1: #5e3f26;
  --wood-2: #4a301b;
  --wood-3: #2f1d10;
  --wall: #1d1915;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.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.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: none; }

.field {
  width: 100%; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.field { padding-right: 32px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast-wrap {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 100; width: min(420px, calc(100% - 32px));
}
.toast {
  padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow); font-weight: 500;
  animation: toast-in .2s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
