/* FAST 59 shared interface: scoped visual rules preserve all permission and data flows. */
:root{--ui-ink:#17324b;--ui-muted:#627589;--ui-line:#dce5ec;--ui-surface:#fff;--ui-bg:#f3f6f9;--ui-focus:#167d92}
body{color:var(--ui-ink);background:var(--ui-bg);line-height:1.55}
body:not(.field-app)>.container{max-width:1160px;padding:24px;margin:auto}
#appBox>.card,#loginBox{border:1px solid var(--ui-line);border-radius:18px;box-shadow:0 5px 22px #18344806;background:var(--ui-surface)}
#appBox>.card{padding:24px;margin-bottom:20px}
#appBox h2{font-size:23px;line-height:1.35;margin-top:0}
#appBox h3{font-size:18px;line-height:1.4}
#appBox .hint{font-size:13px;line-height:1.65;color:var(--ui-muted)}
#appBox input:not([type=checkbox]):not([type=radio]):not([type=hidden]),#appBox select,#appBox textarea,#loginBox input{box-sizing:border-box;max-width:100%;border:1px solid #cfdbe5;border-radius:10px;background:#fff;color:#1c3449;font-size:15px;padding:11px 12px;min-height:44px;box-shadow:none}
#appBox textarea{resize:vertical;min-height:88px;line-height:1.6}
#appBox input::placeholder,#appBox textarea::placeholder{color:#7b8a98}
#appBox :is(input,textarea,select,button):focus-visible,#loginBox :is(input,button):focus-visible{outline:3px solid #138c9b40;outline-offset:2px}
#appBox button{font-size:14px;line-height:1.4;min-height:42px;border-radius:10px;cursor:pointer}
#appBox button:disabled{cursor:default;opacity:.55}
#appBox .form-grid{gap:14px;margin-bottom:16px;align-items:start}
#appBox .section-title-row,#appBox .group-page-header,#appBox .group-section-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:18px}
#appBox .section-title-row h2,#appBox .group-page-header h2{margin-bottom:4px}
#caseList .case-card{padding:20px;border:1px solid var(--ui-line);border-radius:14px;box-shadow:none;margin-bottom:14px;overflow-wrap:anywhere}
#caseList .case-card h3{margin:0 0 12px;font-size:19px}
#caseList .case-card p{margin:8px 0;line-height:1.6}
#userList .user-card{padding:18px!important;border:1px solid var(--ui-line);border-radius:14px!important;box-shadow:none!important}
#userList{gap:12px}
#userList .user-card p{margin:7px 0;font-size:14px;overflow-wrap:anywhere}
#userManagePanel .form-grid,#firstAidPostPanel .form-grid{padding:16px;border:1px solid #e4ebf0;background:#f8fafc;border-radius:12px}
#dashboardPanel .dashboard-hero{padding:22px 24px;border-radius:16px;background:#173950;box-shadow:none;min-height:0}
#dashboardPanel .dashboard-hero h2{font-size:25px;margin:6px 0}
#dashboardPanel .dashboard-eyebrow{font-size:11px;letter-spacing:.1em}
#dashboardPanel .dashboard-hero p{font-size:14px;margin:6px 0 0}
#dashboardPanel .dashboard-stat-grid{gap:12px;margin:18px 0}
#dashboardPanel .dashboard-stat-card{padding:17px;border-radius:14px;border:1px solid var(--ui-line);box-shadow:none;min-height:0}
#dashboardPanel .dashboard-section{padding:20px;border:1px solid var(--ui-line);border-radius:16px;box-shadow:none;margin-bottom:16px}
#dashboardPanel .dashboard-empty{padding:22px;font-size:14px;border-radius:10px;min-height:0}
#dashboardPanel .dashboard-section-header{margin-bottom:16px;gap:12px;flex-wrap:wrap}
#dashboardPanel .dashboard-location-card{padding:16px;border-radius:12px;min-height:0}
#dashboardPanel .dashboard-medic-row{padding:12px 0}
#groupManagePanel .group-section{margin-top:20px}
#groupManagePanel .group-card{border:1px solid var(--ui-line);border-radius:14px;box-shadow:none;padding:18px}
#groupManagePanel .group-summary-grid{gap:12px}
#patientManagementPanel,#patientManagePanel{overflow-wrap:anywhere}
#patientManagementPanel .patient-card,#patientManagePanel .patient-card{padding:18px;border:1px solid var(--ui-line);border-radius:14px;box-shadow:none}
#loginBox{max-width:560px;margin:20px auto;padding:28px}
#loginBox .login-brand{margin-bottom:18px}#loginBox .login-guide{background:#f7fafb}
#loginBox #loginBtn{width:100%;min-height:46px;background:#176b7b;border-radius:10px}
.field-clean-header{border-bottom:1px solid var(--ui-line)!important;box-shadow:0 2px 10px #17324b06!important}
.field-clean-header .field-clean-identity{min-width:0}
.field-bottom-nav button{font-size:12px}
.mission-case-card,.field-route-case-card{border:1px solid var(--ui-line);border-radius:16px;box-shadow:none}
.mission-empty-card,.mission-empty-inline{padding:22px;min-height:0}
.mission-section-heading{margin-bottom:16px}
.field-patient-action-sheet{box-sizing:border-box;max-height:90dvh;overflow-y:auto;overscroll-behavior:contain}
.field-patient-action-head{position:sticky;top:0;background:white;z-index:2;padding-bottom:14px}
#fast59OpsDialog{border:1px solid var(--ui-line)!important;border-radius:20px!important;box-shadow:0 20px 80px #142e4b33!important}
#fast59OpsDialog>nav button{min-height:40px!important;border-radius:9px!important;font-size:14px!important}
@media(min-width:900px){#dashboardPanel .dashboard-location-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}}
@media(max-width:650px){body:not(.field-app)>.container{padding:16px}#appBox>.card{padding:16px;margin-bottom:14px}#appBox h2{font-size:21px}#appBox .form-grid{grid-template-columns:1fr;gap:12px}#userManagePanel .form-grid,#firstAidPostPanel .form-grid{padding:12px}#caseList .case-card{padding:16px}#dashboardPanel .dashboard-hero{padding:18px}#dashboardPanel .dashboard-hero h2{font-size:22px}#dashboardPanel .dashboard-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#dashboardPanel .dashboard-stat-card{padding:14px}#dashboardPanel .dashboard-section{padding:16px}#loginBox{padding:22px;margin:16px auto}.field-patient-action-sheet{max-height:94dvh;border-radius:18px}.mission-case-card{padding:16px}}
/* Each position has its own accent; labels remain the authoritative identity. */
body{--duty-accent:#176b7b;--duty-tint:#eaf5f6}
body[data-duty-position="admin"]{--duty-accent:#6d3ca0;--duty-tint:#f3ecfa}
body[data-duty-position="dispatcher"]{--duty-accent:#175fa6;--duty-tint:#eaf2fc}
body[data-duty-position="YUT"]{--duty-accent:#126747;--duty-tint:#e9f6ef}
body[data-duty-position="YUT IC"],body[data-duty-position="YUT SIC"]{--duty-accent:#8e4c0c;--duty-tint:#fff3e5}
body[data-duty-position="IC"]{--duty-accent:#9d303c;--duty-tint:#fceef0}
body[data-duty-position="SIC"]{--duty-accent:#9b4c19;--duty-tint:#fff1e8}
body[data-duty-position="OFFICE"],body[data-duty-position="OFFICER"]{--duty-accent:#65449b;--duty-tint:#f2edf9}
body[data-duty-position="AUO"]{--duty-accent:#526311;--duty-tint:#f2f6e5}
body[data-duty-position="UO"]{--duty-accent:#30518f;--duty-tint:#edf1fb}
body .field-clean-header{border-top:4px solid var(--duty-accent)!important}
body .field-clean-identity h1,body .field-clean-identity h2{color:var(--duty-accent)!important}
body #v6AdminWorkspace .v6-admin-role{color:var(--duty-accent);background:var(--duty-tint);border-color:var(--duty-accent)}
body #v6AdminWorkspace .v6-admin-shortcut.is-active,body .field-management-nav>button.active{background:var(--duty-tint)!important;color:var(--duty-accent)!important;border-color:var(--duty-accent)!important}
/* Containment follows the viewport rather than hiding overflowing controls. */
*,*::before,*::after{box-sizing:border-box}
#appBox,#fieldRouterPanel,.mobile-field-shell,.field-management-more-sheet,.field-patient-action-sheet{min-width:0;max-width:100%}
#appBox :is(.form-grid,.section-title-row,.group-page-header,.group-section-heading,.group-card-header,.group-card-footer,.dashboard-two-column,.dashboard-stat-grid,.dashboard-location-grid)>*{min-width:0}
#appBox :is(h2,h3,p,label,.group-card-title,.user-card,.case-card){overflow-wrap:anywhere}
.field-clean-header .field-clean-identity{min-width:0;overflow-wrap:anywhere}
.field-management-more-sheet,.field-patient-action-sheet{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto;overscroll-behavior:contain}
@media(max-width:760px){
 body:not(.field-app)>.container{width:100%;padding:14px}
 #appBox>.card{width:100%;max-width:100%;padding:16px}
 #appBox :is(.form-grid,.dashboard-two-column){grid-template-columns:minmax(0,1fr)!important}
 #appBox :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){width:100%;min-width:0;font-size:16px}
 #appBox .section-title-row>select,#appBox .section-title-row>input{flex:1 1 180px}
 #appBox :is(.group-card-actions,.group-card-footer,.v74-command-actions){flex-wrap:wrap;gap:8px}
 #appBox :is(.group-card-actions,.v74-command-actions)>button{flex:1 1 130px;white-space:normal}
 body.field-app .field-clean-header{width:100%!important;left:0!important;right:0!important;padding-left:12px!important;padding-right:12px!important;gap:8px!important}
 body.field-app .field-clean-identity h1,body.field-app .field-clean-identity h2{font-size:20px!important;line-height:1.35!important}
 body.field-app .field-clean-header>#fast59ToolsEntry{max-width:100px!important;min-width:0!important;font-size:12px!important}
 .field-bottom-nav,.field-management-nav{width:100%!important;max-width:100%!important;left:0!important;right:0!important;padding-bottom:env(safe-area-inset-bottom)}
 .field-bottom-nav>button,.field-management-nav>button{min-width:0!important;flex:1 1 0!important;padding-left:3px!important;padding-right:3px!important;font-size:11px!important}
 #v6AdminWorkspace .v6-admin-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}
 #v6AdminWorkspace .v74-admin-actions>button{flex:1 1 130px;white-space:normal}
 #appBox .dashboard-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #appBox .dashboard-location-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #fast59OpsDialog,.admin-email-overlay section,.v74-sheet{max-width:calc(100vw - 20px)!important;min-width:0!important}
 .admin-email-overlay{padding:10px}.admin-email-overlay section{padding:18px}
}
@media(min-width:761px) and (max-width:1100px){body:not(.field-app)>.container{width:100%;padding:24px}#appBox .dashboard-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

body[data-duty-position="SENIOR_MEDIC"]{--duty-accent:#236c65;--duty-tint:#e8f5f2}
#personnelSearch{display:block;width:100%;min-width:0;margin:8px 0 16px;font-size:16px}

.directory-count{font-size:.86rem;color:#435a70;font-variant-numeric:tabular-nums}
.directory-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(7rem,10rem);gap:.75rem;margin-block:1rem}
.directory-filters label{display:grid;gap:.35rem;min-width:0}
.directory-filters :is(input,select){width:100%;min-width:0}
#userList > .user-card{padding:1rem;min-width:0;border:1px solid #d8e3ed;border-radius:14px}
.directory-section{margin-block:1rem}
.directory-section h3{font-size:1rem;margin-bottom:.7rem}
#firstAidPostList{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));gap:.75rem}
.directory-post,.directory-editor{padding:1rem;border:1px solid #d8e3ed;border-radius:14px;background:#fff;color:#17324d}
.directory-post-title{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}
.directory-post :is(h4,p,dd){overflow-wrap:anywhere}
.directory-post h4{margin:.15rem 0;font-size:1.08rem}
.directory-post small,.directory-post dt{color:#4c6073}
.directory-post dl{display:flex;flex-wrap:wrap;gap:.5rem 1rem;margin:.75rem 0}
.directory-post dt{font-size:.78rem}
.directory-post dd{margin:0;font-weight:600}
.directory-state{border-radius:999px;padding:.2rem .55rem;background:#edf1f5;color:#435a70;white-space:nowrap}
.directory-state[data-active=true]{background:#dcf4e8;color:#14603c}
.directory-editor summary{font-weight:700;cursor:pointer}
.directory-editor[open] summary{margin-bottom:.75rem}

/* Mobile field navigation and shared task dialogs */
.fast59-more .fm4-top{display:flex;align-items:center;gap:12px;padding:0;background:none;min-height:44px}
.fast59-more .fm4-top h2{margin:0;font-size:1.45rem}
.fast59-more .fm4-back{width:44px;min-width:44px;flex:none}
.fast59-more .fm4-section-label{margin-top:20px}
.fast59-more .fm4-list .fm4-row{min-height:58px}
.fast59-more .fm4-card{margin-bottom:12px}
.fast59-case-nav{column-gap:4px!important}
.fast59-case-nav > button{flex:1 1 0!important;min-width:0!important}
.fast59-tool-dialog{box-sizing:border-box;width:min(94vw,620px);max-height:calc(100dvh - 32px);overflow:auto;padding:0;border:1px solid #dbe4ed;border-radius:18px;background:#fff;color:#17324d}
.fast59-tool-dialog::backdrop,#fieldStatusModal::backdrop{background:#17263f66}
.fast59-tool-head{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#fff;border-bottom:1px solid #dbe4ed;z-index:1}
.fast59-tool-head h2{font-size:1.2rem;margin:0}
.fast59-tool-head button,#fieldStatusModal [data-status-close]{flex:0 0 44px!important;width:44px!important;height:44px;min-width:44px!important;margin:0!important;padding:0!important;border-radius:10px!important;background:#eef3f8!important;color:#17324d!important;font-size:1.3rem}
.fast59-tool-content{display:grid;gap:12px;padding:16px;min-width:0}
.fast59-tool-content[hidden]{display:none}
.fast59-tool-content fieldset{min-width:0;border:1px solid #dbe4ed;border-radius:12px;padding:12px}
.fast59-tool-content p{margin:0}
.fast59-tool-content > p[role=status]:empty{display:none}
.fast59-tool-note{color:#4b6076;line-height:1.5}
.fast59-tool-state{font-weight:700}
.fast59-tool-actions{display:flex;flex-wrap:wrap;gap:8px}
.fast59-tool-actions button{flex:1 1 auto;min-height:44px}
#fieldStatusModal{inset:auto 0 0;margin:0 auto;width:min(100%,620px);max-width:100%;padding:0;border:0;background:transparent;overflow:visible}
#fieldStatusModal:not([open]){display:none}
#fieldStatusModal[open]{display:block}
#fieldStatusModal .field-status-sheet{max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain}
#fieldStatusModal .field-status-head{align-items:center;gap:12px}
#fieldStatusModal .field-status-options button{color:#17324d!important}
.clean-account-actions{display:grid;gap:8px}
.clean-account-actions button[data-account-action="status"],.clean-account-actions button[data-account-action="mode"]{background:#eef3f8!important;color:#17324d!important}
body.field-app #fast59SyncBadge{position:static!important;font-size:11px!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.field-app #fast59SyncBadge.fast59-mci-toggle[hidden],#casePatientNumberControls[hidden],#fast59OpsDialog [hidden]{display:none!important}
.fast59-people-grid{display:grid;gap:10px}
.fast59-person-card{display:flex;align-items:center;gap:12px}
.fast59-person-card > div{flex:1;min-width:0;overflow-wrap:anywhere}
.fast59-person-card :is(h3,p){margin:0}
.fast59-person-card .fm4-avatar{flex:none;width:42px;height:42px}
body.field-app #fast59ToolsEntry{display:none!important}
body.field-app #fast59SyncBadge{display:block;width:fit-content;margin-top:4px}
#v74OpsOverlay .v74-sheet-head{gap:12px}
#v74OpsOverlay #v74Close{flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:0;border-radius:10px}
#v74OpsOverlay .v73-card{border:1px solid #dbe4ed;border-radius:16px;box-shadow:none}
body.field-app .field-management-more-list button[data-management-tool]{grid-template-columns:minmax(0,1fr) auto}
body.field-app .field-management-more-list button[data-management-tool] > span{min-width:0}
.fast59-mci-toggle[hidden],#casePatientNumberControls[hidden],#fast59OpsDialog [hidden]{display:none!important}
.fast59-more-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fast59-more-tile{min-width:0;padding:10px;border:1px solid #dbe4ed;border-radius:14px;background:#fff}
.fast59-more-tile h3{font-size:1rem;margin:4px 4px 8px}
.fast59-more .fast59-more-tile .fm4-row{min-height:44px;width:100%;margin:0;padding:7px 4px;border-radius:6px;gap:3px;background:#fff;color:#17324d}
.fast59-more-tile .fm4-row-copy strong{font-size:.85rem;overflow-wrap:anywhere}
.fast59-more-tile .fm4-chevron{font-size:1rem}
#fieldManagementMoreOverlay{box-sizing:border-box;width:min(100%,700px);margin:auto;padding:calc(var(--field-header-h, 100px) + 16px) 16px calc(100px + env(safe-area-inset-bottom));min-height:100dvh}
body.field-app:has(#fieldManagementMoreOverlay) #appBox{display:none!important}
.fast59-account-logo{width:48px;height:48px;object-fit:contain;display:inline-block;vertical-align:middle}
.clean-account-top h2:has(+.fast59-account-logo),.clean-account-head h2:has(+.fast59-account-logo){display:inline-block;margin-inline-end:8px}
.fast59-person-card{align-items:flex-start}
.fast59-person-card dl{margin:8px 0 0}
.fast59-person-card dl > div{display:grid;grid-template-columns:4.5em 1fr;gap:5px;margin-top:4px;font-size:.84rem}
.fast59-person-card dd{margin:0}
.fast59-mci-toggle{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.fast59-mci-toggle input{min-width:18px;width:18px;height:18px}
@media(max-width:700px){
 #fast59PatrolDialog{width:100%;max-width:100%;max-height:calc(100dvh - env(safe-area-inset-top));margin:auto 0 0;inset:auto 0 0;overscroll-behavior:contain}
 #fast59PatrolDialog .pt-header{position:sticky;top:0;z-index:2;padding:10px 14px}
 #fast59PatrolDialog .pt-body{padding:10px 12px calc(12px + env(safe-area-inset-bottom))}
 #fast59PatrolDialog :is(.pt-grid,.pt-card,.pt-hero){gap:8px;margin:0 0 8px;padding:10px 12px}
 #fast59PatrolDialog .pt-hero h3{font-size:1.3rem}
 #fast59PatrolDialog details summary{font-weight:700;padding:5px}
 #fast59PatrolDialog #ptHistory{max-height:40dvh;overflow:auto}
}

/* Keep the mobile pages close to the measured fixed header. */
body.field-app .field-router-panel > .field-more-v4.v5-more{
  padding-top:calc(var(--fast59-live-header, 100px) + 12px)!important;
  scroll-margin-top:var(--fast59-live-header, 100px);
}
#fieldManagementMoreOverlay{padding-top:calc(var(--fast59-live-header, 100px) + 12px)}
.fast59-more-grid{align-items:start;gap:12px;margin-top:8px}
.fast59-more-tile{padding:10px;background:linear-gradient(155deg,#f0f5fb,#fff 58%)}
.fast59-more-tile h3{margin:4px 4px 8px}
.fast59-more .fast59-more-tile .fm4-row{background:transparent;border-radius:0}
.fast59-more .fast59-more-tile .fm4-row + .fm4-row{border-top:1px solid #e5edf5}
.fast59-more .fm4-card{padding:14px}
.fast59-more .fm4-section-label{margin-top:14px}
body:has(#fast59SupplyPage) :is(#appBox,#fieldManagementMoreOverlay){display:none!important}
#fast59SupplyPage{
  width:min(100%,700px);margin:0 auto;min-height:100dvh;box-sizing:border-box;color:#17324d;
  padding:16px 16px max(20px,env(safe-area-inset-bottom));
}
body.field-app #fast59SupplyPage{
  padding-top:calc(var(--fast59-live-header,100px) + 12px);
  padding-bottom:calc(var(--field-bottom-nav-h,80px) + 24px + env(safe-area-inset-bottom));
}
.fast59-supply-head{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.fast59-supply-head h2{margin:0;font-size:1.45rem}
.fast59-supply-head [data-supply-back]{width:auto!important;flex:none;min-height:44px}
#fast59SupplyPage form,.fast59-supply-history{display:grid;gap:8px;padding:14px;margin-bottom:10px;border:1px solid #dbe4ed;border-radius:14px;background:white}
#fast59SupplyPage :is(form,label,ul,li){min-width:0}
#fast59SupplyPage [hidden]{display:none!important}
#fast59SupplyPage :is(input,select){width:100%;min-width:0;font-size:16px}
#fast59SupplyPage h3{margin:6px 0;font-size:1rem}
#fast59SupplyPage [data-items]{margin:0;padding:0;list-style:none}
#fast59SupplyPage li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 0;border-top:1px solid #dce5ed}
#fast59SupplyPage li span{overflow-wrap:anywhere}
#fast59SupplyPage li button{width:auto!important;flex:none;margin:0}
.fast59-batch-actions{display:flex;gap:8px}
.fast59-batch-actions button{flex:1 1 auto}
.fast59-supply-history article{border-top:1px solid #dce5ed;padding:8px 0}
@media(max-width:700px){
 #fast59PatrolDialog{position:fixed!important;inset:0!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important}
 #fast59PatrolDialog .pt-header{padding-top:calc(8px + env(safe-area-inset-top))}
 #fast59PatrolDialog .pt-grid{padding:0}
 #fast59PatrolDialog .pt-hero p{margin:6px 0 0}
 #v74OpsOverlay .v74-sheet{width:100%!important;max-width:none!important;padding:10px 12px calc(14px + env(safe-area-inset-bottom));overflow:visible!important}
 #v74OpsOverlay .v74-sheet-head{top:0!important;padding:8px 0;margin-bottom:6px}
 #v74OpsOverlay .v74-sheet-head small{display:none}
 #v74OpsOverlay .v74-sheet-tabs{position:static!important;margin:0 0 8px;padding:0}
 #v74OpsOverlay .v73-table-wrap{overflow-x:auto}
 #v74OpsOverlay .v73-table-wrap table{min-width:440px}
 #v74OpsOverlay .v73-card{padding:12px;margin-top:8px}
}
.fast59-qr-camera{display:grid;gap:8px}
.fast59-qr-camera video{width:100%;max-height:38dvh;object-fit:contain;border-radius:10px;background:#132131}
#fast59SupplyPage [data-equipment-qr]{margin:0;justify-self:start;text-align:center}
#fast59SupplyPage [data-equipment-qr] img{display:block;width:min(190px,100%);height:auto}
#fast59SupplyPage [data-equipment-qr] a{display:inline-flex;align-items:center;min-height:44px;font-weight:650}
.fast59-equipment-directory{padding:14px;border:1px solid #dbe4ed;border-radius:14px;background:#fff;margin-bottom:12px}
.fast59-equipment-directory h3 small{float:right;font-weight:normal;color:#4b6076}
.fast59-equipment-list{display:grid;gap:6px;margin-top:8px;max-height:34dvh;overflow:auto}
#fast59SupplyPage .fast59-equipment-row{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:8px;min-height:44px;margin:0;padding:8px}
.fast59-equipment-row strong{overflow-wrap:anywhere}
.fast59-equipment-row small{white-space:nowrap}
.fast59-account-profile{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.fast59-account-profile > div{min-width:0;overflow-wrap:anywhere}
.fast59-account-profile h3{font-size:1.25rem;margin:0 0 3px}
.clean-account-identity .fast59-account-profile strong{margin:0;font-size:.86rem;color:#475569}
.fast59-account-profile .fast59-account-logo{width:clamp(90px,28vw,136px);height:auto;flex:none}
#fast59SupplyPage .fast59-supply-history{margin-top:12px}
#fast59SupplyPage .fast59-supply-history article p{margin:4px 0 0}

.fast59-planning-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:8px}
#fast59SupplyPage .fast59-planning-cards label{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #dbe4ed;border-radius:12px}
#fast59SupplyPage .fast59-planning-cards label:has(input:checked){background:#eaf3ff;border-color:#3978bf}
#fast59SupplyPage .fast59-planning-cards input{width:20px;height:20px;flex:none;margin:0}
.fast59-planning-cards strong,.fast59-planning-cards small{display:block;overflow-wrap:anywhere}
#fast59SupplyPage form[data-bulk-planning] fieldset{min-width:0;margin:0;padding:0;border:0;display:grid;gap:10px}

#fast59SupplyPage .fast59-supply-menu{grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr))}
#fast59SupplyPage .fast59-supply-menu button{text-align:left;background:#edf3f9;color:#17324d;border:1px solid #dbe4ee;padding:12px}
.fast59-supply-menu small{display:block;margin-top:4px;font-weight:normal;color:#526980}
.fast59-people-search{display:grid;gap:6px;margin-bottom:12px}
.fast59-person-card[hidden]{display:none!important}
.fast59-person-card dd{min-width:0}
.fast59-person-asset{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#v6AdminWorkspace .v6-admin-shortcuts{display:grid;grid-template-columns:1fr;gap:12px}
.fast59-admin-section{border:1px solid #dbe4ee;border-radius:14px;background:#f7f9fc;padding:10px}
.fast59-admin-section h3{margin:0 0 8px;font-size:.9rem;color:#17324d}
.fast59-admin-section>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));gap:8px}

.fast59-notification-compose{display:grid;gap:10px;background:#f7f9fc}
.fast59-notification-compose[hidden],.fast59-notification-compose [hidden]{display:none}
.fast59-notification-compose label,.fast59-notification-compose [data-custom-fields]{display:grid;gap:6px}
.fast59-notification-compose textarea{resize:vertical}
.fast59-notification-members{display:grid;gap:4px;max-height:14rem;overflow:auto;padding:6px;border:1px solid #dbe4ed;border-radius:10px;background:#fff}
.fast59-notification-members>label{padding:5px 6px}

/* Shared mobile inventory and notification presentation. */
.fast59-equipment-directory button { min-height:48px; }
.fast59-tool-content fieldset { min-width:0; border:1px solid #dce5ed; border-radius:16px; padding:16px; margin:16px 0; }
.fast59-tool-content legend { font-weight:700; color:#17324d; padding:0 6px; }
.fast59-notification-history { margin-top:20px; border-top:1px solid #dce5ed; padding-top:16px; }
.fast59-notification-history summary { cursor:pointer; font-weight:700; padding:8px 0; }
.fast59-notification-history article { border:1px solid #dce5ed; border-radius:12px; padding:12px; margin:12px 0; overflow-wrap:anywhere; }
.fast59-history-message { white-space:pre-wrap; }
@media(max-width:600px) {
  .fast59-tool-dialog { width:calc(100% - 20px); max-height:calc(100dvh - 32px); box-sizing:border-box; }
  .fast59-tool-content .fast59-tool-actions { display:grid; grid-template-columns:1fr; gap:8px; }
  .fast59-tool-content input,.fast59-tool-content select,.fast59-tool-content textarea { max-width:100%; box-sizing:border-box; font-size:16px; }
}
#fast59SupplyPage #fast59SyncBadge { position:static!important; display:table; margin-top:6px; max-width:100%; overflow-wrap:anywhere; }

/* Compact allocation cards follow the actual available panel width. */
#fast59SupplyPage form[data-bulk-planning]{container-type:inline-size}
.fast59-planning-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
.fast59-allocation-divider{grid-column:1/-1;font-weight:700;color:#526980;padding:8px 0 2px}
#fast59SupplyPage .fast59-planning-cards label{min-width:0;align-items:flex-start;padding:9px;gap:8px;min-height:64px}
.fast59-planning-cards label>span{min-width:0}
.fast59-planning-cards strong{font-size:.88rem;line-height:1.4}
.fast59-planning-cards small{font-size:.8rem;line-height:1.4;margin-top:3px}
#fast59SupplyPage .fast59-planning-cards label.is-unavailable{background:#f4f6f8}
@container (min-width:560px){.fast59-planning-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container (min-width:760px){.fast59-planning-cards{grid-template-columns:repeat(4,minmax(0,1fr))}}
@container (max-width:300px){.fast59-planning-cards{grid-template-columns:minmax(0,1fr)}}
.fast59-qr-tools{padding:8px 0;display:grid;gap:8px}
.fast59-qr-tools p{font-size:.85rem;line-height:1.5;margin:4px 0}
@media(min-width:1000px){#fast59SupplyPage{width:min(100%,1040px)}}

/* Shared card, form and navigation styling */
:root {
  --ui-ink: #142d43;
  --ui-muted: #53697d;
  --ui-line: #d5e2eb;
  --ui-bg: #eef4f8;
  --ui-panel-shadow: 0 12px 32px #17324b0c, 0 2px 6px #17324b09;
  --ui-panel-radius: 18px;
  --ui-action: #125e73;
  --ui-action-hover: #0b4b60;
}
body.rescue-logged-out #loginBox {
  border-radius: 24px;
  box-shadow: 0 20px 56px #102c4824;
}
#appBox > .card,
#appBox :is(.dashboard-section, .group-card),
#appBox #caseList .case-card,
#appBox #userList .user-card {
  border-color: var(--ui-line);
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--ui-panel-shadow);
}
#appBox #dashboardPanel .dashboard-hero {
  background: linear-gradient(115deg, #102f49, #18566b);
  box-shadow: var(--ui-panel-shadow);
}
#appBox :is(.dashboard-stat-card, .dashboard-location-card) {
  background: linear-gradient(155deg, #fff 60%, #edf6fa);
}
#appBox :is(input, select, textarea):focus-visible,
#appBox button:focus-visible,
#loginBox :is(input, button):focus-visible {
  outline: 2px solid #147a92;
  outline-offset: 2px;
}
#appBox :is(.form-grid, .section-title-row, .group-page-header) {
  column-gap: 16px;
}
#appBox :is(.section-title-row, .group-page-header) h2 {
  letter-spacing: -.015em;
}
#mobileFieldShell .field-bottom-nav {
  box-shadow: 0 -6px 24px #102c4810;
}
:is(#fast59SupplyPage, #v74OpsOverlay, #fast59PatrolDialog) :is(.fast59-supply-history, .v73-card, .pt-card) {
  border-color: var(--ui-line);
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--ui-panel-shadow);
}

#fast59SupplyPage .fast59-transport {
  display: grid;
  gap: 14px;
  padding: clamp(12px, 3vw, 22px);
}
.fast59-transport :is([data-pending-transport], [data-loaded-transport]) {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #f5f9fc;
}
.fast59-transport [data-loaded-transport] {
  border-color: #c7e5e1;
  background: #f0f8f6;
}
.fast59-transport :is(h3, h4, [data-message], [data-shipment]) {
  margin: 0;
}
.fast59-transport :is([data-message], [data-shipment]):empty {
  display: none;
}
.fast59-transport h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ui-ink);
}
.fast59-transport h4 small {
  min-width: 1.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcebf3;
  color: #174359;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.fast59-transport [data-loaded-transport] h4 small {
  background: #d3eae4;
  color: #155747;
}
.fast59-transport :is([data-pending-load], [data-loaded-list], [data-plan-list]) {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ui-muted);
}
#fast59SupplyPage .fast59-transport :is([data-load-all], [data-receive-all]) {
  min-height: 44px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ui-action);
  color: white;
  font-weight: 700;
}
#fast59SupplyPage .fast59-transport :is([data-load-all], [data-receive-all]):hover:not(:disabled) {
  background: var(--ui-action-hover);
}
#fast59SupplyPage .fast59-transport .fast59-equipment-row {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-ink);
  overflow-wrap: anywhere;
}
#fast59SupplyPage .fast59-transport .fast59-equipment-row:hover:not(:disabled) {
  border-color: #79a9bc;
  background: #eff7fb;
}
@media (min-width: 680px) {
  .fast59-transport :is([data-load-all], [data-receive-all]) {
    justify-self: start;
  }
}

.fast59-checkin-equipment{padding:12px;margin:12px 0;border:1px solid #dbe4ed;border-radius:14px;background:#f5f8fc;color:#17324d}
.fast59-checkin-equipment h3{font-size:1rem;margin:0 0 8px}
.fast59-checkin-equipment p{margin:6px 0;font-size:.9rem}
.fast59-checkin-equipment-list{list-style:none;margin:0;padding:0}
.fast59-checkin-equipment-list li{display:grid;gap:4px;padding:10px 0;border-top:1px solid #dbe4ed;overflow-wrap:anywhere}
.fast59-checkin-equipment-list span{font-size:.85rem;color:#526980}
.fast59-checkin-equipment[hidden]{display:none!important}

.fast59-checkin-equipment > section + section,
.fast59-checkin-equipment > section + h3 {
  margin-top: 14px;
}
.fast59-checkin-equipment h4 {
  margin: 8px 0;
  color: var(--ui-ink);
}
.fast59-checkin-officers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.fast59-checkin-officers > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
}
.fast59-checkin-officers dt { color: var(--ui-muted); font-size: .82rem; }
.fast59-checkin-officers dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

#v75Gate {
  box-sizing: border-box;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: radial-gradient(ellipse at top, #dcecf4, #eff4f8 70%);
}
#v75Gate .v75-gate-card {
  flex: 0 0 auto;
  width: min(100%, 560px);
  max-height: none;
  margin-block: auto;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 16px 45px #142d4324;
}
.v75-gate-header {
  padding: clamp(16px, 5vw, 28px);
  text-align: center;
  color: #fff;
  background: linear-gradient(120deg, #102f49, #125e73);
}
#v75Gate .v75-gate-header h1 { margin: 0; color: inherit; }
#v75GateStatus { margin: 8px 0 0; overflow-wrap: anywhere; }
#v75GateStatus:empty { display: none; }
#v75Gate .v75-detail,
#v75Gate .fast59-checkin-equipment,
#v75Gate .v75-gate-actions {
  margin: 12px clamp(12px, 4vw, 20px);
}
#v75Gate .v75-detail { background: #f8fafc; border-color: var(--ui-line); }
#v75Gate .v75-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0;
}
#v75Gate .v75-detail dl > div:nth-child(n+3) {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ui-line);
  padding-top: 7px;
}
#v75Gate .v75-detail dt { color: var(--ui-muted); font-size: .82rem; }
#v75Gate .v75-detail dd { margin: 1px 0 0; font-weight: 600; }
#v75Gate .v75-detail > p { margin: 8px 0 0; color: var(--ui-muted); }
.v75-gate-actions { display: grid; gap: 8px; }
#v75Gate .v75-gate-actions button { min-height: 44px; margin: 0; }
#v75GateCheckIn { background: var(--ui-action); }
#v75GateCheckIn:disabled { opacity: .6; cursor: default; }
#v75Gate .v75-gate-actions #v76GateLogout {
  background: #fff;
  color: var(--ui-ink);
  border: 1px solid var(--ui-line);
}
#v75Gate .v75-gate-actions :is(p, label) { margin: 0; }
#v75Gate .v75-gate-actions input { box-sizing: border-box; width: 100%; min-height: 44px; }

#v75AttendanceLink { margin-top: 12px; }
#v75AttendanceLink summary { cursor: pointer; font-weight: 700; }
#v75AttendanceLink [data-attendance-output]:not([hidden]) { display: grid; gap: 8px; margin-top: 12px; }
#v75AttendanceLink img { display: block; width: min(216px, 100%); height: auto; }
#v75AttendanceLink img[hidden] { display: none; }
#v75AttendanceLink input { box-sizing: border-box; width: 100%; }

#v75CheckinSuccess {
  box-sizing: border-box;
  width: min(460px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  background: #fff;
  color: var(--ui-ink);
  box-shadow: var(--ui-panel-shadow);
}
#v75CheckinSuccess::backdrop { background: #102f498f; }
.v75-success-header { padding: 18px; color: white; background: #125e73; text-align: center; }
.v75-success-header :is(h2, p) { margin: 0; color: inherit; }
.v75-success-content { padding: 16px; }
.v75-success-content > p { margin: 0 0 12px; }
#v75SuccessDeployment dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin: 0;
}
#v75SuccessDeployment dl > div { padding: 9px; border-radius: 10px; background: #edf5f8; }
#v75SuccessDeployment dt { color: var(--ui-muted); font-size: .85rem; }
#v75SuccessDeployment dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.v75-success-actions { display: grid; gap: 8px; }
.v75-success-actions form { margin: 0; }
.v75-success-actions button { width: 100%; margin: 0; min-height: 44px; }

#fast59ApplicationDialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); box-sizing: border-box; padding: 16px; border: 1px solid var(--ui-line); border-radius: 18px; color: var(--ui-ink); }
#fast59ApplicationDialog::backdrop { background: #102f498f; }
#fast59ApplicationDialog header, #fast59ApplicationDialog nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#fast59ApplicationDialog header { justify-content: space-between; }
#fast59ApplicationDialog header :is(h2,form) { margin: 0; }
#fast59ApplicationDialog button { min-height: 44px; }
#fast59ApplicationDialog :is(label,fieldset) { min-width: 0; }
#fast59ApplicationDialog label { display: block; margin: 8px 0; }
#fast59ApplicationDialog :is(input:not([type=checkbox]),select,textarea) { box-sizing: border-box; width: 100%; min-height: 44px; }

#fast59ApplicationDialog [hidden] { display: none !important; }
#fast59ApplicationDialog .fast59-activity-application > fieldset {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #f6f9fc;
}
#fast59ApplicationDialog .fast59-activity-application legend { color: var(--ui-ink); font-weight: 700; }
#fast59ApplicationDialog [data-staff-list] { max-height: 280px; overflow: auto; }
#fast59ApplicationDialog :is([data-staff-row],[data-asset-row]) { border-bottom: 1px solid var(--ui-line); padding: 4px 0; }
#fast59ApplicationDialog [data-assignment] { margin-inline-start: 20px; }

#fast59SupplyPage [data-assigned-checkout] section {
  padding: 8px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  margin-bottom: 6px;
}
#fast59SupplyPage [data-assigned-checkout] h4 { margin: 0 0 4px; }
#fast59SupplyPage [data-assigned-checkout] label { display: flex; align-items: center; gap: 8px; min-height: 36px; }
#fast59SupplyPage [data-assigned-checkout] input[type=checkbox] { width: 19px; height: 19px; flex: none; margin: 0; }
#fast59SupplyPage [data-assigned-checkout] [role=status]:empty { display: none; }

/* Use the check-in confirmation palette throughout the attendance screen. */
#v74OpsOverlay .v74-sheet:has([data-v74-tab="attendance"].is-active) {
  width: min(840px, 100%);
  background: #f4fafb;
  color: #173542;
  padding: clamp(12px, 3vw, 24px);
}
#v74OpsOverlay .v74-sheet:has([data-v74-tab="attendance"].is-active) .v74-sheet-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 6px;
  padding: 14px 10px;
  background: #125e73;
  color: #fff;
  text-align: center;
  border-radius: 16px;
  margin-bottom: 12px;
}
#v74OpsOverlay .v74-sheet:has([data-v74-tab="attendance"].is-active) .v74-sheet-head > div { grid-column: 2; }
#v74OpsOverlay .v74-sheet:has([data-v74-tab="attendance"].is-active) :is(.v74-sheet-head h2, .v74-sheet-tabs .is-active) { color: #fff; }
#v74OpsOverlay .v74-sheet:has([data-v74-tab="attendance"].is-active) .v74-sheet-tabs .is-active {
  background: #125e73;
  border-color: #125e73;
}
#v74OpsOverlay :is(#v73AttendanceCard, #v75Config, #v76RequestPanel, #v76ReviewPanel) {
  border: 1px solid #d5e8eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 15px #125e730c;
}
#v74OpsOverlay #v73MyStatus {
  padding: 12px 14px;
  border-radius: 12px;
  background: #eaf6f7;
  color: #125e73;
  font-weight: 650;
}
#v74OpsOverlay .v73-actions { gap: 8px; flex-wrap: wrap; }
#v74OpsOverlay .v73-deployment:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
  margin-top: 14px;
}
#v74OpsOverlay .v73-deployment > div {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #d5e8eb;
  background: #f4fafb;
  overflow-wrap: anywhere;
}
#v74OpsOverlay .v73-deployment h4 { margin: 0 0 5px; color: #125e73; }
#v74OpsOverlay .v73-deployment p { margin: 0; }

.fast59-more .fast59-more-grid { align-items: stretch; }
.fast59-more .fast59-more-tile { padding: 12px; border-radius: 16px; }
.fast59-more .fast59-more-tile h3 { color: #234c75; }
@media (max-width: 359px) {
  .fast59-more .fast59-more-grid { grid-template-columns: minmax(0, 1fr); }
}
