/* Final workstation component layer. Explicit neutral surfaces avoid recolouring
   priority badges, status controls, map markers, charts and liaison user colours. */
html[data-themis-theme] .themis-workstation{font-size:var(--th-font)}
.themis-workstation #content{padding:16px;max-width:1920px}
.themis-workstation :is(.topbar,.sidebar,.setup){background:var(--th-surface);border-color:var(--th-line);color:var(--th-text)}
.themis-workstation .sidebar{background:var(--th-nav);padding:10px 8px;overflow-y:auto;scrollbar-width:thin}
.themis-workstation .sidebar nav{overflow:visible}
.themis-workstation .topbar{padding:8px 16px;gap:12px;min-height:60px}
.themis-workstation .top-actions{gap:8px;flex-wrap:wrap;font-size:12px}
.themis-workstation .pc-dms-controls{gap:10px;min-width:0}
.themis-workstation .dms-selector{min-width:190px;letter-spacing:.06em}
.themis-workstation .dms-selector select{font-size:14px;max-width:360px}
.themis-workstation .sidebar .brand{color:var(--th-accent);padding:6px 0}
.themis-workstation .sidebar-controls button{background:var(--th-raised);border-color:var(--th-line);border-radius:4px}
.themis-workstation #simple-navigation{gap:2px}
.themis-workstation #simple-navigation :is(button,summary){min-height:34px;margin:1px 0;padding:6px 8px;font-size:13px;border-radius:4px;background:transparent;border-color:transparent;line-height:1.3}
.themis-workstation #simple-navigation summary{background:var(--th-surface);color:var(--th-muted);font-size:12px}
.themis-workstation #simple-navigation details{border-color:var(--th-line);margin:5px 0;padding-top:3px}
.themis-workstation #simple-navigation button:hover{background:var(--th-hover);filter:none}
.themis-workstation #simple-navigation button.active{background:var(--th-selected);border-color:var(--th-line);box-shadow:inset 3px 0 var(--th-accent);outline:0;color:var(--th-text)}
.themis-workstation #simple-navigation .sidebar-new-call{background:#a5263c!important;border-color:#d45f72;color:#fff}
.themis-workstation #simple-navigation .nav-icon{font-size:18px;min-width:24px}
.themis-workstation .v3-products{padding:8px 4px;gap:4px;margin-bottom:4px}
.themis-workstation .v3-op-reserved{font-size:11px;color:var(--th-muted)}
.themis-workstation :is(h1,h2,h3){letter-spacing:0;line-height:1.3}
.themis-workstation #content h1{font-size:22px;margin:0 0 5px}
.themis-workstation #content h2{font-size:17px;margin:0 0 10px}
.themis-workstation #content h3{font-size:14px;margin:0 0 8px}
.themis-workstation #content p{line-height:1.45}
.themis-workstation :is(.muted,.eyebrow,.map-hint){color:var(--th-muted)}
.themis-workstation #content .page-head{gap:10px;margin-bottom:14px;align-items:center}
.themis-workstation #content .page-head p{margin:4px 0 0}
.themis-workstation #content :is(.row,.grid,.columns,.dashboard-middle,.event-layout,.strategic-layout){gap:var(--th-gap)}
.themis-workstation #content :is(.panel,.stat,.card:where(:not([class*="type-"]):not(.operational-card):not(.configured-measure):not(.resource-tile1221))) {
 background:var(--th-surface);border-color:var(--th-line);border-radius:var(--th-radius);padding:12px;
}
.themis-workstation #content .card{border-radius:var(--th-radius)}
.themis-workstation #content .empty{background:var(--th-input);border-color:var(--th-line);padding:20px 12px;border-radius:var(--th-radius)}
.themis-workstation :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){
 background:var(--th-input);color:var(--th-text);border:1px solid var(--th-line);border-radius:var(--th-radius);padding:6px 8px;min-height:var(--th-control);font-size:14px;max-width:100%;
}
.themis-workstation input[type="checkbox"],.themis-workstation input[type="radio"]{accent-color:var(--th-accent)}
.themis-workstation textarea{min-height:76px;line-height:1.45}
.themis-workstation label{margin-bottom:8px;font-size:12px;color:var(--th-muted)}
.themis-workstation label :is(input,select,textarea){margin-top:4px}
.themis-workstation :is(button,.button){border-radius:var(--th-radius);line-height:1.3}
.themis-workstation :is(.ghost,.button.ghost){background:var(--th-raised);color:var(--th-text);border-color:var(--th-line)}
.themis-workstation button:not([class]):not([style*="background"]):not([data-mobile-status]):not([data-do="new-call"]){background:var(--th-primary);color:var(--th-text);border-color:var(--th-line)}
.themis-workstation :is(button,.button):hover{filter:brightness(1.08);box-shadow:none}
.themis-workstation button:disabled{cursor:not-allowed}
.themis-workstation button.danger{background:var(--th-danger);color:#fff;border-color:#e8798b}
.themis-workstation :is(button,.button)[aria-pressed="true"]:not([style*="background"]):not([data-status]){outline:1px solid var(--th-accent);outline-offset:1px}
.themis-workstation #content :is(.form-grid,.clinical-problem-row){gap:0 10px}
.themis-workstation :is(.footer-actions,.modal-head){margin-top:12px;margin-bottom:12px;gap:8px}
.themis-workstation .section-label{padding:10px 0 7px;margin-top:8px;color:var(--th-muted)}
.themis-workstation #content table{font-size:13px}
.themis-workstation #content :is(td,th){padding:7px 8px;border-bottom-color:var(--th-line);vertical-align:middle}
.themis-workstation #content th{font-size:11px;letter-spacing:.04em}
.themis-workstation :is(.table-wrap,.table-scroll){max-width:100%;overflow:auto;scrollbar-width:thin}
.themis-workstation .pma-team-table thead th{background:var(--th-raised)}
.themis-workstation .home-title1216{padding:6px 0 12px}
.themis-workstation .home-title1216 h1{font-size:24px}
.themis-workstation .home-brand1216{font-size:20px;color:var(--th-accent)}
.themis-workstation :is(.home-metrics1216,.home-actions1216){gap:10px}
.themis-workstation .home1216 .home-metric1216{padding:12px;background:var(--th-surface);border-color:var(--th-line);border-radius:var(--th-radius);min-height:90px}
.themis-workstation .home-metric1216 strong{font-size:28px;margin:5px 0}
.themis-workstation .home1216 .home-action1216{padding:12px;gap:10px;min-height:70px;border-radius:var(--th-radius);background:var(--th-raised);border-color:var(--th-line)}
.themis-workstation .home1216 .home-emergency1216{background:#a5263c;border-color:#d45f72}
.themis-workstation .home-action1216 :is(strong,small){font-size:13px}
.themis-workstation .home-action1216 svg{width:26px;height:26px;min-width:26px}
.themis-workstation :is(.home-section1216,.home-secondary1216){margin:14px 0 10px}
.themis-workstation .home1216>.panel,.themis-workstation .home1216 .home32-means{margin-top:14px}
.themis-workstation .home1216 .map{height:clamp(250px,34vh,400px)}
.themis-workstation .stats{gap:10px;margin-bottom:14px}
.themis-workstation .stat strong{font-size:28px;margin-top:5px}
.themis-workstation .operation-counters{gap:10px;margin-bottom:14px}
.themis-workstation .operation-counters article{padding:12px;border-radius:var(--th-radius)}
.themis-workstation .operation-counters strong{font-size:28px}
.themis-workstation .reg-layout{gap:12px;align-items:start}
.themis-workstation .reg-layout>section{min-width:0}
.themis-workstation .reg-layout .call-list{min-height:0;max-height:calc(100dvh - 235px);scrollbar-gutter:stable;scrollbar-width:thin}
.themis-workstation .call-button{padding:9px;margin-bottom:6px;border-radius:var(--th-radius)}
.themis-workstation .call-button.selected{outline:2px solid var(--th-accent);outline-offset:-2px}
.themis-workstation .call-button strong{margin-bottom:4px;font-size:13px}
.themis-workstation .call-button small{margin-top:4px;font-size:12px}
.themis-workstation .alarm-stage{padding:12px;margin-bottom:12px;border-color:var(--th-line);border-radius:var(--th-radius)}
.themis-workstation #call-form .alarm-stage>h2{font-size:17px;margin-bottom:10px;gap:8px}
.themis-workstation .alarm-stage>h2>span{width:25px;height:25px;border-radius:4px;background:var(--th-primary)}
.themis-workstation .alarm-stage .reg-form-block{padding:7px 0}
.themis-workstation .alarm-save-bar{padding:8px;gap:6px;bottom:6px;background:var(--th-raised);border-color:var(--th-line);border-radius:var(--th-radius);box-shadow:0 2px 12px #0004}
.themis-workstation #engagement-slots1221{gap:5px;margin:8px 0}
.themis-workstation #engagement-slots1221 .engagement-row1223{height:44px;min-height:44px;max-height:44px}
.themis-workstation .engagement-row1223.empty{background:var(--th-input)}
.themis-workstation #content .people-filters1221{padding:10px;gap:10px}
.themis-workstation .v3-directory-filters{gap:10px}
.themis-workstation .dms-person-row{padding:8px 10px;gap:8px;border-radius:var(--th-radius)}
.themis-workstation #content .resource-tile1221{padding:12px;gap:12px;border-radius:var(--th-radius)}
.themis-workstation #content .resource-tile1221 .resource-tags1221{min-height:0;gap:5px}
.themis-workstation #content .resource-tile1221 .resource-img{height:72px!important}
.themis-workstation .resource-tags1221 span{padding:4px 6px;font-size:12px;border-radius:4px}
.themis-workstation :is(.event-row,.hospital-option,.simple-details,.v3-passive-units){border-radius:var(--th-radius)}
.themis-workstation .event-row{padding:10px;background:var(--th-surface);border-color:var(--th-line)}
.themis-workstation .pma-chart-grid{gap:12px}
.themis-workstation :is(.pma-history-chart,.alarm-history){margin-top:12px}
.themis-workstation .login-wrap{background:var(--th-bg)}
.themis-workstation .setup{padding:24px;border-radius:6px}
.themis-workstation .setup .brand{color:var(--th-accent)}
.themis-workstation .setup form{margin-top:20px}
.themis-workstation #toast{border-radius:6px;border:1px solid var(--th-line);background:var(--th-raised);box-shadow:0 4px 16px #0005;padding:12px 16px}
.themis-workstation #toast.error{background:#862239;border-color:#e8798b}
/* Fine pointer: information density without reducing touch hit areas. */
@media(min-width:1000px) and (pointer:fine){
 .themis-workstation #content :is(button,.button),.themis-workstation .topbar :is(button,.button){min-height:34px;padding:6px 10px;font-size:13px}
 .themis-workstation #content :is(.panel,.card){padding:12px}
 .themis-workstation #content .page-head>.row{gap:6px}
 .themis-workstation dialog{padding:18px}
}
@media(min-width:1251px){
 .themis-workstation #content .reg-layout:not(.reg-unselected):has(#call-form){grid-template-columns:clamp(180px,var(--interventions-width,220px),340px) minmax(0,1.4fr) minmax(270px,.95fr)}
 .themis-workstation #content .reg-layout>.map-panel{position:sticky;top:10px}
}
@media(min-width:1600px){.themis-workstation #content .reg-layout:not(.reg-unselected):has(#call-form){grid-template-columns:var(--interventions-width,250px) minmax(0,1.4fr) minmax(330px,1fr)}}
@media(max-width:1100px){.themis-workstation .topbar{align-items:flex-start}.themis-workstation .top-actions{justify-content:flex-end}.themis-workstation .topbar #user-label{max-width:170px;overflow-wrap:anywhere}}
@media(pointer:coarse),(max-width:999px){
 html[data-themis-theme]{--th-control:44px}
 .themis-workstation :is(button,.button),.themis-workstation #simple-navigation :is(button,summary){min-height:44px;padding:9px 10px}
 .themis-workstation :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){font-size:16px}
 .themis-workstation .resource-button1221{min-width:44px!important;min-height:44px!important}
 .themis-workstation #engagement-slots1221 .engagement-row1223{height:52px;min-height:52px;max-height:52px}
 .themis-workstation .engagement-row1223.filled{grid-template-columns:minmax(0,1fr) auto 44px}
 .themis-workstation .engagement-row1223 button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
 .themis-workstation .interventions-resizer{min-width:24px}
}
@media(max-width:760px){
 .themis-workstation #content{padding:10px}
 .themis-workstation .topbar{padding:8px 10px;gap:8px}
 .themis-workstation .top-actions{justify-content:flex-start;gap:6px;width:100%}
 .themis-workstation .pc-dms-controls{flex-wrap:wrap;width:100%}
 .themis-workstation .dms-selector{min-width:0;flex:1}
 .themis-workstation .dms-selector select{max-width:100%}
 .themis-workstation #content :is(.page-head,.page-head>.row){align-items:flex-start;justify-content:flex-start}
 .themis-workstation #content :is(.columns,.event-layout,.strategic-layout,.dashboard-middle){grid-template-columns:minmax(0,1fr)}
 .themis-workstation .reg-layout:has(#call-form){display:flex!important;flex-direction:column;gap:10px}
 .themis-workstation .reg-layout:has(#call-form)>section{width:100%!important;max-width:100%;grid-column:auto!important}
 .themis-workstation .reg-layout:has(#call-form)>section:first-child{position:static;max-height:270px;overflow:auto;padding:8px}
 .themis-workstation .reg-layout:has(#call-form)>section:first-child .call-list{max-height:140px}
 .themis-workstation .reg-layout:has(#call-form) .mission-short481{display:grid;grid-template-columns:auto 1fr;gap:8px;font-size:13px}
 .themis-workstation #call-form .alarm-stage{padding:10px}
 .themis-workstation .home1216 .home-action1216{min-height:64px}
 .themis-workstation dialog{max-width:calc(100vw - 16px);padding:14px}
 .themis-workstation .personnel-table td:last-child{min-width:0}
}
@media(max-width:500px){
 .themis-workstation #content h1{font-size:20px}
 .themis-workstation .home-metrics1216{grid-template-columns:repeat(2,minmax(0,1fr))}
 .themis-workstation #content :is(.panel,.card){padding:10px}
 .themis-workstation .v3-directory-filters label{min-width:0;width:100%}
 .themis-workstation .home-action1216 small{margin-top:4px}
 .themis-workstation #toast{left:74px;right:8px;bottom:8px;max-width:none}
}
/* Neutral primary actions and tabs use cyan; urgency/status classes remain intact. */
.themis-workstation #content button:not(.ghost):not(.danger):not([class]):not([style*="background"]):not([data-status]):not([data-priority]):not([data-do="new-call"]){background:var(--th-primary);border-color:var(--th-accent);color:var(--th-text)}
.themis-workstation :is(.dispatch-tabs,.directory-tabs431) button[aria-selected="true"],
.themis-workstation .directory-tabs431 button[aria-pressed="true"]{background:var(--th-selected)!important;border-color:var(--th-accent)!important;color:var(--th-text)!important;box-shadow:inset 0 -2px var(--th-accent)}
.themis-workstation .sidebar.icons-only431 #simple-navigation button.active{background:var(--th-selected)!important;border-color:var(--th-accent)!important;box-shadow:none}
.themis-workstation :is(.top-actions,#connection,.test-pill){color:var(--th-muted)}
.themis-workstation #connection.connection-failed{color:#ffbd70!important}
.themis-workstation #content .home-action1216{min-height:64px}
.themis-workstation #content .home-section1216{margin-top:16px;margin-bottom:10px}
.themis-workstation .home1216>.panel .map{height:clamp(250px,34vh,400px)!important;min-height:0}
.themis-workstation #call-form .save-call-button{background:var(--th-accent)!important;color:#10212f!important}
.themis-workstation dialog :is(h1,h2){font-size:20px;margin:0 0 12px}
@media(min-width:1000px) and (pointer:fine){
 .themis-workstation :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){font-size:14px!important}
 .themis-workstation #modal :is(button,.button){min-height:34px;padding:6px 10px;font-size:13px}
}
@media print{
 html[data-themis-theme="dark"]{color-scheme:light;--th-bg:#fff;--th-surface:#fff;--th-raised:#eef2f6;--th-text:#14212e;--th-muted:#3c5062;--th-line:#8b9cae;--th-input:#fff;--th-accent:#155c7b;--th-primary:#e2edf3}
 .themis-workstation :is(.sidebar,.topbar){display:none!important}
 .themis-workstation .workspace{margin:0!important}
}
/* Prevent fieldset intrinsic widths and secondary tabs from widening phones. */
.themis-workstation #content fieldset{min-inline-size:0;max-width:100%}
.themis-workstation #content .operation-tabs{flex-wrap:wrap}
.themis-workstation #content .panel>table:has([data-do="user-profile"]){display:block;max-width:100%;overflow-x:auto}
@media(prefers-reduced-motion:reduce){html[data-themis-theme] .themis-workstation .sidebar,html[data-themis-theme] .themis-workstation .workspace{transition:none!important}}
.themis-workstation #content .dispatch-tabs{flex-wrap:wrap;gap:6px;margin-bottom:12px}
.themis-workstation #content .dispatch-tabs button{white-space:normal}
.themis-workstation #content .pma-dashboard-cat{border-top-color:var(--category-color)}
.themis-workstation #content :is(.grid,.pma-dashboard-grid,.pma-chart-grid)>.panel{margin-top:0}
.themis-workstation :is(.reg-form-block,.pma-heading,.regulation-form,.mission-detail,.sii-text,.sii-text pre){background:var(--th-surface)}
.themis-workstation #content .page-head button:not(.ghost):not(.danger):not([data-do="new-call"]):not([style*="background"]){background:var(--th-primary);border-color:var(--th-accent)}
.themis-workstation .themis-map-legend{background:var(--th-raised);border-color:var(--th-line);color:var(--th-muted)}
.themis-workstation .themis-map-legend summary{color:var(--th-muted)}
.themis-workstation .dms-actions49 [data-dms-action49="select"]{background:var(--th-accent)!important;border-color:var(--th-accent);color:#10212f!important}
.themis-workstation #content .pma-categories>.panel{margin-top:0;border-top-width:4px}
.themis-workstation :is(.home32-stat,.home32-means .dashboard-counter){background:var(--th-raised);border:1px solid var(--th-line)}
@media(min-width:1100px) and (pointer:fine){
 .themis-workstation .topbar{min-height:54px}
 .themis-workstation .dms-selector{display:flex;align-items:center;gap:8px;white-space:nowrap}
 .themis-workstation .dms-selector select{margin-top:0;min-width:170px;width:auto;max-width:300px}
}
