/* Shared tokens keep every workspace view usable in either theme. */
:root {
  color-scheme: light;
  --surface: #fff;
  --surface-soft: #f0f4e8;
  --surface-raised: #f8faf3;
  --surface-glass: #ffffffd6;
  --nav-active: #e8eedb;
  --control-line: #cdd8c4;
  --primary: #173b32;
  --primary-hover: #244e42;
  --primary-ink: #e3ff9b;
  --badge-bg: #f0f6e5;
  --badge-ink: #4b6932;
  --highlight: #dfff84;
  --shadow: #173b320d;
  --art-opacity: .88;
  --danger: #a43824;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101d19;
  --ink: #e7eee1;
  --muted: #a3b3a6;
  --line: #314139;
  --white: #1a2b24;
  --surface: #1a2b24;
  --surface-soft: #22382c;
  --surface-raised: #1c3027;
  --surface-glass: #182b23e6;
  --nav-active: #344b30;
  --control-line: #49614e;
  --primary: #dfff84;
  --primary-hover: #edffb4;
  --primary-ink: #173b32;
  --badge-bg: #30432a;
  --badge-ink: #c6e896;
  --highlight: #47642d;
  --shadow: #00000030;
  --art-opacity: .72;
  --danger: #ffac92;
}
html { background: var(--paper); }
body {
  isolation: isolate;
  background: var(--paper);
}
button, input, select, textarea { transition: background-color .18s, border-color .18s, color .18s; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #94b64e; outline-offset: 4px;
}
.topbar {
  position: relative;
  z-index: 20;
  max-width: 1350px;
  margin: 22px auto 0;
  padding: 15px 24px;
  width: calc(100% - 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-glass);
  box-shadow: 0 9px 32px var(--shadow), inset 0 1px 0 #ffffff16;
  backdrop-filter: blur(20px);
  gap: 16px;
}
.brand { font-size: 18px; flex-shrink: 0; gap: 10px; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand-caption { font-size: 7px; letter-spacing: 1.9px; margin-top: 6px; }
.topbar nav { gap: 2px; }
.nav-button { padding: 11px 12px; border-radius: 100px; white-space: nowrap; }
.nav-button:hover { color: var(--ink); background: var(--surface-soft); }
.nav-button.active { background: var(--nav-active); color: var(--ink); }
.header-actions { flex-shrink: 0; }
.theme-control { padding: 3px; border: 1px solid var(--line); background: var(--surface-soft); gap: 2px; }
.theme-button {
  border: 0; background: transparent; color: var(--muted); border-radius: 50%;
  width: 30px; height: 30px; display: grid; place-items: center; padding: 6px;
}
.theme-button:hover { color: var(--ink); }
.theme-button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 2px 6px var(--shadow); }
.theme-button svg { width: 16px; height: 16px; }
.header-actions .button { border-radius: 100px; gap: 12px; }
.view { position: relative; }
.hero { position: relative; isolation: isolate; gap: 66px; padding-top: 64px; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { position: relative; font-weight: 680; letter-spacing: -4px; }
.hero-description { color: var(--muted); max-width: 390px; }
.hero-facts i { color: var(--muted); border-color: var(--control-line); background: var(--surface-glass); }
.hero-art { position: absolute; z-index: -1; opacity: var(--art-opacity); height: auto; }
.hero-art-orbit { width: clamp(215px, 24vw, 360px); right: 43%; top: -18px; transform: rotate(-16deg); }
.hero-art-pebble { width: 245px; left: -148px; bottom: 22px; transform: rotate(22deg); opacity: .23; }
.hero-copy::before {
  content: ""; position: absolute; inset: -20px -10px -20px -25px; z-index: -1;
  background: linear-gradient(90deg, var(--paper) 56%, transparent 100%); pointer-events: none;
}
.hero-note { display: flex; align-items: center; gap: 10px; margin-top: 30px; color: var(--muted); font-size: 10px; letter-spacing: .2px; }
.hero-note::before { content: "↗"; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--surface-soft); color: var(--ink); font-size: 14px; }
.accent::after { background: var(--highlight); border-radius: 3px; }
.upload-panel { position: relative; z-index: 2; border-radius: 25px; background: var(--surface); box-shadow: 0 22px 60px var(--shadow); }
.button-primary { background: var(--primary); color: var(--primary-ink); border-radius: 12px; }
.button-primary:hover { background: var(--primary-hover); }
.button-outline { color: var(--ink); border-color: var(--control-line); }
.button-outline:hover { background: var(--surface-soft); }
.drop-zone { background: var(--surface-raised); border-color: var(--control-line); border-radius: 16px; }
.drop-zone.dragging { background: var(--surface-soft); border-color: var(--primary); }
.upload-symbol { color: var(--ink); background: var(--surface-soft); }
input:not([type=checkbox]):not([type=file]), select, textarea { background: var(--surface); color: var(--ink); border-color: var(--control-line); border-radius: 9px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[readonly], textarea[readonly] { background: var(--surface-raised); }
.check input { accent-color: var(--primary); }
.pill, .status { background: var(--badge-bg); color: var(--badge-ink); border-color: var(--control-line); border-radius: 7px; }
.panel-footer { border-color: var(--line); }
.play-choice, .verification-callout, .token-result, .note-line, .auto-options, .empty { background: var(--surface-soft); }
.progress { background: var(--surface-soft); }
.game-card, .job-row, .destination-card, .surface, .play-card, dialog { background: var(--surface); color: var(--ink); }
.game-visual, .destination-icon { background: var(--surface-soft); color: var(--ink); }
.destination-icon img { width: 25px; height: 25px; object-fit: contain; }
.destination-card .route, .step-number { color: var(--badge-ink); }
.status.needs_human, .status.needs_connection, .status.needs_changes { background: #f8ecd3; color: #795523; }
.status.failed, .status.removed { background: #ffece5; color: #994737; }
.status.live { background: #dff2df; color: #377949; }
:root[data-theme="dark"] .status.needs_human, :root[data-theme="dark"] .status.needs_connection, :root[data-theme="dark"] .status.needs_changes { background: #493b22; color: #f5d59b; }
:root[data-theme="dark"] .status.failed, :root[data-theme="dark"] .status.removed { background: #492e27; color: #ffbb9b; }
:root[data-theme="dark"] .status.live { background: #23462f; color: #a8dfb2; }
.toast { background: var(--primary); color: var(--primary-ink); }
.skip { z-index: 30; background: var(--primary); color: var(--primary-ink); }
.workflow-section { position: relative; padding-top: 50px; }
.workflow-step { position: relative; }
.workflow-step h3 { max-width: 210px; }
.workflow-art { position: absolute; pointer-events: none; width: 170px; height: auto; right: 0; bottom: -40px; opacity: .13; z-index: -1; transform: rotate(-28deg); }

/* A duplicated group gives the rail a continuous loop without a JS timer. */
.company-carousel { padding: 28px 0 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.carousel-heading { margin-bottom: 20px; }
.carousel-heading h2 { font-size: 23px; line-height: 1.25; font-weight: 650; letter-spacing: -.7px; margin: 8px 0 0; }
.carousel-heading .eyebrow { color: var(--muted); font-size: 8px; letter-spacing: 1.5px; }
.carousel-controls { display: flex; align-items: center; gap: 20px; }
.carousel-count { font-size: 10px; color: var(--muted); }
.carousel-pause { border: 1px solid var(--line); border-radius: 100px; background: var(--surface-glass); color: var(--muted); font-size: 10px; padding: 8px 11px; }
.carousel-pause svg { width: 11px; height: 11px; }
.carousel-pause:hover { background: var(--surface-soft); color: var(--ink); }
.carousel-window { overflow: hidden; padding: 10px 0 17px; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.carousel-track { display: flex; width: max-content; animation: gateway-marquee 65s linear infinite; }
.carousel-group { display: flex; align-items: center; gap: 16px; padding-right: 16px; }
.company-chip {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface-glass);
  color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
  box-shadow: 0 6px 15px var(--shadow); animation: gateway-float 5s ease-in-out infinite alternate;
}
.company-chip:nth-child(3n+2) { animation-delay: -2s; }
.company-chip:nth-child(3n) { animation-delay: -4s; }
.company-chip:hover { border-color: var(--control-line); background: var(--surface); }
.company-chip img { width: 27px; height: 27px; object-fit: contain; }
.company-chip img, .destination-icon img { filter: grayscale(1) brightness(.5); }
:root[data-theme="dark"] .company-chip img, :root[data-theme="dark"] .destination-icon img { filter: grayscale(1) brightness(0) invert(.9); }
.company-carousel:hover .carousel-track, .company-carousel:focus-within .carousel-track,
.company-carousel[data-paused="true"] .carousel-track,
.company-carousel:hover .company-chip, .company-carousel:focus-within .company-chip,
.company-carousel[data-paused="true"] .company-chip { animation-play-state: paused; }
@keyframes gateway-marquee { to { transform: translateX(-50%); } }
@keyframes gateway-float { from { transform: translateY(-3px); } to { transform: translateY(4px); } }

@media(min-width:1500px) { .hero { gap: 90px; } }
@media(max-width:1150px) {
  .topbar { flex-wrap: wrap; padding: 14px 21px 12px; }
  .topbar nav { order: 3; width: 100%; justify-content: center; padding-top: 10px; border-top: 1px solid var(--line); }
  .nav-button { flex: 0 1 auto; padding: 9px 20px; }
  .hero { gap: 36px; padding-top: 48px; }
  .hero-art-orbit { right: 42%; width: 260px; top: -5px; }
  .hero h1 { font-size: 64px; }
}
@media(max-width:850px) {
  .topbar { width: calc(100% - 36px); margin-top: 18px; }
  .hero { gap: 24px; }
  .hero h1 { font-size: 52px; letter-spacing: -3px; }
  .hero-art-orbit { width: 220px; right: 38%; top: 4px; opacity: .65; }
  .hero-note { font-size: 9px; margin-top: 22px; }
  .hero-art-pebble { width: 175px; }
  .carousel-controls { gap: 12px; }
  .carousel-count { display: none; }
}
@media(max-width:600px) {
  .topbar { width: calc(100% - 24px); margin-top: 12px; padding: 12px 14px 9px; border-radius: 23px; gap: 10px; }
  .brand { font-size: 14px; gap: 6px; }
  .brand img { width: 32px; height: 32px; }
  .brand-caption { font-size: 6px; letter-spacing: 1.15px; }
  .header-actions { gap: 4px; }
  .theme-control { padding: 2px; gap: 0; }
  .theme-button { width: 23px; height: 23px; padding: 4px; }
  .theme-button svg { width: 14px; height: 14px; }
  .header-actions .button { padding: 7px 8px; min-height: 32px; font-size: 9px; gap: 5px; }
  .workspace-label { display: none; }
  .topbar nav { justify-content: space-between; padding-top: 8px; gap: 0; }
  .nav-button { font-size: 10px; padding: 9px 8px; flex: 0 1 auto; }
  .hero { grid-template-columns: 1fr; padding: 45px 0 34px; gap: 32px; }
  .hero-copy { padding-right: 24px; }
  .hero h1 { font-size: clamp(46px, 12.5vw, 61px); letter-spacing: -2.8px; margin: 24px 0; }
  .hero-description { font-size: 14px; max-width: 290px; }
  .hero-facts { font-size: 11px; margin-top: 24px; }
  .hero-copy > .eyebrow { max-width: 220px; font-size: 8px; letter-spacing: 1.3px; }
  .hero-art-orbit { width: 180px; top: 36px; right: 10px; opacity: .5; }
  .hero-copy::before { inset: -10px -8px -12px -8px; background: linear-gradient(90deg, var(--paper) 42%, transparent); }
  .hero-art-pebble { width: 150px; left: -90px; bottom: 120px; }
  .hero-note { margin-top: 22px; font-size: 9px; }
  .upload-panel { border-radius: 21px; }
  .carousel-heading { align-items: center; gap: 10px; }
  .carousel-heading h2 { font-size: 20px; }
  .carousel-heading .eyebrow { font-size: 7px; letter-spacing: 1px; }
  .carousel-pause { padding: 8px; gap: 5px; font-size: 9px; }
  .company-chip { font-size: 13px; padding: 14px 19px; border-radius: 15px; }
  .company-chip img { width: 24px; height: 24px; }
  .carousel-group { gap: 12px; padding-right: 12px; }
  .workflow-art { right: 15px; width: 140px; }
}
@media(max-width:370px) {
  .topbar { padding-inline: 10px; }
  .brand { font-size: 13px; }
  .brand img { width: 30px; height: 30px; }
  .brand-caption { font-size: 5px; }
  .nav-button { font-size: 9px; padding-inline: 5px; }
  .header-actions .button { padding-inline: 8px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { min-width: 0; padding-right: 0; }
  .hero h1 { font-size: 43px; letter-spacing: -2.5px; }
  .hero-art-orbit { width: 150px; right: 12px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .carousel-window { overflow-x: auto; }
  .carousel-group[aria-hidden="true"], .carousel-pause { display: none; }
}

/* Distribution route filters retain room for both choices and their count. */
.filter-row { flex-wrap: wrap; }
.filter-row > span { flex: 1 1 230px; }
@media(max-width:600px) {
  .filter-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .filter-row > label { min-width: 0; }
  .filter-row > span { grid-column: 1 / -1; }
  #queue-connected-button, #queue-button { white-space: normal; }
}
