/* Organization appearance only. Theme changes never remount interview or capture state. */
html[data-org-theme="calm"] {
  color-scheme: light;
  background: #f6f5f0;
}
html[data-org-theme="calm"] body { color: #233b30; }
html[data-org-theme="calm"] #guided-choose,
html[data-org-theme="calm"] #guided-setup,
html[data-org-theme="calm"] .guided-main,
html[data-org-theme="calm"] .guided-side { background: #fffefa; }

html[data-org-theme="pulse"] {
  color-scheme: dark;
  background: #111824;
  color: #edf3fb;
}
html[data-org-theme="pulse"] body,
html[data-org-theme="pulse"] main { background: #111824; color: #edf3fb; }
html[data-org-theme="pulse"] header { border-color: #34445a; }
html[data-org-theme="pulse"] header strong { background: #263d55; color: #e6fbff; }
html[data-org-theme="pulse"] h1,
html[data-org-theme="pulse"] h2,
html[data-org-theme="pulse"] h3,
html[data-org-theme="pulse"] h4,
html[data-org-theme="pulse"] strong { color: #f4f7ff; }
html[data-org-theme="pulse"] p,
html[data-org-theme="pulse"] label,
html[data-org-theme="pulse"] summary,
html[data-org-theme="pulse"] .row { color: inherit; }
html[data-org-theme="pulse"] button,
html[data-org-theme="pulse"] input,
html[data-org-theme="pulse"] textarea,
html[data-org-theme="pulse"] select {
  background: #253449;
  border: 1px solid #526783;
  color: #f4f7fc;
}
html[data-org-theme="pulse"] input::placeholder,
html[data-org-theme="pulse"] textarea::placeholder { color: #aebed0; opacity: 1; }
html[data-org-theme="pulse"] select option { background: #1e2b3d; color: #f4f7fc; }
html[data-org-theme="pulse"] button:hover:not(:disabled) { background: #344861; border-color: #73cce1; }
html[data-org-theme="pulse"] button:focus-visible,
html[data-org-theme="pulse"] input:focus-visible,
html[data-org-theme="pulse"] textarea:focus-visible,
html[data-org-theme="pulse"] select:focus-visible,
html[data-org-theme="pulse"] summary:focus-visible {
  outline: 3px solid #73deef;
  outline-offset: 2px;
}
html[data-org-theme="pulse"] article,
html[data-org-theme="pulse"] details,
html[data-org-theme="pulse"] #workspace .hub-panel,
html[data-org-theme="pulse"] #pilot-home,
html[data-org-theme="pulse"] #supervisor-workspace,
html[data-org-theme="pulse"] #coaching-workspace {
  background: #1c2839;
  border-color: #3b506a;
  color: #edf3fb;
}
html[data-org-theme="pulse"] .row,
html[data-org-theme="pulse"] .guided-answer-row { border-color: #34445a; }
html[data-org-theme="pulse"] .boundary,
html[data-org-theme="pulse"] #call-bar,
html[data-org-theme="pulse"] #fictional-mfa-waiver,
html[data-org-theme="pulse"] #headset-companion .headset-boundary {
  background: #383124;
  color: #fff0cc;
  border-color: #b89451;
}
html[data-org-theme="pulse"] #clinic-status,
html[data-org-theme="pulse"] #active-workspace,
html[data-org-theme="pulse"] #supervisor-coaching,
html[data-org-theme="pulse"] .coaching-label {
  background: #202d40;
  color: #ecf4ff;
  border-color: #9d8ae8;
}
html[data-org-theme="pulse"] #headset-companion,
html[data-org-theme="pulse"] #headset-companion .headset-sources>div,
html[data-org-theme="pulse"] #headset-companion #headset-readiness,
html[data-org-theme="pulse"] #headset-capture-banner {
  background: #203447;
  color: #eaf7ff;
  border-color: #5da9bb;
}
html[data-org-theme="pulse"] #headset-companion #headset-error,
html[data-org-theme="pulse"] #headset-interview-warning { color: #ffb4ac; }
html[data-org-theme="pulse"] #message { color: #ffd595; }
html[data-org-theme="pulse"] .campaign-preview>div,
html[data-org-theme="pulse"] #campaign-desktop-preview,
html[data-org-theme="pulse"] #campaign-mobile-preview { background: #202d40; border-color: #465b77; color: #edf3fb; }

/* One stable, compact guided layout in both appearances. */
main:has(#guided-workspace:not([hidden])) { max-width: 1440px; padding: 12px clamp(14px, 2vw, 28px) 28px; }
#guided-workspace { margin: 4px 0 16px; }
#guided-workspace .guided-heading { margin: 0 0 6px; }
#guided-workspace .guided-heading h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
#guided-workspace .eyebrow { font-size: .68rem; margin-bottom: 1px; }
#guided-status {
  position: static;
  min-height: 0;
  padding: 8px 12px;
  font-size: .85rem;
  line-height: 1.35;
  white-space: normal;
}
.guided-steps { margin: 8px 0 12px; }
.guided-steps button { min-height: 40px; padding: 8px 12px; font-size: .87rem; }
#guided-choose,#guided-setup { min-height: 0; padding: clamp(18px, 2.5vw, 28px); }
.guided-intro { margin-bottom: 14px; }
.guided-layout { grid-template-columns: minmax(0,1fr) 288px; gap: 16px; }
#guided-workspace .guided-main { min-height: 0; padding: clamp(20px, 2.5vw, 34px); }
.guided-side { top: 14px; padding: 16px; min-height: 310px; }
.guided-side nav { margin-bottom: 12px; }
.guided-side nav button { min-height: 38px; }
.guided-side details { margin-top: 16px; }
#guided-workspace #interview-detail>h3 { font-size: 1rem; margin: 0 0 8px; }
.interview-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid #dce5dc;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
#guided-workspace #interview-control-status { margin: 0; font-size: .86rem; font-weight: 600; flex: 1; }
.interview-control-row button { padding: 6px 10px; font-size: .8rem; }
#guided-workspace .question-progress { display: inline-block; margin: 0 0 12px; padding: 5px 10px; border-radius: 100px; background: #ebf3eb; color: #285742; }
#guided-workspace .current-script {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.26;
  letter-spacing: -.025em;
  max-width: 39ch;
  margin: 0 0 23px;
  min-height: 0;
  font-weight: 650;
}
#guided-workspace .answer-area { max-width: 760px; }
#guided-workspace .answer-area label { margin: 0 0 7px; font-size: .9rem; }
#guided-workspace .answer-area textarea { min-height: 102px; }
#guided-workspace .answer-help { margin: 5px 0; font-size: .85rem; }
#guided-workspace #interview-answer-state { margin: 8px 0; min-height: 0; font-size: .85rem; }
#guided-workspace .answer-actions,
#guided-workspace #headset-interview-capture .headset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
#guided-workspace .answer-actions button,
#guided-workspace #headset-interview-capture .headset-actions button { min-height: 42px; padding: 9px 14px; }
#guided-workspace .answer-actions button:first-child { order: 3; }
#guided-workspace .answer-actions button:nth-child(2) { order: 1; }
#guided-workspace .answer-actions button:nth-child(3) { order: 2; }
#headset-interview-previous { order: 1; }
#headset-interview-repeat { order: 2; }
#headset-interview-finish { order: 3; }
#headset-interview-pause,#headset-interview-resume { order: 4; }
#headset-interview-end { order: 5; }
#headset-mock-start,#headset-provider-start { order: 3; }
#guided-workspace .guided-main:has(#headset-interview-end:not([hidden])) .answer-actions button:first-child {
  background: transparent;
  color: inherit;
  border-color: #9caea2;
  font-weight: 500;
}
#guided-workspace #headset-interview-capture { margin-top: 14px; padding-top: 12px; }
#guided-workspace #headset-interview-state { margin: 0 0 6px; min-height: 0; font-size: .88rem; }
#guided-workspace #headset-mock-controls { padding: 14px; }
#guided-workspace #headset-mock-controls h3 { margin-bottom: 4px; font-size: 1rem; }
#guided-workspace #headset-mock-controls p { margin: 4px 0 12px; font-size: .84rem; }
#guided-workspace .practice-actions button { min-height: 42px; }
#guided-workspace .interview-submit { background: #275743; color: #fff; font-weight: 700; margin-top: 10px; }
#guided-workspace #guided-side-help p { font-size: .9rem; line-height: 1.45; }

/* Pulse overrides every guided panel, feedback surface and selected control. */
html[data-org-theme="pulse"] #guided-choose,
html[data-org-theme="pulse"] #guided-setup,
html[data-org-theme="pulse"] #guided-workspace .guided-main,
html[data-org-theme="pulse"] #guided-workspace .guided-side {
  background: #1b2738;
  border-color: #3a4d66;
  color: #edf3fb;
}
html[data-org-theme="pulse"] #guided-status {
  background: #1c3440;
  color: #d8f5fa;
  border-color: #39788c;
}
html[data-org-theme="pulse"] .guided-intro p,
html[data-org-theme="pulse"] .eyebrow,
html[data-org-theme="pulse"] #guided-workspace #interview-detail>h3,
html[data-org-theme="pulse"] #guided-workspace #interview-control-status,
html[data-org-theme="pulse"] #guided-workspace .guided-side details { color: #aebfd3; }
html[data-org-theme="pulse"] .guided-steps button,
html[data-org-theme="pulse"] #guided-modes button,
html[data-org-theme="pulse"] #guided-chooser .row {
  background: #253449;
  border-color: #49607b;
  color: #edf3fb;
}
html[data-org-theme="pulse"] #guided-workspace .guided-steps button[aria-current="step"],
html[data-org-theme="pulse"] #guided-workspace .guided-side nav button[aria-pressed="true"] {
  background: #4a4078;
  border-color: #9c8ee7;
  color: #fff;
}
html[data-org-theme="pulse"] #guided-modes button[aria-pressed="true"] { background: #233e51; border-color: #68cbdf; }
html[data-org-theme="pulse"] #guided-mode-note,
html[data-org-theme="pulse"] #headset-mock-controls {
  background: #203246;
  color: #e9f2fb;
  border-color: #5f85a4;
}
html[data-org-theme="pulse"] #guided-workspace .question-progress { background: #263e57; color: #b9ecf4; }
html[data-org-theme="pulse"] #guided-workspace .current-script { color: #fff; }
html[data-org-theme="pulse"] #guided-workspace #interview-answer-state,
html[data-org-theme="pulse"] #guided-workspace .answer-status[data-state="saved"] { color: #a5ebd5; }
html[data-org-theme="pulse"] #guided-workspace .answer-status[data-state="review"] { color: #ffd4a2; }
html[data-org-theme="pulse"] .interview-control-row,
html[data-org-theme="pulse"] #guided-workspace #headset-interview-capture { border-color: #394f68; }
html[data-org-theme="pulse"] #guided-workspace #guided-continue,
html[data-org-theme="pulse"] #guided-workspace .answer-actions button:first-child,
html[data-org-theme="pulse"] #guided-workspace #headset-interview-finish,
html[data-org-theme="pulse"] #guided-workspace #headset-mock-start,
html[data-org-theme="pulse"] #guided-workspace .interview-submit {
  background: #176879;
  border-color: #74d6e6;
  color: #fff;
  font-weight: 700;
}
html[data-org-theme="pulse"] #guided-workspace .guided-main:has(#headset-interview-end:not([hidden])) .answer-actions button:first-child {
  background: transparent;
  border-color: #526783;
  color: #dce8f6;
  font-weight: 500;
}
html[data-org-theme="pulse"] #guided-workspace .interview-conflict,
html[data-org-theme="pulse"] #guided-workspace .conflict-panel,
html[data-org-theme="pulse"] #move-control-confirm,
html[data-org-theme="pulse"] #guided-diagnostics {
  background: #352d34;
  color: #ffe9df;
  border-color: #b98465;
}
html[data-org-theme="pulse"] #guided-workspace .conflict-values>div { background: #272d3c; border-color: #846d74; }
html[data-org-theme="pulse"] #guided-workspace .guided-answer-row { border-color: #37485e; }
html[data-org-theme="pulse"] #guided-side-setup p,
html[data-org-theme="pulse"] #guided-side-help p { color: #d5e1ee; }

