:root {
  --bg-root: #111214;
  --bg-app: #16181b;
  --bg-panel: #1c1e22;
  --bg-panel-header: #212429;
  --bg-input: #141619;
  --bg-hover: #262a30;
  --border: #2c3037;
  --border-strong: #3a3f48;

  --text-main: #e2e5ea;
  --text-muted: #939aa6;
  --text-dim: #6c7380;

  --accent-blue: #4c8bf5;
  --accent-blue-bg: #243654;
  --player-a: #d98a2b;
  --player-b: #4c8bf5;
  --player-c: #3ea86b;
  --purple: #9b72cf;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 48px;
}

body {
  margin: 0;
  background: var(--bg-root);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-app);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Top menubar */
.menubar {
  height: 32px;
  padding: 0 12px;
  background: #121316;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.menubar-left,
.menubar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text-main);
}

.app-brand img {
  display: block;
}

.menu-items {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-items a {
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--text-muted);
}

.menu-items a:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.menu-gh {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
}

.menu-gh:hover {
  text-decoration: underline;
}

/* Software tab toolbar */
.toolbar {
  padding: 8px 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--text-main);
  border-bottom-color: var(--accent-blue);
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-muted);
}

.mode-auto {
  border-color: #36588c;
  color: #9ec0fa;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-blue);
  color: #0e131b;
}

.btn-primary:hover {
  background: #639bf8;
}

.btn-secondary {
  background: #252930;
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #2e333c;
}

.btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

/* Main workspace container */
.workspace-main {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.panel-header {
  min-height: 34px;
  padding: 6px 12px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.panel-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.panel-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
}

.panel-link:hover {
  text-decoration: underline;
}

/* Overview panel */
.intro-body {
  padding: 16px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
}

.intro-copy h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.intro-copy p {
  margin: 0 0 14px;
  color: var(--text-muted);
  max-width: 62ch;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Player A / B / C summary rows */
.deck-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deck-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.deck-badge {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #111315;
}

.deck-a {
  background: var(--player-a);
}

.deck-b {
  background: var(--player-b);
}

.deck-c {
  background: var(--player-c);
}

.deck-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.deck-info strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.deck-info span {
  font-size: 11px;
  color: var(--text-dim);
}

.deck-state {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border-strong);
}

.state-onair {
  color: #f3b35c;
  border-color: #6b4c22;
  background: #271e12;
}

.state-standby {
  color: #8cb6ff;
  border-color: #2e4975;
  background: #172235;
}

.state-loaded {
  color: #77d49d;
  border-color: #275c3e;
  background: #14291d;
}

/* Screenshot viewer */
.viewer-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.viewer-stage {
  background: #0e1012;
  padding: 10px;
  display: flex;
  justify-content: center;
}

.viewer-stage img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.viewer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-panel-header);
  border-top: 1px solid var(--border);
}

.strip-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}

.strip-item:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.strip-item.active {
  background: var(--accent-blue-bg);
  border-color: var(--accent-blue);
  color: var(--text-main);
}

/* Capabilities & Workflow split */
.split-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
}

.spec-list,
.workflow-table {
  display: flex;
  flex-direction: column;
}

.spec-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 14px;
  align-items: baseline;
}

.spec-item:last-child {
  border-bottom: 0;
}

.spec-key {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dot-orange { background: var(--player-a); }
.dot-blue { background: var(--player-b); }
.dot-green { background: var(--player-c); }
.dot-purple { background: var(--purple); }

.spec-val {
  color: var(--text-muted);
  font-size: 12.5px;
}

.wf-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}

.wf-row:last-child {
  border-bottom: 0;
}

.wf-step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  padding-top: 2px;
}

.wf-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.wf-row p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Platform table */
.platform-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 120px 1fr 220px auto;
  align-items: center;
  gap: 14px;
}

.platform-row:last-child {
  border-bottom: 0;
}

.plat-name {
  font-weight: 600;
  color: var(--text-main);
}

.plat-req {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.plat-license {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Bottom statusbar */
.statusbar {
  min-height: 28px;
  padding: 4px 12px;
  background: #121316;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-link {
  color: var(--text-muted);
}

.status-link:hover {
  color: var(--accent-blue);
}

.status-pill {
  padding: 1px 6px;
  border-radius: 2px;
  background: #1d2838;
  color: #8cb6ff;
  border: 1px solid #2e4568;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .intro-body,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .platform-row {
    grid-template-columns: 100px 1fr auto;
  }

  .plat-license {
    display: none;
  }
}

@media (max-width: 680px) {
  .meta-pill,
  .mode-badge {
    display: none;
  }

  .spec-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .platform-row {
    grid-template-columns: 1fr auto;
  }

  .plat-req {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* What's new panel */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 14px;
}

.news-item:last-child {
  border-bottom: 0;
}

.news-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  padding-top: 1px;
}

.news-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.news-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 2px;
  background: #1d2838;
  color: #8cb6ff;
  border: 1px solid #2e4568;
}

.news-text {
  white-space: pre-line;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.news-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  margin-left: 6px;
}

.news-link:hover {
  text-decoration: underline;
}

.news-more {
  margin: 8px 14px 10px;
  align-self: flex-start;
}

.news-empty {
  margin: 0;
  padding: 10px 14px;
  color: var(--text-dim);
}

/* Download buttons filled from the downloads folder */
.btn.is-ready {
  background: var(--accent-blue);
  border-color: transparent;
  color: #0e131b;
}

.btn.is-ready:hover {
  background: #639bf8;
}

.plat-license .file-name {
  color: var(--text-muted);
}

@media (max-width: 680px) {
  .news-item {
    grid-template-columns: 1fr;
  }
}

.news-text + .news-text {
  margin-top: 8px;
}

.news-toggle {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  cursor: pointer;
}

.news-toggle:hover {
  text-decoration: underline;
}

.news-body > .news-link {
  display: inline-block;
  margin: 6px 0 0;
}
