:root {
  color-scheme: dark;
  --ink: #14100d;
  --ink-2: #1c1712;
  --ink-3: #241d16;
  --bone: #f3ecdd;
  --bone-dim: #c9bfa9;
  --gold: #e8a63c;
  --gold-dim: #b9812c;
  --teal: #22938a;
  --clay: #b2402f;
  --line: rgb(243 236 221 / 0.12);
  --line-strong: rgb(243 236 221 / 0.22);
  --header: rgb(20 16 13 / 0.88);
  --wash: rgb(20 16 13 / 0.35);
  --placeholder: rgb(201 191 169 / 0.55);
  --danger: #f0b2a8;
  --pill: rgb(243 236 221 / 0.08);
  --pill-up-bg: rgb(34 147 138 / 0.18);
  --pill-up-fg: #8ed9d2;
  --pill-down-bg: rgb(178 64 47 / 0.18);
  --pill-down-fg: #f0b2a8;
  --circuit: rgb(243 236 221 / 0.22);
  --gold-ink: #e8a63c;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--sans);
  color: var(--bone);
  background:
    radial-gradient(900px 420px at 10% -10%, rgb(232 166 60 / 0.14), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgb(34 147 138 / 0.1), transparent 55%),
    var(--ink);
}

.frame {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(16px);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.wordmark {
  color: var(--bone);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark span { color: var(--gold-ink); }

.top-side {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.product, .who {
  margin: 0;
}

.product {
  color: var(--bone-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.who {
  color: var(--bone);
  font-size: 14px;
}

main.frame {
  flex: 1;
  padding: 36px 0 24px;
}

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin: 0 0 16px;
}

#gate {
  border-top: 2px solid var(--gold);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 14ch;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.02;
}

h2 { font-size: 32px; line-height: 1.1; }

h3 {
  margin: 8px 0 12px;
  font-size: 22px;
}

.lede, .meta {
  color: var(--bone-dim);
  margin: 14px 0 0;
}

.lede { max-width: 46ch; }

.meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.hidden { display: none !important; }

form, .stack { display: grid; gap: 8px; }

#email-form { margin-top: 28px; max-width: 560px; }

label, .label-row {
  font-size: 13px;
  font-weight: 600;
  color: var(--bone);
}

.email-row, .inline, .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.email-row input { flex: 1 1 220px; }

input, select, button {
  font: inherit;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: 12px 16px;
  color: var(--bone);
  background: var(--ink-3);
}

input::placeholder { color: var(--placeholder); }

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button {
  background: var(--gold);
  color: #14100d;
  border-color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #f0b85a; }

button:disabled {
  cursor: not-allowed;
  background: transparent;
  color: var(--bone-dim);
  border-color: var(--line);
}

button.ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
  font-weight: 600;
}

button.ghost:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
  background: transparent;
}

.section-head { margin-bottom: 6px; }

.section-head .lede { margin-top: 8px; }

.shop-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.shop {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 16px 18px;
  background: var(--ink-3);
}

.shop-copy strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.shop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--pill);
  color: var(--bone-dim);
}

.pill.up { background: var(--pill-up-bg); color: var(--pill-up-fg); }
.pill.down { background: var(--pill-down-bg); color: var(--pill-down-fg); }

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 8px 0 0;
}

.desk-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}

#login-form { max-width: 420px; }

.filters {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--wash);
}

.filters select { min-width: 240px; }

.field { display: grid; gap: 8px; }

.inline.dates { align-items: end; }

.dates label {
  display: grid;
  gap: 8px;
}

.figures { display: grid; gap: 22px; margin-top: 22px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--ink-3);
}

.stat span {
  display: block;
  color: var(--bone-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.report { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--bone-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td.empty { color: var(--bone-dim); }

.foot { padding: 12px 0 36px; }

.circuit {
  display: block;
  width: 100%;
  height: 36px;
}

.foot p {
  margin: 14px 0 0;
  color: var(--bone-dim);
  font-size: 13px;
}

.foot a {
  color: var(--bone);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.foot a:hover { color: var(--gold-ink); }

body:has(#desk:not(.hidden)) #gate { display: none; }

body:has(#shops:not(.hidden)) #gate h1 {
  font-size: clamp(28px, 4vw, 40px);
}

@media (max-width: 800px) {
  .shop, .desk-head, .top-inner { align-items: stretch; }
  .shop, .desk-head { flex-direction: column; }
  .shop-actions { justify-content: space-between; }
  .top-side { flex-direction: column; align-items: flex-end; gap: 2px; }
}

.theme {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ink-3);
}

.theme button {
  background: transparent;
  color: var(--bone-dim);
  border: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme button:hover {
  background: transparent;
  color: var(--bone);
}

.theme button[aria-pressed="true"] {
  background: var(--gold);
  color: #14100d;
}

.theme button[aria-pressed="true"]:hover {
  background: #f0b85a;
  color: #14100d;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #f4efe4;
  --ink-2: #fffdf8;
  --ink-3: #fff;
  --bone: #14100d;
  --bone-dim: #5c5348;
  --line: rgb(20 16 13 / 0.1);
  --line-strong: rgb(20 16 13 / 0.18);
  --header: rgb(244 239 228 / 0.92);
  --wash: rgb(20 16 13 / 0.04);
  --placeholder: rgb(92 83 72 / 0.65);
  --danger: #9f1239;
  --pill: rgb(20 16 13 / 0.06);
  --pill-up-bg: #d7f3ef;
  --pill-up-fg: #0f5c56;
  --pill-down-bg: #fde4df;
  --pill-down-fg: #8f2e22;
  --circuit: rgb(20 16 13 / 0.16);
  --gold-ink: #8a5e16;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
