/* Noir Art Deco: black lacquer, brass and gilt, ivory text, oxblood accents. Same tokens as the app (src/ui/theme.ts). */
:root {
  --bg: #0e0c0a;
  --card: #17130f;
  --raised: #211b15;
  --line: #3a2f1e;
  --brass-line: #6b5530;
  --text: #efe6d2;
  --muted: #9c8f78;
  --gold: #c8a45d;
  --gilt: #e9d29a;
  --red: #b32635;
  --oxblood: #7e1a25;
  --red-dim: #2c1013;
  --green: #5db58a;
  --display: "Cinzel", Georgia, serif;
  --body: "Jost", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); }
body { background: radial-gradient(ellipse at 50% -10%, #241c12 0%, var(--bg) 55%) fixed; min-height: 100vh; }
main { max-width: 440px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px 56px; }
main.wide { max-width: 1120px; }
a { color: var(--gilt); text-decoration-color: var(--brass-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }

/* Header: the ziggurat crest with the wordmark */
.crest { width: 300px; height: 208px; margin: 0 auto 28px; background: url("crest.svg") center / contain no-repeat; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 66px; }
.crest-title { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.brand { font: 700 44px/1 var(--display); letter-spacing: 10px; margin-right: -10px; color: var(--gilt); text-transform: uppercase; }
.rule { position: relative; width: 132px; height: 10px; background:
  linear-gradient(var(--gold), var(--gold)) left center / 52px 1px no-repeat,
  linear-gradient(var(--gold), var(--gold)) right center / 52px 1px no-repeat; }
.rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); }
.sub { color: var(--gold); font-size: 14px; letter-spacing: 5px; }

/* The panel: lacquer with a double brass line */
.card { position: relative; background: var(--card); border: 1px solid var(--gold); outline: 1px solid rgba(200, 164, 93, 0.38); outline-offset: -8px; border-radius: 2px; padding: 28px 26px 26px; }
h2 { margin: 0 0 18px; font: 700 26px/1.2 var(--display); color: var(--text); padding-bottom: 12px; border-bottom: 1px solid var(--brass-line); }
h3 { margin: 34px 0 12px; font: 600 17px/1.2 var(--display); color: var(--gold); display: flex; align-items: center; gap: 12px; }
h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
p { margin: 0 0 14px; }

/* Forms */
form { display: grid; gap: 14px; margin: 0 0 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
input, textarea { width: 100%; padding: 13px 14px; border-radius: 2px; border: 1px solid var(--line); background: #100d0a; color: var(--text); font: 17px var(--body); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
input::placeholder, textarea::placeholder { color: #6f6553; }
button, .button { display: block; width: 100%; padding: 14px 18px; border: 1px solid var(--gold); border-radius: 2px; background: var(--oxblood); color: var(--text); font: 600 17px var(--body); letter-spacing: 1px; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: #941f2c; border-color: var(--gilt); }
button.ghost, .button.ghost { background: transparent; border-color: var(--brass-line); }
button.ghost:hover, .button.ghost:hover { border-color: var(--gold); background: rgba(200, 164, 93, 0.06); }
.button { margin-bottom: 12px; }
button:active, .button:active { transform: scale(0.99); }

.price { font: 700 30px/1.2 var(--display); color: var(--gilt); text-align: center; margin: 22px 0; }
.error, .notice { border-radius: 2px; padding: 11px 14px; }
.error { background: var(--red-dim); border: 1px solid var(--red); }
.notice { background: #12241a; border: 1px solid var(--green); }
.links { color: var(--muted); font-size: 14px; text-align: center; margin: 6px 0 0; }
.links.left { text-align: left; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 22px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 4px; }
.stats div { border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 2px; padding: 12px 14px; color: var(--muted); font-size: 13px; background: var(--raised); }
.stats b { display: block; font: 700 30px/1.2 var(--display); color: var(--gilt); }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 13px var(--display); color: var(--gold); white-space: nowrap; background: #120f0c; }
tbody tr:hover { background: rgba(200, 164, 93, 0.04); }
tr:last-child td { border-bottom: 0; }
td.ua { max-width: 260px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.badge.gold { border-color: var(--gold); color: var(--gilt); }
.badge.red { border-color: var(--red); color: #f2b8bd; }
.dot { display: inline-block; width: 7px; height: 7px; transform: rotate(45deg); background: var(--muted); margin-right: 8px; }
.dot.on { background: var(--green); }
.item { border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 2px; padding: 12px 14px; margin-bottom: 12px; background: var(--raised); }
.pre { white-space: pre-wrap; margin: 8px 0; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.wrap { flex-wrap: wrap; }
.row form, form.inline { margin: 0; }
form.inline { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
form.inline.wrap { flex-wrap: wrap; }
form.inline input:not([type=checkbox]) { flex: 1; min-width: 200px; padding: 10px 12px; font-size: 15px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; }
.check input { width: auto; accent-color: var(--gold); }
button.small, a.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; letter-spacing: .3px; }
a.small { border: 1px solid var(--brass-line); border-radius: 2px; text-decoration: none; color: var(--text); }
a.small:hover { border-color: var(--gold); }
button.danger { background: var(--red-dim); border-color: var(--red); color: #f2b8bd; }

@media (max-width: 480px) {
  .crest { width: 260px; height: 180px; padding-bottom: 56px; }
  .brand { font-size: 38px; letter-spacing: 8px; margin-right: -8px; }
  .card { padding: 24px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
