
/* Shared dialog controls: native dialogs use the same visual language as cards. */
dialog {box-sizing:border-box;color:var(--ink);font:inherit;background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:0 24px 80px #0f172a30;max-width:calc(100vw - 32px);max-height:calc(100dvh - 96px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
dialog::backdrop{background:#0f172a55;backdrop-filter:blur(4px)}
dialog h2{font-size:20px;line-height:1.3;margin:0 0 16px}dialog h3{font-size:15px;margin:18px 0 10px}
dialog button:not(.icon-button):not(.primary-action):not(.secondary-action):not(.link-button){box-sizing:border-box;min-height:36px;width:fit-content;max-width:100%;justify-self:start;padding:8px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font-family:inherit;font-size:13px;font-weight:600;line-height:1.35;cursor:pointer;transition:background .15s,border-color .15s;}
dialog button:not(.icon-button):hover:not(:disabled){background:#f5f7fa;border-color:#bbc7d6}
dialog button:disabled{opacity:.5;cursor:not-allowed}
dialog button:focus-visible{outline:3px solid #e1262f33;outline-offset:2px}
dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea{box-sizing:border-box;width:100%;min-width:0;max-width:100%;font:inherit;}
.location-dialog{width:min(760px,calc(100vw - 32px));}
.location-dialog form{gap:14px;padding:18px 0;margin:0}
.location-dialog label{display:grid;gap:7px;align-items:start;line-height:1.45}
.location-dialog label:has(>input[type=checkbox]),.location-dialog label:has(>input[type=radio]){display:flex;align-items:center;gap:10px;font-size:13px;color:var(--ink);width:fit-content;max-width:100%;}
:is(dialog,.modal) input:is([type=checkbox],[type=radio]){box-sizing:border-box;appearance:auto;flex:0 0 18px;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;padding:0!important;margin:0;accent-color:var(--accent,#e1262f);box-shadow:none;border-radius:4px;}
.location-dialog>div:has(>button){display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.location-dialog details{padding:14px;border-radius:12px;background:#fafbfd;margin:10px 0}
.location-dialog summary{line-height:1.5;font-weight:600;color:var(--ink)}
.location-dialog form>strong{font-size:14px;line-height:1.5}
.location-dialog p{line-height:1.55;overflow-wrap:anywhere}
.location-analytics{width:min(1100px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
.transfer-dialog{width:min(880px,calc(100vw - 32px))}
:is(dialog,.modal) button{white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){dialog{padding:18px;border-radius:16px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 90px)}.location-dialog,.transfer-dialog,.location-analytics{width:calc(100vw - 20px)}.location-dialog form{gap:12px}dialog h2{font-size:18px}}

/* Pending reminders must not obstruct an open card or form. */
body:has(.drawer-root:not([hidden]),.employee-drawer-root:not([hidden]),.modal-root:not([hidden]),dialog[open]) #desktopNotificationRoot{z-index:90}

/* Expertise cards must keep their grid tracks inside the viewport. */
.expertise-drawer{box-sizing:border-box;grid-template-columns:minmax(0,1fr);max-width:100vw}
.expertise-drawer>*{min-width:0}
.expertise-drawer-head>div{min-width:0;overflow-wrap:anywhere}
.expertise-drawer-head h2,.expertise-drawer-head p,.expertise-case-meta>*{overflow-wrap:anywhere}
.expertise-drawer>footer{flex-wrap:wrap}
.expertise-drawer>footer button{max-width:100%;white-space:normal}
.expertise-create-modal,.expertise-payment-modal{box-sizing:border-box}
@media(max-width:600px){.expertise-drawer-head,.expertise-tabs,.expertise-money-bar,.expertise-drawer-body,.expertise-drawer>footer{padding-left:12px;padding-right:12px}.expertise-tabs button{font-size:12px;overflow-wrap:anywhere}.expertise-money-bar{gap:8px}.expertise-drawer>footer button{font-size:12px;padding:8px 10px}.expertise-payment-modal{padding:18px}}

/* On phones, reminders leave the top navigation usable. Open cards/dialogs retain priority. */
@media(max-width:760px){.desktop-notification-root{top:auto;bottom:12px;max-height:calc(100dvh - 120px);overflow:auto}}

/* The phone layout renders queue rows as cards; the desktop table minimum must not remain. */
@media(max-width:760px){.master-queue-table{min-width:0}}
