/* Call Copilot — Scale Systems. Dark, high-contrast, built for fast reading on a live call. */

:root {
  /* Scale Systems brand — dark theme */
  --bg:         #0E0A1F;
  --bg-panel:   #15102B;
  --bg-card:    #1C1640;
  --bg-input:   #0A0717;
  --border:     #2D2640;
  --text:       #F4EEE2;
  --text-dim:   #9F97B8;
  --aubergine:  #3D1F8C;
  --aubergine-deep: #2A0D77;
  --cyan:       #00BFF1;
  --cyan-deep:  #0087AB;
  --amber:      #F5C04A;
  --magenta:    #DB008B;
  --red:        #ff6b6b;
  --green:      #45d18a;
  --radius:     10px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  background: linear-gradient(150deg, var(--aubergine) 0%, var(--aubergine-deep) 100%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
  border: 1px solid #4a2da3;
}
.topbar h1 { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.2; }
.brand-accent { color: var(--cyan); }
.brand-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.mode-badge {
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.mode-offline { background: #243; color: var(--green); }
.mode-smart   { background: #143a4a; color: var(--cyan); }

/* ---- Buttons ---- */
.btn {
  font-size: 13px; font-weight: 600; font-family: inherit;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn-primary { background: var(--cyan); color: #04222b; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ---- Stage strip ---- */
.stage-strip {
  display: flex; gap: 6px; padding: 10px 20px;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  flex-shrink: 0; overflow-x: auto;
}
.stage-pill {
  flex: 1; min-width: 120px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 9px 10px; border-radius: 8px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer;
  white-space: nowrap; text-align: center;
  transition: all .12s ease;
}
.stage-pill:hover { color: var(--text); }
.stage-pill.active {
  background: var(--amber); color: #2a1d00; border-color: var(--amber);
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25);
}

/* ---- Layout ---- */
.layout {
  flex: 1; display: grid; grid-template-columns: 40% 60%;
  gap: 0; overflow: hidden;
}
.panel {
  display: flex; flex-direction: column;
  overflow: hidden; padding: 16px 18px;
}
.panel-left { border-right: 1px solid var(--border); background: var(--bg); }
.panel-right { background: var(--bg-panel); }
.panel-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-dim); margin-bottom: 12px; flex-shrink: 0;
}

/* ---- Input zone ---- */
.input-zone { flex-shrink: 0; margin-bottom: 14px; }
#input {
  width: 100%; resize: vertical; min-height: 64px;
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px; font-size: 15px; font-family: inherit; line-height: 1.45;
}
#input:focus { outline: none; border-color: var(--cyan); }
.input-row { display: flex; gap: 8px; margin-top: 8px; }
.hint { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ---- Call log ---- */
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.log-entry {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; cursor: pointer;
  transition: border-color .12s ease;
}
.log-entry:hover { border-color: var(--cyan); }
.log-entry.active { border-color: var(--cyan); }
.log-time { font-size: 10.5px; color: var(--text-dim); margin-bottom: 3px; }
.log-text { font-size: 14px; line-height: 1.45; }
.log-tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.log-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.tag-obj  { background: #3a1f1f; color: var(--red); }
.tag-flag { background: #143a4a; color: var(--cyan); }
.tag-none { background: #243; color: var(--green); }

/* ---- Copilot output ---- */
.copilot { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.empty-state { color: var(--text-dim); padding: 30px 10px; }
.empty-big { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.55; }

.card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); overflow: hidden;
  flex-shrink: 0;   /* never let a tall card get squashed + clipped */
}
.card-obj    { border-left: 4px solid var(--red); }
.card-flag   { border-left: 4px solid var(--cyan); }
.card-smart  { border-left: 4px solid var(--aubergine); }
.card-none   { border-left: 4px solid var(--green); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 8px;
}
.card-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
}
.card-obj  .card-kicker { color: var(--red); }
.card-flag .card-kicker { color: var(--cyan); }
.card-smart .card-kicker { color: #b6a4ff; }
.card-none .card-kicker { color: var(--green); }
.card-bucket {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--bg-input); color: var(--text-dim); text-transform: uppercase;
}
.card-title { font-size: 16px; font-weight: 700; padding: 0 14px 6px; line-height: 1.3; }
.card-sub { font-size: 12.5px; color: var(--text-dim); padding: 0 14px 8px; }

.say-block { padding: 4px 14px 14px; }
.say-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-dim); margin: 8px 0 5px;
}
.say-step {
  display: flex; gap: 9px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--bg-input); border-radius: 7px;
  font-size: 14px; line-height: 1.5;
}
.say-num {
  flex-shrink: 0; font-weight: 800; color: var(--cyan);
  font-size: 12px; padding-top: 2px; min-width: 16px;
}
.say-flag .say-num { color: var(--amber); }
.donot {
  margin: 2px 14px 14px; padding: 8px 11px;
  background: #2a1a1a; border-radius: 7px;
  font-size: 12.5px; color: #ffb4b4; line-height: 1.45;
}
.donot strong { color: var(--red); }
.card-meta {
  font-size: 11px; color: var(--text-dim);
  padding: 8px 14px; border-top: 1px solid var(--border);
}

/* score pip */
.scorepips { display: flex; gap: 3px; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.pip.on-obj  { background: var(--red); }
.pip.on-flag { background: var(--cyan); }

/* ---- Stage reference ---- */
.stage-ref {
  flex-shrink: 0; margin-top: 12px; padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--amber); border-radius: var(--radius);
  max-height: 38vh; overflow-y: auto;
}
.stage-ref h3 { font-size: 14px; color: var(--amber); margin-bottom: 4px; }
.stage-ref .sr-goal { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 8px; }
.stage-ref .sr-listen {
  font-size: 12px; color: var(--cyan); line-height: 1.5; margin-bottom: 8px;
}
.stage-ref .sr-say-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 5px;
}
.stage-ref ul { list-style: none; }
.stage-ref li {
  font-size: 12.5px; line-height: 1.5; padding: 5px 0 5px 14px;
  position: relative; border-bottom: 1px solid var(--border);
}
.stage-ref li:last-child { border-bottom: none; }
.stage-ref li::before { content: "›"; position: absolute; left: 0; color: var(--amber); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; width: 460px; max-width: 92vw;
}
.modal-card h3 { font-size: 17px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field input[type=password] {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--cyan); }
.field-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline span { font-size: 13px; color: var(--text); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 820px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: visible; }
  .panel { overflow: visible; }
  .panel-left { border-right: none; border-bottom: 1px solid var(--border); }
  .log { max-height: 30vh; }
  .copilot { max-height: none; }
  .stage-ref { max-height: none; }
}

