:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #18191b;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 123, 32, 0.12), transparent 240px),
    #f4f5f7;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  color: #202124;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

button:disabled {
  opacity: 0.45;
}

.app-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: #6d7178;
  text-transform: uppercase;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 6vw, 2.2rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.status-pill {
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
  color: #7b3909;
  background: #fff2e8;
}

.recording-panel,
article,
.toolbar,
section:has(.segments),
section:has(.timeline),
.work-panel,
.summary-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(20, 22, 26, 0.07);
}

.recording-panel {
  padding: 20px;
  margin-bottom: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  min-height: 40px;
  padding: 0 8px;
  color: #5f6368;
  background: rgba(255, 255, 255, 0.7);
}

.tab.active {
  color: #fff;
  background: #202124;
  box-shadow: none;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.recording-state {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pulse {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: #aeb4bd;
}

.pulse.active {
  background: #f47b20;
  box-shadow: 0 0 0 8px rgba(244, 123, 32, 0.14);
}

.pulse.failed {
  background: #d92d20;
  box-shadow: 0 0 0 8px rgba(217, 45, 32, 0.12);
}

.label {
  margin-bottom: 2px;
  color: #6d7178;
  font-size: 0.82rem;
  font-weight: 800;
}

.timer {
  margin: 18px 0 10px;
  font-size: clamp(3.2rem, 17vw, 6rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin-bottom: 18px;
  color: #656a72;
  line-height: 1.45;
}

.transcript-error {
  margin: 8px 0 0;
  color: #9a3b08;
  font-weight: 700;
}

.actions,
.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary {
  color: #fff;
  background: #f47b20;
  box-shadow: none;
}

.danger {
  color: #fff;
  background: #d92d20;
  box-shadow: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

article,
.toolbar,
section:has(.segments),
section:has(.timeline),
.work-panel,
.summary-card {
  padding: 16px;
}

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

.stacked-actions {
  display: grid;
  gap: 10px;
  min-width: min(100%, 220px);
}

.metrics {
  display: grid;
  gap: 12px;
  margin: 0;
}

.metrics div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

dt {
  color: #6d7178;
  font-size: 0.9rem;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.toolbar {
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.section-head span {
  color: #6d7178;
  font-size: 0.86rem;
}

.segments {
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

.timeline,
.compact-list,
.summary-card ul {
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

.segment-item {
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.segment-item strong {
  display: block;
}

.segment-item span {
  color: #6d7178;
  font-size: 0.9rem;
}

.timeline-item {
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.timeline-item time,
.timeline-item span {
  display: block;
  color: #6d7178;
  font-size: 0.86rem;
}

.empty-note {
  color: #6d7178;
  list-style: none;
}

@media (max-width: 680px) {
  .grid,
  .actions,
  .toolbar,
  .tabs {
    grid-template-columns: 1fr;
  }

  .metrics div {
    align-items: flex-start;
  }

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