/* Shared working forms: readable labels, explicit selection, comfortable touch areas. */
.workflow, #documentPreparation, #rnisMonitor, #rptPw, #repPw {font-size:14px;line-height:1.55;}
.workflow *, #documentPreparation * {box-sizing:border-box;}
.workflow h3, .workflow h4 {margin:24px 0 12px;line-height:1.3;}
.workflow h3:first-child {margin-top:0;}
.workflow p {max-width:75ch;margin:12px 0;}
.workflow .workflow-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:20px;align-items:start;}
.workflow .workflow-field {display:grid;gap:8px;min-width:0;}
.workflow input:not([type=checkbox]), .workflow select, .workflow textarea {width:100%;min-width:0;min-height:44px;}
.workflow .btn, #documentPreparation .btn {min-height:44px;padding:10px 16px;line-height:1.35;border-radius:8px;white-space:normal;}
.workflow summary {min-height:44px;padding:10px 0;cursor:pointer;}
.workflow :focus-visible, #documentPreparation :focus-visible {outline:2px solid var(--accent,#1976b8);outline-offset:3px;}
.workflow .workflow-check {display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;}
.workflow .workflow-check input[type=checkbox] {width:20px;height:20px;flex:0 0 20px;margin:0;display:inline-block;}
.workflow .workflow-choices {display:grid;gap:4px;max-height:264px;overflow:auto;border:1px solid var(--border,#ccd4dd);border-radius:8px;padding:8px;}
.workflow .workflow-choices.expanded {max-height:none;}
.workflow .workflow-choice {display:flex;gap:12px;align-items:center;min-height:44px;padding:8px;overflow-wrap:anywhere;cursor:pointer;border-radius:6px;}
.workflow .workflow-choice:has(input:checked) {background:var(--surface-2,rgba(50,120,170,.12));}
.workflow .workflow-choice input {width:20px!important;height:20px;min-height:20px;flex:0 0 20px;margin:0!important;}
.workflow .workflow-help {color:var(--text-2);font-size:13px;}
.workflow .workflow-actions {display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:16px;}
.workflow .workflow-tabs {display:flex;gap:8px;flex-wrap:wrap;margin:0 0 24px;border-bottom:1px solid var(--border);padding-bottom:12px;}
.workflow .workflow-tabs [aria-selected=true] {font-weight:700;background:var(--accent,#1679b5);color:#fff;}
.workflow [hidden] {display:none!important;}
.workflow-dialog-open {overflow:hidden;}
#documentPreparation {padding:24px;}
#documentPreparation section {box-sizing:border-box;}
#documentPreparation .workflow-field small {display:block;color:var(--text-2);font-size:13px;}
#documentPreparation #dpMessage {margin:20px 0 12px;}
#documentPreparation #dpFields {margin:16px 0 24px;}
#documentPreparation #dpPreview {font-family:inherit;line-height:1.6;}
#documentPreparation #dpHistory {display:grid;gap:12px;}
@media(max-width:600px){
 #documentPreparation {padding:12px!important;}
 #documentPreparation section {padding:20px!important;max-height:calc(100dvh - 24px)!important;}
 .workflow .workflow-grid {gap:16px;}
 .workflow .workflow-actions > .btn {flex:1 1 150px;}
 .workflow h3 {font-size:20px;}
}
#documentOrderDialog {box-sizing:border-box;margin:auto;inset:0;width:min(1000px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--border);border-radius:12px;padding:24px;background:var(--surface,#fff);color:var(--text,#172638);}
#documentOrderDialog::backdrop {background:#0008;}
#documentWriteReceiptDialog {box-sizing:border-box;margin:auto;inset:0;width:min(560px,calc(100vw - 48px));max-height:calc(100dvh - 48px);overflow:auto;padding:24px;border:1px solid var(--border);border-radius:12px;background:var(--surface,#fff);color:var(--text,#172638);}
#documentWriteReceiptDialog::backdrop {background:#0008;}
#documentWriteReceiptDialog .workflow-actions {justify-content:flex-end;}
#documentWriteReceiptDialog .btn.primary {background:var(--experience-action-bg,var(--primary));border-color:var(--experience-action-border,var(--primary));color:var(--experience-action-text,#fff);}
.workflow .passport-date-entry {position:relative;display:flex;align-items:center;gap:8px;min-width:0;}
.workflow .passport-date-entry > input:not(.passport-date-native) {flex:1 1 0;min-width:0;width:auto;}
.workflow .passport-date-entry > .passport-date-picker {display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;}
.workflow .passport-date-picker svg {display:block;flex:0 0 auto;width:18px;height:18px;}
.workflow .passport-date-entry[data-picker-fallback="true"] > .passport-date-native {position:static;flex:1 1 0;min-width:0;min-height:44px;width:auto;opacity:1;pointer-events:auto;}
#documentOrderDialog .workflow-grid {margin:16px 0 24px;}
#documentOrderDialog details {margin:16px 0;border-top:1px solid var(--border);padding-top:8px;}
#documentOrderDialog .workflow-choices {margin:12px 0;}
#documentOrderDialog #doCalculation {padding:16px;border:1px solid var(--border);border-radius:8px;margin:20px 0;}
@media(max-width:600px){#documentOrderDialog{padding:20px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px);}}

#tab-templates {min-width:0;max-width:100%;}
#tplList,#tplListCab {max-width:100%;overflow-x:auto;}
#documentOrders {min-width:0;}

#documentOrderDialog .order-vehicles {grid-template-columns:repeat(2,minmax(0,1fr));}
@media(max-width:600px){#documentOrderDialog .order-vehicles{grid-template-columns:1fr;}}

/* v105: keep the selection, six required fields and download within one clear task. */
#rnisRegistrationDialog {box-sizing:border-box;margin:auto;inset:0;width:min(1080px,calc(100vw - 32px));height:min(900px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);}
#rnisRegistrationDialog[open] {display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;}
#rnisRegistrationDialog::backdrop {background:var(--experience-overlay,#0008);}
#rnisRegistrationDialog .registration-header {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;border-bottom:1px solid var(--border);}
#rnisRegistrationDialog .registration-header h2 {margin:0;font-size:20px;line-height:1.3;}
#rnisRegistrationDialog .registration-status {margin:0;max-width:none;padding:12px 24px;color:var(--text-2);background:var(--surface-2);overflow-wrap:anywhere;}
#rnisRegistrationDialog .registration-content {min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--border-2) var(--surface);padding:20px 24px 24px;scroll-padding:20px;}
#rnisRegistrationDialog .registration-intro {margin:0 0 20px;}
#rnisRegistrationDialog .registration-filters {margin-top:12px;}
#rnisRegistrationDialog .registration-caption {display:block;min-height:2.7em;line-height:1.35;}
#rnisRegistrationDialog .registration-selection > summary {font-weight:600;}
#rnisRegistrationDialog .registration-pages .btn {font-size:13px;}
#rnisRegistrationDialog .registration-paste {margin-top:16px;}
#rnisRegistrationDialog .registration-empty {margin:8px;}
#rnisRegistrationDialog .registration-fields h3 {margin:20px 0 8px;}
#rnisRegistrationDialog .registration-vehicle {margin-top:20px;padding-top:8px;border-top:1px solid var(--border);}
#rnisRegistrationDialog .registration-vehicle > summary {font-weight:600;overflow-wrap:anywhere;}
#rnisRegistrationDialog .registration-source {margin:8px 0;color:var(--text-2);}
#rnisRegistrationDialog .registration-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start;margin:20px 0;}
#rnisRegistrationDialog .registration-grid small {font-size:13px;color:var(--text-2);}
#rnisRegistrationDialog .registration-provenance{margin:8px 0;color:var(--text-2);font-size:13px;}
#rnisRegistrationDialog .registration-optional {margin-top:16px;border-top:1px solid var(--border);}
#rnisRegistrationDialog .registration-optional > summary {color:var(--text-2);}
#rnisRegistrationDialog .registration-footer {display:grid;gap:12px;padding:16px 24px;border-top:1px solid var(--border);background:var(--surface);}
#rnisRegistrationDialog .registration-ready {margin:0;color:var(--text-2);font-size:13px;}
#rnisRegistrationDialog .registration-footer > .btn {justify-self:start;}
@media(max-width:800px){#rnisRegistrationDialog .registration-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){
 #rnisRegistrationDialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);}
 #rnisRegistrationDialog .registration-header{padding:16px;gap:12px;align-items:start;}
 #rnisRegistrationDialog .registration-header h2{font-size:18px;}
 #rnisRegistrationDialog .registration-status{padding:10px 16px;font-size:13px;}
 #rnisRegistrationDialog .registration-content{padding:16px;}
 #rnisRegistrationDialog .registration-grid{grid-template-columns:1fr;gap:16px;margin:16px 0;}
 #rnisRegistrationDialog .registration-caption{min-height:0;}
 #rnisRegistrationDialog .registration-footer{padding:12px 16px;gap:8px;}
 #rnisRegistrationDialog .registration-footer > .btn{justify-self:stretch;width:100%;}
 #rnisRegistrationDialog .registration-footer .workflow-check{font-size:13px;line-height:1.4;}
}

/* Recurring TXT registration import: a focused review, with persistent action status. */
#registrationCardImportDialog { position:fixed; inset:0; margin:auto; width:min(1080px,calc(100vw - 32px)); max-width:1080px; height:min(860px,calc(100dvh - 32px)); max-height:calc(100dvh - 32px); padding:0; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:16px; overflow:hidden; }
#registrationCardImportDialog[open] { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; }

/* An explicit map for rare unsigned TXT files; values stay in the current dialog. */
#registrationCardImportDialog .registration-import-layout { min-width:0; display:grid; gap:16px; padding:20px 0 0; border-top:1px solid var(--border); }
#registrationCardImportDialog .registration-import-layout h3 { margin:0; font-size:16px; line-height:1.45; }
#registrationCardImportDialog .registration-import-layout p { margin:0; max-width:76ch; line-height:1.5; }
#registrationCardImportDialog .registration-import-layout summary { cursor:pointer; min-height:40px; padding:8px 0; box-sizing:border-box; line-height:1.5; }
#registrationCardImportDialog .registration-import-layout-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; gap:16px; min-width:0; }
#registrationCardImportDialog .registration-import-layout .workflow-field { min-width:0; }
#registrationCardImportDialog .registration-import-layout select { width:100%; max-width:100%; min-width:0; }
#registrationCardImportDialog .registration-import-layout small,#registrationCardImportDialog .registration-import-layout li { overflow-wrap:anywhere; line-height:1.5; }
#registrationCardImportDialog .registration-import-layout ol { padding-inline-start:28px; max-height:260px; overflow-y:auto; margin:8px 0; }
#registrationCardImportDialog .registration-import-layout > .btn { justify-self:start; }
@media(max-width:760px) { #registrationCardImportDialog .registration-import-layout-fields { grid-template-columns:1fr; } }
#registrationCardImportDialog::backdrop { background:rgba(0,0,0,.5); }
#registrationCardImportDialog .registration-import-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 24px 12px; }
#registrationCardImportDialog h2 { font-size:20px; line-height:1.3; margin:0; }
#registrationCardImportDialog h3 { font-size:16px; line-height:1.4; margin:0 0 10px; }
#registrationCardImportDialog .registration-import-status { margin:0; padding:0 24px 14px; line-height:1.5; color:var(--text-2,var(--text)); border-bottom:1px solid var(--border); }
#registrationCardImportDialog .registration-import-content { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:20px 24px 24px; scrollbar-color:var(--border) var(--surface); }
#registrationCardImportDialog .registration-import-content > p { max-width:78ch; margin:0 0 12px; line-height:1.55; }
#registrationCardImportDialog .registration-import-notice,.registration-card-source .registration-import-notice { color:var(--text-2,var(--text)); font-size:13px; line-height:1.55; }
#registrationCardImportDialog .registration-import-file { display:grid; gap:16px; margin:24px 0; align-items:start; }
#registrationCardImportDialog .workflow-field { display:grid; gap:8px; min-width:0; }
#registrationCardImportDialog input[type=file] { width:100%; box-sizing:border-box; min-height:44px; padding:8px; font:inherit; color:inherit; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
#registrationCardImportDialog input[type=file]::file-selector-button { min-height:32px; margin-right:12px; padding:4px 12px; border:1px solid var(--border); border-radius:6px; color:var(--text); background:var(--surface); font:inherit; cursor:pointer; }
#registrationCardImportDialog .workflow-check { display:flex; align-items:flex-start; gap:10px; min-height:44px; padding:8px 0; box-sizing:border-box; line-height:1.5; margin:0; cursor:pointer; }
#registrationCardImportDialog input[type=checkbox] { flex:0 0 auto; width:18px; height:18px; margin:2px 0 0; accent-color:var(--primary); }
#registrationCardImportDialog .btn { min-height:44px; white-space:normal; text-align:center; }
#registrationCardImportDialog .registration-import-file > .btn { justify-self:start; }
#registrationCardImportDialog .registration-import-rows { display:grid; margin-top:16px; }
#registrationCardImportDialog .registration-import-row { padding:16px 0; border-top:1px solid var(--border); min-width:0; }
#registrationCardImportDialog .registration-import-row-header { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px 16px; }
#registrationCardImportDialog .registration-import-row-header .workflow-check { font-weight:600; }
#registrationCardImportDialog .registration-import-row-status { font-size:13px; color:var(--text-2,var(--text)); }
#registrationCardImportDialog .registration-import-row p { margin:6px 0; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
#registrationCardImportDialog .registration-import-row-note { color:var(--text-2,var(--text)); }
#registrationCardImportDialog .registration-import-counts { font-variant-numeric:tabular-nums; margin:0 0 12px; line-height:1.5; }
#registrationCardImportDialog .registration-import-recovery { padding:16px 0 0; margin-top:16px; border-top:1px solid var(--border); }
#registrationCardImportDialog .registration-import-recovery p { max-width:78ch; line-height:1.55; }
#registrationCardImportDialog .registration-import-footer { display:grid; gap:8px; padding:12px 24px 20px; border-top:1px solid var(--border); background:var(--surface); }
#registrationCardImportDialog .workflow-actions,.registration-card-source .workflow-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
#registrationCardImportDialog [hidden] { display:none !important; }
#registrationCardImportDialog :focus-visible,.registration-card-source :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
#registrationCardImportDialog ::selection,.registration-card-source ::selection { color:var(--text); background:var(--primary-soft,var(--surface-2)); }
.registration-card-source { margin:24px 0 8px; padding:20px 0 0; border-top:1px solid var(--border); }
.registration-card-source h3 { margin:0 0 10px; font-size:16px; line-height:1.4; }
.registration-card-source p { max-width:78ch; line-height:1.55; margin:8px 0; overflow-wrap:anywhere; }
.registration-card-source .workflow-actions { margin-top:16px; }
.registration-card-source .btn { min-height:44px; white-space:normal; }
.registration-card-record { margin:16px 0; }
.registration-card-record summary { min-height:44px; padding:10px 0; box-sizing:border-box; line-height:1.5; cursor:pointer; }
.registration-card-fields { display:grid; grid-template-columns:minmax(130px,1fr) minmax(0,2fr); gap:8px 16px; max-width:740px; margin:16px 0; }
.registration-card-fields dt { color:var(--text-2,var(--text)); }
.registration-card-fields dd { margin:0; overflow-wrap:anywhere; }
@media(max-width:620px) {
  #registrationCardImportDialog { width:calc(100vw - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
  #registrationCardImportDialog .registration-import-header { padding:16px 16px 10px; gap:12px; align-items:flex-start; }
  #registrationCardImportDialog h2 { font-size:17px; }
  #registrationCardImportDialog .registration-import-header > .btn { flex:0 0 auto; padding-inline:10px; }
  #registrationCardImportDialog .registration-import-status { padding:0 16px 12px; font-size:13px; }
  #registrationCardImportDialog .registration-import-content { padding:16px; }
  #registrationCardImportDialog .registration-import-footer { padding:10px 16px 16px; }
  #registrationCardImportDialog .registration-import-footer .workflow-actions > .btn { flex:1 1 100%; }
  #registrationCardImportDialog .registration-import-row-header { display:block; }
  .registration-card-fields { grid-template-columns:minmax(100px,1fr) minmax(0,1.5fr); gap:8px 12px; font-size:13px; }
}
.registration-card-fields dd > small { display:block; margin-top:3px; line-height:1.45; }

/* Saved vehicle routes update independently of other unsaved card forms. */
.vehicle-saved-routes { margin:0 0 24px; padding:0 0 20px; border-bottom:1px solid var(--border); color:var(--text); }
.vehicle-saved-routes h3 { margin:0 0 12px; font-size:17px; line-height:1.4; }
.vehicle-saved-routes h4 { margin:0 0 6px; font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
.vehicle-saved-routes p { margin:8px 0; max-width:78ch; line-height:1.55; overflow-wrap:anywhere; }
.vehicle-route-saved-notice { margin:0 0 16px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.vehicle-route-saved-notice p { margin:0 0 12px; font-weight:600; }
.vehicle-route-list-row { padding:14px 0; border-top:1px solid var(--border); }
.vehicle-route-list-row > p,.vehicle-route-source-note,.vehicle-route-list-status { color:var(--text-2,var(--text)); font-size:13px; }
.vehicle-saved-routes .workflow-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:10px; }
.vehicle-saved-routes .btn { min-height:44px; white-space:normal; text-align:center; }
.vehicle-saved-routes :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
#routeFormModal .rf-point-error { color:var(--text); background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:10px 12px; font-size:13px; line-height:1.5; margin:10px 0 0; }
#routeFormModal [aria-invalid=true] { outline:2px solid var(--red,#b42318); outline-offset:2px; }
@media(max-width:620px) { .vehicle-route-saved-notice { padding:12px; } .vehicle-saved-routes .workflow-actions > .btn { flex:1 1 180px; } }

/* Terminal settings keep their own read/save result while the main vehicle form is dirty. */
.device-profile-dialog{background:var(--surface,#fff);color:var(--text,#222);border:1px solid var(--border);border-radius:14px;padding:24px;width:520px;max-width:100%;max-height:90dvh;overflow:auto;box-sizing:border-box}
.device-profile-dialog h2{margin:0 0 12px}.device-profile-dialog p{margin:0 0 16px;overflow-wrap:anywhere}
.device-profile-dialog fieldset{border:0;padding:0;margin:0 0 16px;display:grid;gap:12px;min-width:0}
.device-profile-dialog input,.device-profile-dialog select{width:100%;min-width:0;box-sizing:border-box}
.device-profile-dialog .workflow-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.device-profile-dialog details{margin-top:24px}.device-profile-history{padding:12px 0;border-bottom:1px solid var(--border);overflow-wrap:anywhere}
[data-device-recovery]{margin-top:12px;flex-wrap:wrap}[data-device-recovery] button{white-space:normal;min-height:40px}
@media(max-width:620px){.device-profile-dialog{padding:16px}.device-profile-dialog input,.device-profile-dialog select{font-size:16px}[data-device-recovery] button{min-height:44px}}

/* Document preparation keeps the current task in three local, reversible steps. */
html body.experience-ui #documentOrderDialog.workflow[open] { display:flex; flex-direction:column; height:min(940px,calc(100dvh - 32px)); padding:0; overflow:hidden; }
html body.experience-ui #documentOrderDialog.workflow .order-step-header { flex:0 0 auto; justify-content:space-between; gap:16px; margin:0; padding:20px 24px 12px; }
html body.experience-ui #documentOrderDialog.workflow .order-step-header h3 { margin:0; font-size:20px; }
html body.experience-ui #documentOrderDialog.workflow .order-guide { flex:0 0 auto; display:flex; gap:8px; padding:12px 24px; margin:0; border-top:0; border-bottom:1px solid var(--border); }
html body.experience-ui #documentOrderDialog.workflow .order-guide > .btn { flex:1 1 200px; background:var(--surface-2); color:var(--text); border:1px solid var(--border); }
html body.experience-ui #documentOrderDialog.workflow .order-guide > .btn[aria-current="step"] { background:var(--experience-action-bg,var(--primary)); color:var(--experience-action-text,#fff); border-color:var(--experience-action-border,var(--primary)); font-weight:600; }
html body.experience-ui #documentOrderDialog.workflow #doGuideStatus { margin:4px 0 0; font-size:13px; line-height:1.45; }
html body.experience-ui #documentOrderDialog.workflow .order-step-body { min-height:0; flex:1 1 auto; overflow:auto; overscroll-behavior:contain; padding:20px 24px 24px; scrollbar-color:var(--border) var(--surface); }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel > h4:first-child { font-size:18px; margin:0 0 16px; }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel > h4:first-child:focus { outline:none; }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel > h4 { margin:24px 0 12px; }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel > p { margin:12px 0; }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel details { margin:12px 0; padding-top:4px; }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel .workflow-grid { margin:12px 0 20px; gap:16px; }
html body.experience-ui #documentOrderDialog.workflow #doPartiesSection > h4 { margin:24px 0 12px; }
html body.experience-ui #documentOrderDialog.workflow #doAccessDetails { margin:16px 0; }
html body.experience-ui #documentOrderDialog.workflow #doTemplate { margin-top:4px; }
html body.experience-ui #documentOrderDialog.workflow .order-step-footer { flex:0 0 auto; padding:12px 24px 20px; border-top:1px solid var(--border); background:var(--surface); }
html body.experience-ui #documentOrderDialog.workflow .order-step-footer #doMessage { margin:0 0 12px; font-size:13px; line-height:1.5; }
html body.experience-ui #documentOrderDialog.workflow .order-step-footer #doSaveReview { max-height:28vh; overflow:auto; padding:0 0 12px; }
html body.experience-ui #documentOrderDialog.workflow .order-save-actions { display:flex; align-items:center; gap:12px; margin:0; padding:0; border-top:0; }
html body.experience-ui #documentOrderDialog.workflow #doSave { margin-left:auto; }
html body.experience-ui #documentOrderDialog.workflow #doStepNext,html body.experience-ui #documentOrderDialog.workflow #doContinue { background:var(--experience-action-bg,var(--primary)); color:var(--experience-action-text,#fff); }
html body.experience-ui #documentOrderDialog.workflow .order-step-panel ::selection { background:var(--primary-soft,var(--surface-2)); color:var(--text); }

html body.experience-ui #documentOrderDialog.workflow #doCaseContext h4 { margin:0 0 6px; font-size:14px; }
html body.experience-ui #documentOrderDialog.workflow #doCaseContext > p { margin:0 0 8px; font-size:13px; }
html body.experience-ui #documentOrderDialog.workflow #doCaseContext { margin-bottom:20px; }
html body.experience-ui #documentOrderDialog.workflow #doCaseContext details { margin:8px 0 0; }
html body.experience-ui #documentOrderDialog.workflow #doAutoStatus { font-size:13px; margin:8px 0 16px; }
html body.experience-ui #documentOrderDialog.workflow #doPartiesSection > h4 { margin-top:20px; }
html body.experience-ui #documentOrderDialog.workflow #doGuideStatus { max-width:none; }
html body.experience-ui #documentOrderDialog.workflow #doPartiesSection details > summary { padding-block:10px; }

html body.experience-ui #documentOrderDialog.workflow #doVehicleSection:has(#doVehicle:disabled) > label { grid-column:1/-1; }
html body.experience-ui #documentOrderDialog.workflow :is(#doStepNext,#doContinue):not(:disabled):hover,html body.experience-ui #documentOrderDialog.workflow .order-guide > .btn[aria-current="step"]:not(:disabled):hover { background:var(--experience-action-hover,var(--primary)); }
html body.experience-ui #documentOrderDialog.workflow :is(#doStepNext,#doContinue):not(:disabled):active,html body.experience-ui #documentOrderDialog.workflow .order-guide > .btn[aria-current="step"]:not(:disabled):active { background:var(--experience-action-active,var(--primary)); }
#documentOrderDialog .do-route-source {display:grid;gap:16px;}
#documentOrderDialog .do-route-source > div {display:grid;gap:16px;min-width:0;}
#documentOrderDialog .do-route-source-choice,
#documentOrderDialog .do-route-source-check {display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:8px;min-width:0;}
#documentOrderDialog .do-route-source-choice > input[type=checkbox],
#documentOrderDialog .do-route-source-check > input[type=checkbox] {width:18px;height:18px;margin:2px 0 0;min-width:0;accent-color:var(--primary);}
#documentOrderDialog .do-route-source-body {display:grid;gap:4px;min-width:0;overflow-wrap:anywhere;}
#documentOrderDialog .do-route-source-body small {color:var(--text-2);}
#documentOrderDialog .do-route-source-codes {max-height:120px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0;padding:8px;border:1px solid var(--border);border-radius:4px;line-height:1.5;}
#documentOrderDialog .do-route-source-codes:focus-visible {outline:2px solid var(--primary);outline-offset:2px;}
#documentOrderDialog .do-route-source [hidden] {display:none !important;}

.staff-permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;border:1px solid var(--border);border-radius:10px;padding:20px;margin:20px 0}.staff-permission-grid legend{font-weight:600;padding:0 8px}.staff-permission-grid label{display:flex;align-items:flex-start;gap:10px;margin:0!important;cursor:pointer}.staff-permission-grid input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-height:18px;margin:3px 0 0;accent-color:var(--action-primary,var(--primary))}.staff-permission-grid span{display:grid;gap:4px;min-width:0}.staff-permission-grid small{font-size:13px;line-height:1.5;color:var(--text-2);font-weight:400}.staff-permission-grid:disabled{opacity:.7}.staff-permission-grid :focus-visible{outline:2px solid var(--primary);outline-offset:3px}@media(max-width:650px){.staff-permission-grid{grid-template-columns:1fr}}

.staff-permission-actions .btn.secondary{background:var(--surface,#fff);color:var(--text,#1a2e3f);border:1px solid var(--border-2,#b8cadb)}.staff-permission-actions .btn.primary{background:var(--action-primary,#176ca4);color:#fff}

/* Route completion stays in the current form across all themes. */
#routeFormModal .rf-assignment-readiness { margin:16px 0; padding:12px 14px; background:var(--surface-2,var(--surface)); color:var(--text); border-radius:8px; line-height:1.5; overflow-wrap:anywhere; }
#routeFormModal .rf-assignment-readiness:empty { display:none; }
#routeFormModal .rf-assignment-readiness p { margin:0; }
#routeFormModal .rf-assignment-readiness p + p { margin-top:8px; }
#routeFormModal .rf-assignment-readiness ul { margin:8px 0; padding-inline-start:20px; }
#routeFormModal .rf-assignment-readiness li + li { margin-top:4px; }

/* Road state and review share one form, including the scoped staff editor. */
#routeFormModal .rf-road-state { margin:16px 0 8px; color:var(--text); line-height:1.5; overflow-wrap:anywhere; }
#routeFormModal .rf-road-state strong { display:block; font-size:15px; font-weight:600; }
#routeFormModal .rf-road-state p { margin:4px 0 0; color:var(--text-2); }
#routeFormModal .rf-road-state [data-road-state="loading"] { min-height:70px; }
#routeFormModal .rf-road-review { display:grid; gap:12px; margin:12px 0 20px; padding:16px; border:1px solid var(--border-2); border-radius:12px; background:var(--surface-2); color:var(--text); }
#routeFormModal .rf-road-review > :is(p,ol) { margin:0; }
#routeFormModal .rf-road-review ol { padding-inline-start:24px; line-height:1.5; }
#routeFormModal .rf-road-review li + li { margin-top:6px; }
#routeFormModal .rf-road-preview { margin:0; min-width:0; color:var(--primary); }
#routeFormModal .rf-road-preview svg { display:block; width:100%; height:220px; background:var(--surface); border-radius:8px; }
#routeFormModal .rf-road-preview text { fill:var(--text); stroke:var(--surface); stroke-width:4px; paint-order:stroke; font:13px var(--f2,sans-serif); }
#routeFormModal .rf-road-preview figcaption { margin-top:8px; color:var(--text-2); font-size:13px; line-height:1.5; }
#routeFormModal .rf-road-reviewed { display:flex; align-items:flex-start; gap:10px; min-height:44px; padding:8px 0; margin:0; cursor:pointer; line-height:1.5; }
#routeFormModal .rf-road-reviewed input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; margin:3px 0 0; accent-color:var(--primary); }
#routeFormModal .rf-road-reviewed span { min-width:0; }
#routeFormModal .rf-road-source summary { cursor:pointer; color:var(--text-2); }
#routeFormModal .rf-road-source p { margin:8px 0 0; }
#routeFormModal .rf-actions { position:sticky; bottom:-20px; z-index:6; margin-top:20px; padding:12px 0 20px; border-block-start:1px solid var(--border); background:var(--surface); }

/* One explicit Access service becomes one working AMIS application. */
.access-application-start { margin:20px 0; padding:20px 0; border-block:1px solid var(--border); color:var(--text); }
.access-application-start h3 { margin:0 0 8px; font-size:18px; line-height:1.4; }
.access-application-start p { max-width:75ch; margin:8px 0; overflow-wrap:anywhere; }
.access-case-status { min-height:44px; color:var(--text); }
.access-case-form { display:grid; gap:16px; }
.access-case-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.access-case-form label { display:grid; gap:8px; margin:0; min-width:0; }
.access-case-form input,.access-case-form select { width:100%; min-width:0; padding:10px 12px; min-height:44px; font:inherit; color:var(--text); background:var(--surface); border:1px solid var(--border-2,var(--border)); border-radius:8px; }
.access-case-form .access-case-confirm { display:flex; align-items:flex-start; gap:10px; cursor:pointer; }
.access-case-confirm input { flex:0 0 18px; width:18px; height:18px; min-height:18px; margin:3px 0 0; accent-color:var(--action-primary,var(--primary)); }
.access-case-hint,.access-case-source p { color:var(--text-2,var(--text)); font-size:13px; }
.access-case-source dl { display:grid; grid-template-columns:140px minmax(0,1fr); gap:8px 16px; margin:0 0 16px; }
.access-case-source dt { color:var(--text-2,var(--text)); }.access-case-source dd { margin:0; overflow-wrap:anywhere; }
.access-case-customer-search { max-width:660px; }.access-case-customer-search summary { cursor:pointer; padding:8px 0; }.access-case-customer-search .btn { margin-top:10px; }
.access-case-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.access-case-actions .btn { min-height:44px; white-space:normal; }
.access-case-actions .btn.primary { color:var(--on-primary,#fff); background:var(--action-primary,#176ca4); }
.access-application-start [hidden] { display:none!important; }.access-application-start :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
@media(max-width:850px){.access-case-grid{grid-template-columns:minmax(0,1fr);}}
.operator-route-overlay { position:fixed; inset:0; z-index:5000; padding:24px; align-items:center; justify-content:center; background:rgba(5,16,28,.6); }
.operator-route-overlay #rfModalCard { width:min(1100px,100%); max-height:calc(100vh - 48px); background:var(--surface); color:var(--text); border-radius:12px; overflow:auto; }
.operator-route-overlay #rfModalCard.rf-expanded { position:fixed; inset:0; width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; margin:0; }
.operator-route-overlay .rf-layout { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; }
#routeFormModal.operator-route-overlay .rf-form-panel { padding:20px; min-width:0; box-sizing:border-box; }
#routeFormModal.operator-route-overlay .rf-map-panel { position:sticky; top:0; align-self:start; min-width:0; padding:20px; box-sizing:border-box; }
#routeFormModal.operator-route-overlay #rfMap { height:600px!important; max-height:70vh; }
#routeFormModal.operator-route-overlay .rf-actions { bottom:0; flex-wrap:wrap; padding-block:12px; }
#routeFormModal.operator-route-overlay .rf-actions > :is(button,.context-help-action) { min-width:0; max-width:100%; }
#routeFormModal.operator-route-overlay .rf-actions button { white-space:normal; overflow-wrap:anywhere; }
.operator-route-overlay .vmodal-hdr { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px; border-bottom:1px solid var(--border); }.operator-route-overlay .vmodal-hdr h2 { margin:0 0 8px; }.operator-route-overlay .vmodal-hdr p { margin:0; color:var(--text-2); }
#routeFormModal.rf-case-scope .rf-check:has(#rfHideMap),#routeFormModal.rf-case-scope .rf-workflow-addresses,#routeFormModal.rf-case-scope #rfOccupancySummary { display:none; }
#routeFormModal.rf-case-scope button[onclick*="_geocodeFree"],#routeFormModal.rf-case-scope button[onclick*="_choosePointOnMap"],#routeFormModal.rf-case-scope button[onclick*="_lookupSavedPoint"],#routeFormModal.rf-case-scope button[onclick*="_reuseSavedPoints"],#routeFormModal.rf-case-scope button[onclick*="_editApplicationPeriod"] { display:none; }

#routeFormModal.rf-case-scope .rf-instr{display:none}
/* Scoped route editor uses the operator's existing three theme palettes. */
#routeFormModal.operator-route-overlay.rf-case-scope .rf-form-panel { background:var(--surface); color:var(--text); font-family:var(--f2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-point { background:var(--surface); color:var(--text); border-color:var(--border-2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-sec-title,#routeFormModal.operator-route-overlay.rf-case-scope .rf-point summary,#routeFormModal.operator-route-overlay.rf-case-scope .rf-check { color:var(--text); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-field input,#routeFormModal.operator-route-overlay.rf-case-scope .rf-field select,#routeFormModal.operator-route-overlay.rf-case-scope .rf-field textarea { background-color:var(--surface); color:var(--text); border-color:var(--border-2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-field label,#routeFormModal.operator-route-overlay.rf-case-scope .rf-muted { color:var(--text-2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-field input:focus,#routeFormModal.operator-route-overlay.rf-case-scope .rf-field select:focus,#routeFormModal.operator-route-overlay.rf-case-scope .rf-field textarea:focus { border-color:var(--primary); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-link,#routeFormModal.operator-route-overlay.rf-case-scope .rf-btn.ghost { background:var(--surface-2); color:var(--text); border-color:var(--border-2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-link:hover,#routeFormModal.operator-route-overlay.rf-case-scope .rf-btn.ghost:hover { background:var(--surface-3); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-btn { min-height:44px; border-color:var(--border-2); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-btn.primary { background:var(--experience-action-bg,#176ca4); border-color:var(--experience-action-border,#176ca4); color:var(--experience-action-text,#fff); }
#routeFormModal.operator-route-overlay.rf-case-scope .rf-btn.primary:hover:enabled { background:var(--experience-action-hover,#125a89); }
#routeFormModal.operator-route-overlay.rf-case-scope :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
