@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #14181f;
  --foreground: #09090b;
  --muted: #737373;
  --gray-400: #9aa3af;
  --gray-300: #c7ced7;
  --line: #e5e5e5;
  --surface: #f5f5f5;
  --green-50: #eafbf2;
  --green-100: #c9efd9;
  --green-200: #9adbb8;
  --green-600: #00b25a;
  --green-700: #00935d;
  --green-800: #00734a;
  --amber-50: #fff6e6;
  --amber-200: #f0d9a8;
  --amber-700: #9a6700;
  --navy: #1e3a5f;
  --red: #dc2626;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 1180px; background: #fff; }

body {
  margin: 0;
  min-width: 1180px;
  color: var(--foreground);
  background: #fff;
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button { color: inherit; }

.empty-panel {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.review-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-600);
  animation: pulse 1s ease-in-out infinite alternate;
}

.review-page { min-height: 100vh; padding: 24px; background: #fff; }

.review-frame {
  position: relative;
  min-width: 1132px;
  max-width: 1720px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.corner {
  position: absolute;
  z-index: 8;
  width: 7px;
  height: 7px;
  background: #fff;
  border: 1px solid var(--foreground);
}

.corner.tl { left: -4px; top: 60px; }
.corner.tr { right: -4px; top: 60px; }
.corner.bl { left: -4px; bottom: 40px; }
.corner.br { right: -4px; bottom: 40px; }

.review-header {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.brand-logo { display: block; height: 20px; width: auto; }
.header-rule { width: 1px; height: 22px; background: var(--line); }

.review-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 11.5px/1 var(--mono);
}

.meta-sep { color: var(--gray-300); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -.005em;
}

.badge.dark { color: #fafafa; background: #171717; border-color: #171717; }
.badge.good { color: #047857; background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); }
.badge.good.dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.framed { box-shadow: 0 1px 2px rgba(0,0,0,.04); }

.meta-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  padding: 14px 24px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.metric:last-child { border-right: 0; }
.metric-label {
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}
.metric-value {
  margin-top: 2px;
  overflow: hidden;
  color: var(--foreground);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-value.good { color: var(--green-700); }
.metric-note { color: var(--muted); font-size: 12px; font-weight: 500; }

.review-main {
  display: grid;
  grid-template-columns: 400px minmax(360px, 1fr) 360px;
}

.playback,
.transcript-column,
.events-column { min-width: 0; }

.playback {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.eyebrow {
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
}

.video-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #14181f center/cover no-repeat;
}

.video-card.no-consent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-style: dashed;
  border-color: var(--gray-300);
  background: var(--surface);
}
.video-card.no-consent strong { color: #5b6573; font-size: 12.5px; }
.video-card.no-consent span { color: var(--gray-400); font-size: 11.5px; }

.video-label,
.video-clock {
  position: absolute;
  color: #fff;
  background: rgba(20,24,31,.72);
  border-radius: 6px;
}
.video-label {
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 600;
}
.video-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.video-clock { right: 10px; bottom: 10px; padding: 3px 8px; font: 11px var(--mono); }

.audio-card,
.avatar-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.audio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.audio-meta { color: var(--muted); font: 10.5px var(--mono); }
.waveform {
  height: 36px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-top: 8px;
}
.wavebar { flex: 1; min-width: 1px; border-radius: 1px; background: var(--gray-300); }
.wavebar.played { background: var(--green-600); }

.avatar-card { display: flex; align-items: center; gap: 14px; }
.avatar-stage {
  width: 74px;
  height: 84px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #3d1052, #501a65);
}
.avatar-stage img { width: 66px; height: 78px; object-fit: contain; transform: translateY(7px); }
.avatar-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.state-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: 11.5px var(--mono);
}
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-400); }
.avatar-note { color: var(--muted); font-size: 11px; line-height: 1.5; }

.playback-controls { display: flex; flex-direction: column; gap: 9px; margin-top: 2px; }
.scrubber {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  border-radius: 99px;
  outline: none;
  background: linear-gradient(90deg, #171717 var(--progress, 0%), var(--line) var(--progress, 0%));
}
.scrubber::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #171717;
  box-shadow: 0 0 0 1px #171717;
  cursor: pointer;
}
.control-row { display: flex; align-items: center; gap: 8px; }
.btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  cursor: pointer;
}
.btn.outline { background: #fff; box-shadow: inset 0 0 0 1px rgba(9,9,11,.1), 0 1px 3px rgba(0,0,0,.05); }
.clock-total { margin-left: auto; color: #5b6573; font: 12px var(--mono); }

.transcript-column { display: flex; flex-direction: column; }
.column-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 10px;
}
.column-help { color: var(--gray-400); font-size: 11px; }

.scroll-panel {
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}
.scroll-panel::-webkit-scrollbar { width: 8px; }
.scroll-panel::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--line); }

