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

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: #f4f6f8;
}

button, input, select, textarea {
  font: inherit;
  letter-spacing: 0;
}

.review-topbar {
  min-height: 96px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #f8fafc;
  background: #15212d;
}

.brand-link {
  display: inline-block;
  margin-bottom: 3px;
  color: #65d4ca;
  font-size: 14px;
  text-decoration: none;
}

.review-topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.review-topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.review-topbar nav a {
  padding: 8px 11px;
  border: 1px solid #526170;
  border-radius: 6px;
  color: #f8fafc;
  text-decoration: none;
}

#reviewerBadge { color: #c8d1da; font-size: 14px; }

.progress-band {
  padding: 14px 28px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 2fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #dce2e8;
  background: #fff;
}

.progress-copy { display: flex; flex-direction: column; gap: 3px; }
.progress-copy strong { font-size: 17px; }
.progress-copy span, .progress-counts { color: #667281; font-size: 13px; }
.progress-counts { display: flex; gap: 14px; white-space: nowrap; }
.progress-counts b { color: #182230; }

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5eaee;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #16877d;
  transition: width 180ms ease;
}

.error-banner {
  margin: 14px 28px 0;
  padding: 11px 13px;
  border: 1px solid #e3a7a7;
  border-radius: 6px;
  color: #8a2020;
  background: #fff1f1;
}

.review-workspace {
  width: min(1600px, calc(100% - 48px));
  margin: 20px auto;
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(500px, 1fr);
  gap: 18px;
  align-items: start;
}

.source-pane, .review-pane, .done-state {
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #fff;
}

.source-pane, .review-pane { padding: 20px; }
.source-pane { max-height: calc(100vh - 190px); overflow: auto; }

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pane-header h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.pane-copy { margin: 5px 0 0; color: #667281; font-size: 13px; }
.case-meta { min-height: 18px; margin: 0 0 4px; color: #718091; font-size: 13px; }
.secondary-link { color: #176f68; font-size: 14px; text-decoration: none; }

#callPlayer { width: 100%; height: 46px; margin: 18px 0 14px; }

.signal-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #667281;
  font-size: 13px;
}

.signal-tag {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 4px;
  color: #315d59;
  background: #eaf5f3;
}

.dialogue { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.turn { width: min(88%, 760px); padding: 10px 12px; border-left: 3px solid #16877d; background: #f1f7f6; }
.turn.client { align-self: flex-end; border-left: 0; border-right: 3px solid #5c7fb7; background: #f1f5fb; }
.turn small { display: block; margin-bottom: 4px; color: #6c7987; font-size: 12px; }
.turn p { margin: 0; line-height: 1.42; white-space: pre-wrap; }

.save-status { min-height: 18px; color: #16877d; font-size: 13px; }
.suggestion-note { margin-top: 16px; padding: 10px 12px; border-left: 3px solid #c28631; color: #6b542e; background: #fff7e9; font-size: 13px; }

.field-grid { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: #52606e; font-size: 13px; font-weight: 600; }
.full-field { margin-top: 16px; }

input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #bdc8d2;
  border-radius: 6px;
  color: #182230;
  background: #fff;
  outline: none;
}

textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: #16877d; box-shadow: 0 0 0 3px rgba(22, 135, 125, 0.14); }

.advanced-fields { margin-top: 16px; border-top: 1px solid #e2e7eb; padding-top: 12px; }
.advanced-fields summary { cursor: pointer; color: #52606e; font-weight: 600; }
.advanced-fields .field { margin-top: 12px; }

.review-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
button { min-height: 42px; padding: 0 17px; border-radius: 6px; cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.55; }
button.primary { border: 1px solid #16877d; color: #fff; background: #16877d; }
button.secondary { border: 1px solid #bdc8d2; color: #344150; background: #fff; }
button.danger { color: #8a2020; }

.done-state { width: min(680px, calc(100% - 40px)); margin: 64px auto; padding: 32px; text-align: center; }
.done-state h2 { margin: 0 0 9px; font-size: 23px; }
.done-state p { color: #667281; }
.done-state a { color: #176f68; }
.is-hidden { display: none !important; }

@media (max-width: 980px) {
  .review-topbar, .progress-band { padding-left: 18px; padding-right: 18px; }
  .progress-band { grid-template-columns: 1fr; gap: 10px; }
  .progress-counts { flex-wrap: wrap; }
  .review-workspace { width: calc(100% - 28px); grid-template-columns: 1fr; }
  .source-pane { max-height: none; }
}

@media (max-width: 600px) {
  .review-topbar { align-items: flex-start; flex-direction: column; }
  .field-grid { grid-template-columns: 1fr; }
  .review-actions { align-items: stretch; flex-direction: column; }
  .turn { width: 96%; }
}
