:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #172026;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(960px, calc(100vw - 32px));
  margin: 32px auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #52616b;
}

a {
  color: #0b6bcb;
  text-decoration: none;
  font-weight: 600;
}

.workspace {
  background: #ffffff;
  border: 1px solid #dde4e8;
  border-radius: 8px;
  padding: 20px;
}

.calls-panel {
  margin-bottom: 24px;
}

.section-heading,
.active-call-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

h2,
h3 {
  margin: 0;
}

.section-heading h2,
.active-call-heading h2 {
  margin-bottom: 6px;
}

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

.call-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 16px;
  border: 1px solid #dde4e8;
  border-radius: 8px;
  background: #ffffff;
}

.call-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f4;
  color: #52616b;
  font-size: 12px;
  font-weight: 700;
}

.outcome-confirmed .badge {
  background: #e6f6e9;
  color: #176b2c;
}

.outcome-declined .badge {
  background: #fbe9e9;
  color: #9d2020;
}

.outcome-reschedule .badge,
.outcome-unsure .badge {
  background: #fff3d6;
  color: #805b00;
}

.call-time {
  color: #52616b;
  font-size: 13px;
}

.call-card h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.car-name {
  margin: 14px 0;
  font-weight: 700;
}

.call-card button {
  width: 100%;
  margin-top: auto;
}

.call-summary,
.reschedule {
  margin-bottom: 12px;
  font-size: 13px;
}

.reschedule {
  color: #805b00;
  font-weight: 600;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #c92727;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.error {
  color: #9d2020;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.live-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #238636;
  box-shadow: 0 0 0 5px #e6f6e9;
}

#endCallButton {
  margin-left: auto;
}

.meter {
  width: 100%;
  height: 8px;
  background: #eef2f4;
  border-radius: 999px;
  overflow: hidden;
  margin: -4px 0 8px;
}

#meterBar {
  width: 0%;
  height: 100%;
  background: #238636;
  transition: width 120ms ease;
}

.debug {
  min-height: 20px;
  margin-bottom: 16px;
  font-size: 13px;
}

button {
  min-height: 40px;
  border: 1px solid #b8c3ca;
  border-radius: 6px;
  background: #ffffff;
  color: #172026;
  padding: 0 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#status {
  color: #52616b;
}

.log {
  display: grid;
  gap: 12px;
}

.message {
  border: 1px solid #dde4e8;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.message strong {
  display: block;
  margin-bottom: 6px;
}

.message.user {
  border-left: 4px solid #0b6bcb;
}

.message.agent {
  border-left: 4px solid #238636;
}

.meta {
  margin-top: 8px;
  font-size: 13px;
  color: #52616b;
}

@media (max-width: 640px) {
  .shell {
    width: calc(100vw - 20px);
    margin: 16px auto;
  }

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

  #endCallButton {
    margin-left: 0;
  }

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