:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-strong: #eef3ee;
  --line: #d7dfd7;
  --text: #152018;
  --muted: #57645a;
  --brand: #1e352a;
  --brand-soft: #d9e5de;
  --high: #9c4f00;
  --critical: #9b1b1b;
  --ok: #2b5d3c;
  --shadow: 0 1px 2px rgba(18, 29, 21, 0.06);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-title,
.call-card h2,
.detail-hero h2,
.panel h3,
.empty-state h2,
.login-copy h2 {
  margin: 0;
  line-height: 1.2;
}

.brand-title {
  font-size: 1.125rem;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.filter-strip,
.panel,
.detail-hero,
.login-panel,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-strip,
.panel,
.detail-hero,
.login-panel,
.empty-state {
  padding: 16px;
}

.filter-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.field input,
.field select,
.primary-button,
.secondary-button,
.ghost-button,
.transcript-segment {
  min-height: 44px;
  border-radius: 8px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid transparent;
  cursor: pointer;
  padding: 10px 14px;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--line);
}

.ghost-button,
.text-link {
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
  text-decoration: none;
}

.call-list {
  display: grid;
  gap: 12px;
}

.call-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.call-card.status-new {
  border-left: 4px solid var(--brand);
}

.call-card.status-in_progress {
  border-left: 4px solid var(--high);
}

.call-card.status-closed {
  border-left: 4px solid var(--ok);
}

.card-link {
  display: block;
  padding: 14px;
  text-decoration: none;
}

.call-card-header,
.panel-header,
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.muted-line,
.supporting-text,
.call-meta,
.segment-meta,
.audit-timestamp {
  color: var(--muted);
}

.muted-line,
.supporting-text,
.summary-text,
.summary-lead {
  margin: 6px 0 0;
}

.pill-row,
.player-controls,
.detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill,
.status-pill,
.urgency-pill,
.duration-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  border: 1px solid var(--line);
}

.category-pill,
.role-pill-manager {
  background: var(--surface-strong);
}

.category-technical,
.role-pill-admin {
  background: var(--brand-soft);
}

.category-hr_finance,
.urgency-critical {
  background: #f7dddd;
  color: var(--critical);
}

.urgency-high {
  background: #f7ead9;
  color: var(--high);
}

.urgency-normal {
  background: var(--surface-strong);
}

.call-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.875rem;
}

.detail-grid {
  margin-top: 16px;
}

.detail-grid div {
  min-width: 140px;
}

.detail-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-grid dd {
  margin: 4px 0 0;
}

.player-controls {
  margin-top: 12px;
}

.compact-field {
  max-width: 120px;
}

.transcript-list,
.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.transcript-segment {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.segment-meta {
  display: block;
  font-size: 0.8125rem;
  margin-bottom: 4px;
}

.login-panel {
  max-width: 440px;
  margin: 8vh auto 0;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.form-error {
  margin: 0;
  color: var(--critical);
}

.empty-state {
  text-align: center;
}

audio {
  width: 100%;
}

@media (min-width: 760px) {
  .page-content {
    padding: 24px;
  }

  .filter-grid {
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
    align-items: end;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }

  .detail-layout > *:first-child,
  .detail-layout > .detail-hero,
  .detail-layout > .panel:first-of-type {
    grid-column: 1 / -1;
  }
}
