/* 11 Nov (Fable audit): simpler flow. Loaded last. */
/* fewer choices on screen */
#builder .forensic-menu,
#builder .studio-session,
#builder .sample-speech-btn,
#builder .prompter-hotkey-badge,
#builder .studio-hear,
#builder .studio-hear + .small,
#builder .coach-compose-actions select,
#builder #takes .take button.measure-button,
#builder #takes .take button.measure-button + p,
#builder .easy-hide,
#builder .take > details { display: none !important; }

/* step line */
#builder .easy-step { margin: 4px 0 18px; padding: 12px 16px; border-left: 3px solid #c0392b; background: rgba(255,255,255,.55); border-radius: 0 10px 10px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
#builder .easy-step p { margin: 0; flex: 1 1 260px; font-size: 15px; line-height: 1.5; color: #2b2722; }
#builder .easy-link { background: none; border: 0; padding: 0; color: #2b2722; text-decoration: underline; font-size: 14px; cursor: pointer; }
#builder .easy-warn { flex-basis: 100%; margin: 0; color: #b02a20; font-weight: 600; }
#builder .easy-cta { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 999px; }

/* "Write my speech" inside the chat */
#builder .easy-write-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 10px 0; padding: 12px 14px; border: 2px solid #2b2722; border-radius: 14px; background: #fffdf7; }
#builder .easy-write-bar[hidden] { display: none; }
#builder .easy-write-bar p { margin: 0; flex: 1 1 220px; font-size: 14px; line-height: 1.45; }

/* chat hidden on Your speech / Practise: main column takes the full width */
#builder.easy-nochat .stage-with-coach { grid-template-columns: minmax(0, 1fr) !important; display: block !important; }
#builder.easy-nochat .shared-coach { display: none !important; }
#builder.easy-nochat .studio-content { max-width: 900px; margin: 0 auto; }

/* mic: obvious listening state */
#builder .coach-mic[aria-pressed="true"] { animation: easyPulse 1.1s ease-in-out infinite; }
@keyframes easyPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(189,56,56,.55); } 50% { box-shadow: 0 0 0 10px rgba(189,56,56,0); } }
#builder .coach-mic[aria-pressed="true"] ~ .coach-mic-caption,
#builder .coach-compose-actions:has(.coach-mic[aria-pressed="true"]) .coach-mic-caption { color: #b02a20 !important; font-weight: 700; }
#builder textarea.coach-interim { color: #6f6a62; }

/* recording */
#builder .easy-rec { margin: 10px 0 0; font-weight: 700; font-size: 18px; color: #b02a20; animation: easyBlink 1.2s steps(2, start) infinite; }
#builder .easy-rec[hidden] { display: none; }
@keyframes easyBlink { to { visibility: hidden; } }
#builder #record-status { display: block !important; position: static !important; margin: 8px 0 0; font-size: 14px; color: #2b2722; min-height: 1em; clip: auto !important; width: auto !important; height: auto !important; overflow: visible !important; }
#builder #record[hidden], #builder #stop[hidden] { display: none !important; }
#builder.easy-recording .recorder { box-shadow: 0 0 0 3px rgba(176,42,32,.35) !important; }

/* review: one big button */
#builder .take .easy-mark { display: block; width: 100%; min-height: 56px; margin: 14px 0 6px; font-size: 18px; border-radius: 14px; }
#builder .take .easy-mark:disabled { opacity: .7; }
#builder .take.easy-marking .easy-mark { animation: easyPulse 1.4s ease-in-out infinite; }
#builder .studio-nav-step:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 700px) {
  #builder .easy-step { margin: 2px 0 12px; padding: 10px 12px; }
  #builder .easy-step p { font-size: 14px; }
  #builder .easy-cta { width: 100%; }
  #builder .easy-write-bar .easy-cta { width: 100%; }
}
#builder .easy-step[hidden]{display:none!important}
#builder .easy-step-chat{margin:0 0 12px}

/* 12 Nov: Send button beside "Want to change the speech?" */
#builder .easy-send-row { display: flex; gap: 8px; align-items: stretch; }
#builder .easy-send-row #revision-request { flex: 1; min-width: 0; font-size: 16px !important; }
#builder .easy-send { flex: none; padding: 0 20px; border: 0; border-radius: 12px; background: #c2372b; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; min-height: 46px; }
#builder .easy-send:disabled { opacity: .6; cursor: wait; }