/* ---- Accessibility: skip link + focus rings ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--cyan); color: #04222b; padding: 8px 14px;
  font-size: 13px; font-weight: 700; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.btn:focus-visible, .stage-pill:focus-visible, .log-entry:focus-visible,
.sit-btn:focus-visible, #input:focus-visible, .field input:focus-visible,
.stage-ref:focus-visible, input[type=checkbox]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---- What's-happening (non-verbal) bar ---- */
.situation-bar {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin-top: 10px;
}
.sit-label {
  font-size: 10.5px; color: var(--text-dim); font-weight: 600;
  width: 100%; margin-bottom: 1px;
}
.sit-btn {
  font-size: 11.5px; font-weight: 600; font-family: inherit;
  padding: 5px 9px; border-radius: 7px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}
.sit-btn:hover { color: var(--text); border-color: var(--aubergine); }

/* ---- Extra card types ---- */
.card-situation { border-left: 4px solid var(--aubergine); }
.card-situation .card-kicker { color: #b6a4ff; }
.card-retie { border-left: 4px solid var(--amber); }
.card-retie .card-kicker { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Live prospect-facts scratchpad ---- */
.facts-zone { flex-shrink: 0; margin-bottom: 12px; }
.facts-label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}
#live-facts {
  width: 100%; resize: vertical; min-height: 56px;
  background: var(--bg-input); color: var(--amber);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; font-size: 13px; font-family: inherit; line-height: 1.5;
}
#live-facts:focus { outline: none; border-color: var(--amber); }
#live-facts::placeholder { color: var(--text-dim); }

/* ---- Side-by-side stage options (e.g. Intro Option A / Option B) ---- */
.sr-options { display: flex; gap: 12px; margin-top: 8px; }
.sr-option {
  flex: 1; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid; min-width: 0;
}
.sr-option-a { background: rgba(0, 191, 241, 0.07); border-color: var(--cyan); }
.sr-option-a .sr-option-title { color: var(--cyan); }
.sr-option-b { background: rgba(245, 192, 74, 0.07); border-color: var(--amber); }
.sr-option-b .sr-option-title { color: var(--amber); }
.sr-option-title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.3px;
  text-transform: uppercase; margin-bottom: 10px;
}
.sr-option ol { margin: 0; padding-left: 20px; }
.sr-option li { font-size: 14px; line-height: 1.55; margin-bottom: 9px; color: var(--text); }
.sr-option li::marker { color: var(--text-dim); font-weight: 700; }
@media (max-width: 820px) {
  .sr-options { flex-direction: column; }
}

/* ---- DISCOVER chip letter highlight ---- */
.chip-letter {
  font-weight: 900; color: var(--cyan); margin-right: 1px;
  font-size: 11.5px; letter-spacing: 0.5px;
}
.belief-chip.on .chip-letter { color: var(--green); }

/* ---- Larger reading text for during-call use ---- */
.stage-ref li { font-size: 14px; line-height: 1.55; }
.card-title { font-size: 17px; }
.card .say-step span:last-child { font-size: 14.5px; line-height: 1.55; }
.empty-state p { font-size: 15px; }

