:root {
  --bg: #f6f3ea; --card: #fffdf6; --ink: #2f352b; --muted: #6f7566; --line: #e3e0d2;
  --accent: #c8542e; --accent-ink: #fff; --error: #b4442a; --ok: #3e6b2c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15140f; --card: #201f19; --ink: #efe9da; --muted: #a8a28f; --line: #34322a; --accent: #e0703f; --error: #ec8a6b; --ok: #8fc27a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 14px; max-width: 760px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 18px; }
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 20px; }
nav { display: flex; gap: 16px; font-size: 14px; }
nav a { color: var(--ink); }
main { max-width: 520px; margin: 0 auto; padding: 8px 16px max(32px, env(safe-area-inset-bottom)); display: grid; gap: 16px; }
main:has(.wide) { max-width: 980px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.4px; }
h2 { font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
p { margin: 0 0 14px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.small { font-size: 13px; color: var(--muted); }
label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
input { width: 100%; min-height: 46px; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
input.code { font-size: 26px; letter-spacing: 8px; text-align: center; }
input.link { font-size: 13px; min-height: 38px; }
button, .button { display: inline-block; min-height: 46px; margin-top: 16px; padding: 11px 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
button.secondary { background: var(--ink); color: var(--bg); }
button.text { background: none; color: var(--accent); padding: 6px 4px; min-height: 36px; margin: 0; font-weight: 600; }
form > button:last-child { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 0; }
.row button { margin-top: 0; width: auto; }
.row form > button:last-child { width: auto; margin-top: 0; }
.error { color: var(--error); font-size: 14px; margin: 12px 0 0; }
.flash { background: var(--card); border-left: 4px solid var(--ok); padding: 12px 14px; border-radius: 10px; margin: 0; }
.list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.list li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.list li:last-child { border: 0; }
.list form > button:last-child { width: auto; justify-self: start; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); }
tr.blocked td { opacity: .55; }
td form > button:last-child { width: auto; }