@media (max-width: 1050px) {
  .guided-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 12px; }
  #guided-workspace .guided-main { padding: 20px; }
}
@media (max-width: 780px) {
  .guided-layout { display: block; }
  .guided-side { position: static; min-height: 0; margin-top: 12px; }
  #guided-workspace .guided-main { min-height: 0; }
  .guided-steps button { font-size: .76rem; padding: 7px; }
}
@media (max-width: 500px) {
  .guided-heading { flex-wrap: wrap; }
  #guided-workspace .answer-actions button,
  #guided-workspace #headset-interview-capture .headset-actions button { flex: 1 1 100%; }
  .interview-control-row { align-items: flex-start; }
}

/* Legacy Pulse declarations in style.css use two IDs; these final selectors
   deliberately outrank them until the older workspaces migrate to variables. */
html[data-org-theme="pulse"] #workspace #guided-choose,
html[data-org-theme="pulse"] #workspace #guided-setup,
html[data-org-theme="pulse"] #workspace .guided-main,
html[data-org-theme="pulse"] #workspace .guided-side {
  background: #1b2738;
  border-color: #3a4d66;
  color: #edf3fb;
}
html[data-org-theme="pulse"] #workspace #guided-status {
  background: #1c3440;
  color: #d8f5fa;
  border-color: #39788c;
}
html[data-org-theme="pulse"] #workspace #guided-mode-note,
html[data-org-theme="pulse"] #workspace #headset-mock-controls {
  background: #203246;
  color: #e9f2fb;
  border-color: #5f85a4;
}
html[data-org-theme="pulse"] #workspace .guided-steps button[aria-current="step"],
html[data-org-theme="pulse"] #workspace .guided-side nav button[aria-pressed="true"] {
  background: #4a4078;
  border-color: #9c8ee7;
  color: #fff;
}
html[data-org-theme="pulse"] #workspace #guided-continue,
html[data-org-theme="pulse"] #workspace .save-answer,
html[data-org-theme="pulse"] #workspace #headset-mock-start,
html[data-org-theme="pulse"] #workspace #headset-interview-finish,
html[data-org-theme="pulse"] #workspace #guided-workspace .answer-actions button:first-child {
  background: #176879;
  border-color: #74d6e6;
  color: #fff;
}
html[data-org-theme="pulse"] #workspace #guided-workspace .guided-main:has(#headset-interview-end:not([hidden])) .answer-actions button:first-child {
  background: transparent;
  border-color: #526783;
  color: #dce8f6;
}
html[data-org-theme="pulse"] #workspace #guided-workspace .interview-conflict,
html[data-org-theme="pulse"] #workspace #guided-workspace .conflict-panel,
html[data-org-theme="pulse"] #workspace #guided-diagnostics {
  background: #352d34;
  color: #ffe9df;
  border-color: #b98465;
}
html[data-org-theme="pulse"] #workspace #headset-companion,
html[data-org-theme="pulse"] #workspace #headset-companion #headset-readiness,
html[data-org-theme="pulse"] #workspace #headset-capture-banner {
  background: #203447;
  border-color: #5da9bb;
  color: #eaf7ff;
}
html[data-org-theme="pulse"] #workspace #supervisor-workspace,
html[data-org-theme="pulse"] #workspace #coaching-workspace,
html[data-org-theme="pulse"] #workspace #pilot-home,
html[data-org-theme="pulse"] #workspace .hub-panel {
  background: #1c2839;
  border-color: #3b506a;
  color: #edf3fb;
}
html[data-org-theme="pulse"] #workspace .hub-nav button {
  background: #253449;
  border-color: #526783;
  color: #f4f7fc;
}
html[data-org-theme="pulse"] #workspace .hub-nav button:hover:not(:disabled) { background: #344861; }
html[data-org-theme="pulse"] #workspace #guided-diagnostics {
  background: #202d40;
  border-color: #465b77;
  color: #d5e1ee;
}
html[data-org-theme="pulse"] #workspace #guided-chooser .row,
html[data-org-theme="pulse"] #workspace #fictional-mfa-waiver {
  background: #253449;
  border-color: #526783;
  color: #f4f7fc;
}
html[data-org-theme="pulse"] #workspace .hub-heading,
html[data-org-theme="pulse"] #workspace .coaching-label { color: #edf3fb; }
html[data-org-theme="pulse"] #workspace .coaching-label {
  background: #29314e;
  border-color: #a997f5;
}
html[data-org-theme="pulse"] #workspace #campaign-desktop-preview,
html[data-org-theme="pulse"] #workspace #campaign-mobile-preview {
  background: #202d40;
  border-color: #465b77;
  color: #edf3fb;
}