/* ---- Outcome zone in the Prep modal ---- */
.outcome-zone {
  margin-top: 14px; padding: 14px;
  background: var(--bg-input); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.outcome-title {
  font-size: 11px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--amber); margin-bottom: 10px;
}

/* ---- Past calls list ---- */
.calls-list { max-height: 520px; overflow-y: auto; margin: 8px 0 4px; }
.calls-row {
  display: block; width: 100%; text-align: left;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px;
  cursor: pointer; font-family: inherit; color: var(--text);
}
.calls-row:hover { border-color: var(--cyan); }
.calls-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.calls-row-name { font-size: 14px; font-weight: 700; }
.calls-row-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.calls-row-notes { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.4; }

/* ---- Outcome chips ---- */
.outcome-chip {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.3px;
  padding: 3px 9px; border-radius: 20px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); white-space: nowrap;
}
.outcome-chip.outcome-pending { color: var(--text-dim); }
.outcome-chip.outcome-closed-pif { background: #15402c; color: var(--green); border-color: #1e5e40; }
.outcome-chip.outcome-closed-plan { background: #143a4a; color: var(--cyan); border-color: #1e5e8a; }
.outcome-chip.outcome-followup { background: #2a1d00; color: var(--amber); border-color: #5a3f00; }
.outcome-chip.outcome-not-closed { background: #3a1f1f; color: var(--red); border-color: #5a2f2f; }
.outcome-chip.outcome-no-show { background: #2a1a2a; color: var(--magenta); border-color: #5a2f5a; }
.outcome-chip.outcome-other { background: var(--bg-card); }

/* ---- Universal-handle reminder strip on objection cards ---- */
.handle-strip {
  font-size: 11.5px; color: var(--text-dim); line-height: 1.45;
  padding: 7px 14px; background: var(--bg-input);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.handle-strip b { color: var(--cyan); font-weight: 700; }

/* ---- Still-working (call memory) card ---- */
.card-continuing { border-left: 4px solid var(--amber); }
.card-continuing .card-kicker { color: var(--amber); }

/* ---- Belief-prompts card ---- */
.card-belief { border-left: 4px solid var(--cyan); }
.card-belief .card-kicker { color: var(--cyan); }
.belief-cover-btn {
  font-size: 11px; font-weight: 700; font-family: inherit;
  padding: 4px 11px; border-radius: 20px; cursor: pointer;
  background: var(--bg-input); color: var(--text-dim);
  border: 1px solid var(--border);
}
.belief-cover-btn:hover { color: var(--text); }
.belief-cover-btn.on {
  background: #15402c; color: var(--green); border-color: #1e5e40;
}

/* ---- Prep button + prospect badge ---- */
.btn-prep {
  background: var(--aubergine); color: var(--text);
  border-color: #4a2da3;
}
.btn-prep:hover { filter: brightness(1.2); }
.prospect-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  background: var(--bg-card); color: var(--amber);
  border: 1px solid var(--border); white-space: nowrap;
}

/* ---- 7-beliefs checklist ---- */
.belief-tracker {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 20px;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.belief-tracker[hidden] { display: none; }
.belief-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-dim);
}
.belief-chip {
  font-size: 12px; font-weight: 700; font-family: inherit;
  padding: 4px 11px; border-radius: 20px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer;
  transition: all .12s ease;
}
.belief-chip:hover { color: var(--text); }
.belief-chip.on {
  background: #15402c; color: var(--green); border-color: #1e5e40;
}
.belief-hint { font-size: 10.5px; color: var(--text-dim); margin-left: auto; }

/* ---- Prep card ---- */
.card-prep { border-left: 4px solid var(--amber); }
.card-prep .card-kicker { color: var(--amber); }

/* ---- Wider modal + select/textarea fields ---- */
.modal-card-wide { width: 560px; max-height: 88vh; overflow-y: auto; }
.field textarea, .field select, .field input[type=text] {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit; line-height: 1.45;
  resize: vertical;
}
.field textarea:focus, .field select:focus, .field input[type=text]:focus {
  outline: none; border-color: var(--cyan);
}

/* ---- My Offer custom-pitch card (renders in stage-ref on pitch + committing) ---- */
.offer-card {
  border: 1px solid var(--amber); border-radius: 10px; padding: 12px 14px;
  background: rgba(245, 192, 74, 0.06); margin-bottom: 14px;
}
.offer-card .offer-head {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 8px;
}
.offer-card .offer-row { margin-bottom: 10px; }
.offer-card .offer-row:last-child { margin-bottom: 0; }
.offer-card .offer-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 3px;
}
.offer-card .offer-body {
  font-size: 14px; line-height: 1.55; color: var(--text); white-space: pre-wrap;
}
.offer-card .offer-foot {
  margin-top: 8px; font-size: 11.5px; color: var(--text-dim); font-style: italic;
}
