html body #spv-demo-login { background: #282019 !important; }
html body #spv-demo-login .spv-login-card { background: #3d3027 !important; border-color: #7e6655 !important; }
html body #spv-demo-login .spv-role-card { background: #49372b !important; border-color: #92745f !important; }
html body #spv-demo-login .spv-role-emblem { background: #30241b !important; }
.voice-planner-actions, .voice-crew-select {
 display: grid;
 grid-template-columns: repeat(2,minmax(0,1fr));
 gap: 8px;
}
.voice-planner-actions { grid-column: 1 / -1; }
.voice-planner-actions > button { white-space: normal; }
html body #voice-plan {
 background: #754830; color: #fff; border-color: #754830;
}
#modal:has(.voice-plan-panel) > .spv-navigation-footer { display: none !important; }
.voice-plan-panel > p:first-child { margin: 0 0 12px; }
.voice-plan-composer {
 border: 1px solid #9a7a63;
 border-radius: 20px;
 padding: 12px;
}
#modal label[for="voice-plan-text"] { display: block; font-weight: 700; }
#modal #voice-plan-text {
 width: 100%;
 box-sizing: border-box;
 min-height: 94px;
 margin: 6px 0 8px;
 font-size: 16px;
 resize: vertical;
}
#modal #voice-plan-text::placeholder { font-size: 14px; }
.voice-plan-controls {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 6px;
}
#modal .voice-plan-controls > button {
 box-sizing: border-box;
 display: inline-grid;
 place-items: center;
 width: 100%;
 min-width: 0;
 height: 44px;
 min-height: 44px;
 margin: 0;
 padding: 0 4px;
 border-radius: 999px;
 font-size: 13px;
 line-height: 1.15;
 white-space: normal;
}

#modal .voice-plan-controls .is-recording { background: #a12836; color: #fff; }
#modal .voice-plan-controls button:disabled { opacity: .48; }
.voice-plan-stop { width: 13px; height: 13px; border-radius: 2px; background: currentColor; }
.voice-plan-status:empty { display: none; }
.voice-plan-status { margin: 10px 0; font-size: 14px; }
.voice-plan-preview > p { padding: 8px; border-bottom: 1px solid #c7b5aa; }
.voice-plan-preview small { display: block; }
.voice-check-entry { display: block; width: 100%; margin-top: 6px; text-align: left; }
@media (max-width: 700px) and (orientation: portrait) {
 body:has(#spv-top-controls) .voice-planner-actions {
  position: fixed; z-index: 28; inset: auto 0 0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #32251e; border-top: 1px solid #9a7a63;
 }
 body:has(#spv-top-controls) .workspace > main {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
 }
}

.voice-guide ol { padding-inline-start: 23px; }
.voice-guide li { margin-block: 8px; }

#modal .voice-plan-panel:focus { outline: none; }
.voice-plan-transcript-tools {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 4px 10px;
}
.voice-plan-transcript-tools label { margin-inline-end: auto; }
#modal .voice-plan-controls .voice-plan-mic.is-recording {
 display: inline-flex;
 justify-content: center;
 align-items: center;
 gap: 9px;
}
.voice-plan-meter {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 3px;
 height: 22px;
}
.voice-plan-meter i {
 width: 4px;
 height: 4px;
 border-radius: 999px;
 background: currentColor;
}
.voice-plan-stop { flex: 0 0 13px; }

#modal .voice-plan-controls .voice-plan-keyboard {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 5px;
}

#modal .voice-plan-help-button { margin-inline-start: auto; }
#modal .voice-plan-progress {
 margin-block: 10px;
 padding: 12px 16px;
 border: 1px solid #a17d62;
 border-radius: 12px;
 background: #fff5e9;
 color: #452e20;
}
.voice-plan-progress strong, .voice-plan-progress span { display: block; }
#modal .voice-plan-progress[hidden], #voice-plan-help[hidden] { display: none; }

