:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #687386;
  --line: #dfe4ea;
  --soft: #edf1f5;
  --navy: #111827;
  --navy-2: #1c2738;
  --accent: #f5b51b;
  --accent-dark: #c98500;
  --green: #1f9d62;
  --green-soft: #e8f7ef;
  --blue: #2878d0;
  --blue-soft: #eaf3fc;
  --orange: #c66a14;
  --orange-soft: #fff2e6;
  --red: #b83b3b;
  --red-soft: #fdecec;
  --shadow: 0 18px 55px rgba(25, 34, 50, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  color: #fff;
  background: rgba(17, 24, 39, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
}

.topbar-actions a:hover { color: var(--accent); }

.simulated-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(245, 181, 27, .28);
  border-radius: 999px;
  color: #ffe29a;
  background: rgba(245, 181, 27, .08);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.simulated-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 181, 27, .12);
}

.page {
  width: min(calc(100% - 40px), 1440px);
  margin: 0 auto;
  padding: 36px 0 64px;
}

.demo-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .12em;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.intro-copy {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

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

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }

.button-primary {
  color: #1d1a12;
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(245, 181, 27, .28);
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

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

.kpi {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(25, 34, 50, .05);
}

.kpi-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.kpi strong {
  display: block;
  font-size: 31px;
  line-height: 1;
  letter-spacing: -.035em;
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.dashboard {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.calls-pane {
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.pane-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.pane-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.02em;
}

.pane-head span {
  color: var(--muted);
  font-size: 13px;
}

.call-list { padding: 10px; }

.call-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: inherit;
  text-align: left;
  background: transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.call-row:hover { background: var(--soft); }
.call-row.selected { background: #fff9e8; border-color: #f2d98f; }
.call-row.demo-call { animation: slide-in .42s ease both; }
.call-row.live { background: #fff8e0; border-color: #eecb67; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #304057;
  background: #e7edf4;
  font-size: 13px;
  font-weight: 850;
}

.avatar.live-avatar {
  color: #674b00;
  background: #ffe8a6;
  position: relative;
}

.avatar.live-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  animation: pulse 1.25s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .58; }
}

.call-main { min-width: 0; }
.call-name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 820;
}

.call-summary {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-meta {
  align-self: start;
  text-align: right;
}

.call-time {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-green { color: #11643b; background: var(--green-soft); }
.badge-blue { color: #195e9f; background: var(--blue-soft); }
.badge-orange { color: #94500f; background: var(--orange-soft); }
.badge-red { color: #922d2d; background: var(--red-soft); }
.badge-live { color: #684d00; background: #ffe49a; }

.details-pane {
  min-width: 0;
  background: #fff;
}

.detail-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin: 0 0 2px;
  font-size: 20px;
  letter-spacing: -.025em;
}

.detail-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.detail-body { padding: 24px; }

.live-stage {
  display: none;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #e8cf83;
  border-radius: 15px;
  background: #fff9e7;
}

.live-stage.visible { display: block; }

.live-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #eddca6;
}

.live-stage-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 820;
}

.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.wave i {
  display: block;
  width: 3px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-dark);
  animation: wave 1s ease-in-out infinite;
}

.wave i:nth-child(2) { animation-delay: .14s; }
.wave i:nth-child(3) { animation-delay: .28s; }
.wave i:nth-child(4) { animation-delay: .42s; }

@keyframes wave {
  0%, 100% { height: 5px; }
  50% { height: 17px; }
}

.progress-track { height: 5px; background: #f0e5c4; }
.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .45s ease;
}

.live-caption {
  min-height: 72px;
  padding: 16px;
  color: #584719;
  font-size: 14px;
}

.live-caption strong { display: block; margin-bottom: 4px; color: #2c271a; }

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

.field {
  min-height: 83px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfd;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.field-value { font-size: 14px; font-weight: 760; }
.field.span-2 { grid-column: 1 / -1; }

.summary-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
}

.summary-card .field-label { color: #aeb8c7; }
.summary-card p { margin: 0; color: #f4f7fb; }

.transcript-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.transcript-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border: 0;
  color: var(--ink);
  background: #f8fafc;
  font-weight: 820;
  text-align: left;
}

.transcript {
  display: none;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.transcript.open { display: block; }

.transcript-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 13px;
  font-size: 13px;
}

.transcript-line:last-child { margin-bottom: 0; }
.transcript-role { color: var(--muted); font-weight: 820; }

.empty-state {
  min-height: 450px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(380px, calc(100% - 32px));
  padding: 16px 18px;
  border: 1px solid #d8e0e8;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 29, 45, .2);
  transform: translateY(120%);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast strong { display: block; margin-bottom: 3px; }
.toast span { color: var(--muted); font-size: 13px; }

.demo-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.footer-row a:hover { color: var(--accent-dark); }

@media (max-width: 1050px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard { grid-template-columns: 340px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .topbar { padding: 0 18px; }
  .simulated-pill { display: none; }
  .page { width: min(calc(100% - 24px), 1440px); padding-top: 24px; }
  .demo-intro { align-items: stretch; flex-direction: column; }
  .demo-controls { justify-content: flex-start; }
  .dashboard { display: block; overflow: visible; }
  .calls-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .call-list { max-height: 410px; overflow: auto; }
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
}

@media (max-width: 560px) {
  .topbar-actions a:first-of-type { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 98px; padding: 15px; }
  .kpi strong { font-size: 25px; }
  .detail-head, .pane-head { padding-left: 16px; padding-right: 16px; }
  .detail-body { padding: 16px; }
  .transcript-line { grid-template-columns: 1fr; gap: 3px; }
}