/* 12 Nov: roomy chat. The chat box fills the screen; only the messages scroll; type box stays at the bottom. */
#builder .shared-coach,
#builder.easy-bigchat:not(.easy-nochat) .shared-coach,
#builder[data-stage="talk"] .shared-coach {
  display: flex !important; flex-direction: column !important;
  height: calc(100dvh - 130px) !important; min-height: 520px !important; max-height: calc(100dvh - 120px) !important;
  overflow: hidden !important; padding: 14px 18px !important;
}
#builder .shared-coach > * { flex: none; }
#builder .shared-coach .coach-panel,
#builder.easy-bigchat .shared-coach .coach-panel {
  flex: 1 1 auto !important; min-height: 0 !important; display: flex !important; flex-direction: column !important;
  height: 100% !important; max-height: none !important; overflow: hidden !important;
}
#builder .shared-coach .coach-panel > * { flex: none; }
#builder .coach-messages,
#builder.easy-bigchat .shared-coach .coach-messages {
  flex: 1 1 auto !important; min-height: 240px !important; height: auto !important; max-height: none !important;
  overflow-y: auto !important; overscroll-behavior: contain !important;
  padding: 8px 4px !important; gap: 10px !important;
}
/* sleek header */
#builder .wingman-stage-header,
#builder.easy-bigchat .wingman-stage-header { padding: 2px 0 6px !important; gap: 10px !important; border-bottom: 1px solid rgba(43,39,34,.08) !important; margin-bottom: 6px !important; }
#builder .wingman-avatar-wrap, #builder .wingman-avatar-img,
#builder.easy-bigchat .wingman-avatar-wrap, #builder.easy-bigchat .wingman-avatar-img { width: 36px !important; height: 36px !important; }
#builder .wingman-stage-header h2,
#builder.easy-bigchat .wingman-stage-header h2 { font-size: 16px !important; margin: 0 !important; display: inline-flex !important; align-items: center !important; gap: 8px !important; }
#builder .wingman-badge-row { display: none !important; }
#builder .wingman-mood,
#builder.easy-bigchat .wingman-mood { font-size: 12px !important; color: #6d645a !important; margin: 1px 0 0 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }

/* compact Step 1 of 4 banner */
#builder .easy-step-chat { padding: 6px 12px !important; margin: 0 0 8px !important; border-left: 3px solid #c2372b !important; background: #fffdf7 !important; font-size: 13px !important; line-height: 1.4 !important; }
#builder .easy-step-chat > p { margin: 0 !important; font-size: 13px !important; }
#builder .easy-step-chat .easy-link { margin-left: 8px; font-size: 12.5px; }

/* streamlined horizontal chip strip for quick starters */
#builder .quick-presets-bar,
#builder.easy-bigchat .quick-presets-bar {
  display: flex !important; flex-direction: row !important; align-items: center !important; gap: 6px !important;
  padding: 4px 0 6px !important; margin: 0 0 4px !important;
  overflow-x: auto !important; white-space: nowrap !important;
  border-bottom: 1px solid rgba(43,39,34,.06) !important;
  scrollbar-width: none !important;
}
#builder .quick-presets-bar::-webkit-scrollbar { display: none; }
#builder .quick-presets-label { font-size: 10px !important; letter-spacing: .08em !important; color: #8c8273 !important; margin-right: 4px !important; flex: none !important; }
#builder .quick-presets-grid { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; }
#builder .quick-preset-chip {
  padding: 4px 10px !important; border-radius: 999px !important; font-size: 12px !important;
  min-height: 26px !important; gap: 4px !important; background: #fff !important; border: 1px solid #cfc4b0 !important;
}
#builder .quick-preset-chip .qp-title { font-size: 12px !important; font-weight: 600 !important; }
#builder .quick-preset-chip .qp-sub { display: none !important; }

#builder .conversation-privacy { display: none !important; }
/* once user has sent something: collapse quick starters to give max space to messages */
#builder .shared-coach.easy-chatting .quick-presets-bar,
#builder .shared-coach.easy-chatting .wingman-mood { display: none !important; }
#builder .shared-coach.easy-chatting .easy-step-chat { padding: 4px 10px !important; margin-bottom: 4px !important; }

