:root {
  color-scheme: dark;
  --bg: #111314;
  --surface: #181c1f;
  --surface-2: #20262a;
  --line: #354046;
  --text: #f1f4ef;
  --muted: #a8b2ad;
  --accent: #e6c15d;
  --accent-2: #5fc0a8;
  --risk: #ee7d63;
  --ok: #7fd887;
  --shadow: rgba(0, 0, 0, 0.34);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(230, 193, 93, 0.12), transparent 26rem),
    linear-gradient(135deg, #101213 0%, #151b1d 54%, #1c1714 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  border-color: var(--accent);
}

button.active {
  border-color: var(--accent);
  color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0;
}

.player-surface {
  background: rgba(24, 28, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 22px 60px var(--shadow);
  overflow: hidden;
}

.topbar,
.now-row,
.control-band,
.split,
.panel {
  padding: 22px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 360px);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.eyebrow,
.label {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.eyebrow {
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  margin-bottom: 0;
}

h2 {
  font-size: clamp(24px, 3vw, 38px);
  margin-bottom: 10px;
}

h3 {
  font-size: 18px;
  margin-bottom: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}

.status-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.status-grid span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.status-grid small,
.file-drop small,
.now-main p,
.note,
.track-meta,
.log-list {
  color: var(--muted);
}

.now-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  background: linear-gradient(90deg, rgba(230, 193, 93, 0.08), rgba(95, 192, 168, 0.06));
}

.progress-wrap {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.transport {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  width: 48px;
  padding: 0;
}

.play-btn {
  min-width: 92px;
  background: var(--accent);
  border-color: var(--accent);
  color: #1b1710;
  font-weight: 800;
}

.control-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.file-drop {
  display: grid;
  gap: 4px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 16px;
}

.file-drop input {
  display: none;
}

.file-drop span {
  font-weight: 800;
}

.file-drop.secondary {
  border-style: solid;
}

.file-drop.locked {
  border-style: solid;
  cursor: default;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 12px;
}

.toggles label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-bottom: 0;
}

html.admin-mode .split {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.panel {
  background: transparent;
}

.split .panel,
.player-surface > .panel {
  border-top: 1px solid var(--line);
}

.panel.compact,
.player-surface > .panel:last-of-type,
#exportManifestBtn {
  display: none;
}

html.admin-mode .panel.compact,
html.admin-mode .player-surface > .panel:last-of-type,
html.admin-mode #exportManifestBtn {
  display: block;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.track-list,
.log-list {
  display: grid;
  gap: 10px;
}

.track-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.track-row[disabled] {
  opacity: 0.58;
}

.track-index {
  color: var(--accent);
  font-weight: 800;
}

.track-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.track-meta {
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.badge,
.pill {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok,
.pill.ok {
  background: rgba(127, 216, 135, 0.14);
  color: var(--ok);
}

.badge.risk,
.pill.risk {
  background: rgba(238, 125, 99, 0.14);
  color: var(--risk);
}

.badge.listen {
  background: rgba(230, 193, 93, 0.16);
  color: var(--accent);
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.check-list li {
  display: flex;
  gap: 10px;
  color: var(--muted);
}

.check-list span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--risk);
  flex: 0 0 12px;
}

.check-list span.ok {
  background: var(--ok);
}

.note {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.log-entry {
  display: grid;
  grid-template-columns: 165px 165px minmax(180px, 1fr) 150px;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
}

.log-entry span,
.log-entry strong {
  overflow-wrap: anywhere;
}

.period-actions label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
}

input[type="date"] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 40px;
  padding: 0 10px;
}

.verification-panel {
  border-top: 1px solid var(--line);
  padding: 22px;
}

.proof-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
}

.proof-line {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 12px;
}

.proof-line span:first-child {
  color: var(--muted);
}

.proof-line a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.registry-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.registry-row {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(210px, 1.4fr) auto;
  padding: 14px;
}

.registry-main strong,
.registry-row code {
  overflow-wrap: anywhere;
}

.registry-row code {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.registry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.registry-links a {
  color: var(--accent);
}

.registry-meta {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar,
  .now-row,
  .control-band,
  .split,
  .registry-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .transport,
  .toggles {
    justify-content: flex-start;
  }

  .log-entry {
    grid-template-columns: 1fr;
  }

  .nav-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100vw - 16px, 1180px);
    padding: 8px 0;
  }

  .topbar,
  .now-row,
  .control-band,
  .split,
  .panel {
    padding: 16px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .transport {
    width: 100%;
  }

  .play-btn {
    flex: 1;
  }
}