.transcript {
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 24px 20px;
}

.transcript-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.transcript-row.active { border-color: var(--green-200); background: var(--green-50); }
.transcript-time { width: 36px; flex: 0 0 auto; padding-top: 2px; color: var(--gray-400); font: 11px var(--mono); }
.transcript-row.active .transcript-time { color: var(--green-700); }
.transcript-who { width: 52px; flex: 0 0 auto; padding-top: 2px; font-size: 11px; font-weight: 600; }
.transcript-who.auntea { color: var(--navy); }
.transcript-who.user { color: var(--green-700); }
.transcript-who.system { color: var(--gray-400); }
.transcript-text { flex: 1; color: var(--ink); font-size: 13px; line-height: 1.5; text-wrap: pretty; }
.line-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #5b6573;
  background: var(--surface);
  font: 600 10px var(--mono);
}
.line-tag.callback { color: var(--amber-700); border-color: var(--amber-200); background: var(--amber-50); }
.line-tag.redacted { color: var(--red); border-color: #f5c6c0; background: #fdecea; }

.events-column { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.events-column > .eyebrow { padding: 20px 24px 10px; }
.events {
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 2px 24px 20px;
}
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.event-row.active { background: var(--surface); }
.event-row.future { opacity: .45; }
.event-time { width: 34px; flex: 0 0 auto; padding-top: 1px; color: var(--gray-400); font: 10.5px var(--mono); }
.event-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--gray-300); }
.event-dot.receipt { background: var(--green-600); }
.event-dot.callback { background: #e0b64f; }
.event-dot.task { border-radius: 2px; background: var(--navy); }
.event-dot.complete { border-radius: 2px; background: var(--green-700); }
.event-copy { min-width: 0; flex: 1; }
.event-name { display: block; overflow-wrap: break-word; color: var(--ink); font: 600 11px var(--mono); }
.event-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }

.panel-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  border-top: 1px solid var(--line);
}
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.panel:last-child { border-right: 0; }

.task-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.task-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr .8fr;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 12.5px;
}
.task-row.header {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.task-name { color: var(--ink); font-weight: 600; }
.task-time { color: #5b6573; font: 11.5px var(--mono); }
.task-xp { color: var(--green-700); font-weight: 600; text-align: right; }
.task-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  color: var(--green-800);
  background: var(--green-50);
  font-size: 12px;
  font-weight: 600;
}
.callback-list { display: flex; flex-wrap: wrap; gap: 6px; }
.callback-chip {
  padding: 4px 10px;
  border: 1px solid var(--amber-200);
  border-radius: 6px;
  color: var(--amber-700);
  background: var(--amber-50);
  font: 600 11px var(--mono);
  cursor: pointer;
}
.panel-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; }

.key-values { display: flex; flex-direction: column; }
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}
.kv:last-child { border-bottom: 0; }
.kv-label { color: #5b6573; font-size: 12.5px; }
.kv-value { color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: right; }
.kv-value.good { color: var(--green-700); }
.kv-value.caution { color: var(--amber-700); }
.kv-value.mono { font: 600 11.5px var(--mono); }

.webhook-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payload {
  max-height: 330px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  color: #c9efd9;
  background: var(--ink);
  font: 10.8px/1.65 var(--mono);
}

.review-footer {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  color: var(--gray-400);
  font-size: 11px;
  white-space: nowrap;
}
.footer-id { font-family: var(--mono); }
.footer-last { margin-left: auto; }

.error-card {
  width: min(580px, calc(100vw - 48px));
  margin: 15vh auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
}
.error-card h1 { margin: 0 0 8px; font-size: 20px; }
.error-card p { margin: 0; color: var(--muted); line-height: 1.5; }

@keyframes pulse { to { opacity: .35; transform: scale(.78); } }

@media (max-width: 1300px) {
  .review-page { padding: 16px; }
  .metric { padding-left: 16px; padding-right: 16px; }
  .playback { padding-left: 18px; padding-right: 18px; }
  .review-main { grid-template-columns: 365px minmax(350px, 1fr) 330px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