/* roomy, readable bubbles (3-4 visible at once) */
#builder .coach-bubble.coach {
  padding: 10px 14px 10px 44px !important;
  border-radius: 12px !important;
  background: rgba(43,39,34,.04) !important;
  border: 1px solid rgba(43,39,34,.08) !important;
}
#builder .coach-bubble.coach:before {
  left: 10px !important; top: 10px !important; width: 24px !important; height: 24px !important;
}
#builder .coach-speaker { font-size: 10.5px !important; letter-spacing: .06em !important; text-transform: uppercase !important; color: #6d645a !important; margin-bottom: 2px !important; }
#builder .coach-bubble p { font-size: 14.5px !important; line-height: 1.5 !important; margin: 2px 0 0 !important; }
#builder .coach-bubble.user {
  padding: 8px 14px !important; border-radius: 12px 12px 2px 12px !important; font-size: 14px !important; line-height: 1.45 !important;
}

/* snug, responsive composer */
#builder .coach-compose { padding: 6px 10px !important; margin-top: auto !important; border-top: 1px solid rgba(43,39,34,.08) !important; }
#builder .coach-typing textarea { min-height: 40px !important; max-height: 76px !important; font-size: 14px !important; padding: 8px 84px 8px 8px !important; }
@media (max-width: 760px) {
  #builder .shared-coach,
  #builder.easy-bigchat:not(.easy-nochat) .shared-coach { height: calc(100dvh - 110px) !important; min-height: 440px !important; padding: 10px 12px !important; }
  #builder .wingman-avatar-wrap, #builder .wingman-avatar-img { width: 30px !important; height: 30px !important; }
  #builder .wingman-mood { display: none !important; }
  #builder .coach-messages { padding: 4px 2px !important; }
}

/* 12 Nov: mic for "Want to change the speech?" */
#builder .easy-rev-mic { flex: none; width: 46px; min-height: 46px; border: 0; border-radius: 50%; background: #c2372b; color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
#builder .easy-rev-mic svg { width: 20px; height: 20px; }
#builder .easy-rev-mic.on { animation: easyMicPulse 1.1s ease-in-out infinite; }
@keyframes easyMicPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(194,55,43,.45); } 50% { box-shadow: 0 0 0 8px rgba(194,55,43,0); } }
#builder .easy-rev-hint { margin: 6px 0 0; font-size: 13.5px; color: #6b6156; }
@media (max-width: 760px) {
  #builder .easy-send-row { flex-wrap: wrap; }
  #builder .easy-send-row #revision-request { order: -1; flex: 1 1 100%; }
  #builder .easy-send-row .easy-send { flex: 1 1 auto; }
}
#builder .easy-rev-mic { height: 46px; align-self: center; }

/* ===== 12 Nov v2 ===== */
/* skip link while the bird is still asking */
#builder .easy-skip[hidden] { display: none; }

/* numbers panel: plain words + tap to explain */
#builder .benchmark-telemetry .bm-sub { margin: 4px 0 0; font-size: 14px; color: #5a5249; }
#builder .bm-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#builder .bm-top .bm-pill { margin-left: auto; }
#builder .bm-label { text-transform: none !important; letter-spacing: 0 !important; font-size: 15px !important; font-weight: 600; color: #2b2722; }
#builder .bm-info { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 1.5px solid #2b2722; background: #fffdf7; color: #2b2722; font-size: 15px; line-height: 1; cursor: pointer; flex: none; }
#builder .bm-info.on { background: #2b2722; color: #fffdf7; }
#builder .bm-value { font-size: 22px !important; }
#builder .bm-small { display: block; font-size: 13.5px; color: #5a5249; margin: 2px 0 6px; }
#builder .bm-explain { margin-top: 10px; padding: 10px 12px; background: #fff; border: 1px solid #e3d9c6; border-radius: 10px; }
#builder .bm-explain[hidden] { display: none; }
#builder .bm-explain p { margin: 0 0 6px; font-size: 14px; line-height: 1.45; color: #2b2722; }
#builder .bm-explain p:last-child { margin-bottom: 0; }
#builder .bm-explain .bm-fix { color: #b02a20; font-weight: 600; }

