:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #191b1f;
  --panel-2: #20242a;
  --line: #333842;
  --text: #f3f5f7;
  --muted: #a8b0bb;
  --green: #48d17a;
  --blue: #5bb7ff;
  --yellow: #f5c451;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.status {
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--yellow);
  font-weight: 800;
  text-align: center;
}

.status[data-stage="resolved"] {
  color: var(--green);
}

.grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.85fr;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

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

.panel-header h2 {
  margin-bottom: 0;
}

.call-panel,
.transcript-panel,
.report-panel {
  grid-column: span 2;
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--blue);
  color: #07111b;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.composer {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #0f1115;
  color: var(--text);
}

.agent-line {
  margin-top: 14px;
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.agent-line span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-line p {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.4;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div,
.diagnosis p {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

dt,
.diagnosis strong {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

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

.stages li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--panel-2);
  color: var(--muted);
}

.stages li.done {
  border-color: rgba(72, 209, 122, 0.7);
  color: var(--green);
}

ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

li {
  line-height: 1.4;
}

.muted {
  color: var(--muted);
}

.transcript {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.message {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-2);
}

.message span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.message p {
  margin-bottom: 0;
}

.message.agent {
  border-left: 4px solid var(--blue);
}

.message.caller {
  border-left: 4px solid var(--green);
}

.report-text {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 980px) {
  .grid,
  .quick-row {
    grid-template-columns: 1fr;
  }

  .call-panel,
  .transcript-panel {
    grid-column: span 1;
  }

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

  .status {
    width: 100%;
  }
}
