:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --border: #d8dee7;
  --accent: #1769aa;
  --accent-strong: #0f4f85;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:disabled {
  border-color: #b8c2cc;
  background: #c9d2dc;
  cursor: not-allowed;
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

input {
  width: min(320px, 100%);
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.app-nav a:hover,
.app-nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

.home-body {
  background: #eef2f6;
}

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

.home-nav {
  margin-bottom: 18px;
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px;
  background: linear-gradient(120deg, #1769aa, #182438);
  color: #fff;
}

.eyebrow {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero h1 {
  font-size: 44px;
  line-height: 1.08;
}

.hero-copy {
  width: min(560px, 100%);
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.7;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  padding: 0 18px;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.entry-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.entry-card:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(15, 79, 133, 0.12);
}

.entry-card.featured {
  border-color: rgba(23, 105, 170, 0.32);
}

.entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #eaf3fb;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.entry-card strong {
  margin-top: 22px;
  font-size: 20px;
}

.entry-card span:last-child {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.status-strip div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.status-strip strong {
  font-size: 15px;
}

.app-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
}

#statusText {
  margin-top: 8px;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics div,
.transcript-panel,
.side-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.metrics div {
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metrics strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  min-height: calc(100vh - 196px);
}

.transcript-panel,
.side-panel {
  min-height: 520px;
  overflow: hidden;
}

.transcript-panel header,
.side-panel h2 {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

.transcript {
  height: calc(100% - 56px);
  overflow: auto;
  padding: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.line {
  border-bottom: 1px solid #eef1f5;
  padding: 8px 0;
}

.line time {
  color: var(--muted);
  font-size: 12px;
  margin-right: 10px;
}

.line.final span {
  font-weight: 600;
}

.session-list {
  height: calc(100% - 56px);
  overflow: auto;
}

.session-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 12px 16px;
}

.session-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

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

@media (max-width: 860px) {
  .home-hero {
    align-items: flex-start;
    flex-direction: column;
    min-height: 300px;
    padding: 26px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

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

  .entry-card {
    min-height: 180px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    justify-content: flex-start;
  }

  .metrics,
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: auto;
  }

  .transcript-panel,
  .side-panel {
    min-height: 420px;
  }
}