/* Results page header */
#builder .rs-head { margin: 0 0 22px; padding: 20px 22px; background: #fffdf7; border: 2px solid #2b2722; border-radius: 16px; display: grid; gap: 16px; }
#builder .rs-eyebrow { display: block; font-size: 12px; letter-spacing: .12em; color: #6d645a; font-weight: 600; }
#builder .rs-top { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; }
#builder .rs-total { margin: 2px 0 4px; font-family: Fraunces, Georgia, serif; line-height: 1; }
#builder .rs-total strong { font-size: 64px; color: #2b2722; }
#builder .rs-total span { font-size: 26px; color: #6d645a; }
#builder .rs-change { margin: 0; font-size: 15px; line-height: 1.45; max-width: 46ch; }
#builder .rs-change.up, #builder .rs-moves .up { color: #2f6b3a; font-weight: 600; }
#builder .rs-change.down, #builder .rs-moves .down { color: #b02a20; }
#builder .rs-hchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
#builder .rs-hchip { padding: 4px 10px; border-radius: 999px; border: 1px solid #cfc4b0; font-size: 14px; background: #fff; }
#builder .rs-hchip.now { background: #2b2722; color: #fffdf7; border-color: #2b2722; }
#builder .rs-moves p { margin: 0 0 4px; font-size: 15px; line-height: 1.45; }
#builder .rs-moves .rs-measured { color: #5a5249; font-size: 14px; }
#builder .rs-focus { padding: 14px 16px; border-left: 3px solid #c0392b; background: rgba(192,57,43,.06); border-radius: 0 12px 12px 0; }
#builder .rs-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
#builder .rs-steps[hidden] { display: none; }
#builder .rs-step { padding: 4px 10px; border-radius: 999px; font-size: 13.5px; border: 1px dashed #b9ad98; color: #6d645a; }
#builder .rs-step.done { border-style: solid; border-color: #2f6b3a; color: #2f6b3a; }
#builder .rs-step.done::before { content: '✓ '; }
#builder .rs-step.now { border: 2px solid #c0392b; color: #c0392b; font-weight: 700; }
#builder .rs-focus-h { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #2b2722; }
#builder .rs-focus-tip { margin: 0; font-size: 15px; line-height: 1.5; }
#builder .rs-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#builder .rs-actions button { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 999px; }
#builder .rs-reset { justify-self: start; background: none; border: 0; padding: 0; min-height: 0; font-size: 13px; color: #6d645a; text-decoration: underline; cursor: pointer; }
/* on the Results page the old heading block + take picker get out of the way */
#builder.easy-results #studio-pane-review .feedback-result > h2:first-child { display: none; }
@media (max-width: 600px) {
  #builder .rs-head { padding: 16px; }
  #builder .rs-total strong { font-size: 52px; }
  #builder .rs-actions button { flex: 1 1 100%; }
}

/* recording bar stays on screen while you scroll (never hunt for Finish): easy.js adds easy-rec-float
   when the bar has scrolled out of view during a recording */
#builder .recorder.easy-rec-float { position: fixed !important; z-index: 60; left: 50%; transform: translateX(-50%); top: 78px; width: min(880px, calc(100vw - 24px)); box-shadow: 0 10px 30px rgba(43,39,34,.25); background: #fffdf7; }
html.easy-floating #builder .studio-pane, html.easy-floating #builder .studio-pane * { animation: none !important; }
html.easy-floating #builder .studio-pane { transform: none !important; }
@media (max-width: 600px) {
  #builder .recorder.easy-rec-float { top: auto !important; bottom: 12px !important; left: 10px !important; right: 10px !important; width: auto !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; transform: none !important; }
  #builder .recorder.easy-rec-float #stop { white-space: nowrap; }
}

/* ===== 12 Nov v4: My results = one-screen dashboard (myresults.js) ===== */
#builder .easy-mytab .step-number { color: #c0392b !important; font-size: 14px !important; }
#builder[data-stage="results"] .studio-content { max-width: 1200px !important; }
#builder .my-results[hidden] { display: none; }
#builder .my-results .rs-eyebrow { font-size: 11.5px; }

/* Dashboard layout: Laptop left ~40%, right ~60% */
#builder .mr-dash,
#builder[data-stage="results"] .mr-dash {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 16px 32px;
  align-items: start;
}

