/* The public status page (GET /). It borrows everything from dashboard.css — tokens, buttons, readouts, the ruler — so
   this file only holds the page's own layout. The state (online / offline / lost) is one attribute on <body>:
   the server writes it, status.js flips it, and CSS decides what shows and which colour the lamp and the word take. */

body.st { display: flex; flex-direction: column; min-height: 100vh; }
body.st > main { flex: 1 0 auto; }
body.st[data-state="online"]  { --st: var(--green); }
body.st[data-state="offline"] { --st: var(--red); }
body.st[data-state="lost"]    { --st: var(--amber); }

/* Only the wording that matches the state is drawn. */
body.st [data-when] { display: none; }
body.st[data-state="online"]  [data-when="online"],
body.st[data-state="offline"] [data-when="offline"],
body.st[data-state="lost"]    [data-when="lost"] { display: inline; }

.st-wrap { position: relative; z-index: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: 32px; }

/* ─── The stage: hero + live numbers, on the survey-sheet ground ─────────── */
.st-stage { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.st-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent);
}
.st-stage::after {
  content: ''; position: absolute; top: 0; right: 0; width: min(820px, 78%); height: 100%; pointer-events: none;
  background: var(--contour); opacity: .8;
  -webkit-mask: url(contours.svg) 100% 0 / cover no-repeat, linear-gradient(to left, #000 15%, transparent 92%), linear-gradient(#000 40%, transparent);
  -webkit-mask-composite: source-in, source-in;
  mask: url(contours.svg) 100% 0 / cover no-repeat, linear-gradient(to left, #000 15%, transparent 92%), linear-gradient(#000 40%, transparent);
  mask-composite: intersect, intersect;
}
.st-hero { padding-block: 68px 40px; }

.st-title {
  display: flex; align-items: center; gap: .2em; margin: 0;
  font: 600 clamp(52px, 11vw, 116px)/.94 var(--font-cond); letter-spacing: .012em; text-transform: uppercase;
  color: var(--st); text-wrap: balance;
}
.st-title .lamp {
  position: relative; flex: 0 0 auto; width: clamp(14px, 1.7vw, 20px); height: clamp(14px, 1.7vw, 20px);
  background: var(--st); box-shadow: 0 0 18px var(--st); margin-top: .04em;
}
body.st[data-state="online"] .st-title .lamp::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--st); opacity: 0;
  animation: st-pulse 2.6s ease-out infinite;
}
@keyframes st-pulse { 0% { transform: scale(.55); opacity: .7; } 70%, 100% { transform: scale(1.7); opacity: 0; } }

.st-hero .lead { margin-top: 18px; font-size: 18px; max-width: 58ch; }
.st-id { margin-top: 12px; font: 500 12.5px var(--font-mono); letter-spacing: .04em; color: var(--text-3); }

.st-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 34px; }
.btn.xl { height: 56px; padding: 0 28px; gap: 12px; font: 600 17px/1 var(--font-ui); border-radius: var(--r-l); }
.btn.xl .ic { width: 20px; height: 20px; transition: transform .16s; }
.btn.xl:hover .ic { transform: translateX(3px); }
.btn.primary.xl { box-shadow: 0 12px 28px -12px var(--blue-fill), inset 0 1px 0 rgba(255, 255, 255, .16); }
.st-cta-note { margin-top: 14px; max-width: 62ch; color: var(--text-3); font-size: 13.5px; }

/* The live numbers sit under the ruler, like a scale bar under a map. */
.st-readouts { margin-top: 0; background: color-mix(in srgb, var(--bg-2) 92%, transparent); }
.st-readouts .readout .v { font-size: clamp(30px, 4vw, 40px); }
.st-readouts .readout .v.mono { font: 500 22px/1.25 var(--font-mono); letter-spacing: .02em; padding-top: 9px; overflow-wrap: anywhere; }
.st-readouts .readout .v small { margin-left: 0; }
body.st[data-state="lost"] .st-readouts .readout .v { opacity: .45; }
.st-live { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding-bottom: 26px; font: 500 12.5px var(--font-mono); color: var(--text-3); }
.st-live .dot { background: var(--st); box-shadow: 0 0 8px var(--st); flex: 0 0 auto; }

