@media screen { html { scrollbar-gutter: stable; } }
*{box-sizing:border-box} :root{font-family:"Segoe UI",Arial,sans-serif;color:#263441;background:#f4f5f7;font-size:15px;--ink:#24323d;--muted:#57656f;--line:#d9dfe3;--teal:#176757;--paper:#fff}body{margin:0}a{color:#176453;text-decoration:none}a:hover{text-decoration:underline}button,input,textarea,select{font:inherit}button,summary,select{cursor:pointer}button{color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #e79f44;outline-offset:3px}svg{flex-shrink:0;vertical-align:middle}h1,h2,h3,p{margin:0}h1{font-size:clamp(30px,3.1vw,45px);line-height:1.12;letter-spacing:-1.7px;font-weight:650}h2{font-size:19px;letter-spacing:-.45px;font-weight:650}h3{font-size:16px}small,.muted{color:var(--muted)}.shell{display:grid;grid-template-columns:228px minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:100vh;height:100dvh;overflow:hidden}aside,.gate-art{background:#293742;color:#f4f6f8}aside{min-height:0;overflow-y:auto;display:flex;flex-direction:column;padding:28px 16px 18px}.brand{display:flex;align-items:center;gap:12px}.brand-icon{display:grid;place-items:center;width:44px;height:44px;background:#d6e7e2;color:#31574f;border-radius:12px}.brand-text{font-size:26px;line-height:1;font-weight:700;letter-spacing:1px}.brand-text span{display:block;font-size:11px;letter-spacing:1.2px;font-weight:500;margin-top:6px;color:#c3ced4}.shell .brand{padding:0 10px}.navlabel,.eyebrow,.kicker{font-size:10px;font-weight:700;letter-spacing:1.6px;text-transform:uppercase}.navlabel{margin:52px 12px 15px;color:#aebdc7}nav{display:grid;gap:6px}nav a{display:flex;align-items:center;gap:12px;color:#d9e1e6;font-size:14px;font-weight:500;border-radius:7px;padding:12px}nav a:hover,.side-bottom button:hover{background:#384955;text-decoration:none}nav a.active{background:#d6e7e2;color:#29463f;font-weight:650}.side-bottom{margin-top:auto;padding:16px 7px 0;border-top:1px solid #475662}.local-chip,.side-bottom button{display:flex;align-items:center;gap:9px;font-size:13px}.local-chip{color:#e0e6eb;padding:7px}.side-bottom button{border:0;background:transparent;color:#cbd5dc;padding:9px 7px;border-radius:5px}.body{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0}header{height:64px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid var(--line);padding:0 clamp(18px,3vw,48px)}header>div{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:600}header>div>svg,header>div>span{color:var(--muted)}header b{font-weight:400;color:#98aaa6}.languages{display:inline-flex;background:#eef1f4;border:1px solid var(--line);border-radius:6px;padding:2px;gap:2px}.languages button{padding:5px 9px;font-size:12px;font-weight:650;background:none;border:1px solid transparent;border-radius:4px;color:var(--muted)}.languages .selected{background:white;border-color:#becbd1;color:var(--teal)}.content{min-width:0;min-height:0;overflow-y:auto;scrollbar-gutter:stable;width:100%;padding:32px clamp(18px,3vw,48px) 48px}.page-head,.panel-head,.metric-top,.list-foot{display:flex;align-items:center;justify-content:space-between;gap:16px}.page-head{margin-bottom:25px}.page-head h1{margin:8px 0}.page-head p,.panel-head p,.empty p,.network-body p,.gate-box p{color:var(--muted);line-height:1.55}.eyebrow{color:#4d746c}.eyebrow b{color:#8caaa0;margin:0 5px}.btn,.link-action,.actions,.back,.period{display:inline-flex;align-items:center;gap:8px}.btn{justify-content:center;padding:10px 15px;min-height:40px;border:1px solid #bfd0c7;background:white;border-radius:7px;font-size:14px;line-height:1.25;font-weight:600;color:var(--teal);text-align:center}.btn:hover{background:#f0f6f1;text-decoration:none}.btn.primary{color:#fff;background:var(--teal);border-color:var(--teal)}.btn.primary:hover{background:#125345}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.metric,.panel{background:var(--paper);border:1px solid var(--line);border-radius:12px}.metric{display:flex;flex-direction:column;padding:17px 18px 18px;color:var(--ink)}.metric:hover{text-decoration:none;border-color:#91b5a5}.metric-top{color:#94a8a0}.tile-icon,.empty-icon{display:grid;place-items:center;border-radius:8px;background:#edf1f2;color:#3d6d60}.tile-icon{width:33px;height:33px}.metric.positive .tile-icon{color:#9b433e;background:#faeae6}.metric.negative .tile-icon{color:#26725b;background:#e5f3e8}.metric.pending .tile-icon{color:#94661e;background:#f8efdb}.metric strong{font-size:38px;line-height:1.15;font-weight:600;letter-spacing:-1.6px;margin-top:14px}.metric>span:last-child{font-size:13px;color:var(--muted);margin-top:3px}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(245px,1fr);gap:18px;margin-bottom:20px}.panel-head{padding:19px 22px}.panel-head p{font-size:13px;margin-top:4px}.period{border:1px solid var(--line);border-radius:5px;padding:5px 8px;color:var(--muted);font-size:11px;white-space:nowrap}.plot{margin:10px 22px 17px;display:flex;height:130px;gap:9px}.bar-slot{flex:1;min-width:0;text-align:center}.bar-space{height:105px;display:flex;align-items:flex-end;justify-content:center;background:repeating-linear-gradient(to top,#e0e5e9 0px,#e0e5e9 1px,transparent 1px,transparent 35px)}.bar{position:relative;width:55%;max-width:35px;background:#4a8e73;border-radius:3px 3px 0 0;min-height:2px}.bar span{position:absolute;bottom:100%;left:0;right:0;color:var(--muted);font-size:10px}.bar-slot small{font-size:10px;font-variant-numeric:tabular-nums}.breakdown{padding:0 22px 14px}.breakdown a{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid #ebefec;color:var(--ink);font-size:13px}.breakdown b{margin-left:auto}.breakdown span{width:39px;text-align:right;color:var(--muted);font-size:12px}.dot,.badge i{width:8px;height:8px;border-radius:50%;background:#83939a}.dot.positive,.badge.positive i{background:#bc6556}.dot.negative,.badge.negative i{background:#498369}.dot.pending,.badge.pending i{background:#ac802e}.dot.indeterminate,.badge.indeterminate i{background:#776698}.badge{display:inline-flex;white-space:nowrap;align-items:center;gap:6px;padding:4px 8px;border-radius:5px;font-size:12px;font-weight:600;color:#42565a;background:#edf1f1}.badge.positive{color:#8b4439;background:#faeae6}.badge.negative{color:#31694f;background:#e8f4e9}.badge.pending{color:#775519;background:#faf1db}.badge.indeterminate{color:#62527f;background:#f1eef7}.badge i{width:6px;height:6px}.link-action,.list-foot a,.back,.empty a{font-size:13px;font-weight:600}.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:27px 20px 31px;border-top:1px solid var(--line)}.empty-icon{width:48px;height:48px;margin-bottom:3px}.empty p{font-size:13px;max-width:460px}.empty a{margin-top:4px}.scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:13px;text-align:left}th{font-size:11px;font-weight:650;color:var(--muted);background:#f1f3f5}td,th{padding:11px 12px;border-top:1px solid var(--line)}td:first-child,th:first-child{padding-left:21px}td:last-child{padding-right:20px}td small,.downloads small{display:block;font-size:11px;margin-top:3px}.patient-link{font-weight:650}.mono,code{font-family:Consolas,monospace;font-size:12px}.row-link{padding:6px;display:inline-block}.filters,.pair-form{padding:18px 21px;display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.filters{border-bottom:1px solid var(--line)}label{display:block;font-size:13px;font-weight:600}input:not([type=hidden]):not([type=checkbox]),textarea,select{display:block;width:100%;min-width:0;border:1px solid #bdc9cf;background:#fff;border-radius:5px;padding:9px 10px;min-height:39px;color:var(--ink);font-size:14px;margin-top:6px}input:focus,select:focus,textarea:focus{outline:2px solid #40856e;outline-offset:1px}textarea{resize:vertical}.search-field{flex:1 1 240px}.filters select{max-width:220px}.filters .link-action{padding:12px 0}.counter,.step{display:inline-block;font-size:12px;border-radius:5px;background:#edf1f3;color:#426d5b;padding:4px 7px;margin-left:5px}.step{margin:0 10px 0 0}.compact{padding:16px 21px}.list-foot{padding:13px 20px;border-top:1px solid var(--line)}.actions{gap:12px;flex-wrap:wrap}.back{margin-bottom:17px}.case-form,.detail-grid{display:grid;gap:16px}.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.field-grid,.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:18px 21px 22px;margin:0;border-top:1px solid var(--line)}.long{grid-column:1/-1}.facts{grid-template-columns:repeat(2,minmax(0,1fr))}.facts dt{font-size:12px;color:var(--muted)}.facts dd{margin:4px 0 0;overflow-wrap:anywhere;white-space:pre-line}.delete-box,.versions details,.network-body details{margin:16px 0}.delete-box summary{color:#925044}.delete-box p,.versions summary{margin:12px 0}.btn.danger{color:#8b352f;border-color:#d5aea6}.versions{margin-bottom:16px;padding:4px 17px;background:#fff8e9}.versions .panel-head{padding-left:0}.check{display:flex;align-items:center;gap:7px}.spaced{margin-bottom:20px}.spaced-top{margin-top:18px}.daily-counts,.downloads{display:flex;gap:16px;padding:18px 21px;flex-wrap:wrap}.daily-counts div{flex:1;display:grid;gap:10px;justify-items:start}.daily-counts strong{font-size:25px}.downloads{border-top:1px solid var(--line)}.downloads a{flex:1 1 185px;display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:7px;padding:14px}.downloads a>svg:last-child{margin-left:auto}.pad,.network-body{padding:18px 21px}.network-body{border-top:1px solid var(--line)}.network-body p{margin:8px 0 13px}.pair-form{padding:15px 0 0}.pair-form label{flex:1 1 200px;max-width:515px}.notice,.alert{border-radius:6px;padding:12px 15px;margin-bottom:16px;line-height:1.5;overflow-wrap:anywhere}.notice{background:#e9f2ed;color:#2d6046}.alert,.warn{color:#863b32}.alert{background:#faece6}.gate{display:grid;grid-template-columns:minmax(280px,.86fr) 1.14fr;min-height:100vh}.gate-art{display:flex;flex-direction:column;padding:clamp(25px,4vw,65px);background:linear-gradient(137deg,#26343f,#354c55)}.gate-center{margin:auto 0;width:100%}.gate-art h1{font-size:clamp(42px,5vw,75px);max-width:530px;line-height:1.06;font-weight:550;margin:20px 0;color:#eef4f3}.kicker{color:#b7d3c9}.lab-art{max-width:430px;margin-top:36px}.gate-art small{display:flex;align-items:center;gap:9px;color:#c8d3d9}.gate-main{position:relative;display:grid;place-items:center;background:#fafbfc;padding:90px 32px}.gate-lang{position:absolute;right:30px;top:24px}.gate-box{width:min(100%,390px)}.gate-box h2{font-size:34px;letter-spacing:-1.4px;margin:10px 0}.gate-box p{margin-bottom:27px}.gate-box label{margin:16px 0}.gate-box small{font-size:12px}.wide{width:100%;margin-top:22px}.gate-box .wide{justify-content:space-between}
@media(max-width:1100px){.shell{grid-template-columns:190px minmax(0,1fr)}aside{padding-left:10px;padding-right:10px}.content{padding:24px 20px}.metrics{gap:9px}.metric{padding:14px}.dashboard-grid{gap:12px}.panel-head{padding:16px}.field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.shell{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}aside{height:auto;position:static;display:block;padding:10px 13px}.shell .brand,.navlabel,.local-chip{display:none}nav{display:flex;gap:4px;overflow:auto}nav a{padding:9px 10px;gap:6px;font-size:13px;white-space:nowrap}.side-bottom{border:0;padding:0;position:absolute;right:14px;top:63px}.side-bottom button{font-size:0;color:var(--teal);border:1px solid var(--line)}header{padding-right:61px;height:49px}.content{padding:22px 16px}.dashboard-grid{grid-template-columns:minmax(0,1.4fr) minmax(200px,1fr)}.period{font-size:10px}.gate{grid-template-columns:.82fr 1.18fr}}
@media(max-width:600px){nav a{flex:1;justify-content:center;font-size:10px;flex-direction:column;text-align:center;white-space:normal;min-width:0}nav svg{width:17px;height:17px}.side-bottom{top:81px}.metrics,.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid,.gate,.detail-grid{grid-template-columns:minmax(0,1fr)}.page-head{align-items:flex-start;flex-wrap:wrap;gap:12px}.page-head h1{font-size:32px}.daily-counts{gap:12px}.field-grid{grid-template-columns:1fr}.gate-art{padding:18px 22px}.gate-center,.gate-art small{display:none}.gate{display:flex;flex-direction:column}.gate-main{flex:1;padding:80px 25px 40px}.gate-lang{right:18px;top:18px}.gate-box h2{font-size:28px}.filters label{flex:1 1 130px}.filters .search-field{flex-basis:100%}.period{white-space:normal}.dashboard-grid,.metrics{margin-bottom:14px}.content{padding-left:12px;padding-right:12px}.panel-head{align-items:flex-start}.versions{overflow-wrap:anywhere}}
:root[data-palette="dark"]{--ink:#e1e6eb;--muted:#adb9c3;--line:#404c57;--teal:#a6cdbf;--paper:#263039;color:var(--ink);background:#1c242b}
:root[data-palette="dark"] {
  nav a{color:#d5dfe6}nav a.active{background:#405752;color:#f1f6f4}.brand-icon{background:#465d59;color:#e1eee9}
  header,.languages .selected,.btn,input:not([type=hidden]):not([type=checkbox]),textarea,select,.gate-main{background:#263039;color:var(--ink)}.languages,.tile-icon,.empty-icon,.step,.counter,th{background:#34404a;color:#d1dbe2}.btn.primary{background:#356b5b;border-color:#577f70}.btn:hover{background:#36454c}.btn.primary:hover{background:#407c69}a,.eyebrow{color:#a8d3c4}.breakdown a{border-color:var(--line)}.bar-space{background:repeating-linear-gradient(to top,#404c57 0px,#404c57 1px,transparent 1px,transparent 35px)}.versions{background:#463d2a}.warn{color:#eaa595}.languages .selected{color:#d8e7e3}.gate-art,.shell aside{color:#eef4f3}.notice{color:#d1efd8;background:#304f3c}.alert{color:#f2c3b9;background:#573a36}.danger{background:#533a32}.delete-box summary{color:#e5a899}
}
.session-header, .session-summary, .session-tools, .session-approval, .session-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.session-header, .session-approval, .session-notice { justify-content: space-between; }
.session-summary { color: var(--muted); }
.session-code { font: 650 .95em Consolas, monospace; letter-spacing: .08em; white-space: nowrap; }
.session-table th, .session-table td { vertical-align: middle; }
.session-table th { white-space: nowrap; }
.session-table .actions { gap: 6px; }
.session-table .btn { padding: 7px 10px; min-height: 34px; }
.session-table .menu-col { width: 1%; padding-left: 0; text-align: right; }
/* Sessions: one slim bar (Select, count, view) above the list. */
.session-bulk > .bulk-bar { min-height: 0; padding: 8px 14px; }
.session-bulk .bulk-toggle { height: 34px; }
.session-bulk .bulk-tools .view-switch .btn.icon-only { width: 28px; height: 28px; min-height: 28px; }
.session-total { font-size: 13px; color: var(--muted); font-weight: 600; }
.session-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(16px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
}
.session-dialog::backdrop { background: rgb(0 0 0 / .45); }
.session-dialog form { display: grid; gap: 12px; }
.session-dialog .actions { justify-content: flex-end; }
.session-notice { margin-bottom: 16px; padding: 12px 16px; border-radius: 7px; background: var(--switch-bg); }
.session-notice:empty { display: none; }
.session-approval { padding: 12px 16px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  aside { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; }
  aside nav { flex-wrap: nowrap; }
  aside nav a { flex: 0 0 auto; }
  .side-bottom { position: static; margin: 0; }
  .side-bottom button { color: #dce4ea; border-color: #53636f; min-width: 34px; min-height: 36px; justify-content: center; }
  header { padding: 0 14px; gap: 8px; min-height: 53px; height: auto; }
  header > div:first-child { min-width: 0; overflow: hidden; }
}
@media (max-width: 600px) {
  aside { padding: 6px 8px; }
  aside nav a { min-width: 60px; max-width: 88px; min-height: 48px; }
  header { padding: 0 9px; }
  header > div:first-child > :is(span,b) { display: none; }
  header .display-options { gap: 5px; }
  .session-header, .session-summary { align-items: flex-start; }
  .session-table .actions { flex-wrap: nowrap; }
  .session-notice { align-items: start; }
}

.current-session,.session-address { display:inline-flex; align-items:center; gap:6px; }
.current-session { margin-bottom:12px; font-size:13px; }
.copy-address { display:inline-grid; place-items:center; padding:5px; min-width:30px; min-height:30px; border:0; border-radius:5px; background:transparent; color:var(--teal); }
.copy-address:hover,.copy-address:focus-visible { background:var(--switch-bg); }
.session-address a { white-space:nowrap; }
@media(pointer:coarse){ .copy-address { min-height:40px; min-width:40px; } }
.signup-action .wide { margin-top:12px; justify-content:center; }

.session-host { margin-top:16px; padding:14px 18px; }
.session-host summary { cursor:pointer; font-weight:600; }
.session-host p { margin:10px 0; }
.session-host code { display:block; overflow-wrap:anywhere; }

/* Only the working pane scrolls. The menu, toolbar and brand stay in their own grid tracks. */
@media screen {
  html:has(.shell), html:has(.gate) { scrollbar-gutter: auto; }
  .content > * { max-width: 1500px; margin-inline: auto; }
  .content > .back, .content > .actions, .content > .current-session { margin-inline: 0; }
  .gate {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  /* The whole right panel scrolls, so its thin scrollbar sits at the window's edge (soft, shown while used). */
  .gate-main {
    min-height: 0;
    padding: 0;
    grid-template-rows: auto minmax(0, 1fr);
    place-items: stretch;
    overflow-y: auto;
    --scroll-thumb: transparent;
  }
  .gate-main:hover, .gate-main.scrolling { --scroll-thumb: color-mix(in srgb, var(--muted, #57656f) 30%, transparent); }
  .gate-lang {
    position: static;
    justify-self: end;
    margin: 18px 22px 0;
  }
  .gate-box {
    align-self: safe center;
    width: 100%;
    padding: clamp(12px, 2vh, 28px) clamp(18px, 4vw, 56px) 48px;
  }
  /* Sign-in, sign-up and forgot password keep a narrow centered column; setup (.gate-panel) uses the full width. */
  .gate-box:not(:has(.gate-panel)) {
    justify-self: center;
    max-width: calc(390px + 2 * clamp(18px, 4vw, 56px));
  }
}
/* Sign-in and sign-up: stacked fields under a hairline, on the white panel. Setup (.gate-panel): the dashboard's canvas,
   the title like a page head and the form as a panel (paper card) with the app's fields, sections and buttons. */
.gate-main:has(.gate-panel) { background: var(--bg, #f4f5f7); }
.gate-box h2 { margin: 10px 0 6px; }
.gate-box > p:not(.alert):not(.notice) { margin-bottom: 22px; max-width: 75ch; }
.gate-box > form:not(.panel) { border-top: 1px solid var(--line); padding-top: 6px; }
.gate-box > form:not(.panel) label { margin: 18px 0; }
.gate-box > form:not(.panel) input:not([type=hidden]):not([type=checkbox]):not([type=radio]) { min-height: 44px; border-radius: 7px; }
.gate-box > form:not(.panel) .wide { min-height: 46px; margin-top: 26px; }
.gate-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.gate-checks li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; background: #e9f2ed; color: #2d6046; }
.gate-checks li.fail { background: #faece6; color: #863b32; }
:root[data-palette="dark"] .gate-checks li { background: #304f3c; color: #d1efd8; }
:root[data-palette="dark"] .gate-checks li.fail { background: #573a36; color: #f2c3b9; }
.gate-panel .panel-head { padding-bottom: 14px; }
.gate-panel .panel-head + .panel-head, .gate-panel .field-grid + .panel-head { border-top: 1px solid var(--line); }
.gate-panel .field-grid label { margin: 0; }
.gate-panel .field-grid label small { display: block; margin-top: 6px; font-weight: 400; }
.via-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; padding: 0 21px 20px; }
.via-choices .choice { margin: 0; cursor: pointer; align-items: flex-start; }
.via-choices .choice input { display: inline-block; width: auto; min-height: 0; margin: 3px 0 0; accent-color: var(--accent, var(--teal)); }
.via-choices .choice:has(:checked) { border-color: var(--accent, var(--teal)); background: var(--accent-soft, #e1efe9); }
.gate-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 16px 21px; border-top: 1px solid var(--line); }
.gate-panel-foot small { flex: 1 1 320px; max-width: 80ch; line-height: 1.5; }
.gate-panel-foot .btn { flex: 0 0 auto; }
.gate-art .gate-center p { max-width: 520px; color: #c8d3d9; line-height: 1.6; }
@media (min-width: 801px) { .gate-panel .session-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
@media (max-width: 600px) { .gate-panel-foot .btn { width: 100%; } }
@media screen and (max-height: 570px) {
  .gate-art .lab-art { display: none; }
}


/* 0.0.3 — sidebar footer, toasts, dialogs, profile and settings. */
.side-bottom nav { margin-bottom: 10px; }
.local-chip { border-radius: 7px; text-decoration: none; }
.local-chip:hover, .local-chip.active { background: #384955; text-decoration: none; }
.local-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-brand, .menu-toggle { display: none; }
header { gap: 12px; }
header .crumbs { margin-right: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
header .crumbs > svg, header .crumbs > span { color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--switch-bg); color: var(--ink); }
.review-banner .actions { gap: 10px; }
.review-open { margin-bottom: 12px; }
.review-open:has(+ .review-banner:not([hidden])) { display: none; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 13px; line-height: 1.45; }
.toast:hover { text-decoration: none; border-color: #91b5a5; }
.toast .icon-btn { margin-left: auto; min-width: 26px; min-height: 26px; }

.session-dialog.wide { width: min(640px, calc(100% - 24px)); }
.session-dialog .field-grid { padding: 0; border: 0; }
.stack { display: grid; gap: 12px; }
.separated { border-top: 1px solid var(--line); }
.grant-grid, .recent-files, .session-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.grant-grid legend, .recent-files legend, .session-kinds legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.grant-grid .check, .recent-files .check, .session-kinds .check { font-weight: 500; }
.recent-files, .session-kinds { grid-template-columns: 1fr; }
.recent-files small, .session-kinds small, .cloud-only small { display: block; font-weight: 400; }
.check input[type=radio] { display: inline-block; width: auto; min-height: 0; margin: 0; }
.choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); list-style: none; }
.choice::-webkit-details-marker { display: none; }
.choice:hover { border-color: #91b5a5; text-decoration: none; }
.choice > svg { color: var(--teal); }
.choice small { display: block; margin-top: 2px; font-weight: 400; }
.choice-more[open] > .choice { border-color: #91b5a5; margin-bottom: 12px; }
.downloads button { flex: 1 1 185px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 14px; background: transparent; color: var(--teal); text-align: left; }
.downloads button:hover { border-color: #91b5a5; }
.downloads button > svg:last-child { margin-left: auto; }
.export-links { flex-wrap: wrap; gap: 4px 14px; }
.export-links button { display: inline; padding: 0; border: 0; background: none; color: var(--teal); font-size: 13px; font-weight: 600; }
.export-links button svg { display: none; }
.export-links button small { display: none; }
.row-tools { white-space: nowrap; text-align: right; }
.row-actions { flex-wrap: wrap; gap: 6px; }
.row-actions .btn { padding: 6px 10px; min-height: 32px; font-size: 13px; }
tr.muted td { color: var(--muted); }

.profile-grid, .settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.profile-grid .field-grid { padding: 0; border: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.grant-list { list-style: none; margin: 0; padding: 0 21px; border-top: 1px solid var(--line); }
.grant-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.grant-list li.on { color: var(--ink); }
.grant-list li.on svg { color: #31694f; }

/* Results: positive in red, negative in green. */
.badge.positive { color: #b42318; background: #fdeceb; }
.badge.positive i { background: #d92d20; }
.badge.negative { color: #146c43; background: #e3f5ea; }
.badge.negative i { background: #1f9254; }

/* Small screens: logo top-left, menu button top-right, sidebar as a drawer. */
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .shell > aside { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(290px, 86vw); display: none; flex-direction: column; padding: 20px 14px 16px; overflow-y: auto; }
  body.menu-open .shell > aside { display: flex; }
  body.menu-open .shell::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / .4); }
  .shell .brand, .shell .navlabel, .shell .local-chip { display: flex; }
  .shell .navlabel { display: block; margin: 30px 12px 12px; }
  .shell aside nav { display: grid; gap: 4px; overflow: visible; }
  .shell aside nav a { flex: none; flex-direction: row; justify-content: flex-start; min-width: 0; max-width: none; min-height: 44px; padding: 11px 12px; font-size: 14px; white-space: nowrap; text-align: left; }
  .shell aside nav svg { width: 20px; height: 20px; }
  .shell .side-bottom { position: static; margin-top: auto; padding: 14px 4px 0; border-top: 1px solid #475662; }
  .shell .side-bottom button { font-size: 13px; border: 0; color: #cbd5dc; min-height: 40px; justify-content: flex-start; }
  header { height: 56px; min-height: 56px; padding: 0 10px 0 14px; }
  header .header-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
  header .header-brand .brand-icon { width: 34px; height: 34px; border-radius: 9px; }
  header .header-brand .brand-text { font-size: 19px; }
  header .header-brand .brand-text span { display: none; }
  header .crumbs { display: none; }
  header .header-brand { margin-right: auto; }
  .menu-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); }
  .profile-grid { grid-template-columns: 1fr; }
  .toasts { right: 10px; bottom: 10px; }
  .fabs { right: 10px; bottom: 10px; }
  .toasts.beside-fabs { right: 62px; width: calc(100vw - 72px); }
}
@media (max-width: 600px) {
  header .display-options .languages button { padding: 5px 7px; }
  .grant-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  header .header-brand .brand-text { display: none; }
}
/* Narrow phones: the theme buttons leave the header (Settings › Theme keeps the choice) so it fits the screen. */
@media (max-width: 480px) {
  header .theme-options { display: none; }
}
a.choice, :root[data-palette] a.choice { color: var(--ink); }
.choice strong { color: var(--ink); }
.stack .field-grid { padding: 0; border: 0; }

/* 0.0.4 — settings tabs and visual choices. */
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.save-state { font-size:13px; font-weight:600; color:var(--accent-ink, var(--teal)); min-height:20px; }
.settings-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:20px; align-items:start; }
.settings-tabs { display:grid; gap:6px; position:sticky; top:0; }
.settings-tabs a { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; border:1px solid transparent; border-radius:10px; color:var(--ink); }
.settings-tabs a:hover { text-decoration:none; background:var(--paper); border-color:var(--line); }
.settings-tabs a.active { background:var(--accent-soft, var(--paper)); border-color:var(--line); }
.settings-tabs a > svg { margin-top:2px; color:var(--accent-ink, var(--teal)); }
.settings-tabs small { display:block; margin-top:2px; font-size:12px; font-weight:400; color:var(--muted); line-height:1.4; }
.settings-body { display:grid; gap:16px; }
.setting-group .pad { padding-top:4px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.tiles.inline { display:flex; flex-wrap:wrap; gap:8px; }
.tile { position:relative; display:grid; gap:8px; justify-items:center; padding:10px; border:1px solid var(--line); border-radius:10px; cursor:pointer; font-size:13px; font-weight:600; text-align:center; }
.tiles.inline .tile { grid-auto-flow:column; align-items:center; padding:8px 14px; }
.tile input { position:absolute; opacity:0; pointer-events:none; }
.tile:hover { border-color:var(--accent, #91b5a5); }
.tile:has(input:checked) { border-color:var(--accent, var(--teal)); outline:2px solid var(--accent, var(--teal)); outline-offset:-1px; }
.tile:has(input:focus-visible) { outline:3px solid #e79f44; }
.tile-preview { display:grid; place-items:center; width:100%; min-height:26px; color:var(--ink); }
.tiles.inline .tile-preview { width:auto; }
.tiles { grid-template-columns:repeat(auto-fit,minmax(148px,1fr)); }
.tile { padding:12px 12px 10px; }
.tile-preview { min-height:40px; }
.mini { position:relative; display:grid; grid-template-columns:24% 1fr; width:100%; aspect-ratio:16/10; border-radius:7px; overflow:hidden; background:var(--b); border:1px solid rgb(0 0 0 / .12); }
.m-side { display:grid; align-content:start; gap:7%; padding:12% 12%; background:var(--s); border-right:1px solid var(--g); }
.m-side u { display:block; width:46%; aspect-ratio:1; border-radius:30%; background:var(--a); opacity:.75; margin-bottom:10%; }
.m-side i { display:block; height:5px; border-radius:3px; background:var(--g); }
.m-side i:nth-child(3) { background:var(--a); opacity:.55; }
.m-main { display:grid; grid-template-rows:auto auto 1fr auto; gap:7%; padding:0 9% 9%; min-width:0; }
.m-head { height:12px; margin:0 -11%; background:var(--p); border-bottom:1px solid var(--g); }
.m-title { width:46%; height:6px; border-radius:3px; background:var(--g); }
.m-cards { display:grid; grid-template-columns:1fr 1fr; gap:8%; }
.m-cards i { border-radius:4px; background:var(--p); border:1px solid var(--g); }
.m-btn { width:34%; height:8px; border-radius:3px; background:var(--a); justify-self:end; }
.mini-right { grid-template-columns:1fr 24%; }
.mini-right .m-side { order:2; border-right:0; border-left:1px solid var(--g); }
.mini-top { grid-template-columns:1fr; grid-template-rows:17% 1fr; }
.mini-top .m-side { grid-auto-flow:column; grid-template-columns:auto; justify-content:start; align-items:center; gap:4%; padding:0 6%; border-right:0; border-bottom:1px solid var(--g); }
.mini-top .m-side u { width:auto; height:60%; margin:0 4% 0 0; }
.mini-top .m-side i { width:22px; height:4px; }
.mini-top .m-head { display:none; }
.mini-top .m-main { grid-template-rows:auto 1fr auto; padding-top:8%; }
.mini-split { position:relative; display:grid; width:100%; }
.mini-split > .mini { grid-area:1/1; }
.mini-split > .mini:last-child { clip-path:polygon(100% 0,100% 100%,0 100%); }
.wire-card { display:grid; gap:7px; width:82%; padding:12px; background:var(--paper); border:1px solid var(--line); border-radius:9px; }
.wire-card span { display:block; height:7px; border-radius:3px; background:var(--line); }
.wire-card .w-title { width:55%; height:8px; background:var(--muted); opacity:.45; }
.wire-card .w-field { height:13px; background:transparent; border:1px solid var(--line); border-radius:5px; }
.wire-card .w-btn { width:42%; height:13px; justify-self:end; border-radius:5px; background:var(--accent, var(--teal)); }
.wire-sharp, .wire-sharp span { border-radius:1px !important; }
.wire-soft { border-radius:18px; }
.wire-soft .w-field, .wire-soft .w-btn { border-radius:999px; }
.wire-flat { border-color:transparent; background:var(--line); }
.wire-flat .w-field { background:var(--paper); border-color:transparent; }
.wire-rows { display:grid; width:82%; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.wire-rows > span { display:grid; grid-template-columns:2fr 1fr 1fr; gap:6px; }
.wire-rows i { display:block; height:5px; border-radius:3px; background:var(--line); }
.wire-rows > span:first-child i { background:var(--muted); opacity:.4; }
.wire-text { display:grid; justify-items:start; gap:5px; width:70%; padding:8px 0; }
.wire-text b { line-height:1; color:var(--ink); }
.wire-text i { display:block; width:100%; height:5px; border-radius:3px; background:var(--line); }
.wire-text i:last-child { width:65%; }
.aa { font-weight:700; }
.dot-pick { display:inline-block; width:18px; height:18px; border-radius:50%; border:1px solid var(--line); }
.switch-row { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.switch-row:last-child { border-bottom:0; }
.switch-row small { display:block; font-weight:400; color:var(--muted); }
.switch-row input[type=checkbox] { appearance:none; width:42px; height:24px; border-radius:12px; background:var(--line); position:relative; cursor:pointer; transition:background .15s; }
.switch-row input[type=checkbox]::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:left .15s; }
.switch-row input[type=checkbox]:checked { background:var(--accent, var(--teal)); }
.switch-row input[type=checkbox]:checked::after { left:21px; }
@media (max-width:800px) {
  .settings-layout { grid-template-columns:1fr; }
  .settings-tabs { position:static; grid-auto-flow:column; grid-auto-columns:max-content; overflow-x:auto; }
  .settings-tabs small { display:none; }
}

/* Profile */
.avatar { display:inline-grid; place-items:center; border-radius:50%; object-fit:cover; flex-shrink:0; }
.avatar-initial { background:var(--accent-soft, #e1efe9); color:var(--accent-ink, var(--teal)); font-weight:700; }
span.avatar-initial:not(.avatar) { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; font-size:13px; }
img.avatar-initial { width:30px; height:30px; border-radius:50%; object-fit:cover; flex:none; }
.profile-hero { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:24px; align-items:center; padding:24px; margin-bottom:18px; }
.profile-photo { display:grid; justify-items:center; gap:10px; }
.photo-actions .btn { cursor:pointer; padding:7px 12px; min-height:34px; font-size:13px; }
.profile-photo .link-action { border:0; background:none; font-size:13px; cursor:pointer; }
.profile-id h1 { margin:6px 0 4px; }
.profile-id p { color:var(--muted); }
.profile-chips { display:flex; flex-wrap:wrap; gap:8px; list-style:none; margin:12px 0 0; padding:0; }
.profile-chips li { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid var(--line); border-radius:999px; font-size:13px; }
.profile-stats { display:flex; gap:12px; margin:0; }
.profile-stats div { min-width:96px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; text-align:center; }
.profile-stats dt { font-size:12px; color:var(--muted); }
.profile-stats dd { margin:4px 0 0; font-size:24px; font-weight:650; }
.user-cell { display:flex; align-items:center; gap:10px; }
.user-cell small { display:block; }
@media (max-width:800px) { .profile-hero { grid-template-columns:1fr; justify-items:center; text-align:center; } .profile-chips { justify-content:center; } }

/* Sessions: header chip, member cards, HTTP link */
header .current-session { margin:0; padding:5px 10px; border:1px solid var(--line); border-radius:6px; font-size:12px; font-weight:600; color:var(--ink); white-space:nowrap; max-width:260px; }
header .current-session span { overflow:hidden; text-overflow:ellipsis; }
header .current-session:hover { text-decoration:none; border-color:var(--accent, #91b5a5); }
.member-card { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink); font-size:13px; }
.member-card:hover { border-color:var(--accent, #91b5a5); }
.member-list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.member-list li { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.member-list small { margin-left:auto; color:var(--muted); }
.scheme-link { font-size:11px; font-weight:700; padding:2px 6px; border:1px solid var(--line); border-radius:4px; }

/* Reports */
.report-filters { align-items:flex-end; flex-wrap:wrap; }
.filter-or { align-self:center; padding-top:18px; color:var(--muted); font-size:13px; }
.chip-link { padding:6px 10px; border:1px solid var(--line); border-radius:999px; font-size:12px; font-weight:600; }
.chip-link:hover { text-decoration:none; border-color:var(--accent, #91b5a5); }
.downloads + .downloads { border-top:0; padding-top:0; }
.downloads a[aria-disabled="true"] { opacity:.5; cursor:not-allowed; }
@media (max-width:800px) { header .current-session span { display:none; } }
/* Sign-in: borderless secondary action and the forgotten-password link. */
.btn.ghost, :root[data-palette] .btn.ghost { border-color:transparent; background:transparent; }
.btn.ghost:hover { background:var(--accent-soft, #f0f6f1); }
.forgot-link { justify-self:end; margin:-6px 0 4px auto; padding:2px 0; border:0; background:none; color:var(--accent-ink, var(--teal)); font-size:13px; font-weight:600; display:block; width:fit-content; }
/* Forgot password: the request, then "I have a reset code" as a second stacked step. */
.gate-box .gate-sub { margin:34px 0 6px; padding-top:22px; border-top:1px solid var(--line); font-size:18px; }
.reset-code code { font-size:16px; letter-spacing:2px; margin:0 6px; }
.forgot-link:hover { text-decoration:underline; }
.pass-field { position:relative; display:block; margin-top:6px; }
.pass-field input { padding-right:44px !important; margin-top:0 !important; }
.pass-toggle { position:absolute; right:4px; top:0; bottom:0; margin:auto 0; display:grid; place-items:center; width:36px; height:32px; border:0; border-radius:5px; background:transparent; color:var(--muted); }
.pass-toggle:hover, .pass-toggle[aria-pressed="true"] { color:var(--accent-ink, var(--teal)); }

.wire-fade { position:relative; display:block; width:78%; aspect-ratio:16/9; }
.wire-fade i { position:absolute; inset:0; border:1px solid var(--line); border-radius:6px; background:var(--paper); }
.wire-fade i:first-child { inset:0 18% 18% 0; }
.wire-fade i:last-child { inset:18% 0 0 18%; background:var(--accent-soft, #e3ecf8); }
.wire-fade.on i:first-child { opacity:.45; }
.wire-motion { position:relative; display:block; width:78%; height:44px; }
.wire-motion i { position:absolute; left:0; right:0; top:19px; height:6px; border-radius:3px; background:var(--line); }
.wire-motion b { position:absolute; top:12px; width:20px; height:20px; border-radius:50%; background:var(--accent, var(--teal)); left:calc(50% - 10px); }
.wire-motion.full b { left:70%; }
.wire-motion.reduced b { left:10%; opacity:.6; }
.wire-motion.system i { background:linear-gradient(90deg,var(--line) 50%,var(--accent-soft, #e3ecf8) 50%); }
.brand-version { font-variant-numeric:tabular-nums; letter-spacing:.4px !important; }

/* 0.0.6 — a soft edge under the native title bar, in the current theme's line colour. */
body::before { content:""; position:fixed; inset:0 0 auto; height:1px; background:var(--line); z-index:60; pointer-events:none; }

/* Softer borders and one control height for every button, input and select on the same line. */
:root { --control-h:40px; --control-r:8px; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border-color:var(--line) !important; border-radius:var(--control-r); }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]), select { height:var(--control-h); min-height:var(--control-h); padding-top:0; padding-bottom:0; }
input[type=file] { border:1px dashed var(--line); border-radius:var(--control-r); padding:8px; background:transparent; }
.btn { min-height:var(--control-h); border-radius:var(--control-r); border-color:var(--line); }
.btn.primary { border-color:var(--accent, var(--teal)); }
.btn.danger { border-color:color-mix(in srgb, #c0392b 35%, var(--line)); }
.chip-link { display:inline-flex; align-items:center; height:var(--control-h); padding:0 14px; border-radius:var(--control-r); }
.filters, .inline-filters, .report-filters { align-items:flex-end; }
.filters label, .inline-filters label { margin:0; }
.filters .link-action { height:var(--control-h); display:inline-flex; align-items:center; padding:0 4px; }
.languages, .theme-options { border-color:var(--line); border-radius:var(--control-r); }
:root[data-style="sharp"] { --control-r:2px; }
:root[data-style="soft"] { --control-r:999px; }
:root[data-style="soft"] textarea { border-radius:14px; }
:root[data-density="compact"] { --control-h:34px; }

/* Dashboard header filters, left of the New Case button. */
.dashboard-head { align-items:flex-end; flex-wrap:wrap; }
.head-tools { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; margin-left:auto; }
.inline-filters { display:flex; gap:10px; flex-wrap:wrap; }
.inline-filters label { display:grid; gap:0; font-size:12px; min-width:150px; }
.inline-filters select { max-width:220px; }

/* Previous / next case. */
.detail-tools { flex-wrap:wrap; }
.case-nav { display:inline-flex; align-items:center; gap:6px; margin-left:auto; }
.case-nav small { margin-right:4px; font-variant-numeric:tabular-nums; }
.btn.icon-only { width:var(--control-h); padding:0; }
.btn[aria-disabled="true"] { opacity:.4; pointer-events:none; }
.form-nav { display:flex; justify-content:flex-end; margin:-30px 0 8px; }

/* Settings section Reset. */
.reset-btn { min-height:32px; padding:5px 11px; font-size:12px; margin-left:auto; }
.panel-head > svg + .reset-btn { margin-left:10px; }

/* Multi-select: checkboxes hidden until "Select" is ticked, then rows shift right. */
.bulk-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 21px; border-bottom:1px solid var(--line); }
.bulk-toggle { font-size:13px; font-weight:600; }
.bulk-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bulk-actions[hidden] { display:none; }
.bulk-actions select { width:auto; min-width:190px; margin:0; }
.bulk-count { font-size:13px; color:var(--muted); margin-right:4px; }
.bulk .pick { display:none; width:40px; padding-right:0; }
.bulk.selecting .pick { display:table-cell; }
.bulk .pick input { width:17px; height:17px; margin:0; vertical-align:middle; }

/* Centers */
.center-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.center-card { display:flex; flex-direction:column; }
.center-card.archived { opacity:.7; }
.center-title { display:flex; align-items:center; gap:12px; }
.center-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:0; padding:0 21px; }
.center-stats div { padding:10px; border:1px solid var(--line); border-radius:var(--control-r); text-align:center; }
:root[data-style="soft"] .center-stats div { border-radius:14px; }
.center-stats dt { font-size:12px; color:var(--muted); }
.center-stats dd { margin:4px 0 0; font-size:22px; font-weight:650; }
.center-meta { list-style:none; margin:14px 0 0; padding:0 21px; display:grid; gap:6px; font-size:13px; color:var(--muted); }
.center-meta li { display:flex; align-items:center; gap:8px; }
.center-actions { margin-top:auto; flex-wrap:wrap; }
.grant-grid .long { grid-column:1/-1; }
@media (max-width:800px) { .head-tools { margin-left:0; width:100%; } .inline-filters label { flex:1 1 140px; } .form-nav { margin:0 0 8px; } }

/* 0.0.7 — every dialog backdrop is a soft, neutral black whatever the theme or tone. */
dialog::backdrop, .session-dialog::backdrop { background:rgb(0 0 0 / .45); }

/* Filters stay visible right under the header while the list scrolls. */
.filters, .report-filters { position:sticky; top:0; z-index:5; background:var(--paper); border-radius:12px 12px 0 0; }
.dashboard-head { position:sticky; top:-32px; z-index:5; margin-top:-32px; padding:32px 0 14px; background:var(--bg, #f4f5f7); }
.page-head + .panel .filters, .panel > .filters:first-child { border-top-left-radius:12px; border-top-right-radius:12px; }
@media (max-width:800px) { .dashboard-head { margin-top:-22px; padding-top:22px; top:-22px; } }

/* Pager and incremental loading. */
.pager { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; border-top:1px solid var(--line); }
.pager .actions { gap:8px; }
.load-more td { text-align:center; padding:14px; }
.loading-dots { display:inline-flex; gap:5px; }
.loading-dots i { width:7px; height:7px; border-radius:50%; background:var(--muted); opacity:.4; animation:cte-dot 1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay:.15s; } .loading-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes cte-dot { 50% { opacity:1; } }
td.pick, th.pick { display:none; }
.bulk.selecting td.pick, .bulk.selecting th.pick { display:table-cell; }
.wire-pages { display:grid; gap:4px; width:70%; }
.wire-pages i { display:block; height:6px; border-radius:3px; background:var(--line); }
.wire-pages b { display:flex; justify-content:center; gap:6px; margin-top:4px; }
.wire-pages u { display:block; width:22px; height:10px; border-radius:4px; border:1px solid var(--accent, var(--teal)); }
.wire-pages em { display:block; height:6px; width:30%; justify-self:center; border-radius:3px; background:var(--accent, var(--teal)); opacity:.5; margin-top:4px; }
.wire-pages.infinite i:nth-child(4) { opacity:.5; }
.sheets-count { display:flex; align-items:center; gap:10px; font-size:15px; }
.sheets-facts { display:grid; gap:8px; margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:var(--control-r, 8px); }
.sheets-facts div { display:flex; justify-content:space-between; gap:12px; font-size:13px; }
.sheets-facts dt { color:var(--muted); }
.sheets-facts dd { margin:0; font-weight:600; }

/* Centers: counts, filters, grid and list views, images. */
.center-metrics .metric { cursor:default; }
.center-filters .search-field { flex-basis:260px; flex-grow:2; }
.view-switch { display:inline-flex; gap:4px; margin-left:auto; }
label.btn { cursor:pointer; }
.view-switch .btn.selected { background:var(--accent-soft, #e3ecf8); border-color:var(--accent, var(--teal)); }
.center-grid { padding:18px 21px 21px; }
.center-card { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--paper); }
:root[data-style="soft"] .center-card { border-radius:20px; }
:root[data-style="sharp"] .center-card { border-radius:2px; }
.center-cover { position:relative; height:110px; background:linear-gradient(120deg, var(--accent-soft, #e3ecf8), var(--bg, #f3f6fa)); background-size:cover; background-position:center; display:flex; justify-content:flex-end; align-items:flex-start; gap:6px; padding:10px; }
.center-cover .session-code { padding:3px 8px; border-radius:6px; background:rgb(255 255 255 / .85); color:#1d2730; }
.center-body { display:flex; flex-direction:column; flex:1; padding:0 18px 16px; }
.center-body .center-title { margin-top:-28px; align-items:flex-end; gap:12px; }
.center-body .center-title h2 { margin-top:0; }
.center-body .center-title p { color:var(--muted); font-size:13px; }
.center-logo { display:inline-grid; place-items:center; flex-shrink:0; border-radius:14px; object-fit:cover; border:3px solid var(--paper); background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); font-weight:700; }
.user-cell .center-logo { border-width:0; border-radius:9px; font-size:12px; }
.center-description { margin:12px 0 0; font-size:13px; color:var(--muted); line-height:1.5; }
.center-body .center-stats { grid-template-columns:repeat(4,1fr); padding:0; margin-top:14px; }
.center-body .center-meta { padding:0; }
.center-body .center-actions { padding:14px 0 0; margin-top:auto; }
.center-table td small { display:block; }
.center-images { position:relative; margin-bottom:6px; }
.image-pick { display:block; cursor:pointer; }
.image-preview { display:grid; place-items:center; background-size:cover; background-position:center; border:1px dashed var(--line); color:var(--muted); font-size:13px; }
.image-preview > span { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:6px; background:var(--paper); }
.cover-preview { height:120px; border-radius:10px; background-color:var(--accent-soft, #e3ecf8); }
.image-pick.logo { position:absolute; left:16px; bottom:-26px; }
.logo-preview { width:72px; height:72px; border-radius:16px; border:3px solid var(--paper); background-color:var(--accent-soft, #e3ecf8); }
.image-remove { display:flex; gap:14px; flex-wrap:wrap; justify-content:flex-end; align-items:center; margin-top:8px; min-height:26px; padding-left:100px; font-size:13px; }
.form-section { margin:14px 0 0; font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--muted); }
.zoom-tiles { grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); }

/* Users: grid view and view switch. */
.user-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; padding:16px 21px 21px; }
.user-card { position:relative; display:grid; justify-items:center; gap:6px; padding:20px 16px 16px; border:1px solid var(--line); border-radius:12px; text-align:center; background:var(--paper); }
:root[data-style="soft"] .user-card { border-radius:20px; }
.user-card h2 { margin-top:6px; font-size:17px; }
.user-card p { margin:0; font-size:13px; }
.user-card small { display:flex; align-items:center; gap:5px; color:var(--muted); }
.card-pick { position:absolute; top:12px; left:12px; display:none; }
.bulk.selecting .card-pick { display:block; }
.card-pick input { width:18px; height:18px; }
.image-pick.has-image .image-preview > span { opacity:0; transition:opacity .15s; }
.image-pick.has-image:hover .image-preview > span, .image-pick.has-image:focus-within .image-preview > span { opacity:.9; }
.image-pick.has-image .image-preview { border-style:solid; }
.zoom-tiles { grid-template-columns:repeat(5,minmax(0,1fr)); }

/* Centers and Users toolbars: even spacing above and below, aligned controls. */
.bulk-bar { min-height:60px; padding:12px 22px; }
.bulk-tools { margin-left:auto; display:flex; align-items:center; gap:8px; }
.center-filters { padding:22px 22px 20px; gap:14px; row-gap:16px; border-bottom:1px solid var(--line); }
.center-filters label { display:grid; gap:0; font-size:12.5px; }
.center-filters label > span { display:inline-flex; align-items:center; gap:6px; }
.center-filters .btn.primary { padding-inline:20px; }
.center-filters .view-switch { padding:3px; border:1px solid var(--line); border-radius:calc(var(--control-r) + 3px); background:var(--bg, #f3f6fa); }
.view-switch .btn.icon-only { width:calc(var(--control-h) - 6px); min-height:calc(var(--control-h) - 6px); height:calc(var(--control-h) - 6px); border-color:transparent; background:transparent; }
.view-switch .btn.icon-only.selected { background:var(--paper); border-color:var(--line); color:var(--accent-ink, var(--teal)); }
.center-filters + .panel-head { padding:18px 22px 14px; }
.center-filters + .panel-head h2 { display:flex; align-items:center; gap:8px; }
.center-grid.pad, .center-grid { padding:22px 22px 24px; }
.center-table th:first-child, .center-table td:first-child { padding-left:22px; }
.center-table th:last-child, .center-table td:last-child { padding-right:22px; }
.bulk-tools .view-switch { padding:3px; border:1px solid var(--line); border-radius:calc(var(--control-r) + 3px); background:var(--bg, #f3f6fa); }
.user-grid { padding:20px 22px 24px; }
@media (max-width:800px) { .center-filters .view-switch { margin-left:0; } .center-filters { padding:16px; } }

/* "Select" switch: a full-height control in filters bars and toolbars, with a larger box. */
.bulk-toggle { display:inline-flex; align-items:center; gap:9px; height:var(--control-h); padding:0 14px 0 12px; border:1px solid var(--line); border-radius:var(--control-r); background:var(--paper); font-size:13.5px; font-weight:600; cursor:pointer; flex:0 0 auto !important; margin:0 !important; }
.bulk-toggle:has(input:checked) { border-color:var(--accent, var(--teal)); background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); }
.bulk-toggle input, .bulk th.pick input, .bulk td.pick input, .card-pick input { width:19px; height:19px; margin:0; accent-color:var(--accent, var(--teal)); cursor:pointer; }
.bulk-bar.no-toggle { display:none; }
.bulk.selecting > .bulk-bar.no-toggle { display:flex; }

/* List toolbar on one line: Select, actions, count far right. */
.bulk-bar { flex-wrap:wrap; }
.bulk-count { margin-left:auto; font-size:13px; font-weight:600; color:var(--muted); white-space:nowrap; }
.bulk:not(.selecting) .bulk-count { display:none; }
.bulk-count + .bulk-tools { margin-left:12px; }
.bulk:not(.selecting) .bulk-tools { margin-left:auto; }
.list-head { gap:16px; flex-wrap:wrap; }
.list-head .bulk-bar { flex:1; min-height:0; padding:0; border:0; justify-content:flex-start; }
.list-head .bulk-bar.no-toggle { display:flex; }

/* Smaller page titles everywhere. */
.page-head h1 { font-size:clamp(24px,2.1vw,31px); letter-spacing:-.7px; line-height:1.15; margin:5px 0 4px; }
.page-head { margin-bottom:18px; }
.page-head p { font-size:14px; }
.eyebrow { font-size:9.5px; }
/* Title rows that also carry counts or the Select toolbar. */
.report-head { flex-wrap:wrap; }
.head-counts { display:flex; gap:14px; flex-wrap:wrap; margin-left:auto; }
.head-count { display:inline-flex; align-items:center; gap:7px; }
.head-count strong { font-size:17px; }
.list-head > div:first-child { flex:0 1 auto; }
.list-head > div:first-child p { margin-top:2px; }
.search-field .counter { margin-left:2px; }
.head-counts { align-items:center; }
.head-counts .btn { margin-left:6px; }
.list-head { flex-wrap:nowrap; align-items:center; }
.list-head .bulk-bar { flex:1 1 auto; justify-content:flex-end; min-width:0; }
/* Select stays at the right end; its actions appear to its left once it is checked. */
.list-head .bulk-bar .bulk-count { margin-left:0; order:1; }
.list-head .bulk-actions { order:2; }
.list-head .bulk-toggle { order:3; }
@media (max-width:800px) { .list-head { flex-wrap:wrap; } .list-head .bulk-bar { justify-content:flex-start; } }
.report-head { flex-wrap:nowrap; align-items:center; }
.report-head > div:first-child { min-width:0; }
.head-counts { flex-shrink:0; flex-wrap:nowrap; }
@media (max-width:1100px) { .report-head { flex-wrap:wrap; } }
.filters .filters-end { margin-left:auto; }

/* Settings → Content */
.inline-form { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.inline-form label { display:grid; font-size:12.5px; min-width:160px; }
.danger-zone { border-color:color-mix(in srgb, #c0392b 35%, var(--line)); }
.reset-steps { list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:13px; color:var(--muted); }
.reset-steps li { display:flex; gap:8px; align-items:flex-start; }
.setting-group .center-stats { grid-template-columns:repeat(3,1fr); }
.reset-options { display:grid; gap:10px; margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:var(--control-r,8px); }
.reset-options legend { padding:0 6px; font-size:12px; font-weight:700; color:var(--muted); }
.reset-options .check { align-items:flex-start; font-weight:500; }
.reset-options .check small { display:block; font-weight:400; color:var(--muted); margin-top:2px; }
.reset-options input { margin-top:3px; width:17px; height:17px; }

/* Pinned filters sit flush under the header: they stick at the edge of the scroll area, not
   inside its top padding (which left a strip where content showed through). */
.content { --content-pt:32px; padding-top:var(--content-pt); }
:root[data-density="compact"] .content { --content-pt:20px; }
.filters, .report-filters { top:calc(-1 * var(--content-pt)); }
/* Stuck under the header, only 12 px of its top padding shows (the sticky offset counts from below the page padding). */
.dashboard-head { top:calc(12px - 2 * var(--content-pt)); margin-top:calc(-1 * var(--content-pt)); padding-top:var(--content-pt); }
@media (max-width:800px) { .content { --content-pt:22px; } }

/* Center logo above the cover image, with a soft shadow. */
.center-body .center-title { position:relative; z-index:2; margin-top:-34px; align-items:flex-start; }
/* The name starts below the cover: logo overlap (34px) plus 14px of air. */
.center-body .center-title > div { padding-top:48px; }
.center-card .center-logo.initial { font-size:19px; }
.center-card .center-logo { box-shadow:0 6px 18px rgb(0 0 0 / .22), 0 1px 3px rgb(0 0 0 / .18); }
.center-card .center-cover { z-index:1; }
.logo-preview { position:relative; z-index:2; box-shadow:0 6px 18px rgb(0 0 0 / .22), 0 1px 3px rgb(0 0 0 / .18); }
/* Slimmer top padding on the pinned filter bars. */
.filters, .report-filters { padding-top:12px; }
.center-filters { padding-top:14px; }
:root[data-density="compact"] :is(.filters, .report-filters, .center-filters) { padding-top:9px; }

/* Reports: statistics and the final daily report */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; margin-top:18px; }
.stat-panel .panel-head { padding:14px 18px 6px; }
.stat-panel .panel-head svg { color:var(--muted); }
.stat-list { padding:0 18px 10px; }
.stat-list a { background:linear-gradient(to right, color-mix(in srgb, var(--accent, #4a8e73) 55%, transparent) var(--share), transparent 0) left bottom / 100% 2px no-repeat; }
.stat-list a:not([href]) { cursor:default; }
.stat-list a:not([href]):hover { text-decoration:none; }
.stat-list .muted { padding:8px 0; font-size:13px; }
.report-dialog { width:min(1220px, calc(100% - 24px)); }
#daily-email { width:min(820px, calc(100% - 24px)); }
.dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.dialog-head p { color:var(--muted); font-size:13px; margin-top:4px; }
.daily-totals { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.daily-totals div { display:grid; gap:2px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.daily-totals small { font-size:12px; color:var(--muted); }
.daily-totals strong { font-size:22px; font-weight:650; }
.daily-totals .positive strong { color:#b03a2e; }
.daily-totals .negative strong { color:#2c7a55; }
.daily-table { margin-bottom:12px; border:1px solid var(--line); font-size:12px; }
.daily-table :is(th,td) { text-align:center; font-variant-numeric:tabular-nums; padding:6px 7px; border:1px solid var(--line); }
.daily-table thead th { font-size:11px; }
.daily-table td.zone { text-align:left; font-weight:600; }
.daily-table td.positive { color:#b03a2e; font-weight:700; }
.daily-table tfoot :is(th,td) { font-weight:700; background:color-mix(in srgb, var(--line) 35%, transparent); }
.daily-table tfoot th { text-align:left; }
.daily-lab { font-size:13px; color:var(--muted); }
.daily-summary { margin:0 0 6px; padding-left:18px; font-size:13px; line-height:1.7; }
.daily-needs h3 { font-size:14px; margin:4px 0; }
.mail-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 12px; }
.rte { border:1px solid #bdc9cf; border-radius:5px; overflow:hidden; }
.rte-bar { display:flex; gap:2px; padding:4px; border-bottom:1px solid var(--line); background:color-mix(in srgb, var(--line) 30%, transparent); }
.rte-bar button { min-width:32px; min-height:30px; border:0; border-radius:4px; background:transparent; color:var(--ink); font-size:14px; }
.rte-bar button:hover { background:var(--paper); }
.rte-body { min-height:220px; max-height:46dvh; overflow:auto; padding:12px 14px; background:var(--paper); color:var(--ink); font-size:14px; line-height:1.5; outline:none; }
.rte-body:focus { box-shadow:inset 0 0 0 2px #40856e; }
.rte-body table { color:#24323d; background:#fff; }
.attachment { display:flex; align-items:center; gap:8px; font-size:13px; padding:8px 12px; border:1px dashed var(--line); border-radius:7px; margin:0; }
.attachment small { margin-left:auto; color:var(--muted); }
@media (max-width:800px) { .mail-fields, .daily-totals { grid-template-columns:1fr 1fr; } }
.rte-body p { margin:0 0 10px; }

/* Patient forms that follow each center's paper form */
.form-template { display:flex; align-items:center; gap:12px; padding:12px 16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.form-template span { display:grid; gap:2px; }
.form-template small { font-size:12px; }
.form-subhead { grid-column:1/-1; font-size:13px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; padding-top:10px; border-top:1px dashed var(--line); }
.field-grid > .form-subhead:first-child { padding-top:0; border-top:0; }
.choice-field { border:0; padding:0; margin:0; min-width:0; }
.choice-field legend { padding:0; font-size:13px; font-weight:600; }
.choices { display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:7px; }
.choices .check { font-weight:500; font-size:13px; }
.form-table .field-title { display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.form-table table { border:1px solid var(--line); }
.form-table :is(th,td) { padding:5px 6px; border:1px solid var(--line); vertical-align:middle; }
.form-table td:first-child, .form-table th:first-child { padding-left:8px; }
.form-table tbody th { white-space:nowrap; font-weight:600; }
.form-table :is(input,select) { margin:0; min-height:32px; padding:5px 7px; font-size:13px; min-width:110px; }
.form-table input[type=date] { min-width:135px; }
.form-table td.choices { display:table-cell; white-space:nowrap; }
.form-table td.choices .check { display:inline-flex; margin-right:8px; }
.form-table small { display:block; margin-top:6px; font-size:12px; }
.facts .long { grid-column:1/-1; }

/* The header always paints above the scrolling page, so pinned filters never cover its bottom border
   (at 90 % zoom the header ends on a fractional pixel). Filter corners follow the panel's own corners. */
.body > header { position:relative; z-index:6; }
:root[data-style="soft"] :is(.filters,.report-filters) { border-radius:19px 19px 0 0; }
:root[data-style="sharp"] :is(.filters,.report-filters) { border-radius:1px 1px 0 0; }
/* The header overlaps the page by 1px: at fractional zoom its edge and a pinned bar's edge would
   share one pixel row, letting the grey page background flicker through as a line while scrolling. */
.body > header { margin-bottom:-1px; }
/* Dashboard result trends: three chart types switched by radio labels (CSS only). */
/* Light mode: lighter, softer series colours; dark mode keeps its own below. */
.trend, .dashboard-grid, .map-layout { --c-pos:#e48a7d; --c-neg:#6dba95; --c-pend:#dcae5a; --grid:#e6eaee; }
.dashboard-grid .bar { background:var(--c-neg); }
.dashboard-grid .dot.positive { background:var(--c-pos); } .dashboard-grid .dot.negative { background:var(--c-neg); } .dashboard-grid .dot.pending { background:var(--c-pend); }
:root[data-palette="dark"] .trend, :root[data-palette="dark"] .dashboard-grid, :root[data-palette="dark"] .map-layout { --c-pos:#ff6b5e; --c-neg:#4cc483; --c-pend:#d9a84a; --grid:#404c57; }
:root[data-palette="dark"] .dashboard-grid .bar { background:#4a8e73; }
.trend > .panel-head { flex-wrap:wrap; }
.trend-switch { padding:3px; border:1px solid var(--line); border-radius:calc(var(--control-r) + 3px); background:var(--bg, #f3f6fa); }
.trend-switch label { position:relative; min-height:calc(var(--control-h) - 6px); padding:4px 13px; font-size:13px; border-color:transparent; background:transparent; color:var(--muted); }
.trend-switch input { position:absolute; opacity:0; pointer-events:none; }
:root[data-palette] .trend .trend-switch label.btn:has(:checked), .trend-switch label:has(:checked) { background:var(--ink); border-color:var(--ink); color:var(--paper); }
.trend-switch label:has(:focus-visible) { outline:3px solid #e79f44; outline-offset:2px; }
.trend-legend { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:0 22px 6px; font-size:13px; color:var(--muted); }
.trend-legend span { display:inline-flex; align-items:center; gap:7px; }
.trend-legend b { color:var(--ink); }
.trend-rate { margin-left:auto; }
.trend-rate em { font-style:normal; font-weight:650; font-size:12px; padding:2px 7px; border-radius:5px; }
.trend-rate em.up { color:var(--c-pos); background:color-mix(in srgb, var(--c-pos) 13%, transparent); }
.trend-rate em.down { color:var(--c-neg); background:color-mix(in srgb, var(--c-neg) 13%, transparent); }
.trend-plot { position:relative; height:240px; margin:16px 22px 0; background:repeating-linear-gradient(to top, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 60px); border-bottom:1px solid var(--line); }
.trend .chart { display:none; position:absolute; inset:0; }
.trend:has([value=bars]:checked) .chart.bars, .trend:has([value=lines]:checked) .chart.lines, .trend:has([value=share]:checked) .chart.share, .trend:has([value=cumulative]:checked) .chart.cumulative { display:block; }
.trend svg { display:block; width:100%; height:100%; overflow:visible; }
.trend .chart.lines svg, .trend .chart.cumulative svg { overflow:hidden; }
/* Line views: labels sit under points that span the full width (first left, last right). */
.trend:has([value=lines]:checked, [value=cumulative]:checked) .trend-x small:first-child { flex:.5; text-align:left; }
.trend:has([value=lines]:checked, [value=cumulative]:checked) .trend-x small:last-child { flex:.5; text-align:right; }
.trend-top { position:absolute; top:-14px; left:0; font-size:10px; color:var(--muted); }
.trend rect.positive, .trend .area.positive { fill:var(--c-pos); }
.trend rect.negative, .trend .area.negative { fill:var(--c-neg); }
.trend rect.pending { fill:var(--c-pend); }
.trend .area { fill-opacity:.12; stroke:none; }
.trend polyline { fill:none; stroke-width:2.5; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.trend polyline.positive { stroke:var(--c-pos); }
.trend polyline.negative { stroke:var(--c-neg); }
.trend polyline.pending { stroke:var(--c-pend); stroke-dasharray:5 4; stroke-width:1.5; }
.trend rect.hit { fill:transparent; }
.trend rect.hit:hover { fill:var(--ink); fill-opacity:.05; }
.trend-x { display:flex; margin:6px 22px 16px; }
.trend-x small { flex:1; min-width:0; text-align:center; font-size:10px; font-variant-numeric:tabular-nums; white-space:nowrap; }
@media (max-width:800px) { .trend-plot { height:180px; } .trend-rate { margin-left:0; } }
/* Reports › Visual analysis: epidemic curve, age–sex pyramid, positivity by zone, delays. Series colours from .trend.
   The grid gap draws the dividers between figures. */
.visuals { overflow:hidden; }
.visuals .dot.positive { background:var(--c-pos); } .visuals .dot.negative { background:var(--c-neg); } .visuals .dot.pending { background:var(--c-pend); }
.viz-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; background:var(--line); border-top:1px solid var(--line); }
.viz { margin:0; padding:18px 0 6px; min-width:0; background:var(--paper); }
.viz.wide { grid-column:1/-1; }
.viz figcaption { display:grid; gap:3px; padding:0 22px 12px; font-size:14px; }
.viz figcaption small, .viz-note { font-size:12px; }
.viz-note { color:var(--muted); padding:8px 22px 10px; }
.viz-empty { padding:4px 22px 16px; font-size:13px; }
.viz .trend-plot { height:200px; }
.trend-top.right { left:auto; right:0; }
.trend polyline.rate { stroke:var(--ink); stroke-width:2; }
.rate-key { width:14px; height:2px; background:var(--ink); }
.viz :is(.pyr-bar, .zone-bar) { position:relative; height:14px; }
.viz :is(.pyr-bar, .zone-bar) i { position:absolute; top:0; bottom:0; border-radius:3px; background:color-mix(in srgb, var(--c-neg) 45%, transparent); }
.viz :is(.pyr-bar, .zone-bar) i.pos { background:var(--c-pos); }
.pyramid { display:grid; gap:5px; padding:0 22px 8px; }
.pyr-row { display:grid; grid-template-columns:3ch minmax(0,1fr) 52px minmax(0,1fr) 3ch; align-items:center; gap:8px; font-size:12px; font-variant-numeric:tabular-nums; }
.pyr-row > b { font-weight:600; color:var(--muted); }
.pyr-row > b:first-child { text-align:right; }
.pyr-row > small { text-align:center; }
.pyr-head { font-size:11px; font-weight:650; color:var(--muted); }
.pyr-head span:nth-child(2) { text-align:right; }
.pyr-bar.f i { right:0; }
.pyr-bar.m i { left:0; }
.zone-bars { padding:0 22px 8px; }
.zone-bars a { display:grid; grid-template-columns:minmax(70px,.8fr) minmax(0,1.2fr) 6ch 7ch; align-items:center; gap:10px; padding:6px 0; border-top:1px solid var(--line); color:var(--ink); font-size:13px; }
.zone-bars a > span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zone-bars b, .zone-bars small { text-align:right; font-variant-numeric:tabular-nums; }
.zone-bar i { left:0; }
.delay-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px 24px; align-items:start; }
.delay-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:0 0 12px 22px; }
.delay-facts div { display:grid; gap:4px; }
.delay-facts strong { font-size:28px; font-weight:600; letter-spacing:-1px; }
.delay-facts span { font-size:12px; color:var(--muted); }
.delay-grid .stat-list { padding-left:0; }
@media (max-width:900px) { .viz-grid, .delay-grid { grid-template-columns:minmax(0,1fr); } .delay-grid .stat-list { padding-left:22px; } }
/* Maps: health zones as a heat scale (one hue mixed into the paper colour), labs, GPS points, side panel. */
.map-filters { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); }
.map-filters > label :is(input, select) { width:100%; }
.map-switches { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; grid-column:1 / -1; }
.map-switches .trend-switch { margin-left:0; }
.map-switches .trend-switch + .trend-switch { margin-left:auto; }
.map-layout { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr); gap:18px; align-items:start; }
.map-panel { --heat:#c4453b; --zone-none:#e1e6ea; }
:root[data-palette="dark"] .map-panel { --heat:#ff6b5e; --zone-none:#3a4752; }
.map-frame { margin:0 22px; border:1px solid var(--line); border-radius:8px; background:var(--paper); position:relative; overflow:hidden; }
.map { touch-action:none; cursor:grab; user-select:none; }
.map.dragging, .map.dragging a { cursor:grabbing; }
.map .zone-label, .map .lab, .map .gps { transform-box:fill-box; transform-origin:center; transform:scale(var(--k, 1)); }
.map-zoom { position:absolute; top:10px; right:10px; z-index:1; display:grid; gap:6px; }
.map-zoom .btn { width:34px; min-height:34px; padding:0; font-size:18px; line-height:1; }
.map { display:block; width:100%; height:auto; max-height:72vh; aspect-ratio:1; }
.map a { stroke:var(--paper); stroke-width:.6; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.map a use { vector-effect:non-scaling-stroke; }
.map.by-province a { stroke-opacity:.12; }
.map a:hover { stroke:var(--ink); stroke-width:1.5; }
/* Province borders: one line per border (computed from shared zone edges), the same width everywhere and at any zoom. */
.map .province-lines { fill:none; stroke:color-mix(in srgb, var(--ink) 72%, var(--paper)); stroke-width:1.3; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; pointer-events:none; }
.map a.on { stroke:var(--ink); stroke-width:2.5; }
.map .h0, .map-legend .h0 { fill:var(--zone-none); background:var(--zone-none); }
.map .h1, .map-legend .h1 { fill:color-mix(in srgb, var(--heat) 16%, var(--paper)); background:color-mix(in srgb, var(--heat) 16%, var(--paper)); }
.map .h2, .map-legend .h2 { fill:color-mix(in srgb, var(--heat) 34%, var(--paper)); background:color-mix(in srgb, var(--heat) 34%, var(--paper)); }
.map .h3, .map-legend .h3 { fill:color-mix(in srgb, var(--heat) 54%, var(--paper)); background:color-mix(in srgb, var(--heat) 54%, var(--paper)); }
.map .h4, .map-legend .h4 { fill:color-mix(in srgb, var(--heat) 76%, var(--paper)); background:color-mix(in srgb, var(--heat) 76%, var(--paper)); }
.map .h5, .map-legend .h5 { fill:var(--heat); background:var(--heat); }
.map .zone-label { fill:var(--ink); paint-order:stroke; stroke:var(--paper); stroke-width:3px; stroke-linejoin:round; text-anchor:middle; pointer-events:none; font-weight:600; }
.map .lab { stroke:none; }
.map .lab rect { fill:var(--ink); stroke:var(--paper); stroke-width:1.5; vector-effect:non-scaling-stroke; }
.map .lab text { fill:var(--paper); text-anchor:middle; font-weight:700; pointer-events:none; }
.map .gps { stroke:var(--paper); stroke-width:1; vector-effect:non-scaling-stroke; fill:var(--muted); }
.map .gps.positive { fill:var(--c-pos); } .map .gps.negative { fill:var(--c-neg); } .map .gps.pending { fill:var(--c-pend); }
.map-legend { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; padding:12px 22px 4px; font-size:12px; color:var(--muted); }
.map-legend span { display:inline-flex; align-items:center; gap:6px; }
.map-legend span:first-child { font-weight:650; color:var(--ink); }
.map-legend i { width:14px; height:10px; border-radius:2px; border:1px solid var(--line); }
.map-legend .lab-key { background:var(--ink); border-radius:3px; }
.map-credit { padding-top:0; font-size:11px; }
.map-side { position:sticky; top:0; }
.map-totals { grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 22px 6px; }
.map-totals .positive strong { color:var(--c-pos); } .map-totals .pending strong { color:var(--c-pend); }
.map-sub { font-size:13px; padding:12px 22px 2px; }
.map-side .stat-list { padding:0 22px 6px; }
.zone-rank { padding:0 22px 14px; }
.zone-rank a { display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-top:1px solid var(--line); color:var(--ink); font-size:13px; }
.zone-rank b { font-variant-numeric:tabular-nums; }
@media (max-width:1000px) { .map-layout { grid-template-columns:minmax(0,1fr); } .map-side { position:static; } }
/* Messages: conversation list beside the open thread; the thread is anchored to its latest message (column-reverse). */
.messages-layout { display:grid; grid-template-columns:minmax(230px,320px) minmax(0,1fr); gap:18px; align-items:start; }
.convos { display:grid; padding:0 10px 10px; }
.convo { position:relative; display:flex; align-items:center; border-radius:8px; }
.convo > a { flex:1; min-width:0; display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px; color:var(--ink); }
/* The list is a <nav>: cancel the side menu's dark link hover so the whole row (menu included) tints lightly. */
.convo:hover { background:color-mix(in srgb, var(--ink, #24323d) 6%, transparent); }
.convo > a:hover { text-decoration:none; background:none; }
.convo.active { background:color-mix(in srgb, var(--accent, #4a8e73) 14%, transparent); }
.convo-menu { flex:none; margin-right:4px; }
.convo-menu .dropdown-panel form { display:grid; }
.convo-meta small svg { vertical-align:-1px; }
.convo-text small svg { vertical-align:-1px; }
.convo-archived { margin-top:6px; padding-top:6px; border-top:1px solid var(--line); }
.convo-archived > summary { display:flex; align-items:center; gap:8px; padding:8px 10px; font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; list-style:none; }
.convo-archived > summary::-webkit-details-marker { display:none; }
.convo-archived .counter { margin-left:auto; }
.thread-lock { justify-content:center; align-items:center; }
.thread-lock .stack { width:min(320px, 100%); justify-items:center; text-align:center; }
.thread-lock label { width:100%; text-align:left; }
.convo-text { display:grid; gap:2px; min-width:0; flex:1; font-size:13px; }
.convo-text strong, .convo-text small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.convo-text small { font-size:12px; }
.convo-meta { display:grid; justify-items:end; gap:3px; font-size:11px; }
.convo-meta .counter { margin:0; background:var(--accent, #4a8e73); color:var(--paper); }
.convo-new { padding:12px 18px 16px; border-top:1px solid var(--line); }
/* Wide screens: the panels fill the page down to a small bottom margin, whatever the window height or zoom
   (the page column is a flex column; the conversation list and the thread scroll inside their panels). */
.thread-panel { display:flex; flex-direction:column; min-height:0; }
@media (min-width:801px) {
  .content:has(> .messages-layout) { display:flex; flex-direction:column; padding-bottom:16px; }
  .content:has(> .messages-layout) > * { width:100%; }
  .content > .messages-layout { flex:1 1 0; min-height:380px; grid-template-rows:minmax(0,1fr); align-items:stretch; }
  .messages-layout > .panel { min-height:0; }
  .convo-panel { display:flex; flex-direction:column; }
  .convo-panel .convos { flex:1; min-height:0; overflow-y:auto; align-content:start; }
}
.thread { flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column-reverse; gap:8px; padding:6px 22px 14px; border-top:1px solid var(--line); }
.thread-empty { margin:auto; font-size:13px; }
.bubble { max-width:min(75%, 560px); align-self:flex-start; display:grid; gap:3px; padding:8px 12px; border-radius:12px 12px 12px 3px; background:var(--bg, #f3f6fa); border:1px solid var(--line); font-size:14px; }
.bubble.mine { align-self:flex-end; border-radius:12px 12px 3px 12px; background:color-mix(in srgb, var(--accent, #4a8e73) 16%, var(--paper)); border-color:color-mix(in srgb, var(--accent, #4a8e73) 30%, var(--line)); }
.bubble strong { font-size:12px; color:var(--accent-ink, var(--teal)); }
.bubble p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.45; }
.bubble small { justify-self:end; font-size:11px; }
.thread-day { display:flex; align-items:center; gap:10px; font-size:11px; color:var(--muted); margin:8px 0 2px; }
.thread-day::before, .thread-day::after { content:""; flex:1; border-top:1px solid var(--line); }
.composer { display:flex; gap:10px; align-items:flex-end; padding:12px 22px 16px; border-top:1px solid var(--line); }
.composer textarea { margin:0; resize:none; max-height:160px; }
@media (max-width:800px) { .messages-layout { grid-template-columns:minmax(0,1fr); } .thread-panel { height:70dvh; } }
/* Form tables: compact "Add another" link under numbered tables. */
.form-table .add-row { display:inline-flex; align-items:center; gap:4px; margin-top:10px; padding:3px 6px; border:0; border-radius:5px; background:transparent; color:var(--accent-ink, var(--teal)); font-size:12px; font-weight:600; }
.form-table .add-row:hover { background:var(--bg, #f3f6fa); }
.form-table .add-row[hidden] { display:none; }
/* Header refresh: same height as the session chip. */
header .header-refresh { display:flex; margin:0; }
header :is(.header-refresh .btn.icon-only, .notify-menu > summary) { width:30px; height:30px; min-height:30px; padding:0; border-color:var(--line); background:transparent; color:var(--muted); }
header :is(.header-refresh .btn.icon-only, .notify-menu > summary):hover { color:var(--ink); border-color:var(--accent, #91b5a5); }
/* Header refresh result: a green tick or red cross over the button for a moment, then the refresh arrow again. */
header .header-refresh .btn.icon-only { position:relative; }
header .refresh-result { position:absolute; inset:-1px; display:grid; place-items:center; border-radius:50%; color:#fff; animation:refresh-result 1.8s ease forwards; pointer-events:none; }
header .is-ok .refresh-result { background:#2f8a5f; }
header .is-fail .refresh-result { background:#c4453b; }
header .refresh-result svg { stroke-width:3; }
@keyframes refresh-result { 0%,70% { opacity:1; } 100% { opacity:0; visibility:hidden; } }
/* Settings: the inline Light / Dark menu buttons stay one line high. */
.tiles.inline .tile { padding:5px 12px; }
.tiles.inline .tile-preview { min-height:0; }
/* Top loading bar: only when an action takes longer than a second (app.js adds .is-loading). */
:root.is-loading::before { content:""; position:fixed; z-index:1000; top:0; left:0; height:2px; background:var(--accent-ink, var(--teal)); animation:loading-bar 12s cubic-bezier(.08,.8,.2,1) forwards; pointer-events:none; }
@keyframes loading-bar { from { width:0; } to { width:92%; } }

/* Settings → Content: room under the Open register counts. */
.center-stats.pad { padding:0 21px 21px; }

/* Dropdown menus (<details class="dropdown">): session switcher, notifications, user actions. */
.dropdown { position:relative; }
.dropdown > summary { list-style:none; }
.dropdown > summary::-webkit-details-marker { display:none; }
.dropdown-panel { position:absolute; right:0; top:calc(100% + 6px); z-index:60; min-width:220px; padding:4px; background:var(--paper); border:1px solid var(--line); border-radius:calc(var(--control-r, 8px) + 2px); text-align:left; }
.dropdown-panel.floating { position:fixed; right:auto; z-index:200; }
.dropdown-panel form { margin:0; }
.dropdown-item { display:flex; align-items:center; gap:9px; width:100%; padding:8px 10px; border:0; border-radius:var(--control-r, 6px); background:none; color:var(--ink); font-size:13px; font-weight:500; text-align:left; white-space:nowrap; }
.dropdown-item:hover { background:var(--accent-soft, #edf2f8); text-decoration:none; }
.dropdown-item > span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.dropdown-item small { display:block; font-size:11px; color:var(--muted); }
.dropdown-item.selected { font-weight:650; color:var(--accent-ink, var(--teal)); }
.dropdown-item.danger { color:#b42318; background:none; }
.dropdown-item.danger:hover { background:color-mix(in srgb, #c0392b 12%, transparent); }
:root[data-palette="dark"] .dropdown-item.danger { color:#ff9b91; background:none; }
:root[data-palette="dark"] .dropdown-item.danger:hover { background:color-mix(in srgb, #ff9b91 14%, transparent); }
.dropdown-item.foot { margin-top:4px; border-top:1px solid var(--line); border-radius:0 0 var(--control-r, 6px) var(--control-r, 6px); }
header .session-switch > summary { gap:6px; cursor:pointer; }
header .session-switch > summary > svg:last-child { color:var(--muted); }
header .session-switch .dropdown-panel { left:0; right:auto; min-width:240px; }

/* Notifications: header menu, sidebar count and the All Notifications page. */
.notify-count { min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:#d92d20; color:#fff; font-size:10px; font-weight:700; line-height:16px; text-align:center; }
header .notify-menu > summary { position:relative; display:inline-grid; place-items:center; border:1px solid var(--line); border-radius:var(--control-r, 7px); }
header .notify-menu .notify-count { position:absolute; top:-6px; right:-7px; }
aside nav a .notify-count { margin-left:auto; }
.notify-panel { width:min(370px, calc(100vw - 24px)); padding:0; }
/* The notification menu floats over the page with a soft shadow (asked for; other menus stay flat). */
.notify-panel, .map-full .map-side, .profile-panel, .fab-messages > .dropdown-panel { box-shadow:0 10px 28px rgb(16 24 40 / .12), 0 2px 6px rgb(16 24 40 / .06); }
:root[data-palette="dark"] :is(.notify-panel, .map-full .map-side, .profile-panel, .fab-messages > .dropdown-panel) { box-shadow:0 12px 32px rgb(0 0 0 / .45), 0 2px 8px rgb(0 0 0 / .3); }
.notify-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 10px 9px 14px; border-bottom:1px solid var(--line); font-size:14px; }
.notify-head span { display:flex; gap:2px; }
.notify-act { padding:3px 7px; border:0; border-radius:5px; background:none; color:var(--accent-ink, var(--teal)); font-size:12px; font-weight:600; white-space:nowrap; }
.notify-act:hover { background:var(--accent-soft, #edf2f8); }
.notify-list { list-style:none; margin:0; padding:0; max-height:380px; overflow-y:auto; }
.notify-list:empty::before { content:attr(data-empty); display:block; padding:22px 14px; color:var(--muted); font-size:13px; text-align:center; }
.notify-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:start; gap:10px; padding:10px 10px 10px 14px; border-bottom:1px solid var(--line); font-size:13px; line-height:1.4; }
.notify-item:last-child { border-bottom:0; }
.notify-item.unread { background:color-mix(in srgb, var(--accent-soft, #e3ecf8) 55%, transparent); }
.notify-item.unread .notify-text { font-weight:600; }
.notify-item a { color:var(--ink); }
.notify-item .tile-icon { width:28px; height:28px; padding:0; margin:0; line-height:1; }
.notify-item .tile-icon.alert { color:#b42318; background:#fdeceb; }
.notify-item .tile-icon.request { color:#94661e; background:#f8efdb; }
:root[data-palette="dark"] .notify-item .tile-icon.alert { color:#ff9b91; background:#4a2c29; }
:root[data-palette="dark"] .notify-item .tile-icon.request { color:#e4bd72; background:#45391f; }
.notify-text small { display:block; margin-top:2px; font-size:11px; font-weight:400; color:var(--muted); }
.notify-acts { display:flex; gap:2px; }
.notify-foot { display:block; padding:9px 12px; border-top:1px solid var(--line); font-size:13px; font-weight:600; text-align:center; }
.notify-page .notify-list { max-height:none; }
.notify-page .notify-item { padding:12px 16px 12px 21px; }

/* Permission pickers: a red dot marks super permissions, an "i" the others; both explain on hover. */
.grant-row { display:flex; align-items:center; gap:8px; min-width:0; }
.grant-row .check { flex:1; min-width:0; }
.grant-grid .grant-all { padding-bottom:8px; border-bottom:1px solid var(--line); font-weight:650; }
.grant-tip { position:relative; flex:none; display:grid; place-items:center; width:16px; height:16px; border:1px solid var(--line); border-radius:50%; color:var(--muted); font:italic 700 10px/1 Georgia, serif; cursor:help; }
.grant-tip.super { width:9px; height:9px; margin-inline:3px; border:0; background:#d92d20; }
.grant-tip:is(:hover, :focus-visible)::after { content:attr(data-tip); position:absolute; right:-8px; bottom:calc(100% + 8px); z-index:5; width:max-content; max-width:250px; padding:7px 9px; border-radius:6px; background:var(--ink); color:var(--paper); font:500 12px/1.45 Inter, "Segoe UI", sans-serif; text-align:left; white-space:normal; pointer-events:none; }

/* Session members: presence, permissions count and actions. */
.status-dot { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#98a2b3; }
.status-dot.on { background:#1f9254; }
.member-list li > span:nth-child(2) { flex:1; min-width:0; }
.member-list .member-meta { display:flex; align-items:center; margin:2px 0 0; font-size:11px; }
.member-acts { display:flex; gap:6px; margin-left:auto; }
.member-acts form { margin:0; }
.member-acts .btn { min-height:30px; padding:4px 10px; font-size:12px; }

/* Users: minimal cards, actions in the corner menu. */
.user-card { gap:3px; padding:22px 16px 18px; }
.user-card h2 { margin-top:8px; }
.user-card .card-menu { position:absolute; top:8px; right:8px; }
.user-meta { display:flex; align-items:center; justify-content:center; margin-top:6px !important; font-size:12px !important; color:var(--muted); }
.card-menu .dropdown-panel { min-width:190px; }
td .card-menu { display:inline-block; }

/* Header session switcher: same height as Refresh, language and theme. */
header .session-switch > summary { padding:0 10px; border-radius:var(--control-r, 7px); }
header :is(.session-switch > summary, .header-refresh .btn.icon-only, .notify-menu > summary, .languages, .theme-options) { box-sizing:border-box; height:32px; min-height:32px; }
header :is(.header-refresh .btn.icon-only, .notify-menu > summary) { width:32px; }

/* Case form: scanned paper form, top right of the page title (never taller than the title block). */
.page-head .scan-slot { flex:none; margin-left:auto; }
.scan-card { display:flex; align-items:center; gap:10px; height:60px; max-width:260px; padding:5px 14px 5px 5px; border:1px dashed var(--line); border-radius:calc(var(--control-r, 8px) + 2px); background:var(--paper); color:var(--ink); text-align:left; }
.scan-card > button { padding:0; border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.scan-card > .scan-preview { border:1px solid var(--line); }
.scan-card > .scan-preview:hover { border-color:var(--accent, var(--teal)); }
.scan-slot.has-scan .scan-card { border-style:solid; }
.scan-card:hover { border-color:var(--accent, var(--teal)); }
.scan-text:hover strong { text-decoration:underline; }
.scan-preview { position:relative; display:grid; place-items:center; flex:none; width:40px; height:48px; overflow:hidden; border:1px solid var(--line); border-radius:4px; background:var(--bg, #f3f6fa); color:var(--muted); }
.scan-preview img { width:100%; height:100%; object-fit:cover; }
.scan-preview iframe { position:absolute; top:0; left:0; width:200px; height:240px; border:0; transform:scale(.2); transform-origin:0 0; pointer-events:none; }
.scan-text { min-width:0; }
.scan-text strong { display:block; font-size:13px; }
.scan-text small { display:block; overflow:hidden; font-size:11px; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
.scan-text small.warn { color:#b42318; white-space:normal; }
.scan-view { width:min(1000px, calc(100% - 24px)); padding:0; }
.scan-view-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 14px 12px 20px; border-bottom:1px solid var(--line); }
.scan-view-head .actions { gap:8px; }
.scan-view-head .btn { min-height:34px; padding:6px 12px; font-size:13px; }
.scan-view-body { display:flex; align-items:center; justify-content:center; height:min(72vh, 900px); overflow:hidden; background:var(--bg, #f3f6fa); }
.scan-view-body img { max-width:100%; max-height:100%; object-fit:contain; }
.scan-view-body iframe { width:100%; height:100%; border:0; }
.scan-fallback { padding:12px 20px; }
@media (max-width:800px) { .scan-text { display:none; } .scan-card { padding-right:5px; } }

/* Backups: automatic backups to keep. */
.backup-keep { display:flex; align-items:center; gap:10px 20px; flex-wrap:wrap; }
.backup-keep .check { font-weight:500; }
.backup-keep input[type=number] { width:84px; min-height:34px; margin:0 0 0 4px; padding:5px 8px; }
.backup-keep .btn { margin-left:auto; }
.scan-slot input[type=file] { display:none; }

/* Sessions: local or cloud, Switch To Session banner. Conflict to review reuses .versions. */
.session-kind { color: var(--muted); }
.session-kinds .check { align-items: flex-start; }
.session-kinds .check svg { margin-top: 2px; color: var(--muted); }
.session-dialog form:has([name=kind][value=local]:checked) .cloud-only { display: none; }
.approved-banner { align-items: center; }
.approved-banner > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.conflict-list { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.conflict-list li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.conflict-list small { margin-left: 6px; }

/* Users: names open the profile; the profile photo opens in a lightbox (Change / Remove photo live there). */
.user-link { display:contents; color:inherit; }
a.user-cell.user-link { display:flex; color:inherit; }
.user-link:hover h2, .user-link:hover strong { text-decoration:underline; }
.photo-open { padding:0; border:0; background:none; border-radius:50%; cursor:zoom-in; }
.photo-open:focus-visible { outline:3px solid #e79f44; outline-offset:3px; }
.lightbox { width:min(460px, calc(100% - 24px)); }
.lightbox .stack { justify-items:center; }
.lightbox-photo .avatar { width:min(320px, 70vw) !important; height:min(320px, 70vw) !important; border-radius:16px; font-size:96px !important; }
.lightbox .actions { justify-content:center; }
/* Settings › Content › Import from Excel: preview lists. */
.import .actions { display:flex; gap:10px; justify-content:flex-end; }
.import-file { font-size:13px; padding-top:0; overflow-wrap:anywhere; }
.import-list summary { cursor:pointer; font-weight:600; font-size:14px; }
.import-list ul { margin:8px 0 0; padding-left:18px; display:grid; gap:3px; font-size:13px; max-height:240px; overflow-y:auto; }
.import .center-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.import-dialog { width:min(920px, calc(100% - 24px)); }
.import-dialog .center-stats { padding:0; }
.import-dialog .import-rows { max-height:min(340px, 40dvh); overflow:auto; border:1px solid var(--line); border-radius:8px; }
.import-dialog .import-rows th { position:sticky; top:0; }
.import-dialog .import-rows tr:first-child th { border-top:0; }
@media (max-width:600px) { .import .center-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
/* Projects: header switcher (the session switcher's design) and Settings › Content list. */
.project-list { list-style:none; margin:0; display:grid; gap:8px; }
.project-list li { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.project-list li.current { border-color:color-mix(in srgb, var(--accent, #4a8e73) 45%, var(--line)); }
.project-list li > span:first-child { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.project-list li > span:first-child small { color:var(--muted); font-size:12px; }
.project-rename > summary { list-style:none; }
.project-rename[open] { flex-basis:100%; }
.project-rename form { margin-top:8px; }
.project-style { margin-top:8px; max-width:560px; }
.project-style .icon-choice legend { font-size:13px; font-weight:600; margin-bottom:6px; padding:0; }
.project-logo-row { display:flex; align-items:center; gap:14px; }
.project-logo-row > div { display:grid; gap:4px; }
.project-logo-pick .image-preview { width:72px; height:72px; border-radius:12px; }
img.project-logo { border-radius:4px; object-fit:cover; flex:none; }
.user-photo { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
@media (max-width:600px) { header .project-switch .dropdown-panel { left:auto; right:0; } }
/* Form Builder (Settings › Content): sections and their fields, saved as they change. */
.builder { display:grid; gap:14px; }
.builder-actions { display:flex; gap:10px; flex-wrap:wrap; padding-top:0; }
.builder-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.builder-row input:not([type=hidden]), .builder-row select { margin:0; width:auto; flex:1 1 180px; min-width:0; }
.builder-row select { flex:0 1 240px; }
.builder-title { font-weight:600; font-size:15px; }
.builder-move { display:inline-flex; gap:4px; }
.builder-move .btn { padding:4px 8px; min-width:30px; justify-content:center; }
.builder-items { list-style:none; margin:0; padding:4px 21px 10px; display:grid; gap:6px; }
.builder-items li { padding:6px 8px; border:1px solid var(--line); border-radius:8px; }
.builder-items li.heading { background:var(--bg, #f3f6fa); }
.builder-items li.builder-empty { border-style:dashed; font-size:13px; }
.builder-type { font-size:11px; color:var(--muted); min-width:110px; }
.builder-add { padding:0 21px 16px; }
.builder-add > summary { list-style:none; display:inline-flex; }
.builder-add > summary::-webkit-details-marker { display:none; }
.builder-add[open] > summary { display:none; }
/* Add a Field: three ways, one row each (input, then Add at the end of the row); × folds it. */
.builder-add-forms { position:relative; display:grid; padding:14px 16px 4px; border:1px solid var(--line); border-radius:10px; background:var(--bg, #f3f6fa); }
.builder-add-forms > h3 { margin:0 40px 6px 0; font-size:14px; }
.builder-add-forms > .dialog-x { position:absolute; top:8px; right:8px; width:30px; height:30px; }
.builder-add-forms form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; align-items:end; padding:12px 0; }
.builder-add-forms form + form { border-top:1px solid var(--line); }
.builder-add-forms label { min-width:0; font-size:12.5px; }
.builder-add-forms .builder-add-new { grid-template-columns:minmax(0,1fr) minmax(0,220px) auto; }
.builder-add-forms .builder-add-new .long { grid-column:1 / -2; }
.builder-add-forms textarea { min-height:64px; }
.builder-add-forms .btn { min-width:84px; }
@media (max-width:600px) { .builder-add-forms form, .builder-add-forms .builder-add-new { grid-template-columns:minmax(0,1fr); } .builder-add-forms .builder-add-new .long { grid-column:auto; } }
.builder-new-section { margin:0; }
@media (max-width:600px) { .builder-type { min-width:0; flex-basis:100%; } .builder-row select { flex-basis:100%; } }
.builder-show { display:flex; align-items:center; gap:6px; flex:0 1 280px; margin:0; font-size:12px; color:var(--muted); white-space:nowrap; }
.builder-show input { flex:1; min-width:0; }
@media (max-width:600px) { .builder-show { flex-basis:100%; } }
.project-rename .pad-top { margin-top:8px; }

.badge.validated { color:#0f5f56; background:#e0f2ef; }
.badge.validated i { background:#178a7a; }
.badge.preliminary { color:#775519; background:#faf1db; }
.badge.preliminary i { background:#ac802e; }
:root[data-palette="dark"] .badge.validated { color:#9fe0d4; background:#1f3d3a; }
:root[data-palette="dark"] .badge.preliminary { color:#e8c57f; background:#3d3220; }
.page-head .actions form { display:contents; }
.history { margin-top:16px; }
.history summary { cursor:pointer; list-style:none; }
.history summary::-webkit-details-marker { display:none; }
.history h2 { display:flex; align-items:center; gap:8px; }
.history-list { margin:0; padding:0 21px 14px; list-style:none; }
.history-list > li { padding:11px 0; border-top:1px solid var(--line); font-size:13px; }
.history-list ul { margin:6px 0 0; padding:0; list-style:none; display:grid; gap:4px; }
.history-list ul span { color:var(--muted); }
.history-list del { color:var(--muted); }
.history-list del:empty, .history-list b:empty { display:none; }
.history-list del:not(:empty) + b::before { content:"→ "; color:var(--muted); font-weight:400; }
.tat .daily-counts { border-top:1px solid var(--line); }
.tat .daily-counts div { gap:4px; min-width:150px; }
.tat .stat-list { padding-bottom:14px; }
.quality details { border-top:1px solid var(--line); }
.quality details:first-child { border-top:0; }
.quality summary { display:flex; align-items:center; gap:12px; padding:13px 21px; cursor:pointer; list-style:none; }
.quality summary::-webkit-details-marker { display:none; }
.quality summary span { flex:1; display:grid; gap:2px; font-size:14px; }
.quality summary small { font-size:12px; }
.quality summary b { font-size:16px; }
.quality details.ok summary { cursor:default; color:var(--muted); }
.quality ul { margin:0; padding:0 21px 14px 41px; display:grid; gap:4px; font-size:13px; }
.quality li .row-link { padding:2px 4px; }
.quality details > p { padding:0 21px 12px 41px; font-size:12px; }
.threshold-alert { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.threshold-alert span { flex:1; }
.alert-rules { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; align-items:end; }
.alert-rules p, .alert-rules button { grid-column:1 / -1; justify-self:start; }
.fu-bar { display:block; width:120px; height:6px; border-radius:3px; background:var(--line); margin-bottom:5px; }
.fu-bar::before { content:""; display:block; height:100%; width:var(--p); border-radius:3px; background:var(--accent, #176757); }
.fu-week { display:inline-flex; gap:4px; }
.fu-dot { width:10px; height:10px; border-radius:50%; border:1px solid var(--line); background:transparent; }
.fu-dot.well { background:#498369; border-color:#498369; }
.fu-dot.sick { background:#bc6556; border-color:#bc6556; }
.fu-dot.absent { background:#ac802e; border-color:#ac802e; }
.fu-visit { display:inline-flex; gap:6px; flex-wrap:wrap; }
.fu-visit .btn { min-height:32px; padding:5px 10px; font-size:13px; }
.fu-visit .btn[aria-pressed="true"].well { background:#e8f4e9; border-color:#498369; color:#31694f; }
.fu-visit .btn[aria-pressed="true"].sick { background:#faeae6; border-color:#bc6556; color:#8b4439; }
.fu-visit .btn[aria-pressed="true"].absent { background:#faf1db; border-color:#ac802e; color:#775519; }
:root[data-palette="dark"] .fu-visit .btn[aria-pressed="true"].well { background:#1f3b2e; color:#9fd8b8; }
:root[data-palette="dark"] .fu-visit .btn[aria-pressed="true"].sick { background:#4a2522; color:#ffb4ab; }
:root[data-palette="dark"] .fu-visit .btn[aria-pressed="true"].absent { background:#3d3220; color:#e8c57f; }
.case-contacts .panel-head h2 { display:flex; align-items:center; gap:8px; }
/* Page descriptions: a small info button after the title, the text in a tooltip on hover or focus. */
.info-tip { position:relative; display:inline-grid; place-items:center; width:26px; height:26px; margin-left:8px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); vertical-align:middle; letter-spacing:normal; }
.info-tip:hover, .info-tip:focus-visible { color:var(--ink); background:color-mix(in srgb, var(--ink) 8%, transparent); }
.info-tip::after { content:attr(data-tip); position:absolute; z-index:30; top:calc(100% + 8px); left:0; width:max-content; max-width:min(360px, 70vw); padding:9px 12px; border-radius:8px;
  background:var(--ink); color:var(--paper); font-size:13px; font-weight:450; line-height:1.45; text-align:left; white-space:normal; visibility:hidden; opacity:0; transition:opacity .12s; pointer-events:none; }
.info-tip:hover::after, .info-tip:focus-visible::after, .info-tip:focus::after { visibility:visible; opacity:1; }
/* Presence: a green dot on users active on this workstation in the last five minutes. */
.avatar-wrap { position:relative; display:inline-grid; flex:none; }
.online-dot { position:absolute; right:-1px; bottom:-1px; width:11px; height:11px; border-radius:50%; background:#2fa66a; border:2px solid var(--paper); }
.person-dot { flex:none; width:9px; height:9px; border-radius:50%; background:color-mix(in srgb, var(--muted) 45%, transparent); }
.person-dot.online { background:#2fa66a; }
/* Messages "+" menu: search on top, people below. */
.people-picker .dropdown-panel { right:0; left:auto; width:min(300px, 80vw); padding:8px; }
.people-picker input[type=search] { margin:0 0 6px; }
.people-list { max-height:320px; overflow-y:auto; display:grid; gap:2px; }
.people-list .dropdown-item small { display:block; color:var(--muted); font-size:12px; }
/* Floating buttons (bottom right, Settings › General): go to bottom (Reports), back to top, quick messages. Toasts
   stand beside them. The popover opens upwards. */
.fabs { position:fixed; right:16px; bottom:16px; z-index:55; display:grid; gap:8px; justify-items:end; }
html:root .fabs .fab { position:relative; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border-radius:50%; aspect-ratio:1; background:var(--paper); border-color:color-mix(in srgb, var(--ink) 18%, var(--line)); }
.fab[hidden] { display:none; }
.fab .notify-count { position:absolute; top:-4px; right:-4px; }
.toasts.beside-fabs { right:72px; width:min(360px, calc(100vw - 88px)); }
.fab-messages > .dropdown-panel { top:auto; bottom:calc(100% + 8px); display:flex; flex-direction:column; width:min(360px, calc(100vw - 32px)); max-height:min(520px, calc(100dvh / var(--zoom, 1) - 110px)); padding:0; overflow:hidden; }
.quick-msg:empty::before { content:""; margin:auto; width:22px; height:22px; border:2px solid var(--line); border-top-color:var(--accent, var(--teal)); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.quick-head { display:flex; align-items:center; gap:8px; padding:10px 10px 10px 14px; border-bottom:1px solid var(--line); }
.quick-head strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-head .quick-open { min-height:36px; padding:6px 12px; font-size:13px; }
.quick-head .people-picker > summary { width:36px; height:36px; min-height:36px; padding:0; }
.quick-head .people-picker > summary::-webkit-details-marker { display:none; }
/* + opens over the list (the popover clips anything outside it). */
.quick-head .people-picker { position:static; }
.quick-head .people-picker .dropdown-panel { top:58px; left:8px; right:8px; bottom:8px; width:auto; display:flex; flex-direction:column; }
.quick-head .people-picker .people-list { flex:1; max-height:none; }
.quick-locked { display:grid; justify-items:center; align-content:center; gap:8px; padding:24px; text-align:center; }
.quick-body { flex:1; min-height:320px; overflow-y:auto; padding:8px 0; }
.quick-body .convos { padding:0 6px 6px; }
.quick-thread { min-height:240px; padding:10px 12px; border-top:0; }
.quick-thread .bubble { max-width:85%; }
.quick-msg .composer { padding:10px; gap:8px; }
.quick-msg .composer textarea { min-height:40px; }
.people-empty { padding:8px 10px; font-size:13px; }
/* Side menu: both groups share one item size; the divider has equal space above and below. */
.shell aside > nav { margin-bottom:12px; }
.shell .side-bottom { margin-top:0; padding:12px 0 0; }
.shell .side-bottom nav { margin-bottom:0; }
aside nav a svg { width:20px; height:20px; }
/* Header profile: a rounded square avatar opening the profile menu. */
.profile-btn { display:grid; place-items:center; width:var(--control-h, 40px); height:var(--control-h, 40px); padding:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; cursor:pointer; }
.profile-btn .avatar { border-radius:0; object-fit:cover; }
.profile-panel { width:260px; padding:6px; }
.profile-card { display:flex; align-items:center; gap:12px; padding:10px 10px 12px; margin-bottom:4px; border-bottom:1px solid var(--line); color:var(--ink); border-radius:8px 8px 0 0; }
a.profile-card:hover { background:var(--bg, #f3f6fa); text-decoration:none; }
.profile-card .avatar { border-radius:10px; }
.profile-card strong { display:block; font-size:14px; }
.profile-card small { display:block; font-size:12px; color:var(--muted); }
.profile-panel hr { margin:6px 0; border:0; border-top:1px solid var(--line); }
/* Filter bars: compact, every control on one line where the width allows (the maps bar keeps its grid). */
.filters:not(.map-filters) { gap:10px; padding:14px 18px; }
@media (min-width:1100px) {
  .filters:not(.map-filters) { flex-wrap:nowrap; }
  .filters:not(.map-filters) > label { flex:1 1 0; min-width:0; }
  .filters:not(.map-filters) > .search-field { flex:2 1 0; }
  .filters:not(.map-filters) select { max-width:none; }
  .filters:not(.map-filters) > :is(.btn, button, a.btn) { flex:none; }
}
/* Documentation (templates/guide_*.html, generated by tools/guide.py) and its printed form (the PDF guides). */
/* The layout follows the width of the content area (container query), not the window: the main menu takes room. */
.guide-wrap { container-type:inline-size; max-width:1400px; }
.guide-layout { display:grid; grid-template-columns:minmax(0, 1fr); gap:18px; }
.guide { display:grid; grid-template-columns:minmax(0, 1fr); gap:18px; min-width:0; }
.guide-cover { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px; padding:22px 24px; background:var(--paper); border:1px solid var(--line); border-radius:12px; }
.guide-cover h2 { font-size:26px; letter-spacing:-.6px; }
.guide-cover p { color:var(--muted); margin-top:6px; font-size:14px; }
.guide-cover .btn { white-space:nowrap; }
/* Contents. Narrow: a sticky bar (☰ and the chapters scrolling sideways); ☰ opens the panel as a dropdown. Wide
   (content area of 900px or more): the panel is a sticky left column. The panel is as tall as its list, up to the
   bottom of the window; past that its list scrolls inside. */
.guide-toc { display:block; position:sticky; top:calc(-1 * var(--content-pt)); z-index:5; overflow:visible; }
.guide-toc ol { list-style:none; margin:0; padding:0; }
.guide-toc a { display:flex; flex:none; flex-direction:row; align-items:center; gap:10px; min-width:0; padding:6px 8px; border-radius:7px; color:var(--ink); font-size:14px; font-weight:500; text-align:left; white-space:nowrap; }
.guide-toc a:hover { background:var(--accent-soft, #eef5f2); text-decoration:none; }
.guide-toc a.active { background:var(--accent-soft, #e1efe9); color:var(--accent-ink, var(--teal)); font-weight:650; }
.guide-toc a span { display:inline-grid; place-items:center; flex:none; width:24px; height:24px; border-radius:7px; background:var(--accent-soft, #e1efe9); color:var(--accent-ink, var(--teal)); font-size:12px; font-weight:700; }
.guide-bar { display:flex; align-items:center; gap:6px; padding:6px; background:var(--paper); border:1px solid var(--line); border-radius:12px; }
.guide-burger { flex:none; }
.guide-burger[aria-expanded="true"] { background:var(--accent-soft, #e1efe9); color:var(--accent-ink, var(--teal)); }
.guide-chips { position:relative; display:flex; flex:1; min-width:0; gap:2px; overflow-x:auto; scrollbar-width:none; }
.guide-chips > li { flex:none; }
.guide-panel { display:none; flex-direction:column; gap:10px; padding:14px 10px 12px; background:var(--paper); border:1px solid var(--line); border-radius:12px;
  max-height:calc(100dvh / var(--zoom, 1) - 150px); }
.guide-toc.open .guide-panel { display:flex; position:absolute; left:0; right:0; top:calc(100% + 6px); border-color:color-mix(in srgb, var(--ink) 18%, var(--line)); }
.guide-panel h3 { margin:0 8px; font-size:12px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--muted); }
.guide-search { display:flex; align-items:center; gap:8px; margin:0 2px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg, #f4f5f7); color:var(--muted); font-weight:400; }
.guide-search:focus-within { border-color:var(--accent, var(--teal)); }
.guide-search input:not([type=hidden]) { flex:1; min-width:0; min-height:36px; margin:0; padding:6px 0; border:0; background:transparent; color:var(--ink); font-size:14px; outline:none; }
.guide-list { position:relative; display:grid; align-content:start; min-height:0; overflow-y:auto; }
.guide-panel a { white-space:normal; }
.guide-toc .guide-changes { margin:2px 0 6px 20px; padding-left:12px; border-left:1px solid var(--line); }
.guide-changes a { padding:4px 8px; font-size:13px; color:var(--muted); }
.guide-none { margin:2px 10px; color:var(--muted); font-size:13px; }
@container (min-width:900px) {
  .guide-layout { grid-template-columns:240px minmax(0, 1fr); align-items:start; }
  .guide-toc { top:0; }
  .guide-bar { display:none; }
  .guide-panel, .guide-toc.open .guide-panel { display:flex; position:static; max-height:calc(100dvh / var(--zoom, 1) - 64px - 2 * var(--content-pt)); }
}
.guide-section { content-visibility:auto; contain-intrinsic-block-size:auto 1100px; scroll-margin-top:72px; }
@container (min-width:900px) { .guide-section { scroll-margin-top:16px; } }
.guide-tips a { font-weight:600; white-space:nowrap; }
.guide-section { padding:20px 22px; background:var(--paper); border:1px solid var(--line); border-radius:12px; }
.guide-section h2 { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
/* Chapter editing (can_edit_docs): a pen in each chapter's top-right corner; the editor dialog with a toolbar. */
.guide-section { position:relative; }
.doc-edit { position:absolute; top:14px; right:14px; }
.guide-section.editable > h2 { padding-right:40px; }
.session-dialog.doc-editor { width:min(920px, calc(100% - 24px)); }
.doc-tools { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:6px; border:1px solid var(--line); border-radius:8px; }
.doc-tools .icon-btn { min-width:32px; font-size:14px; }
.doc-sep { width:1px; height:22px; margin:0 4px; background:var(--line); }
.doc-add-image input[type=file] { display:none; }
.doc-add-image { white-space:nowrap; min-height:32px; padding:4px 10px; font-size:13px; font-weight:500; cursor:pointer; }
.doc-body { min-height:260px; max-height:55dvh; overflow-y:auto; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:var(--paper); outline:none; }
.doc-body:focus { border-color:var(--accent, var(--teal)); }
.doc-body img[data-pending] { opacity:.5; }
.doc-editor .actions .spacer { flex:1; }
.docs-rooms { display:grid; gap:6px; margin:0; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.docs-rooms legend { padding:0 4px; font-size:13px; color:var(--muted); }
.guide-section h2 span { display:inline-grid; place-items:center; width:28px; height:28px; border-radius:8px; background:var(--accent-soft, #e1efe9); color:var(--accent-ink, var(--teal)); font-size:14px; }
.guide-section > p { color:var(--muted); line-height:1.6; max-width:80ch; }
.guide-shot { margin:16px 0 0; }
.guide-img { position:relative; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.guide-img img { display:block; width:100%; height:auto; }
.guide-pin { position:absolute; display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#e2562b; color:#fff; font-size:12px; font-weight:700; border:2px solid #fff; }
.guide-callouts { margin:12px 0 0; padding-left:22px; display:grid; gap:4px; font-size:14px; line-height:1.5; }
.guide-callouts li::marker { font-weight:700; color:#e2562b; }
.guide-tips { margin:14px 0 0; padding:12px 16px 12px 34px; border-radius:8px; background:var(--accent-soft, #eef5f2); font-size:14px; line-height:1.6; }
@media print {
  .shell { display:block; height:auto; overflow:visible; }
  .shell > aside, .body > header, .info-tip, .guide-pdf, .toasts, .fabs, .doc-edit, .doc-new { display:none !important; }
  .body, .content { display:block; overflow:visible; padding:0; height:auto; }
  .page-head { display:none; }
  :root, :root[data-palette], body { background:#fff !important; }
  .guide-wrap { container-type:normal; max-width:none; }
  .guide-layout { display:flex; flex-direction:column; gap:0; }
  .guide { display:contents; }
  .guide-cover { order:-1; }
  .guide-toc { position:static; }
  .guide-bar, .guide-search, .guide-none { display:none !important; }
  .guide-panel { display:block; max-height:none; padding:0; border:0; }
  .guide-panel h3 { margin:0 0 12px; }
  .guide-list { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:2px 16px; overflow:visible; }
  .guide-toc a.active { background:none; color:var(--ink); font-weight:500; }
  .guide-changes { display:none !important; }
  .guide-section { content-visibility:visible; }
  .guide-cover, .guide-toc, .guide-section { border:0; border-radius:0; padding:0 0 14px; }
  .guide-cover { min-height:30vh; align-items:flex-end; border-bottom:2px solid #e2562b; margin-bottom:18px; }
  .guide-cover h2 { font-size:34px; }
  .guide-toc { break-after:page; }
  .guide-section { break-before:page; }
  .guide-shot { break-inside:avoid; }
}


.banner-close { margin-left:auto; display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:6px; background:transparent; color:inherit; opacity:.7; }
.banner-close:hover { opacity:1; background:color-mix(in srgb, currentColor 12%, transparent); }
.alert.banner-pos { color:#9b1c1c; background:#fbe0dc; border-left:4px solid #c0392b; font-weight:600; }
:root[data-palette="dark"] .alert.banner-pos { color:#ffb4a8; background:#5a2b27; border-left-color:#e05a4a; }
.rediag { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; color:#62527f; }
.metric small.rediag { margin-top:4px; }
.patient-tests li.current { font-weight:600; }
:root[data-palette="dark"] .rediag { color:#c4b5e6; }

/* Sessions: the ⋯ menu (a soft floating popover, as asked for this menu), grid cards, sync jobs, icon choice */
.session-more .dropdown-panel { min-width:240px; }
:is(.session-more, header .session-switch) > .dropdown-panel { box-shadow:0 10px 30px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06); }
:root[data-palette="dark"] :is(.session-more, header .session-switch) > .dropdown-panel { box-shadow:0 12px 32px rgba(0, 0, 0, .45); }
.session-more .dropdown-panel hr { margin:4px 2px; border:0; border-top:1px solid var(--line); }
.session-table .actions { flex-wrap:nowrap; }
.session-switch .switch-row { display:flex; align-items:center; gap:2px; }
.session-switch .switch-row > .dropdown-item { flex:1; min-width:0; }
.session-switch .switch-row .session-more summary { width:30px; height:30px; }
.session-switch .dropdown-panel { min-width:280px; }
.session-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; padding:16px 21px 21px; }
.session-card { position:relative; display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--paper); }
.session-card.selected { border-color:var(--accent, var(--teal)); }
:root[data-style="soft"] .session-card { border-radius:20px; }
.session-card-head { display:flex; align-items:center; gap:10px; }
.session-card .card-pick { position:static; }
.session-card .session-kind { display:grid; place-items:center; width:36px; height:36px; border-radius:9px; background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); }
.session-card-title { display:grid; gap:2px; min-width:0; }
.session-card-title strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.session-card-facts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0; }
.session-card-facts dt { font-size:11px; color:var(--muted); }
.session-card-facts dd { margin:3px 0 0; font-size:13px; }
.session-card .actions { flex-wrap:wrap; }
.session-card .session-more { margin-left:auto; }
.move-notice form { margin:0; }
.sync-jobs { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.sync-jobs li { display:grid; grid-template-columns:minmax(0, 1.3fr) minmax(0, 1fr) 44px; align-items:center; gap:12px; }
.sync-job-name { display:flex; align-items:center; gap:8px; min-width:0; }
.sync-job-name strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sync-job-name small { color:var(--muted); white-space:nowrap; }
.sync-bar { height:8px; border-radius:99px; background:var(--line); overflow:hidden; }
.sync-bar i { display:block; height:100%; border-radius:inherit; background:var(--accent, var(--teal)); }
.sync-jobs b { text-align:right; font-size:13px; font-variant-numeric:tabular-nums; }
.icon-choice { display:grid; grid-template-columns:repeat(6, 1fr); gap:8px; margin:0 0 4px; padding:0; border:0; }
.icon-choice label { display:block; }
.icon-choice input { position:absolute; opacity:0; pointer-events:none; }
.icon-choice span { display:grid; place-items:center; height:44px; border:1px solid var(--line); border-radius:9px; cursor:pointer; color:var(--ink); }
.icon-choice input:checked + span { border-color:var(--accent, var(--teal)); background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); }
.icon-choice input:focus-visible + span { outline:3px solid #e79f44; outline-offset:2px; }
@media (max-width: 640px) { .sync-jobs li { grid-template-columns:1fr 44px; } .sync-bar { grid-column:1 / -1; grid-row:2; } }
/* Dialogs: a small × in the top-right corner closes them. */
.session-dialog > .dialog-x { position:absolute; top:10px; right:10px; z-index:2; width:30px; height:30px; color:var(--muted); }
.session-dialog > .dialog-x:hover { color:var(--ink); }
.session-dialog:has(> .dialog-x) :is(h2, .dialog-head):first-of-type { padding-right:34px; }
/* A banner or notice above the dashboard head: the head pulls itself up only into the banner's bottom margin, not
   over the banner's lower edge; its sticky offset stays the same, so it still sticks flush under the header. */
main.content > :is(.notice, .alert, [data-session-live]:has(> .session-notice)):not([hidden], :has(> .session-notice[hidden]:only-child)) ~ .dashboard-head { margin-top:-16px; }
/* Map filters: the chosen metric and level get a tinted background and a soft accent border. */
:root .map-switches .trend-switch label.btn:has(:checked) { background:color-mix(in srgb, var(--accent, var(--teal)) 24%, var(--paper)); border-color:color-mix(in srgb, var(--accent, var(--teal)) 40%, transparent); color:var(--accent-ink, var(--teal)); }
/* Map full page (the ⤢ button): the map fills the window; its side panel floats over it, dragged by its head,
   resized from its corner and collapsed to its head. */
.map-zoom .when-on, .map-side-toggle, .map-full-close { display:none; }
.map-full .map-full-close { display:grid; }
/* Inside the zoomed shell, inset:0 covers only zoom × the window: size it from the viewport instead. */
#map-body.map-full { position:fixed; top:0; left:0; width:calc(100vw / var(--zoom, 1)); height:calc(100dvh / var(--zoom, 1)); z-index:70; display:block; margin:0; background:var(--bg, #f4f5f7); }
.map-full .map-panel { height:100%; display:flex; flex-direction:column; border:0; border-radius:0; }
.map-full .map-frame { flex:1; min-height:0; margin:0 16px; display:flex; }
.map-full .map { height:100%; max-height:none; aspect-ratio:auto; }
.map-full .map-panel > .viz-note { display:none; }
.map-full .map-zoom .when-on { display:contents; } .map-full .map-zoom .when-off { display:none; }
.map-full .map-zoom { right:auto; left:10px; }
.map-full .map-side { position:absolute; z-index:3; top:76px; right:28px; width:340px; height:min(520px, calc(100% - 110px)); min-width:240px; min-height:56px;
  max-width:calc(100vw - 40px); max-height:calc(100% - 20px); overflow:auto; resize:both; }
/* Floats over the map, so it keeps a soft border even in the flat style. */
:root .map-full .map-side.panel { border:1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.map-full .map-side > .panel-head { cursor:move; touch-action:none; user-select:none; padding-right:48px; }
.map-full .map-side-toggle { display:grid; position:absolute; top:14px; right:12px; z-index:1; }
.map-side-toggle svg { transition:transform .15s; }
.map-full .map-side.collapsed { height:auto !important; min-height:0; resize:none; overflow:hidden; }
.map-full .map-side.collapsed > :not(.panel-head, .map-side-toggle) { display:none; }
.map-full .map-side.collapsed .map-side-toggle svg { transform:rotate(-90deg); }
.map-side.dragging { opacity:.92; }

/* Older engines without :has() (app.js adds .no-has and mirrors the checked states). */
.no-has .tile.is-checked { border-color:var(--accent, var(--teal)); outline:2px solid var(--accent, var(--teal)); outline-offset:-1px; }
.no-has .bulk-toggle.is-checked { border-color:var(--accent, var(--teal)); background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); }
.no-has .trend-switch label.is-checked { background:var(--ink); border-color:var(--ink); color:var(--paper); }
:root.no-has .map-switches .trend-switch label.btn.is-checked { background:var(--accent-soft, #e3ecf8); border-color:var(--accent, var(--teal)); color:var(--accent-ink, var(--teal)); }
.no-has .trend[data-view=bars] .chart.bars, .no-has .trend[data-view=lines] .chart.lines, .no-has .trend[data-view=share] .chart.share, .no-has .trend[data-view=cumulative] .chart.cumulative { display:block; }
.no-has .session-dialog form[data-kind=local] .cloud-only { display:none; }

/* 0.0.27 — dialogs: hidden radios no longer widen the icon picker; a backdrop click on a dialog with unsaved
   changes shakes it and shows a bar to keep editing or discard. */
.icon-choice label { position:relative; }
.icon-choice input { width:1px; height:1px; }
@keyframes dialog-shake { 0%, 100% { translate:0; } 20%, 60% { translate:-8px; } 40%, 80% { translate:8px; } }
@media (prefers-reduced-motion: no-preference) { dialog.shake { animation:dialog-shake .4s ease; } }
.unsaved-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:14px; padding:10px 12px; border:1px solid color-mix(in srgb, #f79009 45%, var(--line)); border-radius:8px; background:color-mix(in srgb, #f79009 12%, var(--paper)); }
.unsaved-bar span { flex:1 1 180px; font-size:13px; font-weight:600; }
/* Header switcher: only the "Manage Sessions" line separates the list from the footer link. */
.session-switch .switch-row:last-of-type { border-bottom:0; }
.session-switch .switch-row > form { flex:1; min-width:0; }
/* Session menus: each action has an "i" on its right that explains it. */
.menu-row { display:flex; align-items:center; gap:4px; }
.menu-row > :is(form, .dropdown-item) { flex:1; min-width:0; }
.menu-row > .grant-tip { margin-right:6px; }
.dropdown-item:disabled { opacity:.5; cursor:not-allowed; background:none; }
.grant-tip.super.online { background:#12b76a; margin-left:6px; vertical-align:middle; display:inline-block; }
/* Session name opens its details. */
.session-name { padding:0; border:0; background:none; color:inherit; font:inherit; cursor:pointer; text-align:left; }
.session-name:hover strong { text-decoration:underline; }
button.scheme-link { background:none; color:var(--ink); cursor:pointer; line-height:1.4; }
button.scheme-link:hover { border-color:var(--accent, var(--teal)); }
a.session-total { text-decoration:none; color:var(--accent-ink, var(--teal)); }
.cloud-target { margin:0 0 6px; font-size:13px; color:var(--muted); }
.session-details .details-head { display:flex; align-items:center; gap:12px; padding-right:34px; }
.session-details .details-head .session-kind { display:grid; place-items:center; width:42px; height:42px; flex:none; border-radius:10px; background:var(--accent-soft, #e3ecf8); color:var(--accent-ink, var(--teal)); }
.session-details .details-head p { margin:2px 0 0; color:var(--muted); font-size:13px; }
.details-facts { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:10px 16px; margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:10px; }
.details-facts > div.wide { grid-column:1 / -1; }
.details-facts dt { font-size:11px; font-weight:650; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.details-facts dd { margin:3px 0 0; font-size:14px; }
.session-details h3 { margin:6px 0 0; font-size:14px; }
.session-details .actions { flex-wrap:wrap; }
.session-details .actions > .actions { display:contents; }

/* Side menu: "Workspace" sits closer to the CTE logo. */
.navlabel { margin-top:28px; }
/* Copy / Move: optional filter (who added the content, and when). */
.pick-filter { border:1px solid var(--line); border-radius:8px; padding:8px 12px; }
.pick-filter > summary { font-size:13px; font-weight:600; cursor:pointer; }
.pick-filter p { font-size:12px; margin:6px 0; }
.pick-authors { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:4px 12px; margin:6px 0; padding:0; border:0; max-height:160px; overflow:auto; }
.pick-authors legend { font-size:12px; font-weight:650; color:var(--muted); margin-bottom:4px; }
.pick-dates { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
/* Floating tooltip (app.js, .has-tip): same look as the permission "i" tips. */
.float-tip { position:fixed; z-index:1000; max-width:300px; padding:7px 9px; border-radius:6px; background:var(--ink); color:var(--paper); font:500 12px/1.45 Inter, "Segoe UI", sans-serif; pointer-events:none; overflow-wrap:anywhere; }
/* Sign in with a Cloud Session (gate): folded under the password, like the forgot-password link. */
.cloud-signin { margin:4px 0 14px; }
.cloud-signin summary { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--accent-ink, var(--teal)); }
.cloud-signin p { margin:8px 0 0; }
.cloud-signin label { margin:12px 0 0; }