/* Top bar: speech name + take chips + Record next take button */
#builder .mr-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
#builder .mr-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-right: auto;
}
#builder .mr-name .rs-eyebrow { flex-basis: 100%; }
#builder .mr-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.1;
  color: #2b2722;
}
#builder .mr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#builder .mr-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cfc4b0;
  background: #fff;
  font-size: 14px;
  color: #2b2722;
  cursor: pointer;
}
#builder .mr-chip.on {
  background: #2b2722;
  border-color: #2b2722;
  color: #fffdf7;
  font-weight: 600;
}
#builder .mr-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}
#builder .mr-acts button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}
#builder .mr-chat-toggle {
  display: none !important;
}

/* Left ~40%: total score huge, red-pen Caveat, one-sentence overview. No box. */
#builder .mr-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#builder .mr-total {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  line-height: 0.88;
  font-family: Fraunces, Georgia, serif !important;
  color: #2b2722;
  margin: 0;
}
#builder .mr-total-num {
  font-family: Fraunces, Georgia, serif !important;
  font-size: clamp(84px, 8.5vw, 120px) !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em;
}
#builder .mr-total-slash,
#builder .mr-total-max {
  font-family: Fraunces, Georgia, serif !important;
  font-size: clamp(40px, 4vw, 56px) !important;
  font-weight: 400 !important;
  color: #6d645a;
}
#builder .mr-delta-hand {
  font-family: var(--hand, 'Caveat', cursive) !important;
  color: #c0392b !important;
  font-size: clamp(22px, 2vw, 28px) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  margin: 4px 0 8px !important;
}
#builder .mr-overview {
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
  color: #2b2722;
  margin: 0;
  max-width: 360px;
}

/* Right ~60%: 7 plain rows, NO boxes */
#builder .mr-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#builder .mr-row {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(43,39,34,.12);
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
}
#builder .mr-row:last-child {
  border-bottom: 0;
}
#builder .mr-row:hover {
  background: rgba(43,39,34,.035);
}
#builder .mr-row:focus-visible {
  outline: 2px solid #c0392b;
  outline-offset: 2px;
}
#builder .mr-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
#builder .mr-row-name {
  font-weight: 600;
  font-size: 15px;
  color: #2b2722;
  flex: 1;
}

/* 5-segment bar coloured by score (red 1-2, amber 3, green 4-5) */
#builder .mr-bar-5 {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}
#builder .mr-seg {
  width: 20px;
  height: 8px;
  border-radius: 2px;
  background: #e6dccb;
  display: block;
}
/* scores 1-2: red */
#builder .tone-low .mr-seg.on,
#builder .tone-red .mr-seg.on {
  background: #c0392b !important;
}
/* score 3: amber */
#builder .tone-mid .mr-seg.on,
#builder .tone-amber .mr-seg.on {
  background: #c28816 !important;
}
/* scores 4-5: green */
#builder .tone-good .mr-seg.on,
#builder .tone-ok .mr-seg.on,
#builder .tone-green .mr-seg.on {
  background: #2f6b3a !important;
}

#builder .mr-row-num {
  font-family: Fraunces, Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
  color: #2b2722;
  flex: none;
}
#builder .mr-arrow {
  font-weight: 700;
  font-size: 13px;
  min-width: 36px;
  text-align: right;
  flex: none;
}
#builder .mr-arrow.up { color: #2f6b3a; }
#builder .mr-arrow.down { color: #b02a20; }
#builder .mr-arrow.same { color: #8a8073; }

/* Lowest row ONLY: red-pen circle + handwritten "work on this" + its tip */
#builder .mr-row-focus {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 3px;
  padding-left: 2px;
}
#builder .mr-circ {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--hand, 'Caveat', cursive) !important;
  color: #c0392b !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 1px 8px !important;
  border: 1.8px solid #c0392b !important;
  border-radius: 999px !important;
  transform: rotate(-1.5deg);
  white-space: nowrap;
}
#builder .mr-circ svg {
  display: none !important;
}
#builder .mr-focus-tip {
  font-family: var(--hand, 'Caveat', cursive) !important;
  color: #c0392b !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
}