/* Test 5 U32: immediate Stop feedback, visible spinner, scroll cue and compact results table. */
#modal:has(.voice-plan-panel) { scrollbar-width: thin; scrollbar-color: #a48166 #f4eae2; }
#modal .voice-plan-scroll-indicator {
 position: sticky; top: 0; z-index: 4; height: 3px; width: 100%;
 border-radius: 4px; background: #f1e5da; pointer-events: none; margin: 0 0 8px;
}
#modal .voice-plan-scroll-indicator[hidden] { display: none; }
#modal .voice-plan-scroll-fill { display: block; height: 100%; width: 8%; border-radius: inherit; background: #91603e; transition: width .1s linear; }
#modal .voice-plan-progress {
 display: flex; align-items: center; gap: 14px; padding: 16px;
 border: 1px solid #be967a; background: #fff4e6;
}
#modal .voice-plan-progress-words { min-width: 0; }
#modal .voice-plan-progress strong { font-size: 16px; color: #422d21; }
#modal .voice-plan-progress .voice-plan-progress-words > span { font-size: 13px; margin-top: 3px; color: #624a3c; }
#modal .voice-plan-spinner {
 display: block; width: 27px; height: 27px; flex: 0 0 27px;
 border: 3px solid #e1c0a4; border-top-color: #754830; border-right-color: #754830;
 border-radius: 50%; animation: voice-plan-spin .85s linear infinite;
}
@keyframes voice-plan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #modal .voice-plan-spinner { animation-duration: 2s; } }
#modal .voice-plan-preview h3 { font-size: 15px; margin: 14px 0 9px; font-weight: 750; }
#modal .voice-plan-results-table { width: 100%; border: 1px solid #d6c3b4; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; table-layout: fixed; font-size: 13px; }
#modal .voice-plan-results-table th { background: #efe3d8; padding: 10px 8px; color: #402e23; text-align: left; border-bottom: 1px solid #d6c3b4; font-weight: 750; }
#modal .voice-plan-results-table td { padding: 11px 8px; vertical-align: top; background: #fff; color: #382c24; overflow-wrap: anywhere; border-bottom: 1px solid #eee0d6; }
#modal .voice-plan-results-table tr:last-child td { border-bottom: 0; }
#modal .voice-plan-results-table th:nth-child(1), #modal .voice-plan-results-table td:nth-child(1) { width: 27%; }
#modal .voice-plan-results-table th:nth-child(2), #modal .voice-plan-results-table td:nth-child(2) { width: 25%; }
#modal .voice-plan-results-table .voice-plan-loading-cell { text-align: center; font-style: italic; color: #715c4b; }
#modal .voice-plan-results-table small { display: block; font-size: 11px; margin-top: 4px; color: #765a4a; }
#modal .voice-plan-preview .voice-plan-correction { margin: 4px 0; font-size: 12px; background: #f6f0e9; padding: 6px 9px; border-radius: 8px; }
#modal .voice-plan-preview .voice-plan-alert { margin: 8px 0; padding: 9px; border: 1px solid #e5cdae; border-radius: 9px; background: #fff8ec; }
#modal .voice-plan-apply { margin: 14px 0 0; width: 100%; min-height: 44px; }
@media(max-width: 410px) { #modal .voice-plan-results-table { font-size: 12px; } #modal .voice-plan-results-table th, #modal .voice-plan-results-table td { padding: 9px 5px; } }

/* U34: keep gestures within the front dialog, never scroll the dimmed planner. */
html:has(#modal[open]:has(.voice-plan-panel)),
body:has(#modal[open]:has(.voice-plan-panel)) { overflow:hidden!important; overscroll-behavior:none!important; }
#modal:has(.voice-plan-panel) { overscroll-behavior:contain!important; touch-action:pan-y; }
#modal .voice-plan-panel { overscroll-behavior:contain; }

/* U35: keep weekday names, including Wednesday, on one line. */
#modal .voice-plan-results-table th:nth-child(1),#modal .voice-plan-results-table td:nth-child(1){width:24%;}
#modal .voice-plan-results-table th:nth-child(2),#modal .voice-plan-results-table td:nth-child(2){width:34%;white-space:nowrap;overflow-wrap:normal;word-break:normal;}
#modal .voice-plan-results-table th:nth-child(3),#modal .voice-plan-results-table td:nth-child(3){width:42%;}

/* U42: explicit completion for iPhone keyboard dictation */
#modal .voice-plan-analyse-text{display:block;width:100%;min-height:44px;margin:12px 0 0;}

/* U45: editable, accessible voice-plan preview */
#modal .voice-plan-cell-select {display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:9px 2px;font:inherit;color:#26394c;background:#fff;border:1px solid #b8c7d5;border-radius:7px;}
#modal .voice-plan-results-table td {overflow-wrap:normal;word-break:normal;padding:7px 3px;}
#modal .voice-plan-results-table th:nth-child(1),#modal .voice-plan-results-table td:nth-child(1){width:25%;}
#modal .voice-plan-results-table th:nth-child(2),#modal .voice-plan-results-table td:nth-child(2){width:36%;}
#modal .voice-plan-results-table th:nth-child(3),#modal .voice-plan-results-table td:nth-child(3){width:39%;}
#modal .voice-plan-editor-help {font-size:13px;color:#526478;}
#modal .voice-plan-editor-warning {color:#a52c2c;font-size:13px;}
#modal .voice-plan-editor-warning:empty {display:none;}
#modal .voice-plan-editor-actions {display:grid;gap:9px;margin-top:14px;}
#modal .voice-plan-editor-actions button {min-height:46px;width:100%;}

/* U7: uncertainty is per cell, never an entire row */
#modal .voice-plan-results-table td.voice-plan-review-cell {background:#fff2c8!important;}
#modal .voice-plan-results-table td.voice-plan-review-cell select {background:#fff7df!important;border-color:#c99738!important;}
#modal .voice-plan-new-site {display:block;font-size:11px;font-weight:700;color:#885400;margin:4px 0 0;}
