:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1c2b36;
  --muted: #6b7c8a;
  --line: #e3e9ef;
  --teal: #1f9c92;
  --teal-dark: #16766e;
  --blue: #2d6cdf;
  --rec: #e0564f;
  --good: #1f9c92;
  --bad: #d97706;
  --crit: #d64545;
  --shadow: 0 1px 3px rgba(28, 43, 54, 0.08), 0 6px 24px rgba(28, 43, 54, 0.06);
  font-size: 15px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.15rem; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}
.tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: none; padding: 8px 14px; border-radius: 8px;
  font-size: 0.95rem; color: var(--muted); cursor: pointer; font-weight: 550;
}
.tab.active { background: #eef4ff; color: var(--blue); }
.privacy { margin-left: auto; font-size: 0.85rem; color: var(--muted); }

.view { max-width: 920px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 620; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

/* Scenario picker */
.scenario-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.scenario {
  text-align: left; border: 1.5px solid var(--line); background: #fbfdff;
  border-radius: 12px; padding: 14px; cursor: pointer; transition: all .12s ease;
}
.scenario:hover { border-color: var(--teal); transform: translateY(-1px); }
.scenario.selected { border-color: var(--teal); background: #effaf8; box-shadow: 0 0 0 3px rgba(31,156,146,.12); }
.scenario.read-cold { border-style: dashed; border-color: var(--blue); background: #f4f7ff; }
.scenario.read-cold:hover { border-color: var(--blue); }
.scenario .name { font-weight: 600; display: block; margin-bottom: 6px; }
.scenario .persona { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.badge { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 20px; font-weight: 700; margin-bottom: 8px; }
.badge.easy { background: #e6f6ee; color: #18794e; }
.badge.medium { background: #fff3e0; color: #b45309; }
.badge.hard { background: #fde8e8; color: #c0392b; }

/* Skill picker (role -> skill) */
.skill-list { margin-top: 8px; }
.role-head { font-size: 0.74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--teal-dark); font-weight: 700; margin: 16px 0 8px; }
.role-head:first-child { margin-top: 4px; }
.skill-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.skill-card { text-align: left; border: 1.5px solid var(--line); background: #fbfdff;
  border-radius: 12px; padding: 14px; cursor: pointer; transition: all .12s ease; }
.skill-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.skill-card.selected { border-color: var(--blue); background: #eef4ff; box-shadow: 0 0 0 3px rgba(45,108,223,.12); }
.skill-card .name { font-weight: 620; display: block; margin-bottom: 5px; }
.skill-card .persona { font-size: 0.8rem; color: var(--muted); }

/* Record */
.record-area { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; }
.record-btn {
  width: 130px; height: 130px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: white;
  font-weight: 600; font-size: 0.95rem; box-shadow: 0 8px 24px rgba(31,156,146,.35);
  transition: transform .1s ease, background .2s ease;
}
.record-btn:disabled { background: #c4ced6; box-shadow: none; cursor: not-allowed; }
.record-btn:not(:disabled):hover { transform: scale(1.04); }
.record-btn.recording { background: linear-gradient(135deg, #e0564f, #c0392b);
  box-shadow: 0 8px 24px rgba(224,86,79,.4); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 8px 24px rgba(224,86,79,.4);} 50% { box-shadow: 0 8px 34px rgba(224,86,79,.6);} }

/* Results */
.score-head { display: flex; align-items: center; gap: 18px; margin: 8px 0 18px; }
.score-ring { width: 76px; height: 76px; flex: none; }
.score-summary { font-size: 0.98rem; line-height: 1.5; }
.section-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }

.beat { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.beat .mark { font-size: 1.2rem; flex: none; line-height: 1.4; }
.beat.hit { background: #f3fbf9; border-color: #cdeae6; }
.beat.miss { background: #fff8f1; border-color: #f3e2cf; }
.beat .b-title { font-weight: 600; }
.beat .b-why { color: var(--muted); font-size: 0.88rem; margin-top: 3px; line-height: 1.45; }
.b-evidence { font-size: 0.85rem; color: #5a6b78; font-style: italic; margin-top: 6px;
  border-left: 3px solid var(--line); padding-left: 9px; }
.model-answer { margin-top: 9px; background: #eff7ff; border: 1px solid #d6e6fb;
  border-radius: 9px; padding: 9px 11px; }
.ma-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 700; color: var(--blue); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.ma-text { font-size: 0.92rem; color: var(--ink); line-height: 1.5; }
.play-btn { border: none; background: var(--blue); color: white; border-radius: 20px;
  padding: 2px 10px; font-size: 0.72rem; font-weight: 600; cursor: pointer; letter-spacing: 0; text-transform: none; }
.play-btn:hover { background: #1f56c0; }

/* Qualities — how you came across. Same visual family as beats, but a 1-5
   scale rather than a tick, because "half empathetic" is a real thing. */
.quality { padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.quality.hit { background: #f3fbf9; border-color: #cdeae6; }
.quality.mid { background: #fffdf4; border-color: #eee5c9; }
.quality.miss { background: #fff8f1; border-color: #f3e2cf; }
.quality .b-title { font-weight: 600; }
.quality .b-why { color: var(--muted); font-size: 0.88rem; margin-top: 3px; line-height: 1.45; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-scale { display: flex; align-items: center; gap: 4px; flex: none; }
.q-dot { width: 9px; height: 9px; border-radius: 50%; background: #e3e9ef; display: inline-block; }
.quality.hit .q-dot.on { background: #1f9c92; }
.quality.mid .q-dot.on { background: #d97706; }
.quality.miss .q-dot.on { background: #d64545; }
.q-num { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-left: 4px; }

.flag { padding: 10px 12px; border-radius: 9px; margin-bottom: 7px; font-size: 0.9rem; border: 1px solid var(--line); }
.flag.on { background: #fdecec; border-color: #f3cccc; }
.flag.on.critical { background: #fbe0e0; border-color: #e9b3b3; }
.flag .f-title { font-weight: 600; }
.flag.off { opacity: .55; }

.priority { background: #eef4ff; border: 1px solid #d6e2fb; border-radius: 10px; padding: 14px; margin-top: 14px; }
.priority b { color: var(--blue); }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; margin-top: 8px; }
.metric { background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.metric .v { font-size: 1.4rem; font-weight: 680; }
.metric .l { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.metric .v.warn { color: var(--bad); }
.metric .v.ok { color: var(--good); }

.transcript { background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 0.92rem; line-height: 1.55; }
.transcript.dialogue { white-space: pre-wrap; }
.patient-reply { background: #f4f0ff; border: 1px solid #e2daf7; border-radius: 10px; padding: 14px; margin-top: 8px; }
.patient-reply .who { font-weight: 650; color: #6b46c1; margin-bottom: 6px; }
audio { width: 100%; margin-top: 8px; }

/* History */
.history-list { display: grid; gap: 10px; margin-top: 16px; }
.hrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.hrow .hscore { font-weight: 700; font-size: 1.1rem; width: 42px; }
.hrow .hmeta { flex: 1; }
.hrow .hmeta .hname { font-weight: 580; }
.hrow .hmeta .hdate { font-size: 0.8rem; color: var(--muted); }
.hrow.clickable { cursor: pointer; transition: border-color .12s ease, transform .08s ease; }
.hrow.clickable:hover { border-color: var(--teal); transform: translateX(2px); }
.hrow .hchev { color: var(--muted); font-size: 1.3rem; font-weight: 300; }
.detail-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.chart { padding: 10px 0; }

/* Mode picker */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 16px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fbfdff; cursor: pointer; font-size: 1.6rem; transition: all .12s ease;
}
.mode-btn span { font-size: 1.02rem; font-weight: 650; color: var(--ink); }
.mode-btn small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.mode-btn:not(:disabled):hover { border-color: var(--teal); transform: translateY(-1px); }
.mode-btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 0.88rem; margin-top: 6px; }

/* Conversation mic toggle (hands-free vs hold-to-talk) */
.convo-input-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 20px; overflow: hidden; }
.seg-btn {
  border: none; background: #fbfdff; padding: 7px 14px; font-size: 0.86rem;
  font-weight: 600; color: var(--muted); cursor: pointer; transition: all .12s ease;
}
.seg-btn.active { background: var(--teal); color: white; }
.seg-btn:not(.active):hover { color: var(--ink); }

/* Conversation */
.convo-status { text-align: center; color: var(--muted); font-weight: 550; padding: 8px; min-height: 22px; }
.convo-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 8px 2px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; font-size: 0.95rem; }
.bubble.you { align-self: flex-end; background: var(--teal); color: white; border-bottom-right-radius: 4px; }
.bubble.patient { align-self: flex-start; background: #f1eafe; color: #3b2a64; border-bottom-left-radius: 4px; }
.bubble.nudge { align-self: flex-start; background: #f0f3f7; color: var(--muted); font-style: italic; padding: 6px 12px; font-size: 0.88rem; }
.end-btn {
  display: block; margin: 16px auto 4px; padding: 12px 26px; border: none; border-radius: 30px;
  background: var(--rec); color: white; font-weight: 650; font-size: 0.98rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(224,86,79,.32);
}
.end-btn:disabled { background: #c4ced6; box-shadow: none; cursor: default; }

/* Push-to-talk hold button */
.ptt-btn {
  display: block; margin: 14px auto 0; padding: 16px 34px; border: none; border-radius: 34px;
  background: var(--teal); color: white; font-weight: 650; font-size: 1.02rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(31,156,146,.32); user-select: none; -webkit-user-select: none;
  touch-action: none; transition: all .1s ease;
}
.ptt-btn small { display: block; font-weight: 400; font-size: 0.78rem; opacity: .85; margin-top: 2px; }
.ptt-btn.holding { background: var(--rec); box-shadow: 0 6px 22px rgba(224,86,79,.45); transform: scale(1.04); }

/* Outcome banner */
.outcome-banner { padding: 11px 14px; border-radius: 10px; font-weight: 650; font-size: 0.95rem; margin-bottom: 14px; }
.outcome-banner.win { background: #e6f6ee; color: #18794e; border: 1px solid #bfe6cf; }
.outcome-banner.lose { background: #fdecec; color: #c0392b; border: 1px solid #f3cccc; }

/* Debrief lists */
ul.ptr { margin: 4px 0 0; padding-left: 20px; }
ul.ptr li { margin-bottom: 6px; line-height: 1.5; }
ul.ptr.good li::marker { color: var(--good); }
ul.ptr.work li::marker { color: var(--bad); }
/* Drill board — same grammar as Practice; only the state badges are new */
.tier-btn.locked { opacity: 0.55; cursor: default; }
.badge.dgold { background: #fdf8e7; color: #8a6d1a; }
.badge.dsilver { background: #f0f2f5; color: #5a6b78; }
.badge.dbronze { background: #f9efe6; color: #a0622d; }
.badge.dtry  { background: #eef2f6; color: var(--muted); }
.badge.dnew  { background: #eef6fb; color: #2c6e91; }

/* Measure — craft findings as pointer-style bullets; 📏 toggles the receipts.
   Italic label at body size, coaching sentence plain. Tier colors label AND
   bullet: policy red (house rule) · confidence amber · polish grey (whisper). */
.m-label { font-style: italic; font-weight: 400; }
li.mt-policy::marker { color: var(--crit); }
li.mt-policy .m-label { color: var(--crit); }
li.mt-confidence::marker { color: var(--bad); }
li.mt-confidence .m-label { color: var(--bad); }
li.mt-polish::marker { color: var(--muted); }
li.mt-polish .m-label { color: var(--muted); }
.measure-tape { border: none; background: none; cursor: pointer; font-size: 0.9rem; padding: 0 2px; }
.measure-more { font-size: 0.84rem; margin-top: 2px; }
.measure-receipts { margin: 6px 0 2px; padding-left: 18px; }
.measure-receipts li { font-size: 0.84rem; color: var(--muted); line-height: 1.5; margin-bottom: 4px; list-style: none; }
.measure-receipts mark { background: #fdeaea; color: #c0392b; border-radius: 3px; padding: 0 2px; }
.measure-try { font-size: 0.87rem; line-height: 1.5; background: #eff7ff; border: 1px solid #d6e6fb;
  border-radius: 9px; padding: 8px 11px; margin: 6px 0 4px; }
.measure-try b { color: var(--blue); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
.measure-clean { font-size: 0.88rem; color: #2c6e91; background: #eef6fb; border: 1px solid #cfe4f0; border-radius: 10px; padding: 8px 12px; }

.again-btn { display: block; margin: 20px auto 0; padding: 10px 22px; border: 1.5px solid var(--teal);
  background: white; color: var(--teal-dark); border-radius: 30px; font-weight: 600; cursor: pointer; }
.again-btn:hover { background: #effaf8; }

/* Coaching cards */
#coaching-cards { display: grid; gap: 14px; margin-top: 12px; }
.coach-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fbfdff; }
.cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cc-name { font-weight: 650; font-size: 1.02rem; }
.cc-sub { font-size: 0.82rem; color: var(--muted); }
.cc-beats { display: grid; gap: 7px; margin-bottom: 10px; }
.beatbar { display: grid; grid-template-columns: 1fr 120px 38px; align-items: center; gap: 10px; }
.bb-label { font-size: 0.85rem; }
.bb-track { background: #e9eef3; border-radius: 6px; height: 9px; overflow: hidden; }
.bb-fill { height: 100%; border-radius: 6px; }
.bb-fill.hi { background: var(--good); }
.bb-fill.mid { background: var(--bad); }
.bb-fill.lo { background: var(--crit); }
.bb-pct { font-size: 0.8rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cc-flag { font-size: 0.85rem; color: #b45309; background: #fff6e9; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
.cc-deliv { font-size: 0.82rem; color: var(--muted); }
.cc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mini-btn { border: 1.5px solid var(--line); background: white; border-radius: 20px; padding: 6px 14px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.mini-btn:hover { border-color: var(--teal); }
.mini-btn.primary { background: var(--teal); color: white; border-color: var(--teal); }
.mini-btn.primary:hover { background: var(--teal-dark); }
.cc-insight { margin-top: 12px; background: #eef4ff; border: 1px solid #d6e2fb; border-radius: 10px; padding: 12px; }
.ins-summary { line-height: 1.5; }
.ins-focus { margin-top: 7px; }
.ins-focus b { color: var(--blue); }
.ins-why { margin-top: 5px; font-size: 0.88rem; color: var(--muted); }

/* Login gate */
.gate { position: fixed; inset: 0; z-index: 60; background: linear-gradient(160deg, #eef4ff, #f5f7fa);
  display: flex; align-items: center; justify-content: center; }
.gate-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 32px; width: 360px; max-width: 92vw; }
.gate-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.gate-brand h1 { font-size: 1.3rem; margin: 0; font-weight: 680; }
.dot.big { width: 16px; height: 16px; }
.gate-lead { text-align: center; color: var(--muted); margin: 0 0 16px; }
.gate-input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; margin-bottom: 10px; font-family: inherit; }
.gate-input:focus { outline: none; border-color: var(--teal); }
.gate-btn { width: 100%; padding: 11px; border: none; border-radius: 10px; background: var(--teal);
  color: white; font-weight: 650; font-size: 0.95rem; cursor: pointer; }
.gate-btn:hover { background: var(--teal-dark); }
.gate-users { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gate-user { text-align: left; padding: 11px 14px; border: 1.5px solid var(--line); background: #fbfdff;
  border-radius: 10px; cursor: pointer; font-size: 0.95rem; font-weight: 550; }
.gate-user:hover { border-color: var(--teal); }
.gate-user.selected { border-color: var(--teal); background: #effaf8; }
.gate-err { color: var(--crit); font-size: 0.85rem; margin-top: 8px; min-height: 18px; text-align: center; }

/* Topbar user chip */
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; }
.logout-btn { border: 1px solid var(--line); background: white; border-radius: 16px; padding: 4px 12px;
  font-size: 0.8rem; cursor: pointer; color: var(--muted); font-weight: 600; }
.logout-btn:hover { border-color: var(--rec); color: var(--rec); }

/* Add-person form + communication-style dots (swatch per style key in disc.yaml) */
.add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.add-form .gate-input { width: auto; margin-bottom: 0; flex: 1; min-width: 120px; }
.disc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.disc-dot.direct { background: #e0564f; } .disc-dot.expressive { background: #e6b800; }
.disc-dot.steady { background: #1f9c92; } .disc-dot.precise { background: #2d6cdf; }

/* Communication-style cards */
.disc-card { background: #fbfbff; border-left: 4px solid var(--blue); }
.comms-tip { margin-top: 10px; background: #eef4ff; border: 1px solid #d6e2fb; border-radius: 8px;
  padding: 9px 11px; font-size: 0.88rem; line-height: 1.45; }
.comms-tip b { color: var(--blue); }
.disc-legend { margin-top: 10px; font-size: 0.8rem; color: #6b7280; line-height: 1.45; }
.disc-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; font-size: 0.92rem; }
.disc-tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  color: var(--muted); background: #eef2f6; border-radius: 12px; padding: 2px 8px; }
.disc-tag.perf { background: #effaf8; color: var(--teal-dark); }
.disc-note { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.disc-plus { font-weight: 500; color: var(--muted); }
.disc-dot.small { width: 8px; height: 8px; }
.disc-reason { font-size: 0.85rem; color: #5a6b78; line-height: 1.45; margin: 3px 0 4px 4px;
  border-left: 3px solid var(--line); padding-left: 9px; }

/* Core drivers (what motivates a person) — distinct accent from DISC */
.drivers-card { background: #fffdf7; border-left: 4px solid #e0a93b; }
.drv-name { font-weight: 700; }
/* The synopsis line tying the self-check and the reps read together. */
.drivers-card .drives-read { margin-top: 14px; background: #fdf3df; border-color: #ecd49a; }
.drivers-card .drives-read b { color: #b07d14; }

/* Quiz */
.gate-card.wide { width: 540px; }
.quiz-q { margin: 14px 0; text-align: left; }
.quiz-prompt { font-weight: 600; margin-bottom: 8px; }
.quiz-opts { display: grid; gap: 7px; }
.quiz-opt { text-align: left; padding: 9px 12px; border: 1.5px solid var(--line); background: #fbfdff;
  border-radius: 9px; cursor: pointer; font-size: 0.9rem; }
.quiz-opt:hover { border-color: var(--teal); }
.quiz-opt.selected { border-color: var(--teal); background: #effaf8; font-weight: 600; }
#quiz-questions, #dquiz-questions { max-height: 52vh; overflow-y: auto; padding-right: 6px; margin-bottom: 14px; }

/* Calibration + team analytics */
.cal-chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 11px;
  border-radius: 14px; margin: 6px 0 4px; }
.cal-chip.calibrated { background: #e6f6ee; color: #18794e; }
.cal-chip.overconfident { background: #eef4ff; color: #2d6cdf; }
.cal-chip.too_hard { background: #f4f0ff; color: #6b46c1; }
.cal-buckets { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 0.85rem; }
.cal-b { color: var(--ink); }
.trend { font-size: 0.78rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.trend.up { background: #e6f6ee; color: #18794e; }
.trend.down { background: #fdecec; color: #c0392b; }
.trend.flat { background: #eef2f6; color: var(--muted); }
.team-weakspot { background: #fff6e9; border: 1px solid #f3e2cf; color: #92400e; border-radius: 10px;
  padding: 11px 13px; font-size: 0.9rem; margin-bottom: 6px; }

/* Self-rating */
.rate-row { display: flex; gap: 10px; margin-top: 6px; }
.rate-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfdff;
  cursor: pointer; font-size: 1.7rem; transition: all .12s ease; }
.rate-btn span { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.rate-btn:hover { transform: translateY(-1px); }
.rate-btn.good:hover { border-color: var(--good); background: #effaf8; }
.rate-btn.neutral:hover { border-color: var(--bad); background: #fff6e9; }
.rate-btn.bad:hover { border-color: var(--crit); background: #fdecec; }
.rating-badge { display: inline-block; font-size: 0.82rem; font-weight: 600; padding: 4px 12px;
  border-radius: 16px; margin-bottom: 12px; }
.rating-badge.good { background: #e6f6ee; color: #18794e; }
.rating-badge.neutral { background: #fff3e0; color: #b45309; }
.rating-badge.bad { background: #fdecec; color: #c0392b; }

/* Busy overlay */
.busy { position: fixed; inset: 0; background: rgba(245,247,250,.8); display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 50; }
.spinner { width: 42px; height: 42px; border: 4px solid #d6e0e8; border-top-color: var(--teal);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#busy-text { color: var(--muted); font-weight: 550; }

/* ---------- Playbook (owner) ---------- */
.pb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pb-voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-voice-badge { font-weight: 600; color: var(--teal); background: #e8f5f3;
  border-radius: 20px; padding: 3px 12px; font-size: 0.85rem; }
.playbook-list { margin-top: 10px; }
.pb-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 8px 0; box-shadow: var(--shadow); }
.pb-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pb-title { font-weight: 600; color: var(--ink); }
.pb-beats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pb-beat { font-size: 0.72rem; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; }
.pb-script { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  color: var(--ink); line-height: 1.55; white-space: pre-wrap; }

/* ---------- Voice questionnaire (Tier 1) ---------- */
.voice-q { text-align: left; margin: 14px 0; }
.voice-q > label { display: block; font-weight: 550; color: var(--ink); margin-bottom: 6px; font-size: 0.92rem; }
.voice-scale { display: flex; align-items: center; gap: 10px; }
.voice-scale input[type=range] { flex: 1; accent-color: var(--teal); }
.voice-q textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; color: var(--ink); resize: vertical; box-sizing: border-box; }
.voice-progress { text-align: center; margin-top: 12px; padding: 10px; border-radius: 8px;
  background: #e8f5f3; color: var(--teal); font-weight: 550; font-size: 0.9rem; }
.voice-quota { text-align: center; font-size: 0.85rem; font-weight: 550; color: var(--teal);
  background: #e8f5f3; border-radius: 8px; padding: 7px 10px; margin: 4px 0 8px; }
.voice-quota.none-left { color: var(--bad); background: #fdf3e7; }

/* b2c email gate */
.gate-alt { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 12px; }
.gate-alt a { color: var(--accent); text-decoration: none; }

/* settings view (b2c) */
.settings-wrap { max-width: 460px; margin: 24px auto; display: flex; flex-direction: column; gap: 20px; padding: 0 16px; }
.settings-card { background: var(--card, #fff); border: 1px solid var(--border, #e3e3e3); border-radius: 14px; padding: 20px; }
.settings-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.settings-card .gate-btn { margin-top: 4px; }

/* role/track pills + danger zone */
.track-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.track-row.big { flex-direction: column; margin: 16px 0 4px; }
.track-pill { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border, #d8d8d8); background: transparent; color: inherit; font-size: 0.95rem; cursor: pointer; }
.track-row.big .track-pill { padding: 14px; font-size: 1.05rem; }
.track-pill.selected { border-color: var(--accent, #0a8f8f); background: var(--accent, #0a8f8f); color: #fff; }
.settings-card.danger { border-color: #d9534f55; }
.danger-btn { background: #b8433f; }

/* ---- hiring (owner) — slate accent, deliberately NOT the training teal:
   training is iterative coaching, hiring is one-shot assessment ---- */
:root { --hire: #4a5d8a; --hire-dark: #37466b; }
.hiring-tab.active { background: var(--hire) !important; }
.hiring-accent { border-top: 3px solid var(--hire); }
.hire-new { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 16px; }
.hire-new .gate-input { flex: 1; min-width: 200px; margin: 0; }
.hire-select { padding: 10px 12px; border: 1px solid #cfcac1; border-radius: 8px; font-size: 0.95rem; background: #fff; }
.hire-btn { background: var(--hire); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font-size: 0.95rem; cursor: pointer; }
.hire-btn:hover { background: var(--hire-dark); }
.hire-link-box { background: #f4f6fb; border: 1px solid #d6dcea; border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.hire-copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.hire-copy-row code { background: #fff; border: 1px solid #d6dcea; border-radius: 6px; padding: 6px 10px; font-size: 0.82rem; word-break: break-all; }
.hire-mail { width: 100%; font-family: inherit; font-size: 0.88rem; border: 1px solid #d6dcea; border-radius: 8px; padding: 10px; margin: 8px 0; color: var(--ink); background: #fff; -webkit-text-fill-color: var(--ink); }
.hire-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hire-row:hover { border-color: var(--hire) !important; }
.hire-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hire-chip { background: #eceff5; color: #45507a; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; }
.hire-chip.new { background: var(--hire); color: #fff; font-weight: 600; }
.hire-chip.decision { background: #e7ecdf; color: #4a5d3a; text-transform: capitalize; }
.hire-decide { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.hire-decide .mini-btn.primary { background: var(--hire); border-color: var(--hire); }
.hire-notes { background: #f8f9fc; border: 1px solid #e2e6f0; border-radius: 10px; padding: 16px; margin: 14px 0; }
.hire-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0; }
.hire-dim { background: #fff; border: 1px solid #e2e6f0; border-radius: 8px; padding: 10px 12px; }
.hire-dim strong { color: var(--hire-dark); font-size: 0.85rem; }
.hire-dim p { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.45; }
.hire-qnote { border-top: 1px solid #e2e6f0; padding: 10px 0; }
.hire-qtext { font-weight: 600; font-size: 0.88rem; color: var(--hire-dark); margin-bottom: 4px; }
.hire-qnote blockquote { border-left: 3px solid var(--hire); margin: 6px 0; padding: 2px 10px; color: #555; font-size: 0.9rem; }
.hire-transcript { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; border: 1px solid #e2e6f0; border-radius: 10px; padding: 12px; background: #fff; }
.hire-tmsg { max-width: 88%; padding: 8px 12px; border-radius: 10px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; }
.hire-tmsg span { display: block; font-size: 0.72rem; color: #8a8a8a; margin-bottom: 2px; }
.hire-tmsg.coach { background: #f1f3f8; align-self: flex-start; }
.hire-tmsg.applicant { background: #e7ecf7; align-self: flex-end; }
.hire-tevent { align-self: center; color: #8a857c; font-size: 0.8rem; font-style: italic; }
.hire-delete { margin-top: 14px; border-color: #b8433f; color: #b8433f; }
.hire-nextstep { background: #fbf7ec; border: 1px solid #e8dcc0; border-radius: 10px; padding: 14px; margin: 12px 0; }
.hire-nextstep p { margin: 0 0 8px; font-size: 0.92rem; }

/* ---- conversation session page + typed input ---- */
.session-panel { display: flex; flex-direction: column; gap: 12px; }
.sess-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sess-head h2 { margin: 0; }
.sess-head .link-btn { white-space: nowrap; }
.typed-row { display: flex; gap: 8px; }
.typed-input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.typed-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,156,146,.12); }
.typed-input:disabled { background: #f4f6f9; color: var(--muted); }
.typed-send {
  border: none; border-radius: 10px; padding: 12px 20px; font-size: 1rem; font-weight: 600;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff; cursor: pointer;
}
.typed-send:disabled { opacity: 0.5; cursor: default; }

/* ---- review badge + history states ---- */
.tab-badge {
  display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 999px;
  background: var(--teal); color: #fff; font-size: 0.72rem; font-weight: 700;
  text-align: center; vertical-align: 2px;
}
.tab-badge.warn { background: #d64545; }
.hrow.review-row.pending { background: #f6f9fd; border-style: dashed; }
.hrow.review-row.failed { background: #fdf6f6; border-color: #e5c4c4; }
.hrow .hname .chip {
  display: inline-block; margin-left: 8px; border-radius: 999px; padding: 2px 9px;
  font-size: 0.72rem; font-weight: 600; vertical-align: 1px;
}
.hrow .hname .chip.new { background: var(--teal); color: #fff; }
.hrow .hname .chip.typed { background: #eceff5; color: #45507a; }

/* ---- the five principles: beat chips + coaching rollup ---- */
.p-chip {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #eef4ff; color: #3b5aa0; font-size: 0.72rem; font-weight: 600;
  vertical-align: 1px; white-space: nowrap;
}
.pr-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pr-name { flex: 0 0 220px; font-size: 0.88rem; font-weight: 580; }
.pr-bar { flex: 1; height: 10px; background: #eef1f5; border-radius: 999px; overflow: hidden; position: relative; }
.pr-fill { height: 100%; border-radius: 999px; }
.pr-fill.good { background: var(--teal); }
.pr-fill.mid { background: #d97706; }
.pr-fill.low { background: #d64545; }
.pr-none { font-size: 0.72rem; color: var(--muted); position: absolute; left: 8px; top: -3px; }
.pr-pct { flex: 0 0 44px; text-align: right; font-size: 0.85rem; font-weight: 650; color: var(--muted); }
@media (max-width: 640px) { .pr-name { flex-basis: 130px; } }

/* ---- coaching tab reorg: expandable principles + skill folds ---- */
.pr-row.clickable { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: 6px -6px; }
.pr-row.clickable:hover { background: #f4f8fb; }
.pr-detail { margin: 2px 0 10px 8px; border-left: 2px solid var(--line); padding-left: 12px; }
.pr-beat { display: flex; gap: 10px; align-items: baseline; padding: 4px 6px; border-radius: 6px; font-size: 0.85rem; }
.pr-beat:hover { background: #f4f8fb; }
.prb-title { font-weight: 560; }
.prb-skill { color: var(--muted); flex: 1; font-size: 0.78rem; }
.prb-pct { font-weight: 650; color: var(--muted); }
.pr-focus { margin-top: 14px; padding: 12px 14px; background: #effaf8; border: 1px solid #cdeae6; border-radius: 10px; font-size: 0.92rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.skill-fold { border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; padding: 0; }
.skill-fold summary { cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; font-weight: 580; list-style: none; }
.skill-fold summary::-webkit-details-marker { display: none; }
.skill-fold summary .sf-meta { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.skill-fold[open] summary { border-bottom: 1px solid var(--line); }
.skill-fold .coach-card { border: none; box-shadow: none; margin: 0; }

/* ---- the tier ladder ---- */
.tier-head {
  width: 100%; margin: 14px 0 4px; font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--teal-dark); font-weight: 700;
}
.tier-head .tier-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-left: 6px; }
.tier-badge {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #f3eefc; color: #6b4fa0; font-size: 0.7rem; font-weight: 700; vertical-align: 1px;
}
.skill-card.capstone { border-style: dashed; }
.sess-goal { margin: 4px 0 0; font-size: 0.9rem; color: var(--teal-dark); font-weight: 550; }

/* ---- phone topbar: the TAB ROW scrolls, the page never does ---- */
body { overflow-x: hidden; }
.tabs {
  overflow-x: auto; min-width: 0; flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;           /* Firefox */
}
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 640px) {
  .topbar { gap: 10px; row-gap: 4px; padding: 8px 12px 6px; flex-wrap: wrap; }
  .brand h1 { display: none; }     /* the dot carries the brand on a phone */
  .privacy { display: none; }
  /* Row 1: dot + tabs. Row 2: who's logged in — it was crowding the tabs. */
  .brand { order: 0; }
  .tabs { order: 1; flex: 1 1 auto; }
  .topbar-right { order: 2; flex-basis: 100%; margin-left: 0;
                  justify-content: flex-end; gap: 8px; }
  .user-chip { font-size: 0.78rem; color: var(--muted); }
  .logout-btn { font-size: 0.78rem; }
}

/* ---- tier-first picker ---- */
.tier-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.tier-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fbfdff; cursor: pointer; text-align: left; transition: all .12s ease;
}
.tier-btn .tb-tier {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; color: var(--teal-dark);
}
.tier-btn.t3 .tb-tier { color: #6b4fa0; }
.tier-btn .tb-name { font-size: 1rem; font-weight: 650; color: var(--ink); }
.tier-btn small { font-size: 0.8rem; color: var(--muted); }
.tier-btn:hover { border-color: var(--teal); transform: translateY(-1px); }
.tier-btn.selected { border-color: var(--teal); background: #effaf8; box-shadow: 0 0 0 3px rgba(31,156,146,.12); }
.tier-btn.t3.selected { border-color: #6b4fa0; background: #f7f3fd; box-shadow: 0 0 0 3px rgba(107,79,160,.12); }

/* ---- excluded reps + owner showcase ---- */
.hrow.is-excluded { opacity: 0.5; }
.hrow .hname .chip.excl { background: #eceff2; color: #6b7c8a; }
.excl-toggle { display: block; margin-top: 16px; color: var(--muted); }
.showcase-line {
  margin-top: 14px; padding: 12px 14px; background: #f4f7ff; border: 1px solid #d6e2fb;
  border-radius: 10px; font-size: 0.9rem; line-height: 1.5;
}
.sc-row { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; font-size: 0.88rem; }
.sc-skill { flex: 1; font-weight: 560; }
.sc-arc { color: var(--teal-dark); }
.sc-count { color: var(--muted); font-size: 0.78rem; }

/* owner: remove-member control */
.member-delete { color: #b8433f; margin-top: 18px; display: block; }

/* ---- review folds + clean-flags + pre-rep avoid line ---- */
.rev-fold { border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; margin: 8px 0; }
.rev-fold summary { cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; font-weight: 600; list-style: none; }
.rev-fold summary::-webkit-details-marker { display: none; }
.rev-fold summary::after { content: "▸"; color: var(--muted); font-weight: 400; }
.rev-fold[open] summary::after { content: "▾"; }
.rev-fold .rf-agg { color: var(--teal-dark); font-weight: 700; margin-left: auto; }
.rev-fold .rf-body { padding: 0 12px 12px; }
.flags-clean {
  margin: 12px 0; padding: 10px 14px; background: #f3fbf9; border: 1px solid #cdeae6;
  border-radius: 10px; font-size: 0.9rem; color: var(--teal-dark); font-weight: 560;
}
.avoid-line { margin: 4px 0 0; font-size: 0.85rem; color: #a15c07; }

.detail-title { font-weight: 650; font-size: 1.05rem; margin-bottom: 2px; }

/* ---- v4: principle group headers inside the beats fold ---- */
.pg-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line);
}
.pg-head:first-child { margin-top: 4px; }
.pg-name { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--teal-dark); font-weight: 700; }
.pg-agg { font-weight: 700; color: var(--teal-dark); font-size: 0.85rem; }

.outcome-banner.half { background: #fff7e8; border: 1px solid #ecd9ad; color: #8a6410; }

/* ---- live turn counter ---- */
.convo-status-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.turn-counter { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.turn-counter.warn { color: #b45309; font-weight: 650; }

/* ---- trial funnel: banner, locks, guide ---- */
.trial-banner {
  background: #effaf8; border: 1px solid #cdeae6; border-radius: 12px;
  padding: 12px 16px; font-size: 0.92rem;
}
.trial-banner a { color: var(--teal-dark); font-weight: 650; }
.guide-glow { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 10px;
  animation: guidepulse 1.2s ease-in-out infinite; }
@keyframes guidepulse { 0%,100% { outline-color: rgba(31,156,146,.9);} 50% { outline-color: rgba(31,156,146,.35);} }
.guide-tip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px;
  max-width: 420px; width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.35);
  display: flex; align-items: center; gap: 12px; font-size: 0.92rem; line-height: 1.45;
}
.guide-tip .mini-btn { flex: none; }
.access-requests { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 22px; box-shadow: var(--shadow); margin-bottom: 4px; display: grid; gap: 8px; }
.access-requests .hrow { align-items: center; }

/* ---- login gate: open-door layout ---- */
.gate-or { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 10px 0 2px; }
.gate-btn.secondary { background: #fff; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.gate-btn.secondary:hover { background: #effaf8; }

.locked-teaser { text-align: left; }
.locked-teaser .gate-btn { margin-top: 12px; }
