:root {
  --ink: #140c18;
  --paper: #fff6ec;
  --card: rgba(18, 8, 24, 0.82);
  --line: rgba(255, 246, 236, 0.16);
  --curator: #ff3d9a;
  --appraiser: #ffc247;
  --minter: #3de2ff;
  --auctioneer: #ff5a32;
  --risk: #c6f25a;
  --logger: #9b86ff;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: Georgia, "Iowan Old Style", Palatino, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
@media (min-width: 1100px) {
  body { height: 100vh; overflow: hidden; }
  .desk { height: calc(100vh - 36px); min-height: 0; }
}
body {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(255, 61, 154, 0.35), transparent 60%),
    radial-gradient(800px 480px at 110% 0%, rgba(61, 226, 255, 0.28), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(255, 194, 71, 0.22), transparent 50%),
    #1a1024;
  color: var(--paper);
  font-family: var(--mono);
}
.desk {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 280px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1440px, calc(100% - 20px));
  margin: 10px auto 0;
  min-height: calc(100vh - 36px);
}
.brand, .cards, .stage, .dossier, .trackbar {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 6, 16, 0.55);
  backdrop-filter: blur(8px);
}
.brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}
.brand-mark {
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd6f2, #ff3d9a 42%, #2a0d3a 72%);
  box-shadow: 0 0 24px rgba(255, 61, 154, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.4);
}
.brand-mark span {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 12px white;
}
.brand-line { display: flex; align-items: baseline; gap: 12px; }
.brand-line b {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.04em;
  font-weight: 700;
}
.brand-line b span { color: var(--minter); }
.brand-line i { color: rgba(255, 246, 236, 0.45); font-style: normal; }
.brand-line strong { letter-spacing: 0.14em; font-size: clamp(16px, 2vw, 22px); }
.brand-tag { margin: 4px 0 0; color: rgba(255, 246, 236, 0.72); font-size: 11px; letter-spacing: 0.08em; }
.brand-tag span { color: var(--appraiser); }
.brand-pills { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill, .agent-top label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.pill.live { display: inline-flex; align-items: center; gap: 6px; color: var(--risk); }
.pill.live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--risk);
  box-shadow: 0 0 10px var(--risk); animation: pulse 1.4s ease-in-out infinite;
}
.cards { display: grid; gap: 8px; padding: 8px; align-content: start; overflow: auto; }
.agent-card {
  --c: var(--logger);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-radius: 14px;
  padding: 8px 10px 9px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 18%, #120814), #120814 70%);
  min-height: 0;
}
.tone-curator { --c: var(--curator); }
.tone-appraiser { --c: var(--appraiser); }
.tone-minter { --c: var(--minter); }
.tone-auctioneer { --c: var(--auctioneer); }
.tone-risk { --c: var(--risk); }
.tone-logger { --c: var(--logger); }
.agent-card.is-current {
  box-shadow: 0 0 0 1px var(--c), 0 10px 28px color-mix(in srgb, var(--c) 35%, transparent);
}
.agent-card.is-engaged { animation: nudge 0.7s ease; }
.agent-top { display: flex; gap: 8px; align-items: center; }
.agent-swatch {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background:
    radial-gradient(circle at 50% 42%, #fff 0 3px, transparent 4px),
    linear-gradient(#111, #111) center 16px / 14px 4px no-repeat,
    radial-gradient(circle at 50% 30%, #2a2a32, #050507 70%);
  box-shadow: 0 0 0 2px var(--c), 0 0 12px var(--c);
}
.agent-top b { display: block; font-size: 14px; letter-spacing: 0.04em; }
.agent-top small, .node small, .track-head small { display: block; color: rgba(255,246,236,0.62); font-size: 9px; letter-spacing: 0.08em; }
.agent-top label { margin-left: auto; color: var(--c); }
.agent-card p { margin: 6px 0 4px; font-size: 11px; line-height: 1.35; color: rgba(255,246,236,0.86); }
.agent-card footer { font-size: 10px; color: var(--c); min-height: 14px; }
.stage { position: relative; min-height: 280px; overflow: hidden; background: #2a140c; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage-hint, .stage-fallback {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  margin: 0; font-size: 11px; letter-spacing: 0.04em;
  color: #1a1024; background: rgba(255, 246, 236, 0.88);
  border-radius: 999px; padding: 6px 10px; width: max-content; max-width: calc(100% - 24px);
}
.stage-fallback { top: 12px; bottom: auto; width: auto; border-radius: 12px; }
.dossier { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lot { margin: 0; display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; }
.lot-canvas { height: 92px; border-radius: 10px; border: 6px solid #f0d48a; box-shadow: 0 8px 18px rgba(0,0,0,0.35); }
.lot-canvas[data-style="cadmium"] { background: repeating-linear-gradient(#ff3b1f, #ff3b1f 10px, #ffb703 10px, #ffb703 18px); }
.lot-canvas[data-style="orbit"] { background: radial-gradient(circle at 50% 58%, transparent 0 18px, #fff 19px 22px, transparent 23px), radial-gradient(circle at 38% 42%, #fff 0 6px, transparent 7px), radial-gradient(circle at 62% 42%, #fff 0 6px, transparent 7px), #123a8f; }
.lot-canvas[data-style="market"] { background: linear-gradient(135deg, #6d28d9 0 40%, #fbbf24 40% 58%, #fb7185 58% 100%); }
.lot-canvas[data-style="glitch"] { background: linear-gradient(90deg, #ff2d55 0 33%, #39ff14 33% 66%, #3d7bff 66% 100%); }
.lot-canvas[data-style="bouquet"] { background: radial-gradient(circle at 30% 60%, #ff4fa3 0 18px, transparent 19px), radial-gradient(circle at 58% 40%, #7dff6a 0 16px, transparent 17px), radial-gradient(circle at 70% 68%, #fff 0 10px, transparent 11px), #2a0f18; }
.lot-canvas[data-style="room"] { background: linear-gradient(#9ad7ff, #9ad7ff 30%, #1d4ed8 30% 70%, #f4e1c1 70%); }
.lot figcaption small, .mark-note, .journal-head small { color: rgba(255,246,236,0.62); font-size: 10px; letter-spacing: 0.06em; }
.lot figcaption b { display: block; font-family: var(--serif); font-size: 20px; margin: 3px 0; }
.lot figcaption p { margin: 0; font-size: 11px; line-height: 1.35; }
.mark-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mark-row div { background: rgba(255,255,255,0.04); border-radius: 10px; padding: 6px; }
.mark-row span { display: block; font-size: 9px; letter-spacing: 0.06em; color: rgba(255,246,236,0.6); }
.mark-row strong { font-size: 14px; }
.mark-note { margin: 0; }
.journal-head { display: flex; justify-content: space-between; align-items: center; }
.journal { overflow: auto; min-height: 120px; flex: 1; font-size: 11px; line-height: 1.4; }
.journal .line { display: grid; grid-template-columns: 64px 92px 1fr; gap: 6px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.journal time { color: rgba(255,246,236,0.5); }
.journal b { color: var(--c, white); }
.trackbar { grid-column: 1 / -1; padding: 10px 12px 12px; }
.track-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.track-head b { letter-spacing: 0.08em; font-size: 12px; }
.track-head i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--minter); box-shadow: 0 0 8px var(--minter); margin-right: 6px; }
.track-head small { display: inline; margin-left: 6px; }
#cycleLabel { font-size: 10px; letter-spacing: 0.08em; color: var(--appraiser); }
.track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding-top: 8px;
}
.track::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 34px;
  height: 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 18px);
  background-size: 36px 4px;
  animation: travel 0.9s linear infinite;
  opacity: 0.8;
}
.bead {
  position: absolute;
  top: 26px;
  left: 8%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 12px #fff, 0 0 22px var(--minter);
  transition: left 0.55s ease;
  z-index: 2;
}
.node {
  --c: white;
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 6px 4px 4px;
}
.node span {
  width: 42px; height: 42px; margin: 0 auto 4px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--c); background: #140c18;
  box-shadow: 0 0 0 4px rgba(20,12,24,0.9);
  font-size: 12px;
}
.node.is-hot span { animation: nodePulse 0.9s ease-in-out infinite; background: color-mix(in srgb, var(--c) 35%, #140c18); }
.node b { display: block; font-size: 11px; }
.track-controls { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
button {
  font: 700 12px var(--mono);
  letter-spacing: 0.06em;
  color: #1a1024;
  background: linear-gradient(#ffe38a, #ffb703);
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
button[aria-pressed="false"] { background: #2a2233; color: var(--paper); }
#handoffCaption { margin: 0; font-size: 12px; color: rgba(255,246,236,0.86); }
.legal {
  width: min(1440px, calc(100% - 20px));
  margin: 8px auto 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
  color: rgba(255,246,236,0.62);
}
@keyframes travel { to { background-position: 36px 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes nudge { 50% { transform: translateX(4px) scale(1.01); } }
@keyframes nodePulse { 50% { transform: scale(1.06); filter: brightness(1.3); } }
@media (max-width: 1100px) {
  .desk { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto minmax(420px, 1fr) auto auto; }
  .cards { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .stage { grid-column: 1; }
  .dossier { grid-column: 2; }
}
@media (max-width: 760px) {
  .desk { width: calc(100% - 12px); grid-template-columns: 1fr; }
  .brand { flex-wrap: wrap; }
  .brand-pills { margin-left: 0; }
  .cards, .stage, .dossier, .trackbar { grid-column: 1; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stage { min-height: 320px; }
  .track { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .track::before { display: none; }
  .bead { display: none; }
  .track-controls { flex-wrap: wrap; }
  .journal .line { grid-template-columns: 52px 78px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .track::before, .pill.live i, .agent-card.is-engaged, .node.is-hot span { animation: none; }
  .bead { transition: none; }
}
