:root {
  color-scheme: dark;
  --bg: #02060a;
  --panel: #08111b;
  --panel-strong: #0d1722;
  --line: #223245;
  --line-strong: #31516d;
  --ink: #edf6ff;
  --muted: #8ea0b3;
  --muted-strong: #b6c4d2;
  --blue: #4aa3ff;
  --blue-strong: #67bdff;
  --green: #68e28b;
  --danger: #ff6c7a;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 18px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 14px;
}

.brand {
  min-width: 0;
  flex: 1;
}

.brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

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

.icon-button,
.text-button,
.primary-button {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  display: inline-grid;
  place-items: center;
  background: var(--panel-strong);
  color: var(--ink);
  border: 1px solid var(--line);
}

.text-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.text-button {
  background: transparent;
  color: var(--muted-strong);
  border: 1px solid var(--line);
}

.primary-button {
  background: #134b80;
  color: white;
  border: 1px solid #2a79bd;
}

.text-button:disabled,
.primary-button:disabled,
.icon-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.recording-list {
  display: grid;
  gap: 10px;
}

.recording-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(8, 17, 27, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 16px 40px var(--shadow);
}

.recording-card:hover {
  border-color: var(--line-strong);
}

.recording-title {
  min-width: 0;
}

.recording-title strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 21px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric {
  min-width: 72px;
  text-align: right;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
}

.status-dot {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #153824;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.status-dot.pending {
  background: #162c47;
  color: var(--blue-strong);
}

.viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: 18px;
  align-items: start;
}

.transcript-panel,
.side-panel,
.empty-panel {
  background: rgba(8, 17, 27, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transcript-panel {
  min-height: 58vh;
  padding: 8px 12px 18px;
}

.side-panel {
  display: grid;
  gap: 18px;
  padding: 14px;
}

.empty-panel {
  min-height: 38vh;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.viewer-meta {
  display: grid;
  gap: 8px;
}

.meta-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid rgba(34, 50, 69, 0.6);
  padding-bottom: 7px;
}

.meta-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.meta-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.summary-section h2,
.archives-section h2 {
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-section p,
.summary-section li,
.archives-section p {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 20px;
}

.summary-section p {
  margin: 0 0 8px;
}

.summary-section ul {
  margin: 0;
  padding-left: 18px;
}

.transcript-list {
  display: grid;
  gap: 0;
}

.segment {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
}

.segment.active .segment-text {
  color: var(--blue-strong);
}

.segment-time {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.segment-body {
  min-width: 0;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  padding: 0 10px;
  border-radius: 7px;
  background: #0a3760;
  color: #55b1ff;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.segment-text {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 26px;
}

.gap-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.gap-rule::before,
.gap-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.playback-dock {
  position: sticky;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 17, 27, 0.96);
  box-shadow: 0 16px 40px var(--shadow);
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seek-area {
  min-width: 0;
}

.seek-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

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

.archive-list {
  display: grid;
  gap: 8px;
}

.archive-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 16px;
  border: 1px solid rgba(34, 50, 69, 0.8);
  border-radius: 8px;
  padding: 8px;
}

.error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 14px 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .recording-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recording-card .metric:nth-of-type(2),
  .recording-card .metric:nth-of-type(3) {
    display: none;
  }

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

  .playback-dock {
    grid-template-columns: 1fr;
  }

  .playback-controls {
    justify-content: center;
  }

  .segment {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
  }

  .segment-text {
    font-size: 17px;
    line-height: 25px;
  }
}
