:root {
  color-scheme: light;
  --or: #F05A28;
  --or-hover: #D93A1E;
  --bl: #1194DC;
  --sky: #29A9DF;
  --tx: #333333;
  --mu: #888888;
  --bd: #E6E9F0;
  --pg: #F8FAFC;
  --ok: #1E9E4A;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ink: var(--tx);
  --muted: var(--mu);
  --line: var(--bd);
  --paper: var(--pg);
  --card: #ffffff;
  --green: var(--ok);
  --green-ink: #e8f7ee;
  --amber: var(--or);
  --amber-bg: #fff4ef;
  --red: #D93A1E;
  --red-bg: #fff1ec;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--pg);
  color: var(--tx);
  font-size: 15px;
  line-height: 1.4;
}

button, input, select { font: inherit; color: inherit; }

button {
  border: 0;
  background: var(--or);
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
button:hover { background: var(--or-hover); }

button.ghost {
  background: white;
  color: var(--bl);
  border: 1px solid var(--bd);
}
button.ghost:hover { background: #f3f9fd; }

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

button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: white;
  color: var(--tx);
  border-bottom: 1px solid var(--bd);
}
.logo { width: 32px; height: 32px; border-radius: 8px; }

.brand { display: flex; gap: 10px; align-items: center; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.mark { display: none; }
.who { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.who button { color: var(--bl); border-color: var(--bd); padding: 4px 8px; }

.preview-note, .hint, .muted, .note { color: var(--muted); font-size: 12px; }
.preview-note { margin: 0; padding: 8px 14px; background: #efe6d2; }

.login, main { padding: 14px; display: grid; gap: 12px; }
#app {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: clip;
  padding: 10px 12px 8px;
}
#app > * { flex: none; }
#app > .checklist { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; background: white; border: 1px solid var(--bd); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.checklist-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: white; border-bottom: 3px solid var(--or); }
.checklist-head h2 { margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--tx); }
#script-scroll { flex: 1; min-height: 0; overflow: auto; padding: 4px 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--bd); }
.steps li.current { background: #f3f9fd; }
.steps li.said .script-line { color: var(--ok); }
.box { width: 18px; height: 18px; flex: none; margin-top: 2px; border: 2px solid #c5ced8; border-radius: 5px; background: white; }
.steps li.said .box { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px white; }
.script-line { margin: 0; color: var(--tx); font-size: 14px; line-height: 1.4; }
.steps button.step { display: none; }
.capture, .inline-rebuttal { margin-top: 6px; border-radius: 8px; padding: 6px 8px; font-size: 12px; line-height: 1.35; }
.capture { background: #f6f1e6; }
.capture.unclear { color: var(--muted); }
.inline-rebuttal { background: var(--amber-bg); }
.inline-rebuttal strong { display: block; color: var(--amber); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.capture p, .inline-rebuttal p { margin: 2px 0 0; }
.capture-who { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.login { max-width: 460px; }
.login h2 { margin: 0; font-size: 22px; }
.lede { margin: 0; }
.login label, .grow { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
input, select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 450;
}
[hidden] { display: none !important; }

.row, .modes, .buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.transport { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.error { color: var(--red); margin: 0; }

.status {
  display: grid;
  grid-template-columns: 1.3fr 0.5fr 1fr 1fr;
  gap: 8px;
}
.status > div, .say, .cards article, details, .transcript-wrap, fieldset {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.status > div { padding: 8px 10px; }
.status .k, .kicker { margin: 0; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.status p:last-child { margin: 2px 0 0; font-weight: 650; }
.step-stat { grid-column: 1 / -1; }

.direction { display: flex; gap: 8px; }
.direction button[aria-pressed="true"] { background: var(--bl); color: white; border-color: var(--bl); }
.call-chip { margin: 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rebuttal { padding: 14px; border-radius: 12px; background: var(--amber-bg); border: 1px solid #efd7a4; }
.rebuttal-title { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--amber); }
#rebuttal-line { margin: 6px 0 0; font-size: 20px; line-height: 1.35; font-weight: 650; }
.stop-bar { display: flex; justify-content: center; padding: 4px 0 2px; }
#stop-listen {
  min-width: 148px;
  height: 48px;
  border-radius: 999px;
  background: var(--or);
  color: white;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 16px;
}
#stop-listen:hover { background: var(--or-hover); }
.objection {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 72px;
  max-height: 54%;
  overflow: auto;
  background: white;
  color: var(--tx);
  border: 1px solid var(--bd);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  z-index: 4;
  padding: 0 0 12px;
}
.objection.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.objection-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: var(--or); color: white; border-radius: 14px 14px 0 0; }
.objection-head h2 { margin: 0; font-size: 16px; }
.objection-head button { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.7); border-radius: 999px; padding: 4px 10px; }
#objection-line { margin: 14px 14px 8px; font-size: 18px; font-weight: 750; line-height: 1.3; }
#objection-follow { list-style: none; margin: 0; padding: 0 10px; display: grid; gap: 6px; }
#objection-follow li { display: flex; gap: 8px; align-items: flex-start; }
#objection-follow button { width: 100%; text-align: left; background: var(--pg); color: var(--tx); border: 1px solid var(--bd); border-radius: 10px; padding: 8px 10px; }
#objection-follow li.said button { color: var(--ok); border-color: #b7e7c8; background: #f3fbf6; }
.helpful { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 14px 0; color: var(--mu); font-size: 13px; }
.helpful button { background: white; color: var(--bl); border: 1px solid var(--bd); }
.helpful p { margin: 0; flex-basis: 100%; }
.say { padding: 10px 12px; border-left: 6px solid var(--green); }
.say.rebuttal { border-left-color: var(--amber); background: var(--amber-bg); }
.say.danger { border-left-color: var(--red); background: var(--red-bg); }
.say.done { border-left-color: #8a8175; }
#say-line { margin: 4px 0 0; font-size: 18px; line-height: 1.3; font-weight: 650; }
.then { margin: 8px 0 0; }
.note { margin: 8px 0 0; }

.alert {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--red-bg);
  color: var(--red);
}
.alert strong { display: block; }
.alert.warn { background: var(--amber-bg); color: var(--amber); }
#alerts:empty { display: none; }

.section-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.section-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.cards, .pinned { display: flex; flex-wrap: wrap; gap: 8px; }
.cards { display: grid; gap: 8px; }
.pin { font-size: 12px; padding: 4px 8px; }
.cards article { padding: 10px 12px; }
.cards h3 { margin: 0 0 4px; font-size: 15px; }
.cards p { margin: 0; color: var(--muted); font-size: 13px; }
.cards .actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.phone { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.cards article.block { background: var(--red-bg); border-color: #f0c2bd; }
.cards article.warning { background: var(--amber-bg); border-color: #efd7a4; }

details { padding: 8px 12px; }
summary { cursor: pointer; font-weight: 650; }
#note-list { margin: 8px 0 0; padding-left: 18px; }
#note-list li { margin: 4px 0; }

.transcript {
  max-height: 64px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}
.bubble { max-width: 92%; padding: 6px 8px; border-radius: 10px; background: #f6f1e6; }
.bubble.rep { align-self: flex-end; background: #e5f3ed; }
.bubble .who { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bubble p { margin: 2px 0 0; }
.empty { margin: 0; color: var(--muted); }
.partial { margin: 0; font-style: italic; }

.dock { background: var(--paper); padding-bottom: 4px; display: grid; gap: 4px; }
#demo-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; min-width: 0; max-width: 100%; }
#mode-help { margin: 4px 0 0; }
fieldset { border: 1px solid var(--line); margin: 0; padding: 6px 8px; min-width: 0; max-width: 100%; }
.dock, #demo-controls, .modes, .grow { min-width: 0; max-width: 100%; }
select { width: 100%; min-width: 0; max-width: 100%; }
legend { padding: 0 4px; font-size: 12px; color: var(--muted); }
.modes label { display: flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 600; }
.grow { flex: 1; min-width: 180px; }
.flags { margin: 0; font-size: 12px; color: var(--muted); }
.outcome { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.outcome span { font-size: 12px; color: var(--muted); font-weight: 650; }

@media (max-width: 520px) {
  .status { grid-template-columns: 1fr 1fr; }
  #say-line { font-size: 18px; }
}