/* Bottom: one thin line of 4 numbers (pace, pauses, fillers, length). No cards. */
#builder .mr-bottom-numbers {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule, #e6dccb);
  padding-top: 12px;
  margin-top: 8px;
  gap: 14px;
}
#builder .mr-num-item {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .12s;
}
#builder .mr-num-item:hover {
  background: rgba(43,39,34,.035);
}
#builder .mr-num-item:focus-visible {
  outline: 2px solid #c0392b;
}
#builder .mr-num-lab {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6d645a;
  font-weight: 600;
}
#builder .mr-num-val {
  font-family: Fraunces, Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: #2b2722;
}

#builder .mr-empty {
  max-width: 640px;
  margin: 20px auto;
  padding: 24px;
  background: #fffdf7;
  border: 2px solid #2b2722;
  border-radius: 16px;
  display: grid;
  gap: 12px;
  justify-items: start;
}
#builder .mr-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #5a5249;
}

/* Detail sheet (page-within-the-page) */
#builder .mr-sheet { position: fixed; inset: 0; z-index: 80; background: rgba(43,39,34,.45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: mrFade .15s ease-out; }
#builder .mr-sheet[hidden] { display: none; }
#builder .mr-panel { width: min(680px, 100%); max-height: min(88dvh, 860px); overflow-y: auto; overscroll-behavior: contain; background: #fbf7ef; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: mrUp .2s ease-out; }
@keyframes mrFade { from { opacity: 0; } } @keyframes mrUp { from { transform: translateY(18px); opacity: 0; } }
#builder .mr-ptop { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fbf7ef; border-bottom: 1px solid #e6dccb; }
#builder .mr-back { all: unset; cursor: pointer; font-weight: 600; font-size: 15px; padding: 6px 4px; }
#builder .mr-pnav { display: flex; gap: 6px; }
#builder .mr-pnav-b { all: unset; cursor: pointer; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #cfc4b0; border-radius: 50%; font-size: 22px; background: #fff; }
#builder .mr-back:focus-visible, #builder .mr-pnav-b:focus-visible { outline: 3px solid #c0392b; outline-offset: 2px; }
#builder .mr-pbody { padding: 18px 24px 26px; display: grid; gap: 14px; }
#builder .mr-ph { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 36px; line-height: 1.1; color: #2b2722; }
#builder .mr-pscore { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
#builder .mr-pscore > strong { font-family: Fraunces, Georgia, serif; font-size: 40px; line-height: 1; }
#builder .mr-dots { display: inline-flex; gap: 4px; }
#builder .mr-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e6dccb; display: block; }
#builder .mr-dots i.on { background: #2b2722; }
#builder .mr-pscore .mr-dots i { width: 13px; height: 13px; }
#builder .my-results ~ * .mr-pover, #builder .mr-pover { margin: 0; font-size: 18px; line-height: 1.45; color: #2b2722; font-weight: 500; }
#builder .mr-psec { padding: 14px 16px; background: #fffdf7; border: 1px solid #e6dccb; border-radius: 12px; }
#builder .mr-psec h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #6d645a; }
#builder .mr-psec p { margin: 0; font-size: 16px; line-height: 1.5; color: #2b2722; }
#builder .mr-hist { display: flex; flex-wrap: wrap; gap: 8px; }
#builder .mr-hist-i { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid #e0d5c1; background: #fff; min-width: 70px; }
#builder .mr-hist-i span { font-size: 12px; color: #6d645a; }
#builder .mr-hist-i strong { font-size: 18px; }
#builder .mr-hist-i.on { border: 2px solid #2b2722; }
#builder .mr-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
#builder .mr-mini-r { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #efe7d8; font-size: 15px; }
#builder .mr-takes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
#builder .mr-take { padding: 14px 16px; background: #fffdf7; border: 1px solid #e3d9c6; border-radius: 12px; display: grid; gap: 6px; }
#builder .mr-take-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#builder .mr-take-score { font-family: Fraunces, Georgia, serif; font-size: 24px; font-weight: 700; }
#builder .mr-take-line { margin: 0; font-size: 14.5px; color: #5a5249; }
#builder .mr-when { color: #6d645a; font-size: 14px; }
#builder .mr-take-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
#builder .mr-audio { flex: 1 1 240px; }
#builder .mr-audio audio { width: 100%; }
#builder .mr-pill { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eee6d8; color: #5a5249; }
#builder .mr-pill.good { background: #e3efe3; color: #2f6b3a; }
#builder .mr-pill.mid { background: #f4ead2; color: #7a5a14; }
#builder .mr-pill.warn { background: #f7dfdb; color: #b02a20; }

