
:root{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#e9eef8;background:#0b1020;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}.app{max-width:1500px;margin:auto;padding:20px 24px 80px}header{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #26314b;padding-bottom:18px;flex-wrap:wrap}h1{margin:0;font-size:24px;letter-spacing:-.6px}h1 span{color:#70d8b2}small,.muted{color:#9aa9c5}.headright,.flex,.tabs,.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.pill{background:#152139;color:#a7bce1;padding:5px 10px;border-radius:20px;font-size:12px}.btn{border:1px solid #3a4a69;background:#1c2942;color:#e8efff;padding:9px 12px;border-radius:9px}.btn:hover{background:#2b3d5e}.btn.primary{background:#4f85e8;border-color:#4f85e8;color:#fff}.btn.green{background:#176d59;border-color:#258e73}.btn.danger{color:#ffb1b1}.btn.small{padding:5px 9px;font-size:12px}.nav{display:flex;gap:7px;margin:20px 0}.nav button{background:transparent;border:1px solid #2d3b58;color:#a8b8d2;padding:11px 17px;border-radius:10px}.nav button.active{background:#1e365d;color:white;border-color:#6096ef}.panel{background:#111b30;border:1px solid #2a3854;border-radius:14px;padding:18px;margin:14px 0}.panel h2{margin:0 0 7px;font-size:18px}.panel h3{margin:0 0 10px;font-size:15px}.panelhead{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.three{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}label{display:block;color:#c2d0e6;font-weight:600;margin:10px 0 5px}input,select,textarea{width:100%;background:#0b1427;color:#f0f5ff;border:1px solid #364866;border-radius:8px;padding:10px;outline:none}input:focus,select:focus,textarea:focus{border-color:#6d9ef1}textarea{resize:vertical;min-height:70px}.hint{color:#92a5c4;font-size:12px;margin:7px 0}.item{border:1px solid #33435f;background:#152139;border-radius:11px;padding:14px;margin:12px 0}.item.selected{border-color:#6d9ef1}.itemtitle{font-weight:700}.rule{border-top:1px solid #30405d;margin:14px 0}.badge{display:inline-block;background:#254365;border-radius:6px;padding:3px 7px;font-size:11px;color:#b8d8ff}.script-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}.script-tabs button{border:1px solid #344666;border-radius:9px;padding:9px 13px;color:#c0d1ee;background:#17233c}.script-tabs button.active{background:#365e9e;color:white}.choice{border:1px solid #45608a;background:#1a2a46;color:#e8efff;padding:9px 12px;border-radius:8px;margin:4px 6px 4px 0}.choice.active{background:#3564ad;border-color:#82b0fa}.question{margin:12px 0 16px;padding:12px 14px;border-left:3px solid #4e89e7;background:#121f36;border-radius:0 9px 9px 0}.conditional{margin:12px 0 6px 20px;padding-left:12px;border-left:2px dashed #537ba9}.question-title{font-weight:700;margin-bottom:6px}.section{padding:17px;margin:14px 0;border:1px solid #34435d;border-radius:12px;background:#101b30}.section h3{font-size:17px;color:#a8ccff}.note{min-height:145px}.runlayout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px}.sticky{position:sticky;top:12px;align-self:start}.drawer{position:fixed;right:0;top:25%;z-index:15;display:flex;align-items:flex-start;pointer-events:none}.category-rail{display:flex;flex-direction:column;gap:5px;pointer-events:auto}.railbtn{max-width:110px;min-width:92px;padding:11px 6px;border-radius:9px 0 0 9px;border:1px solid #6d91ca;background:#2b518b;color:white;font-size:12px}.railbtn.active{background:#558ce3}.drawer-body{width:310px;max-height:55vh;overflow:auto;background:#16243c;border:1px solid #45638f;border-right:0;border-radius:10px 0 0 10px;padding:14px;pointer-events:auto;box-shadow:0 10px 40px #0009}.drawer-body button{display:block;width:100%;text-align:left;margin:7px 0}.backdrop{position:fixed;inset:0;background:#050913c9;z-index:30;display:flex;justify-content:center;align-items:center;padding:22px}.modal{background:#14213a;border:1px solid #5b77a2;border-radius:14px;padding:22px;width:min(860px,96vw);max-height:90vh;overflow:auto;box-shadow:0 30px 100px #000a}.modal .grid{grid-template-columns:repeat(3,minmax(0,1fr))}.modal li{margin:8px 0;line-height:1.5}.option{border:1px solid #344c70;padding:9px;border-radius:8px;margin:7px 0;background:#1a2b48}.empty{padding:30px;text-align:center;color:#a5b6d1;border:1px dashed #465675;border-radius:12px}.help{padding:12px;background:#192c46;border-left:3px solid #75c7a9;border-radius:7px;margin:12px 0}.right{text-align:right}.hidden{display:none!important}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#2c735e;color:white;border-radius:10px;padding:12px 18px;display:none;z-index:99}@media(max-width:900px){.grid,.three,.runlayout,.modal .grid{grid-template-columns:1fr}.sticky{position:static}.app{padding:14px}.drawer{top:20%}}
.builder-layout{display:grid;grid-template-columns:minmax(280px,1fr) minmax(400px,1.3fr);gap:16px;align-items:start}.builder-editor{position:sticky;top:10px;max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain}.builder-editor>.panel{margin-top:0}.category-list{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.response-grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important}@media(max-width:850px){.builder-layout{grid-template-columns:1fr}.builder-editor{position:static;max-height:none;overflow:visible}}
.color-picker{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.color-picker input[type=color]{width:54px;height:38px;padding:3px;cursor:pointer}.swatch{width:25px;height:25px;border-radius:7px;border:2px solid #ffffff77;padding:0}.section{border-left:6px solid var(--section-color,#4e89e7)}.section h3{color:var(--section-color,#a8ccff)}.note-field-list{max-height:320px;overflow:auto;border:1px solid #34435d;border-radius:9px;padding:8px}.note-field-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px;border-bottom:1px solid #26314b}.note-field-row:last-child{border-bottom:0}.note-field-row small{display:block}.note-builder-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.8fr);gap:14px}@media(max-width:900px){.note-builder-card{grid-template-columns:1fr}}


/* Keep custom accent colors; use neutral, readable text in the light theme. */
:root{color-scheme:dark}
:root[data-theme="light"]{color-scheme:light;color:#17263b;background:#f3f5f8}
[data-theme="light"] header{border-color:#cdd5df}
[data-theme="light"] h1 span{color:#08674e}
[data-theme="light"] small,[data-theme="light"] .muted,[data-theme="light"] .hint{color:#4e6077}
[data-theme="light"] .pill{background:#e4ebf2;color:#334b68}
[data-theme="light"] .btn{background:#fff;color:#243b58;border-color:#acbbcd}
[data-theme="light"] .btn:hover{background:#eaf0f7}
[data-theme="light"] .btn.primary{background:#245fc5;border-color:#245fc5;color:#fff}
[data-theme="light"] .btn.primary:hover{background:#1d4fa5}
[data-theme="light"] .btn.green{background:#14634f;border-color:#14634f;color:#fff}
[data-theme="light"] .btn.danger{color:#a7192d}
[data-theme="light"] .nav button{background:#fff;border-color:#acbbcd;color:#334b68}
[data-theme="light"] .nav button.active,[data-theme="light"] .script-tabs button.active{background:#245fc5;border-color:#245fc5;color:#fff}
[data-theme="light"] .panel,[data-theme="light"] .section{background:#fff;border-top-color:#c6d0dc;border-right-color:#c6d0dc;border-bottom-color:#c6d0dc}
[data-theme="light"] .panel{border-left-color:#c6d0dc}
[data-theme="light"] .section h3{color:#243b58}
[data-theme="light"] label{color:#243b58}
[data-theme="light"] input,[data-theme="light"] select,[data-theme="light"] textarea{background:#fff;color:#17263b;border-color:#9aaec4}
[data-theme="light"] input::placeholder,[data-theme="light"] textarea::placeholder{color:#65758b;opacity:1}
[data-theme="light"] input:focus,[data-theme="light"] select:focus,[data-theme="light"] textarea:focus{border-color:#245fc5;box-shadow:0 0 0 2px #245fc526}
[data-theme="light"] textarea[readonly]{background:#f3f6fa}
[data-theme="light"] .item{background:#f3f6fa;border-color:#c6d0dc}
[data-theme="light"] .item.selected{border-color:#245fc5}
[data-theme="light"] .rule,[data-theme="light"] .note-field-row{border-color:#d2dbe5}
[data-theme="light"] .badge{background:#e0ebfa;color:#244a78}
[data-theme="light"] .script-tabs button{background:#fff;color:#334b68;border-color:#acbbcd}
[data-theme="light"] .choice{background:#edf3fc;color:#243b58;border-color:#9aaec4}
[data-theme="light"] .choice.active{background:#245fc5;color:#fff;border-color:#245fc5}
[data-theme="light"] .question{background:#edf3fc}
[data-theme="light"] .conditional{border-color:#7d98b9}
[data-theme="light"] .drawer-body,[data-theme="light"] .modal{background:#fff;border-color:#9aaec4;box-shadow:0 12px 45px #17263b26}
[data-theme="light"] .backdrop{background:#17263b66}
[data-theme="light"] .option{background:#f3f6fa;border-color:#c6d0dc}
[data-theme="light"] .empty{color:#4e6077;border-color:#9aaec4}
[data-theme="light"] .help{background:#e7f2ed;border-left-color:#14785a}
[data-theme="light"] .swatch{border-color:#17263b55}
[data-theme="light"] .note-field-list{border-color:#c6d0dc}
button:focus-visible{outline:3px solid #6d9ef1;outline-offset:3px}
/* Viewport-bounded category navigation, with accent-only category colors. */
.drawer{top:20%;bottom:16px;max-width:100vw;gap:6px}
.category-rail{max-height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:3px 0 3px 3px;min-width:0}
.railbtn{flex-shrink:0;background:#17233c;color:#e9eef8;border:1px solid #45608a;border-left:5px solid var(--category-color);min-height:44px;max-width:140px;overflow-wrap:anywhere;box-shadow:0 2px 5px #0002}
.railbtn:hover{background:#263b5b}
.railbtn.active{background:#263b5b;box-shadow:inset 0 0 0 1px #91add0;font-weight:700}
.drawer-body{max-height:100%;width:min(310px,calc(100vw - 150px));min-width:0}
[data-theme="light"] .railbtn{background:#fff;color:#243b58;border-top-color:#acbbcd;border-right-color:#acbbcd;border-bottom-color:#acbbcd}
[data-theme="light"] .railbtn:hover{background:#edf3fc}
[data-theme="light"] .railbtn.active{background:#e7eef8;box-shadow:inset 0 0 0 1px #8ba4c5}
@media(max-width:600px){.drawer{top:20%;bottom:12px}.railbtn{min-width:80px;max-width:105px}.drawer-body{width:calc(100vw - 120px)}}
/* Reserve a right-hand gutter for category tabs instead of overlaying controls. */
body:has(.drawer) .app{padding-right:170px}
@media(max-width:600px){body:has(.drawer) .app{padding-right:126px}.runlayout{min-width:0}.runlayout>div{min-width:0}}


@media(max-width:600px){body:has(.drawer) .app{padding-right:14px}.drawer{position:static;max-width:100%;max-height:320px;margin:0 0 24px 14px;pointer-events:auto}.category-rail{max-height:300px}.drawer-body{max-height:300px}}

/* Keep call notes after the complete script and category navigation at the top. */
.runlayout{grid-template-columns:minmax(0,1fr)}
.call-notes{position:static}
.call-reset{display:flex;justify-content:flex-end;margin:20px 0}
.drawer{top:12px}
@media(max-width:600px){.drawer{top:auto}}
@media(max-width:600px){body{display:flex;flex-direction:column}#overlay{order:-1}.app{width:100%}.drawer{margin-top:12px;margin-bottom:12px}}
/* Category identity belongs to the dialog header, without a filled badge. */
.rebuttal-modal{padding:0;overflow:hidden;border-top:4px solid var(--category-color);display:flex;flex-direction:column}
.rebuttal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 20px;border-bottom:1px solid #34435d;flex-shrink:0}
.rebuttal-heading{min-width:0}
.rebuttal-category{display:flex;align-items:center;gap:9px;color:#a8b8d2;font-size:12px;font-weight:600;letter-spacing:.04em;margin-bottom:9px;overflow-wrap:anywhere}
.category-dot{width:9px;height:9px;background:var(--category-color);border-radius:50%;flex-shrink:0}
.rebuttal-header h2{margin:0;font-size:23px;line-height:1.3;overflow-wrap:anywhere}
.rebuttal-close{width:36px;height:36px;display:grid;place-items:center;padding:0;flex-shrink:0;background:transparent;border-color:transparent;font-size:18px}
.rebuttal-modal>.response-grid{padding:24px;overflow-y:auto;min-height:0}
.rebuttal-modal>.help{margin:18px 24px 0;flex-shrink:0}
[data-theme="light"] .rebuttal-modal{border-top-color:var(--category-color)}
[data-theme="light"] .rebuttal-header{border-bottom-color:#d2dbe5}
[data-theme="light"] .rebuttal-category{color:#4e6077}
[data-theme="light"] .rebuttal-close{background:transparent;border-color:transparent}
[data-theme="light"] .rebuttal-close:hover{background:#eaf0f7}
@media(max-width:600px){.rebuttal-header{padding:18px;gap:12px}.rebuttal-header h2{font-size:20px}.rebuttal-modal>.response-grid{padding:18px}.rebuttal-modal>.help{margin:14px 18px 0}}

.call-notes{container-type:inline-size}
.notes-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;margin-top:14px}
.generated-note-card{min-width:0;display:flex;flex-direction:column;gap:10px;border:1px solid #34435d;border-top:4px solid var(--note-color);border-radius:10px;padding:14px;background:#101b30}
.generated-note-card label{margin:0;overflow-wrap:anywhere}
.generated-note-card .note{flex:1;min-height:190px}
.generated-note-card .right{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.note-template-panel{border-left:5px solid var(--note-color)}
[data-theme="light"] .generated-note-card{background:#fff;border-right-color:#c6d0dc;border-left-color:#c6d0dc;border-bottom-color:#c6d0dc}
[data-theme="light"] .note-template-panel{border-left-color:var(--note-color)}
@container(min-width:580px){.notes-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container(min-width:900px){.notes-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.script-tabs button{border-top:4px solid var(--script-color,#3B82F6)}
.script-tabs button.active{background:#263b5b;border-top-color:var(--script-color,#3B82F6);box-shadow:inset 0 0 0 1px #91add0;font-weight:700}
[data-theme="light"] .script-tabs button.active{background:#e7eef8;color:#243b58;border-top-color:var(--script-color,#3B82F6);box-shadow:inset 0 0 0 1px #8ba4c5}
[data-theme="light"] .script-tabs button{border-top:4px solid var(--script-color,#3B82F6)}

.info-modal{padding:0;display:flex;flex-direction:column;overflow:hidden;max-width:740px}
.info-header{padding:20px 24px;border-bottom:1px solid #34435d;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0}
.info-header h2{margin:0;font-size:21px}
.info-header button{flex-shrink:0}
.info-body{padding:8px 24px 24px;overflow-y:auto;line-height:1.65}
.info-body h3{margin:22px 0 6px;font-size:16px}
.info-body p{margin:6px 0 14px}
.info-intro{font-size:16px}
[data-theme="light"] .info-header{border-bottom-color:#d2dbe5}
@media(max-width:600px){.info-header{padding:16px}.info-header h2{font-size:18px}.info-body{padding:8px 16px 18px}}

.tab-group{display:inline-flex;gap:5px;align-items:center;max-width:100%}
.script-tabs .tab-group>[data-script-tab]{overflow-wrap:anywhere}
.category-list .tab-group{flex-wrap:wrap}

.drag-handle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:#8293ac;cursor:grab;touch-action:none;user-select:none;width:22px;min-height:30px;font-size:19px;border-radius:5px;opacity:.7}
.drag-handle:hover,.drag-handle:focus-visible{opacity:1;background:#8293ac22;outline:2px solid #6d9ef1;outline-offset:2px}
[data-theme="light"] .drag-handle{color:#61738a}
.is-dragging,.is-dragging .drag-handle{cursor:grabbing;user-select:none}
.dragging{opacity:.45}
.drop-before{box-shadow:inset 0 3px #4f85e8!important}
.drop-after{box-shadow:inset 0 -3px #4f85e8!important}
.tab-group.drop-before{box-shadow:inset 3px 0 #4f85e8!important}
.tab-group.drop-after{box-shadow:inset -3px 0 #4f85e8!important}

/* Grips sit inside the item surface, beside its accent edge. */
.sortable-item{position:relative}
.tab-group{gap:0}
.tab-group>.drag-handle{position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:1;width:20px}
.tab-group:has(>.drag-handle)>button{padding-left:40px}
.sortable-item>.panelhead{padding-left:24px}
.sortable-item>.panelhead>.actions>.drag-handle{position:absolute;left:8px;top:12px;width:20px}
.note-template-panel>.panelhead>.actions>.drag-handle{left:14px;top:16px}
.sortable-item.flex>.drag-handle{order:-1}

.question{border-left-color:var(--question-color,#4e89e7)}
.script-wording{margin:12px 0 16px;padding:14px;border:1px solid #34435d;border-left:4px solid var(--question-color,#64748B);border-radius:8px;background:#152139}
.script-wording-text{white-space:pre-wrap;line-height:1.65;overflow-wrap:anywhere}
[data-theme="light"] .script-wording{background:#f8fafc;border-top-color:#d2dbe5;border-right-color:#d2dbe5;border-bottom-color:#d2dbe5}
[data-select-kind]{cursor:pointer}
[data-select-kind]:focus-visible{outline:2px solid #6d9ef1;outline-offset:3px}
[data-select-kind].selected{box-shadow:inset 0 0 0 1px #6d9ef155}

.check-row{display:flex;align-items:center;gap:10px;margin:8px 0;font-weight:400;cursor:pointer}
.check-row input[type=checkbox]{width:18px;height:18px;margin:0;flex-shrink:0;accent-color:#245fc5}
.checkbox-options{display:flex;flex-wrap:wrap;gap:8px 24px}
.appointment-days{display:flex;flex-wrap:wrap;gap:4px;max-height:240px;overflow:auto}
.appointment-picker{max-width:100%;min-width:0}
.appointment-picker label{font-size:13px}

.appointment-schedule{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;padding:3px;margin:12px 0}
.appointment-day-card{min-width:0;padding:12px;border:1px solid #45608a;border-radius:9px;background:#17233c}
.appointment-day-card h4{margin:0 0 10px;font-size:13px}
.appointment-day-card.selected{border-color:#6d9ef1;box-shadow:inset 0 0 0 1px #6d9ef1}
.appointment-slots{display:flex;flex-direction:column;gap:5px}
.appointment-slots .choice{margin:0;padding:8px 6px;font-size:12px}
.appointment-schedule.full-calendar{grid-template-columns:repeat(7,minmax(0,1fr))}
.appointment-month-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.appointment-day-card.unavailable{opacity:.55}
[data-theme="light"] .appointment-day-card{background:#fff;border-color:#acbbcd}
[data-theme="light"] .appointment-day-card.selected{border-color:#245fc5;box-shadow:inset 0 0 0 1px #245fc5}
@media(max-width:900px){.appointment-schedule.full-calendar{grid-template-columns:repeat(3,minmax(0,1fr))}.calendar-spacer{display:none}}
@media(max-width:600px){.appointment-schedule,.appointment-schedule.full-calendar{grid-template-columns:repeat(2,minmax(0,1fr))}.appointment-day-card{padding:9px}}


/* Center the rebuttal rail and open list; long lists stay viewport-bounded. */
@media(min-width:601px){.drawer{top:50%;bottom:auto;transform:translateY(-50%);max-height:calc(100dvh - 24px);align-items:center}.category-rail,.drawer-body{max-height:calc(100dvh - 24px)}}

/* Compact builder cards and bounded editor context. */
.section-body[hidden]{display:none}
[data-select-kind="section"]>.panelhead{margin-bottom:8px}
[data-select-kind="section"]>.section-body>.muted:empty{display:none}
[data-select-kind="section"]:has(>.section-body[hidden])>.panelhead{margin-bottom:0}
.section-toggle{min-width:28px}
.editor-heading{min-width:0;flex:1;overflow:hidden}
.editor-heading>.hint{display:block;margin:0 0 4px}
.editor-heading>h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 12px}
.grid>div{min-width:0}
.panel.sticky>.panelhead{flex-wrap:nowrap;align-items:flex-start}
.panel.sticky>.panelhead>.btn{flex-shrink:0}
[data-select-kind] .panelhead>.actions{gap:6px}

.item-menu{position:relative}
.item-menu>summary{list-style:none;cursor:pointer;font-size:20px;line-height:24px;padding:0 6px;border-radius:6px}
.item-menu>summary::-webkit-details-marker{display:none}
.item-menu>summary:focus-visible{outline:2px solid #6d9ef1}
.item-menu>div{position:absolute;right:0;top:100%;z-index:20;padding:6px;background:#152139;border:1px solid #33435f;border-radius:8px;box-shadow:0 6px 20px #0003}
[data-theme="light"] .item-menu>div{background:#fff;border-color:#bac9df}
#undoBar{position:fixed;bottom:18px;right:18px;z-index:80;background:#203957;color:#fff;padding:10px 14px;border-radius:10px;box-shadow:0 6px 24px #0003;display:flex;align-items:center;gap:14px}
#undoBar[hidden]{display:none}
#toast{bottom:76px}

.right:has(>.item-menu){display:flex;justify-content:flex-end;align-items:center;gap:6px}

.search-rebuttal-result{border-left:4px solid var(--result-color)!important}
.search-rebuttal-result strong,.search-rebuttal-result small{display:block;overflow-wrap:anywhere}
.search-rebuttal-result small{margin-top:5px}
.rebuttal-search-toggle{font-weight:600}
.call-rebuttal-search input{min-width:0}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.call-rebuttal-search>.panelhead>button{width:auto;margin:0;flex-shrink:0}.call-rebuttal-search>.panelhead{flex-wrap:nowrap}


.rebuttal-defaults>summary{cursor:pointer;font-weight:600}.rebuttal-defaults:not([open]){padding:12px 18px}

.preview-banner,.setup-issue{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #6d9ef155;border-radius:9px;margin:10px 0}.setup-issue>span{min-width:0;overflow-wrap:anywhere}.setup-issue>button{flex-shrink:0}

/* Quiet main navigation in the normal page flow. */
#mainNav{position:static;padding:0;background:transparent;box-shadow:none;gap:8px}
#mainNav button{white-space:nowrap;font-weight:500;border-width:1px;padding:9px 14px;border-radius:8px}
#mainNav button.active{background:#26354c;border-color:#61728c;color:#edf2fa}
[data-theme="light"] #mainNav button.active{background:#e4ebf5;border-color:#9eb2cf;color:#284768}
#mainNav [data-view="workspace"]{font-weight:500}
@media(max-width:600px){#mainNav{gap:5px}#mainNav button{padding:9px 8px;font-size:12px;flex:1}}
/* Field type identity is separate from each question's custom accent. */
.field-type-badge[data-field-type]{background:var(--type-dark-bg);color:var(--type-dark-text);border:1px solid var(--type-dark-text)}
[data-theme="light"] .field-type-badge[data-field-type]{background:var(--type-light-bg);color:var(--type-light-text);border-color:var(--type-light-text)}

.field-type-badge[data-field-type="text"]{--type-light-bg:#e0ebfa;--type-light-text:#244a78;--type-dark-bg:#203958;--type-dark-text:#a8c9ff}
.field-type-badge[data-field-type="textarea"]{--type-light-bg:#e2e7ff;--type-light-text:#44348b;--type-dark-bg:#302952;--type-dark-text:#c7bdff}
.field-type-badge[data-field-type="choice"]{--type-light-bg:#e1f4e9;--type-light-text:#19633c;--type-dark-bg:#153d2b;--type-dark-text:#91e0b0}
.field-type-badge[data-field-type="dropdown"]{--type-light-bg:#daf2f3;--type-light-text:#14606a;--type-dark-bg:#173c43;--type-dark-text:#8cdfe7}
.field-type-badge[data-field-type="multiselect"]{--type-light-bg:#f2e3fa;--type-light-text:#6b2c85;--type-dark-bg:#432751;--type-dark-text:#e5b0fb}
.field-type-badge[data-field-type="checkbox"]{--type-light-bg:#edf2d8;--type-light-text:#4e6215;--type-dark-bg:#303d1d;--type-dark-text:#c3de81}
.field-type-badge[data-field-type="appointment"]{--type-light-bg:#ffecd5;--type-light-text:#8b4509;--type-dark-bg:#4a321d;--type-dark-text:#ffcf8b}
.field-type-badge[data-field-type="email"]{--type-light-bg:#fbe3eb;--type-light-text:#883456;--type-dark-bg:#482737;--type-dark-text:#f6b0cc}
.field-type-badge[data-field-type="tel"]{--type-light-bg:#e3f1dc;--type-light-text:#3a611d;--type-dark-bg:#293d20;--type-dark-text:#b5db97}
.field-type-badge[data-field-type="url"]{--type-light-bg:#dfeffa;--type-light-text:#245d81;--type-dark-bg:#203848;--type-dark-text:#a1d9f7}
.field-type-badge[data-field-type="number"]{--type-light-bg:#f9e1dc;--type-light-text:#8b3727;--type-dark-bg:#482c26;--type-dark-text:#ffb7a3}
.field-type-badge[data-field-type="date"]{--type-light-bg:#f5e9d4;--type-light-text:#765411;--type-dark-bg:#43371f;--type-dark-text:#ead18b}
.field-type-badge[data-field-type="time"]{--type-light-bg:#e6e4fa;--type-light-text:#51478c;--type-dark-bg:#302d4b;--type-dark-text:#c6c0fb}
.field-type-badge[data-field-type="script"]{--type-light-bg:#e7eaf0;--type-light-text:#465166;--type-dark-bg:#2b3443;--type-dark-text:#c6d0e1}
.note-field-row[hidden],.field-search-empty[hidden]{display:none!important}.undo-dismiss{padding:4px 6px!important}



/* Separate navigation tabs share the script tabs' top-edge accent. */
#mainNav{display:flex;gap:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#mainNav [data-view="workspace"]{--nav-accent:#3aa487}
#mainNav [data-view="scripts"]{--nav-accent:#6395dc}
#mainNav [data-view="rebuttals"]{--nav-accent:#ae82d0}
#mainNav [data-view="notes"]{--nav-accent:#c79b50}
#mainNav button{border:1px solid #41516b;border-top:3px solid var(--nav-accent);background:#111b30;color:#bdc9dc;box-shadow:none;padding:9px 14px;font-weight:500}
#mainNav button.active{background:#26344a;color:#f1f5fc;box-shadow:inset 0 0 0 1px #60728c66}
#mainNav button:hover{background:#1d2b40}
[data-theme="light"] #mainNav button{background:#fff;border-color:#bdcadb;border-top-color:var(--nav-accent);color:#44566e}
[data-theme="light"] #mainNav button.active{background:#e9eef5;color:#1c304b;box-shadow:inset 0 0 0 1px #9eb2cf55}
[data-theme="light"] #mainNav button:hover:not(.active){background:#f6f8fb}
[data-info="setup"]{display:inline-flex;align-items:center;gap:7px}
.setup-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:6px;background:#5a421d;color:#ffda8e;font-size:11px;font-weight:600}
[data-theme="light"] .setup-count{background:#f6e9c9;color:#795819}
@media(max-width:600px){#mainNav{gap:5px}#mainNav button{padding:9px 8px;font-size:12px;flex:1}}

/* Both navigation levels share a single selected-tab treatment. */
#mainNav button{border-top-width:4px;border-radius:9px}
#mainNav button.active,.script-tabs button.active{background:#263b5b;color:#f0f5ff;border-color:#627a9c;box-shadow:inset 0 0 0 1px #91add0;font-weight:700}
[data-theme="light"] #mainNav button.active,[data-theme="light"] .script-tabs button.active{background:#e7eef8;color:#243b58;border-color:#9eb0c8;box-shadow:inset 0 0 0 1px #8ba4c5;font-weight:700}
#mainNav button.active,[data-theme="light"] #mainNav button.active{border-top-color:var(--nav-accent)}
.script-tabs button.active,[data-theme="light"] .script-tabs button.active{border-top-color:var(--script-color,#3B82F6)}

/* Tabs meet the panel below instead of floating as separate buttons. */
#mainNav{margin:16px 0 0;gap:4px;align-items:end;border-bottom:1px solid #34435d}
#mainNav button,.script-tabs button{border:1px solid #34435d;border-top:3px solid var(--nav-accent,var(--script-color,#3B82F6));border-radius:9px 9px 0 0;background:#152139;color:#aebed4;padding:10px 16px;box-shadow:none;margin-bottom:-1px}
#mainNav button.active,.script-tabs button.active{background:#111b30;color:#f0f5ff;border-bottom-color:#111b30;box-shadow:none;font-weight:700}
#main{padding:16px;border:1px solid #34435d;border-top:0;border-radius:0 0 12px 12px;background:#111b30;min-width:0}
[data-theme="light"] #mainNav{border-bottom-color:#c6d0dc}
[data-theme="light"] #main{background:#fff;border-color:#c6d0dc}
[data-theme="light"] #mainNav button,[data-theme="light"] .script-tabs button{background:#edf1f6;border-color:#c6d0dc;border-top-color:var(--nav-accent,var(--script-color,#3B82F6));color:#4b5f79;box-shadow:none}
[data-theme="light"] #mainNav button.active,[data-theme="light"] .script-tabs button.active{background:#fff;border-bottom-color:#fff;color:#1c304b;box-shadow:none;font-weight:700}
#mainNav button:hover:not(.active),.script-tabs button:hover:not(.active){filter:brightness(1.04)}
.workspace-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:0 0 4px}
.workspace-toolbar>.script-tabs{flex:1;min-width:0;margin:0}
.workspace-toolbar>.btn{align-self:center;flex-shrink:0}
.script-tabs{gap:4px;border-bottom:1px solid #34435d;align-items:flex-end}
[data-theme="light"] .script-tabs{border-bottom-color:#c6d0dc}
.tab-group{align-self:flex-end}
.rebuttal-search-toggle{display:flex;align-items:center;justify-content:center;gap:8px}
.search-icon{width:19px;height:19px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
@media(max-width:600px){#main{padding:12px}#mainNav button{padding:10px 8px;font-size:12px}.script-tabs button{padding:10px 12px}.workspace-toolbar{gap:10px}.workspace-toolbar>.script-tabs{flex-basis:100%}.workspace-toolbar>.btn{margin-left:auto}}

/* Builder card wording wraps without pushing actions onto another row. */
[data-select-kind="question"]>.panelhead{flex-wrap:nowrap;align-items:flex-start}
[data-select-kind="question"]>.panelhead>div:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
[data-select-kind="question"]>.panelhead>.actions{flex:0 0 auto;flex-wrap:nowrap;align-self:flex-start}

.format-toolbar{display:flex;gap:5px;margin:6px 0}.format-toolbar button{min-width:32px}.script-format-preview{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;margin-top:10px;border:1px solid #34435d;border-radius:8px;line-height:1.6}[data-theme="light"] .script-format-preview{background:#f5f7fb;border-color:#c6d0dc}

.internal-note,[data-block-kind="note"]{--note-accent:#c79b50;--note-bg:#342e20;border:1px solid var(--note-accent);border-left:4px solid var(--note-accent)!important;background:var(--note-bg);border-radius:9px;padding:14px;margin:12px 0 16px}
.internal-note[data-importance="fyi"],[data-block-kind="note"][data-importance="fyi"]{--note-accent:#6395dc;--note-bg:#202d43}
.internal-note[data-importance="important"],[data-block-kind="note"][data-importance="important"]{--note-accent:#d2777f;--note-bg:#3c252f}
.internal-note-label{font-size:12px;font-weight:600;color:var(--note-accent);margin-bottom:8px}
.internal-note .script-wording-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
[data-theme="light"] .internal-note,[data-theme="light"] [data-block-kind="note"]{--note-bg:#fbf5e6}
[data-theme="light"] .internal-note[data-importance="fyi"],[data-theme="light"] [data-block-kind="note"][data-importance="fyi"]{--note-bg:#edf3fc}
[data-theme="light"] .internal-note[data-importance="important"],[data-theme="light"] [data-block-kind="note"][data-importance="important"]{--note-bg:#fcf0f1}
.field-type-badge[data-field-type="note"]{background:transparent!important;color:inherit!important;border-color:var(--note-accent)!important}

/* Questions use the same card shape as script blocks. */
.question{padding:14px;border:1px solid #34435d;border-left:4px solid var(--question-color,#3B82F6);border-radius:9px;background:#152139}
.question>.question-title{margin-bottom:10px;line-height:1.45}
[data-theme="light"] .question{background:#f7f9fc;border-top-color:#cdd8e8;border-right-color:#cdd8e8;border-bottom-color:#cdd8e8}
.question .conditional{margin-top:16px;padding-left:12px}

/* Compact rebuttal access on phones/tablets; preserve the desktop rail. */
.mobile-rebuttals-toggle,.mobile-rebuttals-header,.rebuttal-mobile-scrim{display:none}
@media(max-width:900px){
 body{display:block}#overlay{order:0}
 body:has(.drawer) .app{width:100%;padding:14px}
 .drawer{display:none}
 .mobile-rebuttals-toggle{display:inline-flex;min-height:40px;align-items:center;justify-content:center}
 .drawer.mobile-open{position:fixed;inset:auto 12px 12px;top:auto;bottom:12px;transform:none;display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:0;padding:12px;max-width:none;max-height:calc(100dvh - 24px);border:1px solid #45608a;border-radius:14px;background:#111b30;box-shadow:0 16px 70px #0008;z-index:25;overflow:hidden;pointer-events:auto}
 .mobile-rebuttals-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
 .mobile-rebuttals-header>.btn{min-width:40px;min-height:40px}
 .rebuttal-mobile-scrim{display:block;position:fixed;inset:0;border:0;background:#05091388;z-index:24;cursor:default}
 .drawer.mobile-open .category-rail{display:flex;flex-flow:row wrap;gap:6px;padding:0;max-height:min(30dvh,180px);flex-shrink:0;overflow-y:auto;width:100%}
 .drawer.mobile-open .railbtn{flex:1 0 calc(50% - 6px);min-width:0;max-width:none;min-height:42px;border-radius:8px;padding:9px}
 .drawer.mobile-open .rebuttal-search-toggle{flex-basis:100%}
 .drawer.mobile-open .drawer-body{width:100%;max-height:45dvh;min-height:0;flex:1 1 auto;border:1px solid #45608a;border-radius:9px;overflow-y:auto;padding:12px}
 body:has(.drawer.mobile-open){overflow:hidden}
 [data-theme="light"] .drawer.mobile-open{background:#fff;border-color:#b8c8dd}
 [data-theme="light"] .drawer.mobile-open .drawer-body{border-color:#c6d0dc}
}
@media(max-width:400px){#mainNav{gap:3px}#mainNav button{padding:10px 5px;font-size:11px}.workspace-toolbar{gap:8px}.workspace-toolbar>.btn{margin-left:0}.section{padding:12px}.question,.script-wording{padding:12px}}

@media(max-width:900px){.drawer.mobile-open .drawer-body>.panelhead{flex-wrap:nowrap}.drawer.mobile-open .drawer-body>.panelhead>.btn{width:auto;margin:0;flex-shrink:0}}