/* Before mock capture starts, Start is primary. A typed unsaved answer makes
   Save primary instead; neither choice changes the answer or capture state. */
#guided-workspace .answer-actions button:first-child {
  background: transparent;
  color: inherit;
  border-color: #9caea2;
  font-weight: 500;
}
#guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) .answer-actions button:first-child {
  background: #275743;
  border-color: #275743;
  color: #fff;
  font-weight: 700;
}
#guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) #headset-mock-start,
#guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) #headset-interview-finish {
  background: transparent;
  border-color: #9caea2;
  color: inherit;
  font-weight: 500;
}
html[data-org-theme="pulse"] #workspace #guided-workspace .answer-actions button:first-child {
  background: transparent;
  border-color: #526783;
  color: #dce8f6;
  font-weight: 500;
}
html[data-org-theme="pulse"] #workspace #guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) .answer-actions button:first-child {
  background: #176879;
  border-color: #74d6e6;
  color: #fff;
  font-weight: 700;
}
html[data-org-theme="pulse"] #workspace #guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) #headset-mock-start,
html[data-org-theme="pulse"] #workspace #guided-workspace .guided-main:has(.answer-area[data-dirty="true"]) #headset-interview-finish {
  background: transparent;
  border-color: #526783;
  color: #dce8f6;
  font-weight: 500;
}
main:has(#guided-workspace:not([hidden])) #workspace>p.boundary { display: none; }