/* Laptop screen fit: chat beside results, exactly fits 1440x900 without page scroll */
@media (min-width: 761px) {
  #builder[data-stage="results"] .stage-with-coach {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    align-items: start !important;
  }
  #builder.easy-bigchat:not(.easy-nochat)[data-stage="results"] .shared-coach {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    height: calc(100dvh - var(--ag-stick, 110px) - 48px) !important;
    min-height: 380px !important;
  }
}

/* Phone responsive (390px): stacked total, rows, numbers in 2x2, chat from button */
@media (max-width: 760px) {
  #builder .mr-dash,
  #builder[data-stage="results"] .mr-dash { grid-template-columns: 1fr !important; gap: 16px; }
  #builder .mr-bar { flex-wrap: wrap; gap: 10px; }
  #builder .mr-chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  #builder .mr-chip { flex: none; }
  #builder .mr-acts { width: 100%; display: flex; gap: 8px; }
  #builder .mr-acts button { flex: 1; padding: 0 10px; text-align: center; }
  #builder .mr-total-num { font-size: 68px !important; }
  #builder .mr-total-slash, #builder .mr-total-max { font-size: 34px !important; }
  #builder .mr-delta-hand { font-size: 22px !important; }
  #builder .mr-overview { max-width: none; font-size: 15px; }
  #builder .mr-bottom-numbers {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 14px !important;
    padding-top: 10px;
  }
  #builder .mr-num-item { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
  #builder .mr-sheet { padding: 0; align-items: flex-end; }
  #builder .mr-panel { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  #builder .mr-pbody { padding: 16px 16px 30px; }
  #builder .mr-ph { font-size: 30px; }
  #builder .mr-mini { grid-template-columns: 1fr; }
  #builder .mr-chat-toggle { display: inline-flex !important; }
  #builder.easy-bigchat:not(.easy-nochat)[data-stage="results"] .shared-coach { display: none !important; }
  #builder.easy-bigchat:not(.easy-nochat)[data-stage="results"].mr-coach-open .shared-coach {
    display: flex !important;
    position: fixed !important;
    inset: 48px 10px 10px 10px !important;
    z-index: 100 !important;
    background: #fbf8f1 !important;
    box-shadow: 0 0 0 100vmax rgba(43,39,34,.5), 0 20px 40px rgba(0,0,0,.25) !important;
    border-radius: 16px !important;
    max-height: calc(100dvh - 58px) !important;
    height: auto !important;
    margin: 0 !important;
  }
}
@media (prefers-reduced-motion: reduce) { #builder .mr-sheet, #builder .mr-panel { animation: none; } }


/* ===== 12 Nov v5: tabs pinned, chat on every page, results colour-coded (studio-snap.js) ===== */
#builder.easy-pinnav .studio-nav { position: sticky; top: var(--ag-hdr, 68px); z-index: 40; background: rgba(246,241,233,.97); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (min-width: 761px) {
  #builder.easy-bigchat:not(.easy-nochat) .shared-coach {
    position: sticky !important; top: calc(var(--ag-stick, 110px) + 12px) !important;
    margin-top: 12px !important; margin-bottom: 12px !important;
    height: calc(100dvh - var(--ag-stick, 110px) - 28px - var(--ag-chat-cut, 0px)) !important; min-height: 380px !important;
  }
}
/* My results next to the chat: the dashboard sizes itself to its own width */
#builder[data-stage="results"] .studio-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1200px !important;
}
#builder[data-stage="results"] .my-results {
  padding-top: 10px;
}

