:root {
  color-scheme: dark;
  /* Navy from the tektinkers.com back-to-top button, coral accent kept */
  --polar-deep: #011f3c;
  --polar-ice: #e7f1fa;
  --polar-mist: #a9c3d8;
  --polar-sea: #1498c4;
  --polar-coral: #c46960;
  --bg: var(--polar-deep);
  --bg-elev: #013a54;
  --card: #001428;
  --accent: var(--polar-coral);
  --accent-2: var(--polar-sea);
  --ink: var(--polar-ice);
  --muted: var(--polar-mist);
  --line: color-mix(in oklab, var(--polar-ice) 12%, transparent);
  --sidebar: var(--card);
  --user: color-mix(in oklab, var(--polar-sea) 18%, var(--bg-elev));
  --composer: var(--bg-elev);
  --danger: #e7b2ac;
  --ok: #cfe6f6;
  --wait: #f3dfc0;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(900px 600px at 100% 0%, color-mix(in oklab, var(--polar-sea) 22%, transparent), transparent 70%),
    color-mix(in oklab, var(--polar-ice) 14%, var(--bg));
  color: var(--ink);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { filter: brightness(1.1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }
.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.evan-name { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.evan-mark { width: 28px; height: 28px; object-fit: contain; display: block; }
h1, h2 { margin: 0; font-weight: 600; }

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}
.gate-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 92%, transparent), color-mix(in oklab, var(--bg) 55%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.gate-card h1 { margin: 8px 0; font-size: 2rem; }
.lede { margin: 0 0 8px; color: var(--muted); line-height: 1.5; }
label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 0.92rem; }
input, textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
}
textarea { resize: none; }
input:focus, textarea:focus { outline: 2px solid color-mix(in oklab, var(--accent) 65%, transparent); border-color: transparent; }
.gate-card button {
  width: 100%;
  margin-top: 18px;
  background: var(--accent);
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.gate-card button:hover { filter: brightness(1.08); }

.app { height: 100%; display: grid; grid-template-columns: 260px 1fr; }
.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--sidebar);
  border-right: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  min-height: 0;
}
.solid {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 14px;
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
}
.solid:hover { background: color-mix(in oklab, var(--polar-sea) 16%, var(--bg-elev)); }
.rail nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; flex: 1; }
.group-form { display: flex; gap: 6px; }
.group-form input { padding: 8px 10px; }
.group-form .solid { width: auto; padding: 8px 10px; }
.group-label { display: flex; align-items: center; gap: 4px; }
.group-label .fold {
  width: 28px;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 0 2px;
}
.group-label .name {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 4px 2px;
}
.group-label .count { color: var(--muted); font-size: 0.72rem; padding: 8px 4px 2px; }
.group-label .name.active { color: var(--ink); }
.group-label .quiet { width: auto; padding: 4px 8px; }
#chat-group {
  max-width: 9rem;
}
.picker {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.picker:disabled { opacity: 0.45; cursor: default; }
.quiet {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
}
.quiet:hover { background: color-mix(in oklab, var(--polar-ice) 10%, transparent); color: var(--ink); }
.chat-row { display: flex; align-items: center; border-radius: 10px; }
.chat-row.active, .chat-row:hover { background: color-mix(in oklab, var(--polar-sea) 16%, transparent); }
.chat-row .open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 8px 10px 12px;
  color: var(--ink);
}
.chat-row .open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .drop {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 1.1rem;
}
.solid.active { background: var(--accent); color: var(--ink); border-color: transparent; }
.logout { margin-top: auto; }
.accounts { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; }
.account-body { width: min(640px, calc(100% - 32px)); margin: 0 auto 32px; }
.account-body h3 { margin: 28px 0 0; font-size: 1.05rem; }
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.account-row span { flex: 1; }
.account-row .role { color: var(--muted); flex: none; }
.account-body .picker {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 12px 14px;
}
.action {
  margin-top: 16px;
  background: var(--accent);
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.action:hover { filter: brightness(1.08); }
.banner.ok { background: color-mix(in oklab, var(--accent-2) 28%, var(--card)); color: var(--ink); }

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
}
.top h2,
.chat-title {
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-title {
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}
#chat-name {
  width: min(280px, 46vw);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 2px;
  font-size: 1rem;
  font-weight: 600;
}
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.pill {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-2);
  color: var(--card);
  font-size: 0.78rem;
  font-weight: 700;
}
.pill.wait { background: color-mix(in oklab, var(--wait) 24%, var(--card)); color: var(--wait); }
.pill.ok { background: color-mix(in oklab, var(--accent-2) 35%, var(--card)); color: var(--ink); }
.pill.bad { background: color-mix(in oklab, var(--accent) 40%, var(--card)); color: var(--ink); }
.token-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 8%, var(--card));
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.token-meter-track {
  width: 72px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 16%, transparent);
  overflow: hidden;
}
.token-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-2);
}
.token-meter.high .token-meter-fill { background: var(--accent); }
.banner {
  width: min(768px, calc(100% - 32px));
  margin: 0 auto 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--accent) 32%, var(--card));
  color: var(--ink);
}
.thread {
  flex: 1;
  overflow: auto;
  width: min(768px, 100%);
  margin: 0 auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.bubble {
  max-width: 100%;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  align-self: flex-end;
  max-width: min(560px, 86%);
  padding: 12px 16px;
  border-radius: 22px;
  background: var(--user);
}
.bubble img.sent-image {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin-top: 8px;
  border-radius: 12px;
}
.bubble.assistant {
  align-self: stretch;
  padding: 2px 4px;
}
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.bubble.user .message-actions { justify-content: flex-end; }
.message-actions button,
.message-edit {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
}
.message-edit {
  display: block;
  width: 100%;
  min-height: 72px;
  margin-top: 8px;
  border-radius: 12px;
  padding: 8px 10px;
  resize: vertical;
}
.bubble img {
  display: block;
  max-width: min(100%, 512px);
  margin-top: 8px;
  border-radius: 12px;
}
.picture {
  display: block;
  width: min(100%, 512px);
  margin-top: 8px;
  white-space: normal;
}
.picture img {
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  cursor: zoom-in;
}
.picture-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.picture-actions:has(.picture-votes) { justify-content: space-between; }
.picture-votes,
.picture-tools {
  display: flex;
  gap: 8px;
}
.picture-actions a,
.picture-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.picture-votes button { padding: 4px 10px; }
.picture-votes button[aria-pressed="true"] { border-color: var(--ink); }
.picture-votes button.up[aria-pressed="true"] { color: var(--ok); }
.picture-votes button.down[aria-pressed="true"] { color: var(--danger); }
.picture-link {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.picture-frame {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.picture-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  cursor: zoom-out;
}
.picture-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.empty {
  margin: auto;
  max-width: 560px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { color: var(--ink); font-size: 1.8rem; font-weight: 500; margin: 0 0 8px; }
.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
  width: min(768px, calc(100% - 32px));
  margin: 8px auto 0;
  padding: 8px 8px 8px 16px;
  background: var(--composer);
  border: 1px solid var(--line);
  border-radius: 28px;
}
.composer textarea {
  background: transparent;
  border: 0;
  padding: 10px 0;
  min-height: 28px;
  max-height: 180px;
}
.composer textarea:focus { outline: 0; }
.composer button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
}
.composer button.attach {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 500;
}
.composer button:disabled { opacity: 0.45; cursor: progress; }
.attach-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 4px 0 6px;
}
.attach-row figure {
  position: relative;
  margin: 0;
}
.attach-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.attach-row button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 20, 40, 0.72);
  color: var(--ink);
  font-size: 12px;
  line-height: 18px;
  padding: 0;
}
.hint {
  width: min(768px, calc(100% - 32px));
  margin: 8px auto 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}
