:root {
  --bg: #070b16;
  --bg-2: #101628;
  --card: #141b2e;
  --line: rgba(214, 178, 106, 0.28);
  --gold: #d6b26a;
  --gold-2: #f0d7a0;
  --silver: #d5d8e2;
  --text: #f5f7fb;
  --muted: #8e96aa;
  --ok: #8fd0ae;
  --danger: #e08b8b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); text-decoration: none; }

.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
.bg-glow {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(214, 178, 106, 0.16), transparent 55%),
    radial-gradient(500px 300px at 100% 20%, rgba(180, 190, 210, 0.06), transparent 50%);
}

.top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 8px;
}
.logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--line); background: #0c1222;
}
.brand { display: flex; flex-direction: column; }
.brand b {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 500; letter-spacing: 0.16em; font-size: 18px;
}
.brand span { color: var(--gold); letter-spacing: 0.42em; font-size: 10px; margin-top: 2px; }
.gold-line { height: 1px; margin: 4px 16px 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.view { padding: 14px 16px 108px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.status-card { padding: 16px; display: flex; gap: 12px; align-items: center; }
.status-card .mark {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: rgba(214, 178, 106, 0.12); color: var(--gold-2);
}
.status-k { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.status-v { font-size: 18px; margin-top: 2px; }
.status-n { color: var(--muted); font-size: 13px; margin-top: 4px; }
.chev { margin-left: auto; color: var(--muted); }

.facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 12px 0; }
.fact { padding: 10px 8px; text-align: center; }
.fact b { display: block; font-size: 13px; font-weight: 600; }
.fact span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.3; }

.search {
  width: 100%; margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(8, 12, 24, 0.7); outline: none;
}
.search:focus { border-color: var(--gold); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  text-align: left; padding: 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--card); min-height: 132px; display: flex; flex-direction: column; gap: 8px;
}
.cat svg { width: 28px; height: 28px; }
.cat b { font-size: 15px; font-weight: 600; }
.cat em { font-style: normal; color: var(--muted); font-size: 12px; line-height: 1.35; }
.cat .count { margin-top: auto; color: var(--gold); font-size: 12px; }

.back {
  position: sticky; top: 0; z-index: 6;
  background: rgba(7, 11, 22, 0.94);
  border: 0; color: var(--gold-2); padding: 10px 0; display: flex; align-items: center; gap: 6px;
  font-size: 15px;
}
.h-title { margin: 0; font-family: Palatino, Georgia, serif; font-weight: 500; font-size: 28px; }
.h-sub { color: var(--muted); margin: 4px 0 12px; }
.warn {
  border: 1px solid rgba(224, 139, 139, 0.4); color: #f0c9c9; background: rgba(120, 40, 40, 0.25);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 12px;
}
.group-t {
  margin: 16px 0 8px; color: var(--gold); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.item {
  width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 13px 14px; margin-bottom: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
}
.item b { font-weight: 600; font-size: 14px; display: block; }
.item small { color: var(--muted); }
.price { color: var(--gold-2); white-space: nowrap; font-size: 13px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); z-index: 21; padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; border: 1px solid var(--line); background: #101628;
}
.handle { width: 42px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); margin: 6px auto 12px; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; }
.sheet .big { color: var(--gold-2); font-size: 22px; margin: 8px 0; }
.buy, .ghost {
  width: 100%; border: 0; border-radius: 14px; padding: 14px; margin-top: 8px;
}
.buy { background: linear-gradient(180deg, #f0d7a0, #c6a15a); color: #1a1408; font-weight: 700; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }

.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(480px, 100%);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 11, 22, 0.92); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
  z-index: 10;
}
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 4px; border-radius: 12px; font-size: 12px; }
.tabs button.on { color: var(--gold-2); background: rgba(214, 178, 106, 0.1); }

.person { padding: 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.avatar {
  width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(214, 178, 106, 0.14); color: var(--gold-2); font-weight: 700;
}
.muted { color: var(--muted); line-height: 1.5; }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

.admin-body { max-width: 1080px; margin: 0 auto; padding: 28px 18px 60px; }
.admin-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.login {
  max-width: 420px; margin: 12vh auto; padding: 28px 22px;
}
.login h1 { font-family: Palatino, Georgia, serif; font-weight: 500; letter-spacing: 0.08em; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(214,178,106,.15); vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
tr.pick { cursor: pointer; }
tr.pick:hover { background: rgba(214,178,106,.06); }
.pill {
  display: inline-block; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--gold-2); font-size: 12px;
}
.editor { padding: 16px; margin-top: 14px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 6px; }
select, textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #0c1222; outline: none;
}
.err { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.hist { font-size: 13px; color: var(--muted); }
.hist div { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
@media (max-width: 800px) {
  .admin-split { display: block; }
  table { font-size: 14px; }
}
.admin-split { display: grid; grid-template-columns: 1.3fr .8fr; gap: 14px; align-items: start; }
