:root {
  --accent: #7a3e5a;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --bg: #faf6f2;
  --surface: #ffffff;
  --surface-2: #f4eee8;
  --ink: #2a1f24;
  --muted: #7d6f74;
  --line: #e9e0d8;
  --ok: #2f7d4f;
  --ok-soft: #e3f1e7;
  --off: #b0455d;
  --off-soft: #f8e3e7;
  --warn-soft: #fdf1dc;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(42, 31, 36, .04), 0 8px 24px rgba(42, 31, 36, .06);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17121a; --surface: #211a24; --surface-2: #2a222e; --ink: #f2ebee; --muted: #a6979e; --line: #3a3040;
    --ok: #7ccf9b; --ok-soft: #1f3528; --off: #f08ea2; --off-soft: #3d2129; --warn-soft: #3b3020;
    --accent-soft: color-mix(in srgb, var(--accent) 28%, var(--bg));
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17121a; --surface: #211a24; --surface-2: #2a222e; --ink: #f2ebee; --muted: #a6979e; --line: #3a3040;
  --ok: #7ccf9b; --ok-soft: #1f3528; --off: #f08ea2; --off-soft: #3d2129; --warn-soft: #3b3020;
  --accent-soft: color-mix(in srgb, var(--accent) 28%, var(--bg));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background .12s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: transparent; color: var(--off); border-color: color-mix(in srgb, var(--off) 40%, transparent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin-top: 1px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 100;
  transition: all .2s ease; max-width: calc(100% - 32px); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--off); color: #fff; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