.done-model {
  margin-left: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}

.chooser { width: min(880px, 100%); }
.chooser h1 { margin: 8px 0 0; font-size: 2.4rem; }
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}
.choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 86%, transparent), color-mix(in oklab, var(--bg) 40%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.choice:hover, .choice:focus-visible {
  outline: 0;
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  transform: translateY(-2px);
  filter: none;
}
.choice-name { font-size: 1.15rem; font-weight: 650; }
.choice-detail { color: var(--muted); line-height: 1.45; font-size: 0.92rem; }
a.back { color: var(--accent); }

.site-module {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}
.site-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 92%, transparent), color-mix(in oklab, var(--bg) 55%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.site-card p { margin: 0; line-height: 1.5; }
.site-choice {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}
.site-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.site-actions button {
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 600;
}
#site-accept {
  background: var(--accent);
  border-color: transparent;
}

body.home-page {
  min-height: 100%;
  background:
    radial-gradient(640px 240px at 0% 0%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 72%),
    radial-gradient(900px 600px at 100% 0%, color-mix(in oklab, var(--polar-sea) 22%, transparent), transparent 70%),
    color-mix(in oklab, var(--polar-ice) 14%, var(--bg));
}
.home {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
}
.home-mast {
  display: flex;
  align-items: center;
  gap: 18px;
}
.home-mark {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
}
.home h1 { font-size: 2.4rem; line-height: 1.05; }
.shelf-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.shelf-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in oklab, var(--accent) 40%, transparent);
}
.air {
  margin-top: 28px;
  padding: 16px 16px 18px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--card) 92%, transparent), color-mix(in oklab, #000 28%, var(--card)));
  border: 1px solid color-mix(in oklab, var(--accent) 42%, transparent);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.air-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.air-head .shelf-label { margin: 0; flex: 1; }
.air-count:empty { display: none; }
.air-count { letter-spacing: 0; text-transform: none; color: var(--ink); }
.air-quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  padding: 0;
}
.air-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-color: #c46960 #001428;
  scrollbar-width: auto;
}
.air-row::-webkit-scrollbar { height: 12px; }
.air-row::-webkit-scrollbar-thumb {
  background: #c46960;
  border-radius: 8px;
}
.air-row::-webkit-scrollbar-track { background: #001428; }
.air-status { margin: 0; color: var(--muted); line-height: 1.45; }
.air-card {
  display: flex;
  flex: 1 0 260px;
  flex-direction: column;
  max-width: 340px;
  color: var(--ink);
  text-decoration: none;
}
.air-row:has(.air-card:only-child) .air-card { max-width: 520px; }
.air-card:hover, .air-card:focus-visible { filter: none; outline: 0; }
.air-shot {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}
.air-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
}
.air-meta img {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}
.air-name, .air-game, .air-title, .air-viewers { display: block; }
.air-name { font-weight: 650; }
.air-game, .air-viewers { color: var(--muted); font-size: 0.84rem; }
.air-title {
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.live-pip {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a0a08;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.place {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 86%, transparent), color-mix(in oklab, var(--bg) 40%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.place:hover, .place:focus-visible {
  outline: 0;
  filter: none;
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  transform: translateY(-2px);
}
.place img {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: contain;
  border-radius: 12px;
}
.place img.pixel { image-rendering: pixelated; }

.mega-home { min-height: 100%; }
.mega-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid color-mix(in oklab, var(--polar-sea) 45%, transparent);
}
.mega-brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; }
.mega-browse {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}
.mega-burger {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: white;
}
.mega-burger::before,
.mega-burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: white;
}
.mega-burger::before { top: -5px; }
.mega-burger::after { top: 5px; }
.mega-count {
  margin-left: auto;
  flex: none;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
}
.mega-count:empty { display: none; }
.mega-panel {
  display: none;
  position: absolute;
  z-index: 25;
  left: 0;
  right: 0;
  top: 62px;
  max-height: min(80vh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  background: var(--bg-elev);
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
  scrollbar-color: #c46960 #001428;
  scrollbar-width: auto;
}
.mega-panel::-webkit-scrollbar { width: 12px; }
.mega-panel::-webkit-scrollbar-thumb {
  background: #c46960;
  border-radius: 8px;
}
.mega-panel::-webkit-scrollbar-track { background: #001428; }
.mega-panel.is-open { display: block; height: auto; }
.mega-flow {
  column-width: 240px;
  column-gap: 0;
  column-fill: balance;
}
.mega-col {
  margin: 0;
  padding: 12px 14px;
  border-radius: 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.mega-flow > .mega-col:nth-child(1) {
  background: linear-gradient(180deg, color-mix(in oklab, var(--polar-sea) 42%, #013a54), color-mix(in oklab, var(--polar-sea) 10%, #011f3c));
}
.mega-flow > .mega-col:nth-child(2) {
  background: linear-gradient(180deg, color-mix(in oklab, var(--polar-ice) 18%, #01263f), var(--card));
}
.mega-flow > .mega-col:nth-child(3) {
  background: linear-gradient(165deg, color-mix(in oklab, var(--polar-sea) 34%, var(--bg-elev)), color-mix(in oklab, var(--polar-sea) 8%, #011f3c));
}
.mega-flow > .mega-col:nth-child(4) {
  background: linear-gradient(180deg, color-mix(in oklab, var(--polar-sea) 26%, #014058), color-mix(in oklab, var(--polar-sea) 12%, #011c36));
}
.mega-flow > .mega-col:nth-child(5) {
  background: linear-gradient(180deg, color-mix(in oklab, var(--polar-mist) 30%, #01324a), color-mix(in oklab, var(--polar-mist) 6%, #011828));
}
.mega-flow > .mega-col:nth-child(6) {
  background: linear-gradient(200deg, color-mix(in oklab, #3d8eb0 38%, #01283f), color-mix(in oklab, #3d8eb0 8%, var(--card)));
}
.mega-grid { display: contents; }
.mega-col h2 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  break-after: avoid;
  page-break-after: avoid;
}
.mega-link {
  display: inline-flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  color: var(--ink);
  break-inside: avoid;
  page-break-inside: avoid;
}
.mega-link img {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 8px;
  object-fit: contain;
  background: transparent;
}
.mega-link img.pixel { image-rendering: pixelated; }
.mega-link span { display: flex; flex-direction: column; min-width: 0; }
.mega-link small { color: var(--muted); font-size: 0.78rem; }
.mega-home .home {
  width: 100%;
  /* 6 columns at 280px, plus the 16px gaps and this padding. Wider windows keep the side space. */
  max-width: 1796px;
  margin: 0 auto;
  padding: 18px 18px 48px;
}
.mega-home .air {
  width: auto;
  margin: 0;
  border-radius: 22px;
}
.mega-home .air-card { max-width: none; flex-basis: 280px; }
.wire { margin-top: 22px; }
.wire-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.wire-head .shelf-label { flex: 1; }
.wire-fresh {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.wire-next,
.wire-action {
  width: auto;
  align-self: flex-start;
  border: 0;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--ink);
  padding: 6px 12px;
  font-weight: 650;
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}
.wire-card > .wire-next,
.wire-card > .wire-action {
  margin-top: auto;
}
.wire-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.wire-row-gap { grid-row: 1; }
.wire-row-gap.at3 { grid-column-start: 3; }
.wire-row-gap.at4 { grid-column-start: 4; }
.wire-row-gap.at5 { grid-column-start: 5; }
.wire-row-gap.at6 { grid-column-start: 6; }
.wire-row-gap.s1 { grid-column-end: span 1; }
.wire-row-gap.s2 { grid-column-end: span 2; }
.wire-row-gap.s3 { grid-column-end: span 3; }
.wire-row-gap.s4 { grid-column-end: span 4; }
.wire-more { display: flex; justify-content: center; margin-top: 16px; }
.wire-show {
  width: auto;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  font-weight: 750;
}
.wire-show:hover,
.wire-show:focus-visible {
  filter: brightness(1.08);
  outline: 0;
}
.wire-wide { grid-column: span 2; position: relative; min-width: 0; overflow: hidden; }
.wire-wide.wire-c1 { grid-column: 1 / span 2; }
.wire-wide.wire-c2 { grid-column: 2 / span 2; }
.wire-wide.wire-c3 { grid-column: 3 / span 2; }
.wire-wide.wire-c4 { grid-column: 4 / span 2; }
.wire-wide.wire-c5 { grid-column: 5 / span 2; }
.wire-wide.wire-c6 { grid-column: 6 / span 2; }
.wire-wide.wire-c7 { grid-column: 7 / span 2; }
.wire-wide.wire-c8 { grid-column: 8 / span 2; }
.wire-wide.wire-r1 { grid-row: 1; }
.wire-wide.wire-r2 { grid-row: 2; }
.wire-wide.wire-r3 { grid-row: 3; }
.wire-wide.wire-r4 { grid-row: 4; }
.wire-wide.wire-r5 { grid-row: 5; }
.wire-wide.wire-r6 { grid-row: 6; }
.wire-wide.wire-r7 { grid-row: 7; }
.wire-wide.wire-r8 { grid-row: 8; }
.wire-wide.wire-r9 { grid-row: 9; }
.wire-wide.wire-r10 { grid-row: 10; }
.wire-wide.wire-r11 { grid-row: 11; }
.wire-wide.wire-r12 { grid-row: 12; }
.wire-wide.wire-r13 { grid-row: 13; }
.wire-wide.wire-r14 { grid-row: 14; }
.wire-wide.wire-r15 { grid-row: 15; }
.wire-wide.wire-r16 { grid-row: 16; }
.wire-wide.wire-r17 { grid-row: 17; }
.wire-wide.wire-r18 { grid-row: 18; }
.wire-wide.wire-r19 { grid-row: 19; }
.wire-wide.wire-r20 { grid-row: 20; }
.wire-wide.wire-r21 { grid-row: 21; }
.wire-wide.wire-r22 { grid-row: 22; }
.wire-wide.wire-r23 { grid-row: 23; }
.wire-wide.wire-r24 { grid-row: 24; }
.wire-wide.wire-r25 { grid-row: 25; }
.wire-wide.wire-r26 { grid-row: 26; }
.wire-wide.wire-r27 { grid-row: 27; }
.wire-wide.wire-r28 { grid-row: 28; }
.wire-wide.wire-r29 { grid-row: 29; }
.wire-wide.wire-r30 { grid-row: 30; }
.wire-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow: hidden;
  scroll-behavior: smooth;
}
.wire-track.instant { scroll-behavior: auto; }
.wire-slide { min-width: 0; }
.wire-arrow {
  position: absolute;
  top: 96px;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}
.wire-arrow.prev { left: 8px; }
.wire-arrow.next { right: 8px; }
.wire-card.wire-razer {
  background: #000;
  color: #44d62c;
  border: 1px solid #44d62c;
}
.wire-razer .wire-source { color: #44d62c; }
.wire-razer .wire-title { color: #fff; }
.wire-razer .wire-detail,
.wire-razer .wire-when { color: #c6c6c6; }
.wire-razer .wire-action { background: #44d62c; color: #000; }
.wire-razer .wire-arrow {
  background: #000;
  color: #44d62c;
  box-shadow: 0 0 0 1px #44d62c;
}
.wire-razer .wire-photo.product { background: #000; }
.wire-card.wire-nacho {
  background: linear-gradient(180deg, #faf4eb, #f0e6d8);
  color: #2f1f14;
  border: 1px solid #e8a020;
}
.wire-nacho .wire-source { color: #e87820; }
.wire-nacho .wire-title { color: #2f1f14; }
.wire-nacho .wire-detail,
.wire-nacho .wire-when { color: #6b4f3a; }
.wire-nacho .wire-arrow { background: #e8a020; color: #3a2510; }
.wire-nacho > .wire-action {
  background: linear-gradient(180deg, #efc050 0%, #e8a020 52%, #e07818 100%);
  color: #3a2510;
}
.wire-nacho .wire-photo { background: #fff9f2; }
.wire-craft { position: relative; }
.craft-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}
.craft-arrow.prev { left: 0; transform: translate(-50%, -50%); }
.craft-arrow.next { right: 0; transform: translate(50%, -50%); }
.craft-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}
.craft-dot {
  width: 7px;
  height: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 35%, transparent);
}
.craft-dot.is-on { background: var(--accent); }
.wire-wide .wire-photo { height: 200px; }
@media (max-width: 560px) {
  .wire-list .wire-wide { grid-column: auto; grid-row: auto; }
}
.wire-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  background: var(--card);
  border-radius: 16px;
}
.wire-photo-link { display: block; }
.wire-photo {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg-elev);
}
.wire-photo.product {
  object-fit: contain;
  background: #001428;
  padding: 12px;
}
.wire-photo.cover-top { object-position: top center; }
.wire-photo.cover-raise { object-position: center 10%; }
.wire-card.wire-forecast {
  background:
    linear-gradient(180deg, rgba(1, 20, 40, 0.78), rgba(1, 20, 40, 0.62)),
    url("/static/feed/weather.png") center / cover no-repeat;
}
.wire-card.wire-forecast .wire-source,
.wire-card.wire-forecast .wire-title,
.wire-card.wire-forecast .forecast-days span,
.wire-card.wire-forecast .forecast-days strong,
.wire-card.wire-forecast .forecast-days .forecast-low,
.wire-card.wire-forecast .forecast-days small {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}
.forecast-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.forecast-days span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.forecast-days strong { display: block; margin-top: 4px; font-size: 1.15rem; }
.forecast-icon { display: block; width: 32px; height: 32px; margin-top: 6px; }
.forecast-days .forecast-low {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-style: normal;
  font-weight: 650;
  font-size: 0.95rem;
}
.forecast-find {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.forecast-find input {
  width: 14rem;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 6px 12px;
}
.forecast-find button {
  width: auto;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--ink);
  padding: 6px 12px;
  font-weight: 650;
}
.forecast-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
}
.forecast-map {
  align-self: flex-start;
  margin-top: 12px;
  font-weight: 650;
}
.forecast-days small {
  display: -webkit-box;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 700px) {
  .forecast-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wire-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 12px auto 4px;
  object-fit: contain;
}
.wire-source {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wire-title {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.25;
}
.wire-detail, .wire-rank, .wire-when, .wire-note { color: var(--muted); font-size: 0.88rem; margin: 8px 0 0; }
.wire-detail {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wire-rank, .wire-when { margin: 4px 0 0; }
@media (max-width: 800px) {
  .mega-panel { max-height: 70vh; }
}
.upload-preview {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 0 8px;
  border-radius: 12px;
  background: var(--card);
}
.place-name { display: block; font-size: 1.05rem; font-weight: 650; }
.place-detail { display: block; margin-top: 2px; color: var(--muted); line-height: 1.4; font-size: 0.9rem; }
@media (max-width: 700px) {
  .choices { grid-template-columns: 1fr; }
  .home-mast { align-items: flex-start; }
  .home h1 { font-size: 2rem; }
}

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { max-height: 34vh; }
  .top { padding-left: 14px; padding-right: 14px; }
}