/* Quick questions above the chat box on My results */
#builder .mr-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
}
#builder .mr-ask[hidden], #builder:not([data-stage="results"]) .mr-ask {
  display: none !important;
}
#builder .mr-ask-b {
  all: unset;
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #cfc4b0;
  background: #fff;
  font-size: 12.5px;
  color: #2b2722;
  transition: all .12s;
}
#builder .mr-ask-b:hover {
  border-color: #2b2722;
  background: #fbf8f1;
}
#builder .mr-ask-b:focus-visible {
  outline: 2px solid #c0392b;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  #builder[data-stage="results"] .mr-bar {
    flex-wrap: wrap;
  }
}
/* Plan it: the plan panel never makes the page taller than the screen */
@media (min-width: 761px) {
  #builder[data-stage="talk"] .speech-profile { max-height: calc(100dvh - var(--ag-stick, 110px) - 40px - var(--ag-chat-cut, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  #builder[data-stage="talk"] .talk-layout { align-items: start; }
}

/* 12 Nov: phone fix for My results (grid was sizing to its widest item, ~385px, so the right edge was cut off) */
@media (max-width: 760px) {
  #builder .mr-dash,
  #builder[data-stage="results"] .mr-dash { grid-template-columns: minmax(0, 1fr) !important; }
  #builder .mr-dash > *, #builder .mr-bar > *, #builder .mr-left, #builder .mr-rows, #builder .mr-row, #builder .mr-row-main { min-width: 0; max-width: 100%; }
  #builder .mr-bar { width: 100%; }
  #builder .mr-acts { flex-wrap: wrap; }
  #builder .mr-acts button { flex: 1 1 calc(50% - 4px); min-width: 0; white-space: normal; min-height: 44px; }
  #builder .mr-acts .mr-record-next { flex-basis: 100%; order: -1; }
  #builder .mr-total { width: auto; }
}
@media (max-width: 600px) {
  #builder .stage-with-coach { padding-left: 12px !important; padding-right: 12px !important; }
}

/* 12 Nov: Google sign-in slot (landing nav + studio header) */
.ag-auth { display: inline-flex; align-items: center; gap: 10px; font: 500 14px/1.2 "Instrument Sans", system-ui, sans-serif; color: #1F1B16; }
.ag-auth[hidden] { display: none !important; }
.ag-auth-who { display: inline-flex; align-items: center; gap: 8px; }
.ag-auth-who img { width: 28px; height: 28px; border-radius: 50%; }
.ag-auth-out { background: none; border: 0; padding: 0; color: #8A8275; text-decoration: underline; cursor: pointer; font: inherit; }
.ag-auth-err { color: #C2372B; font-size: 12px; }
#builder .ag-auth-builder { margin-left: auto; margin-right: 12px; }
@media (max-width: 600px) {
  #builder .ag-auth-builder { margin-right: 6px; }
  #builder .ag-auth-who { display: none; }
  .pp .p-nav .ag-auth .ag-auth-who span, .pp .p-nav .ag-auth-who { font-size: 13px; }
}
.ag-auth, .ag-auth * { white-space: nowrap; }

/* 12 Nov gap fix: tighter top of each step page (step box already explains the page) */
#builder .studio-pane > .easy-step { margin: 0 0 10px !important; }
#builder .stage-heading { padding: 6px 0 14px !important; }
#builder .stage-heading .studio-eyebrow { margin: 0 0 2px !important; font-size: 19px !important; }
#builder .stage-heading h1 { margin: 0 0 4px !important; font-size: clamp(26px, 2.6vw, 34px) !important; line-height: 1.15 !important; }
#builder .stage-heading p:not(.studio-eyebrow) { margin: 0 !important; font-size: 16px !important; }
#builder .script-start-actions { margin-bottom: 14px !important; }

/* 12 Nov gap fix 2: every page starts at the same spot under the tabs (was centred = different gaps) */
#builder .studio-nav { margin-top: 0 !important; }
#builder .stage-with-coach { align-items: start !important; padding-top: 16px !important; }
#builder .stage-with-coach > .studio-content { padding-top: 0 !important; margin-top: 0 !important; align-self: start !important; }
#builder .stage-with-coach > .shared-coach { margin-top: 0 !important; align-self: start !important; }
#builder .studio-pane { padding-top: 0 !important; margin-top: 0 !important; }
#builder .conversation-canvas { padding-top: 0 !important; }
#builder[data-stage] .stage-with-coach.stage-with-coach { padding-top: 16px !important; }
#builder[data-stage] .stage-with-coach > .shared-coach.shared-coach { margin-top: 0 !important; }
#builder .stage-heading .studio-eyebrow:empty { display: none !important; }
