:root {
  --bg: #0d1210; --panel: #141c18; --panel-2: #1a2520; --line: #263a30; --text: #f2efe6; --muted: #92a399;
  --gold: #e6b84a; --ok: #4cc38a; --warn: #f0a23b; --bad: #ef5350;
  --heat-0: #17241e; --heat-1: #24598f; --heat-2: #2f73b3; --heat-3: #4a90d4; --heat-4: #74afe6; --heat-5: #a9cff5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
button, input, select { font: inherit; color: inherit; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
button.primary { background: var(--gold); border-color: var(--gold); color: #1a1405; }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.link { background: none; border: 0; color: var(--gold); padding: 6px; min-height: 0; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.card h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.narrow { width: min(380px, 100%); }
.signin h1 { margin: 0; color: var(--gold); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
#tabs { display: flex; gap: 4px; flex-wrap: wrap; }
#tabs a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
#tabs a.on { color: var(--text); background: var(--panel-2); }
.grow { flex: 1; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; display: grid; gap: 16px; }
.alert { margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: #3a1d1c; color: #ffd9d6; border: 1px solid var(--bad); }
.alert.ok { background: #13301f; color: #c9f4dc; border-color: var(--ok); }
.signin .alert { margin: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tcard .name { font-size: 18px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--bad); margin-right: 6px; }
.dot.on { background: var(--ok); }
.score { font-size: 22px; font-weight: 700; }
.lamp { font-size: 13px; color: var(--muted); }
.lamp.on { color: var(--gold); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list > li > button:not(.link) { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 8px; }
.list li.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.list li.row .grow { flex: 1; }
.list button.on { border-color: var(--gold); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td.r, th.r { text-align: right; }
tfoot td { font-weight: 700; border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.tag.cam { color: var(--gold); border-color: var(--gold); }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1; min-width: 120px; }
.methods { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.total { font-size: 28px; font-weight: 750; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 4px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { font-size: 26px; }
.variance { font-size: 22px; font-weight: 750; }
.variance.short { color: var(--bad); }
.variance.over { color: var(--warn); }
.variance.even { color: var(--ok); }
.heat { display: grid; grid-template-columns: 40px repeat(24, minmax(18px, 1fr)); gap: 2px; font-size: 11px; color: var(--muted); }
.heat span { text-align: center; }
.heat i.light { color: #0d1210; }
.heat i { display: block; height: 22px; border-radius: 3px; font-style: normal; font-size: 10px; line-height: 22px; text-align: center; color: var(--text); }
.legend { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.legend i { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.keybox { font-family: ui-monospace, Consolas, monospace; background: var(--bg); border: 1px dashed var(--gold); border-radius: 10px; padding: 10px; word-break: break-all; font-size: 13px; }
.tlink { color: var(--gold); font-weight: 600; text-decoration: none; }
.tname { margin: 0; font-size: 24px; }
.winner { font-size: 20px; font-weight: 700; color: var(--gold); margin: 0; }
.small { font-size: 13px; }
.seed { width: 64px; padding: 6px 8px; }
.fee { display: inline-flex; gap: 6px; align-items: center; }
.fee select { padding: 6px 8px; }
.mcard { border-color: var(--gold); }
details > summary { cursor: pointer; color: var(--gold); font-weight: 600; padding: 4px 0; }
details[open] > summary { margin-bottom: 8px; }
.alert.warnbar { background: #3a2a12; color: #ffe3b0; border-color: var(--warn); }
main > .alert { margin: 0; }
.photo { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.photo.big { width: 180px; height: 225px; }
.prow { display: flex; gap: 12px; align-items: center; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.status-active { color: var(--ok); } .status-paused { color: var(--bad); } .status-ended { color: var(--muted); }
details > summary { cursor: pointer; color: var(--gold); font-weight: 600; padding: 4px 0; }
.alert.warnbar { background: #3a2a12; color: #ffe3b0; border-color: var(--warn); }
main > .alert { margin: 0; }
.cols2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.chat li { max-width: 80%; background: var(--panel2, #1a2420); border-radius: 12px; padding: 8px 12px; }
.chat li.mine { justify-self: end; background: #2a2a1a; }
.chat p { margin: 2px 0 0; white-space: pre-wrap; }
.chatphoto { display: block; margin-top: 4px; }
.chatphoto img { display: block; max-width: min(240px, 100%); max-height: 240px; border-radius: 8px; }
.awaiting { display: grid; gap: 2px; margin-top: 4px; }
/* the Shop page: the courier and its tracking number on an order */
.courier { display: grid; gap: 4px; margin-top: 6px; min-width: 150px; }
.courier select, .courier input { padding: 6px 8px; width: 100%; box-sizing: border-box; }
textarea { width: 100%; box-sizing: border-box; font: inherit; background: #0b100e; color: inherit; border: 1px solid #2c4236; border-radius: 10px; padding: 10px; }
/* the Shop page: product photos */
.photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.photos .ph { margin: 0; width: 112px; display: grid; gap: 4px; }
.photos .ph img { width: 112px; height: 112px; object-fit: contain; background: #f4f4f1; border-radius: 8px; border: 1px solid var(--line); }
.photos .ph figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.photos .upload { width: 112px; height: 112px; border: 1px dashed var(--gold); border-radius: 8px; display: grid; place-items: center; color: var(--gold); cursor: pointer; text-align: center; }
.photos .upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photos .upload:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.clamp { max-width: 420px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stack { display: grid; gap: 12px; }
.stack .row > label { min-width: 160px; }