/* ─── Below the stage ────────────────────────────────────────────────────── */
.st-body { padding-block: 8px 72px; }
.st-block { border-top: 0; }   /* the stage above already ends in a line */
.st-block .block-meta h2 { font: 600 17px/1.3 var(--font-ui); color: var(--text); }
.st-cmds { overflow: hidden; }
.st-cmd-head { margin: 0; padding: 13px 18px 11px; font: 600 11.5px/1 var(--font-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); background: var(--bg-3); border-bottom: 1px solid var(--line); }
.st-cmd-list { margin: 0; }
.st-cmds .st-cmd-head:not(:first-child) { border-top: 1px solid var(--line); }
.st-cmd { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 4px 18px; align-items: baseline; padding: 10px 18px; }
.st-cmd + .st-cmd { border-top: 1px solid var(--line); }
.st-cmd dt { font: 500 13.5px/1.45 var(--font-mono); color: var(--blue); overflow-wrap: anywhere; }
.st-cmd dd { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* ─── The shop: every item on sale, and what it costs ─────────────────────────── */
.st-shop[hidden] { display: none; }
.st-shop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }
.st-shop-tools input[type="search"] { flex: 0 1 380px; min-width: 0; }
.st-shop-tools input[hidden] { display: none; }
.st-shop-found { margin: 0; color: var(--text-3); font: 500 12.5px var(--font-mono); }
.st-shop-found:empty, .st-shop-tools:not(:has(input:not([hidden]))) { display: none; }
.st-shop-one + .st-shop-one { margin-top: 38px; }
.st-shop-name { margin: 0 0 12px; font: 600 24px/1.1 var(--font-cond); letter-spacing: .02em; color: var(--text); }
.st-shop-status { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--text-2); font-size: 14.5px; }
.st-shop-status strong { color: var(--text); font-weight: 600; }
.st-shop-note { margin: -6px 0 14px; color: var(--text-3); font-size: 13.5px; }
.st-shop-list { overflow: hidden; }
.st-shop-group + .st-shop-group { border-top: 1px solid var(--line); }
.st-shop-cat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding: 13px 18px 11px;
  font: 600 11.5px/1 var(--font-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); background: var(--bg-3); border-bottom: 1px solid var(--line);
}
.st-shop-cat small { font: 500 11.5px var(--font-mono); letter-spacing: .04em; color: var(--text-3); }
.st-shop-group:first-child .st-shop-cat { border-top: 0; }
.st-items { list-style: none; margin: 0; padding: 0; }
.st-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; padding: 14px 18px; }
.st-item + .st-item { border-top: 1px solid var(--line); }
.st-item[hidden], .st-shop-group[hidden] { display: none; }
.st-item-main { display: grid; gap: 3px; min-width: 0; }
.st-item-name { font: 600 16.5px/1.3 var(--font-ui); color: var(--text); overflow-wrap: anywhere; }
.st-item-sum { color: var(--text-2); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.st-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.st-price { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.st-amount { font: 600 21px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.st-cur { font: 600 11px/1 var(--font-cond); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.st-shop-foot { margin: 16px 0 0; max-width: 72ch; color: var(--text-3); font-size: 13px; line-height: 1.55; }
.st-shop-foot code { font-size: 12.5px; }

/* ─── Buying from the page: the sign-in bar, the Buy buttons, the gas strike, the dialog ─────────────────────── */
.st-buybar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-2); color: var(--text-2); font-size: 14px; }
.st-buybar[hidden] { display: none; }
.st-who { display: inline-flex; align-items: center; gap: 9px; }
.st-who strong { color: var(--text); font-weight: 600; }
.st-bar-actions { display: inline-flex; align-items: center; gap: 8px; }
.st-buy-note { margin: 0 0 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line)); border-radius: var(--r); background: var(--amber-soft); color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.st-buy { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.st-buy.st-buy-note { margin: 0; justify-content: flex-start; }
.st-item.has-buy .st-item-main, .st-strike.has-buy .st-strike-main { grid-row: 1 / span 2; }
.st-item.has-buy .st-price, .st-strike.has-buy .st-price { grid-column: 2; grid-row: 1; }
.st-item.has-buy .st-buy, .st-strike.has-buy .st-buy { grid-column: 2; grid-row: 2; }
.st-amount.st-struck { color: var(--text-3); text-decoration: line-through; font-size: 17px; }
.st-yourprice { color: color-mix(in srgb, var(--green) 76%, var(--text)); font-size: 13.5px; white-space: nowrap; }
.st-yourprice strong { font: 600 15px var(--font-mono); }
.st-yourprice small { color: var(--text-3); font-size: 12px; }

.st-strike { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; padding: 16px 18px; border-color: color-mix(in srgb, var(--green) 38%, var(--line)); background: linear-gradient(110deg, var(--green-soft), transparent 72%), var(--bg-2); }
.st-strike-main { display: grid; gap: 3px; min-width: 0; }
.st-strike-mark { color: var(--green); }
.st-how { color: var(--text-3); font-size: 12.5px; }
.st-how code { font-size: 12px; }

.st-dialog { width: min(560px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 32px); margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); overflow: auto; }
.st-dialog::backdrop { background: rgba(5, 8, 12, .62); }
.st-dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.st-dlg-head h3 { margin: 0; font: 600 22px/1.15 var(--font-cond); letter-spacing: .02em; color: var(--text); overflow-wrap: anywhere; }
.st-dlg-head .btn { width: 34px; padding: 0; font-size: 20px; line-height: 1; }
.st-dlg-body { display: grid; gap: 14px; padding: 16px 20px 20px; }
.st-dlg-sum { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.st-dlg-price { margin: 0; color: var(--text-2); font-size: 15px; }
.st-dlg-price strong { color: var(--text); font: 600 17px var(--font-mono); }
.st-dlg-price small { color: var(--text-3); }
.st-where { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.st-where legend { padding: 0 6px; font: 600 11.5px/1 var(--font-cond); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.st-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; margin: 0; cursor: pointer; color: var(--text); }
.st-opt input { margin-top: 3px; }
.st-opt.st-only { grid-template-columns: minmax(0, 1fr); cursor: default; }
.st-opt strong { display: block; font-weight: 600; font-size: 14.5px; }
.st-opt small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.st-coords { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-coords[hidden] { display: none; }
.st-coord { margin: 0; font-size: 12.5px; }
.st-coord input { margin-top: 4px; font-family: var(--font-mono); }
.st-msg { margin: 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.st-msg:empty { display: none; }
.st-msg[data-kind="error"] { color: var(--red); }
.st-msg[data-kind="info"] { color: var(--text-3); }
.st-msg[data-kind="ok"] { color: color-mix(in srgb, var(--green) 76%, var(--text)); }
.st-dlg-actions { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 0 -20px -20px; padding: 14px 20px 20px; background: linear-gradient(to bottom, transparent, var(--bg-2) 14px); }
.st-sum { display: grid; margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.st-sum > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 14px; }
.st-sum > div + div { border-top: 1px solid var(--line); }
.st-sum dt { color: var(--text-3); font: 600 11.5px/1.7 var(--font-cond); letter-spacing: .14em; text-transform: uppercase; }
.st-sum dd { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.st-sum dd small { color: var(--text-3); }
.st-sum s { color: var(--text-3); }
.st-block { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.st-done p { margin: 0 0 8px; color: var(--text-2); line-height: 1.5; }
.st-done p:first-child { color: var(--text); font-size: 16px; }
.st-rules { display: grid; gap: 3px; margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.st-muted { margin: 0; color: var(--text-3); }
.st-pm-shop { margin: 4px 0 -6px; font: 600 20px/1.1 var(--font-cond); letter-spacing: .02em; color: var(--text); }
.st-dlg-body h5 { margin: 4px 0 -6px; font: 600 11.5px/1 var(--font-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.st-pm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.st-pm { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 11px 14px; }
.st-pm + .st-pm { border-top: 1px solid var(--line); }
.st-pm-main { display: grid; gap: 2px; min-width: 0; }
.st-pm-main strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.st-pm-main span, .st-pm-main small { color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.st-pm-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.st-pm-price { font: 600 14px var(--font-mono); color: var(--text); white-space: nowrap; }
.st-pm-price small { color: var(--text-3); font: 500 12px var(--font-ui); }
.st-pm-ask { max-width: 30ch; color: var(--text-2); font-size: 13px; text-align: right; }

@media (max-width: 700px) {
  .st-item.has-buy, .st-strike { grid-template-columns: minmax(0, 1fr); }
  .st-item.has-buy .st-item-main, .st-strike.has-buy .st-strike-main { grid-row: auto; }
  .st-item.has-buy .st-price, .st-strike.has-buy .st-price { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .st-item.has-buy .st-buy, .st-strike.has-buy .st-buy { grid-column: 1; grid-row: auto; justify-content: flex-end; }
  .st-buy .st-yourprice { margin-right: auto; }
  .st-buy .btn { flex: 0 0 132px; height: 42px; }
  .st-strike { padding: 14px 16px; }
  .st-buybar { padding: 10px 12px; }
  .st-dlg-body { padding: 14px 16px 18px; }
  .st-dlg-actions { margin: 0 -16px -18px; padding: 14px 16px 18px; }
  .st-dlg-head { padding-left: 16px; }
  .st-sum > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .st-pm { grid-template-columns: minmax(0, 1fr); }
  .st-pm-side { justify-content: flex-start; }
  .st-pm-ask { max-width: none; text-align: left; }
  .st-dlg-actions .btn { flex: 1 1 140px; height: 44px; }
}

/* ─── The shop page (GET /shop): the same shop on a page of its own, open to everyone ─────────────────────────── */
.sp-hero { padding-block: 52px 34px; }
.sp-title { display: flex; align-items: center; gap: 14px; margin: 0; font: 600 clamp(46px, 9vw, 92px)/.94 var(--font-cond); letter-spacing: .012em; text-transform: uppercase; color: var(--text); }
.sp-title .sp-mark { flex: 0 0 auto; width: .6em; height: .6em; color: var(--blue); }
.sp-hero .lead { margin-top: 16px; font-size: 17.5px; max-width: 60ch; }
.st-shop-empty { display: grid; gap: 6px; padding: 22px 24px; }
.st-shop-empty strong { font: 600 17px/1.3 var(--font-ui); color: var(--text); }
.st-shop-empty span { max-width: 64ch; color: var(--text-2); font-size: 14.5px; }

.st-support {
  display: grid; grid-template-columns: minmax(170px, 250px) minmax(0, 1fr); gap: 22px 44px; align-items: center;
  margin-top: 28px; padding: 30px 34px;
  border: 1px solid var(--blue-ring); border-radius: var(--r-l);
  background: linear-gradient(115deg, var(--blue-soft), transparent 72%), var(--bg-2);
}
.st-logo { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .3)); }
.st-support h2 { font: 600 34px/1.05 var(--font-cond); letter-spacing: .005em; color: var(--text); }
.st-support p { margin-top: 10px; max-width: 50ch; color: var(--text-2); }
.st-support-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.st-foot { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--bg-1); }
.st-foot .st-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; padding-block: 22px; font-size: 13px; color: var(--text-3); }
.st-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.st-foot a { color: var(--text-2); }
.st-foot a:hover { color: var(--text); }

@media (max-width: 960px) {
  .st-wrap { padding-inline: 24px; }
  .st-hero { padding-block: 44px 30px; }
}
@media (max-width: 700px) {
  .st-wrap { padding-inline: 16px; }
  .st-hero { padding-block: 34px 26px; }
  .st-hero .lead { font-size: 16.5px; }
  .st-cta > * { flex: 1 1 100%; }
  .st-cmd { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .st-item { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 13px 16px; }
  .st-price { justify-content: flex-start; }
  .st-shop-cat { padding-inline: 16px; }
  .st-shop-tools input[type="search"] { flex: 1 1 100%; }
  .st-support { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .st-logo { max-width: 210px; }
  .st-support h2 { font-size: 30px; }
  .st-support-links > * { flex: 1 1 100%; }
  .st-foot .st-wrap { flex-direction: column; }
}

