/* MyWCX design system, ported from the MyWCX prototype (static/css/style.css):
   navy + teal from the WCX swoosh, left-rail shell, KPI tiles, panels. */
:root{
  --navy-900:#0b1f38; --navy-800:#0f2a4a; --navy-700:#132a63;
  --blue-500:#1b4f8c; --blue-300:#6fa8dc;
  --teal-600:#158a68; --teal-500:#1f9e7a; --teal-400:#3ecb9c; --teal-300:#7fd0b8;

  --grad-teal:linear-gradient(135deg,#3ecb9c 0%,#1f9e7a 100%);
  --grad-brand:linear-gradient(120deg,#1b4f8c 0%,#1f9e7a 100%);
  --grad-rail:linear-gradient(180deg,#0b1f38 0%,#0f2a4a 60%,#123056 100%);

  --bg:#eef2f6; --text:#14202e; --muted:#5b6b7a; --faint:#8798a6;
  --surface:#fff; --surface-2:#f6f9fb; --border:#e1e8ee; --border-strong:#cdd8e2;
  --skel:#e6ecf1;

  --good:#14804a; --good-bg:#e6f5ec;
  --warn:#9a5b00; --warn-bg:#fff4e0;
  --bad:#b3261e;  --bad-bg:#fdecea;

  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:22px;
  --sh-1:0 1px 2px rgba(16,42,74,.06),0 1px 3px rgba(16,42,74,.08);
  --sh-2:0 4px 12px rgba(16,42,74,.08),0 2px 4px rgba(16,42,74,.05);
  --sh-3:0 18px 40px rgba(11,31,56,.16);
  --ring:0 0 0 3px rgba(31,158,122,.18);

  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --serif:Georgia,"Times New Roman",serif;
  color-scheme:light;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;font-size:15px;line-height:1.5}
a{color:inherit;text-decoration:none}
h1,h2,h3,h4{margin:0 0 .4em;line-height:1.2;letter-spacing:-.01em;color:var(--navy-800)}
button{font-family:inherit}
:focus-visible{outline:2px solid var(--teal-500);outline-offset:2px}
.faint{color:var(--faint)} .small{font-size:12.5px} .strong{font-weight:600;color:var(--navy-800)}
.nowrap{white-space:nowrap} .center{text-align:center}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.note{color:var(--muted);font-size:13.5px;line-height:1.55;margin:0}
.linklike{background:none;border:0;padding:0;color:var(--teal-600);font-weight:600;cursor:pointer;font-size:inherit}
.linklike:hover,.notice a{text-decoration:underline}
.notice a{color:var(--teal-600);font-weight:600}

/* ===================== SHELL ===================== */
.shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh}
.rail{background:var(--grad-rail);color:#c6d3e2;padding:20px 14px;display:flex;flex-direction:column;gap:3px;position:sticky;top:0;height:100vh;overflow-y:auto}
.rail-nav,.rail-admin{display:flex;flex-direction:column;gap:3px}
.rail-nav{flex:1 1 auto}
.rail-admin{padding-bottom:6px}
.rail-brand{display:flex;align-items:center;gap:11px;padding:4px 8px 18px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px}
.rb-word{font-family:var(--serif);font-weight:700;font-size:19px;color:#fff;line-height:1;letter-spacing:-.01em}
.rb-word .c{color:var(--teal-400)}
.rb-sub{display:block;font-size:10.5px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#7f93ab;margin-top:3px}
.rail-sec{font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;color:#5f748c;padding:14px 10px 6px;font-weight:600}
.nav-item{display:flex;align-items:center;gap:12px;white-space:nowrap;padding:10px 12px;border-radius:10px;font-size:14px;font-weight:500;color:#c6d3e2;cursor:pointer;transition:background .14s,color .14s}
.nav-item svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.85;flex:none}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:rgba(62,203,156,.16);color:#fff}
.nav-item.active svg{color:var(--teal-400);opacity:1}
.nav-badge{margin-left:auto;font-size:10px;font-weight:700;letter-spacing:.03em;background:var(--grad-teal);color:#04231a;padding:2px 8px;border-radius:999px}
.nav-badge.soon{background:rgba(255,255,255,.07);color:#7f93ab;font-weight:600}

.rail-foot{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding-top:12px}
.rail-user{display:flex;align-items:center;gap:11px;padding:6px 8px}
.rail-user .av{width:34px;height:34px;border-radius:50%;background:var(--grad-teal);color:#04231a;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex:none}
.u-text{min-width:0}
.u-name{font-size:13px;font-weight:600;color:#fff;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.u-email{font-size:11.5px;color:#8ba0b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.u-role{display:inline-block;margin-top:4px;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--teal-300);background:rgba(62,203,156,.12);padding:1px 8px;border-radius:999px}
.rail-signout{display:flex;align-items:center;gap:10px;margin-top:8px;padding:9px 12px;border-radius:10px;font-size:13px;font-weight:600;color:#c6d3e2}
.rail-signout svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rail-signout:hover{background:rgba(255,255,255,.06);color:#fff}

.workspace{min-width:0;display:flex;flex-direction:column}
.content-area{padding:30px 32px 48px;max-width:1280px;width:100%}

/* ===================== PAGE HEADER ===================== */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-bottom:22px}
.page-head .eyebrow{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--teal-600);margin-bottom:6px}
.page-head h1{font-size:27px;margin:0;font-weight:750}
.page-head .lede{margin:6px 0 0;color:var(--muted);font-size:14.5px;max-width:720px}
.page-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* ===================== BUTTONS / CONTROLS ===================== */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--grad-teal);color:#04231a;font-weight:650;font-size:15px;padding:12px 24px;border-radius:10px;border:none;cursor:pointer;transition:filter .15s,box-shadow .15s;box-shadow:var(--sh-1)}
.btn:hover{filter:brightness(1.04);box-shadow:var(--sh-2)}
.btn:disabled{opacity:.55;cursor:default;filter:none;box-shadow:none}
.btn-ghost{background:transparent;color:var(--navy-700);border:1px solid var(--border-strong);box-shadow:none}
.btn-ghost:hover{background:var(--surface-2)}
.btn-block{width:100%}

.seg{display:inline-flex;background:var(--surface);border:1px solid var(--border-strong);border-radius:10px;padding:3px;gap:2px}
.seg button{border:0;background:transparent;font-size:13px;font-weight:600;color:var(--muted);padding:6px 13px;border-radius:7px;cursor:pointer}
.seg button:hover{color:var(--navy-800)}
.seg button.on{background:var(--navy-800);color:#fff}

select,.field input,.cell-input{font-family:inherit;font-size:14px;padding:9px 12px;border:1px solid var(--border-strong);border-radius:9px;background:var(--surface);color:var(--text)}
select{cursor:pointer}
select:focus,.field input:focus,.cell-input:focus{outline:none;border-color:var(--teal-500);box-shadow:var(--ring)}
select:disabled,input:disabled{opacity:.6;cursor:default}

.switch{display:inline-flex;align-items:center;gap:9px;font-size:13px;font-weight:600;color:var(--muted);cursor:pointer;user-select:none;position:relative}
.switch input{position:absolute;opacity:0;width:1px;height:1px}
.switch .track{width:34px;height:20px;border-radius:999px;background:var(--border-strong);position:relative;transition:background .15s;flex:none}
.switch .track::after{content:"";position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:var(--sh-1);transition:transform .15s}
.switch input:checked+.track{background:var(--teal-500)}
.switch input:checked+.track::after{transform:translateX(14px)}
.switch input:focus-visible+.track{box-shadow:var(--ring)}
.switch input:disabled+.track{opacity:.5}

.check{display:inline-flex;align-items:center;gap:8px;font-size:13.5px;font-weight:600;color:var(--text);cursor:pointer}
.check input{width:16px;height:16px;accent-color:var(--teal-500)}

/* ===================== PILLS / FLAGS / CHIPS ===================== */
.pill{font-size:12px;font-weight:600;padding:6px 13px;border-radius:999px;background:var(--surface);color:var(--muted);border:1px solid var(--border);white-space:nowrap}
.pill.live{color:var(--teal-600);background:var(--good-bg);border-color:transparent}
.pill.live::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--teal-500);margin-right:7px;vertical-align:middle;box-shadow:0 0 0 3px rgba(31,158,122,.18)}
.pill.soon{color:var(--warn);background:var(--warn-bg);border-color:transparent}
.flag{display:inline-block;padding:3px 11px;border-radius:999px;font-weight:700;font-size:12px;white-space:nowrap}
.flag-bad{background:var(--bad-bg);color:var(--bad)}
.flag-warn{background:var(--warn-bg);color:var(--warn)}
.flag-good{background:var(--good-bg);color:var(--good)}
.flag-system{background:#e6edf5;color:var(--navy-800);margin-top:3px}
.chip{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:1px 8px;border-radius:999px;background:#e8f1fb;color:var(--blue-500)}

/* ===================== PANELS / KPIs ===================== */
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--sh-1);overflow:hidden;margin-bottom:20px}
.panel .p-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 10px}
.panel .p-head h3{font-size:15.5px;margin:0}
.panel .p-sub{font-size:12.5px;color:var(--faint);margin-top:3px}
.panel .p-body{padding:6px 20px 20px}
.panel .p-body.flush{padding:4px 0 0}

.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.kpi-row-1{grid-template-columns:minmax(0,320px)}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:18px 20px;position:relative;overflow:hidden;box-shadow:var(--sh-1);min-width:0}
.kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--grad-teal)}
.kpi.accent-blue::before{background:linear-gradient(180deg,#6fa8dc,#1b4f8c)}
.kpi.accent-navy::before{background:linear-gradient(180deg,#3f7cbf,#132a63)}
.kpi.accent-amber::before{background:linear-gradient(180deg,#f4b360,#c9871f)}
.kpi.accent-bad::before{background:linear-gradient(180deg,#e88a80,#b3261e)}
.k-lab{font-size:12.5px;color:var(--muted);font-weight:600}
.k-num{font-size:32px;font-weight:800;color:var(--navy-800);margin:6px 0 2px;letter-spacing:-.02em;line-height:1.05;font-variant-numeric:tabular-nums}
.k-num.sm{font-size:24px;margin-top:9px}
.k-num.bad{color:var(--bad)}
.k-num.muted{color:var(--faint)}
.k-sub{font-size:12.5px;color:var(--faint)}
.k-delta{display:inline-block;margin-top:8px;font-size:11.5px;font-weight:700;padding:2px 9px;border-radius:999px}
.k-flag{margin-top:8px;font-size:11.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.delta-good{color:var(--good);background:var(--good-bg)}
.delta-bad{color:var(--bad);background:var(--bad-bg)}
.delta-flat{color:var(--muted);background:var(--surface-2)}

/* ===================== TABLES ===================== */
.table-wrap{overflow-x:auto}
table.metrics{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
table.metrics th{text-align:left;padding:11px 16px;font-size:11.5px;letter-spacing:.03em;text-transform:uppercase;color:var(--faint);font-weight:700;background:var(--surface-2);border-top:1px solid var(--border);border-bottom:1px solid var(--border);white-space:nowrap}
table.metrics td{padding:12px 16px;font-size:14px;border-bottom:1px solid var(--border);color:var(--text);vertical-align:middle}
table.metrics th:first-child,table.metrics td:first-child{padding-left:20px}
table.metrics th:last-child,table.metrics td:last-child{padding-right:20px}
table.metrics tbody tr:hover td{background:var(--surface-2)}
table.metrics tfoot td{font-weight:700;color:var(--navy-800);border-bottom:none;background:var(--surface-2)}
table.metrics .num{text-align:right}
td .up{color:var(--good);font-weight:600}
td .down{color:var(--bad);font-weight:600}
.share-col{width:34%}
.share{display:flex;align-items:center;gap:10px}
.share-track{flex:1;height:8px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);overflow:hidden}
.share-fill{height:100%;border-radius:999px;background:var(--grad-brand)}
.share-num{width:52px;text-align:right;font-size:13px;color:var(--muted)}

/* ===================== CHART ===================== */
.chart-plot{position:relative}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart .grid{stroke:var(--border);stroke-width:1}
.chart .baseline{stroke:var(--border-strong);stroke-width:1}
.chart .tick{fill:var(--faint);font-size:11.5px;font-variant-numeric:tabular-nums}
.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart .line.emph{stroke-width:2.5;stroke-dasharray:6 4}
.chart .crosshair{stroke:var(--navy-800);stroke-opacity:.25;stroke-width:1}
.chart .hover circle{stroke:#fff;stroke-width:2}
.chart .hit{fill:transparent;cursor:crosshair}
.tooltip{position:absolute;top:6px;transform:translateX(14px);min-width:190px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--sh-3);padding:10px 12px;font-size:12.5px;pointer-events:none;z-index:2}
.tooltip.left{transform:translateX(calc(-100% - 14px))}
.tt-head{font-weight:700;color:var(--navy-800);margin-bottom:6px}
.tt-row{display:flex;align-items:center;gap:8px;padding:2px 0;color:var(--muted)}
.tt-row i{width:10px;height:3px;border-radius:2px;flex:none}
.tt-row .tt-lab{flex:1;white-space:nowrap}
.tt-row .tt-val{font-weight:700;color:var(--text);font-variant-numeric:tabular-nums}
.tt-row.emph{border-top:1px solid var(--border);margin-top:4px;padding-top:6px}
.legend{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.legend-item{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--surface);border-radius:999px;padding:4px 11px;font-size:12.5px;font-weight:600;color:var(--text);cursor:pointer}
.legend-item i{width:12px;height:3px;border-radius:2px}
.legend-item:hover{border-color:var(--border-strong)}
.legend-item.off{color:var(--faint);background:var(--surface-2)}
.legend-item.off i{opacity:.25}

/* ===================== STATES ===================== */
.boot{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.loading{display:flex;align-items:center;justify-content:center;gap:12px;padding:56px 20px;color:var(--faint);font-size:14px}
.spinner{width:18px;height:18px;border-radius:50%;border:2px solid var(--border-strong);border-top-color:var(--teal-500);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.notice{text-align:center;padding:44px 24px;max-width:560px;margin:0 auto}
.notice h3{font-size:17px;margin:14px 0 6px}
.notice-ic{width:52px;height:52px;border-radius:14px;margin:0 auto;display:flex;align-items:center;justify-content:center;background:var(--surface-2);border:1px solid var(--border)}
.notice-ic svg{width:24px;height:24px;stroke:var(--muted);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.notice-lock .notice-ic{background:#e8f1fb;border-color:transparent}
.notice-lock .notice-ic svg{stroke:var(--blue-500)}
.notice-error .notice-ic{background:var(--bad-bg);border-color:transparent}
.notice-error .notice-ic svg{stroke:var(--bad)}
.content-area>.notice{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--sh-1);max-width:none}

.flash{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-radius:12px;margin-bottom:18px;font-size:14px;font-weight:600}
.flash button{border:0;background:transparent;font-size:20px;line-height:1;color:inherit;cursor:pointer;opacity:.7}
.flash-error{background:var(--bad-bg);color:var(--bad);border:1px solid #f4c7c2}
.flash-ok{background:var(--good-bg);color:var(--good);border:1px solid #bfe3cd}

/* ===================== GATE (sign in, pending, deactivated) ===================== */
.gate{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;
  background:radial-gradient(1000px 460px at 78% -10%,rgba(31,158,122,.30),transparent 60%),radial-gradient(820px 460px at 10% 110%,rgba(111,168,220,.26),transparent 55%),linear-gradient(140deg,#0b1f38 0%,#0f2a4a 45%,#123a63 100%)}
.gate-brand{display:flex;align-items:center;gap:12px;margin-bottom:26px}
.brand-word{font-family:var(--serif);font-weight:700;font-size:24px;letter-spacing:-.01em}
.brand-word .w{color:#fff}
.brand-word .c{color:var(--teal-400)}
.brand-word .my{font-family:var(--font);font-weight:600;font-size:14px;color:#8ba0b8;margin-left:8px}
.gate-card{width:100%;max-width:440px;background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--sh-3);padding:34px 34px 28px}
.gate-card h1{font-size:23px;margin-bottom:8px}
.gate-card .note{margin-bottom:22px}
.gate-card .note.small{margin:16px 0 0;font-size:12.5px;color:var(--faint)}
.gate-card .btn .ms{width:18px;height:18px;background:#fff;border-radius:3px;padding:2px}
.gate-icon{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;margin-bottom:18px}
.gate-icon svg{width:26px;height:26px;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gate-icon.wait{background:var(--warn-bg)} .gate-icon.wait svg{stroke:var(--warn)}
.gate-icon.off{background:var(--bad-bg)} .gate-icon.off svg{stroke:var(--bad)}
.gate-actions{display:flex;gap:10px;flex-wrap:wrap}
.gate-foot{margin:22px 0 0;color:#7f93ab;font-size:12.5px;text-align:center}

/* ===================== COMING SOON / SKELETON ===================== */
.coming{display:flex;gap:18px;align-items:flex-start;background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--teal-500);border-radius:var(--r-lg);box-shadow:var(--sh-1);padding:20px 22px;margin-bottom:22px}
.coming h3{font-size:16px;margin:2px 0 4px}
.coming ul{margin:10px 0 0;padding-left:18px;color:var(--text);font-size:14px}
.coming li{margin:3px 0}
.coming-ic{width:44px;height:44px;border-radius:12px;background:var(--grad-brand);display:flex;align-items:center;justify-content:center;flex:none}
.coming-ic svg{width:22px;height:22px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.skeleton{opacity:.75;pointer-events:none;user-select:none;position:relative}
.skeleton .kpi::before{background:var(--skel)}
.skeleton .k-lab{color:var(--faint)}
.sk-block{background:var(--skel);border-radius:6px;position:relative;overflow:hidden}
.sk-block::after,.sk-bars span::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.6),transparent);transform:translateX(-100%);animation:shimmer 2.2s infinite}
@keyframes shimmer{to{transform:translateX(100%)}}
.sk-block.num{height:30px;width:55%;margin:10px 0 8px}
.sk-block.line{height:10px;width:75%}
.sk-block.title{height:14px;width:220px}
.sk-block.sub{height:10px;width:320px;max-width:100%;margin-top:8px}
.sk-line{display:block;width:100%;height:200px}
.sk-line line{stroke:var(--border);stroke-width:1}
.sk-line polyline{fill:none;stroke:#cdd8e2;stroke-width:3;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.sk-line polyline.faint{stroke:var(--skel)}
.sk-bars{display:flex;flex-direction:column;gap:10px;padding:6px 0}
.sk-bars span{display:block;height:14px;border-radius:4px;background:var(--skel);position:relative;overflow:hidden}
.sk-heat{display:grid;grid-template-columns:repeat(12,1fr);gap:4px}
.sk-heat span{height:26px;border-radius:4px;background:#cdd8e2}
@media (prefers-reduced-motion:reduce){.sk-block::after,.sk-bars span::after,.spinner{animation:none}}

/* ===================== ADMIN ===================== */
.invite{display:grid;grid-template-columns:1.4fr 1.1fr 1fr auto auto;gap:14px;align-items:end}
.field>label{display:block;font-size:12.5px;font-weight:600;color:var(--text);margin-bottom:6px}
.field input,.field select{width:100%;padding:10px 12px}
.invite .check{padding-bottom:11px}
.invite .btn{padding:10px 20px;font-size:14px}
table.users td{font-size:13.5px}
table.users select,table.sites select{font-size:13px;padding:6px 10px;min-width:150px}
.u-cell{display:flex;align-items:center;gap:8px}
.priv-pills{display:flex;flex-wrap:wrap;gap:5px}
.toggle-pill{font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;border:1px dashed var(--border-strong);background:transparent;color:var(--faint);cursor:pointer;white-space:nowrap}
.toggle-pill:hover:not(:disabled){border-color:var(--teal-500);color:var(--teal-600)}
.toggle-pill.on{border:1px solid transparent;background:var(--good-bg);color:var(--teal-600)}
.toggle-pill.on::before{content:"✓ "}
.toggle-pill:disabled{opacity:.55;cursor:default}
.cell-input{font-size:13px;padding:6px 10px;width:170px}
.cell-input::placeholder{color:var(--faint)}
tr.inactive td{color:var(--faint)}
tr.inactive .strong{color:var(--faint);text-decoration:line-through}
tr.busy td{opacity:.7}

/* ===================== FACILITIES ===================== */
.btn-sm{padding:7px 14px;font-size:13px}
.panel-attn{border-left:4px solid #f4b360}
.count-badge{display:inline-block;margin-left:8px;font-size:11.5px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--warn-bg);color:var(--warn);vertical-align:2px}
.unmapped{list-style:none;margin:0;padding:0;border-top:1px solid var(--border)}
.unmapped-item{padding:12px 20px;border-bottom:1px solid var(--border)}
.unmapped-item:last-child{border-bottom:none}
.unmapped-item.busy{opacity:.7}
.unmapped-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.unmapped-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.unmapped-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.unmapped-actions select{font-size:13px;padding:7px 10px;min-width:200px}
.unmapped-create{margin-top:12px;padding:14px 16px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-md)}
.unmapped-create>.small{margin-top:10px}
.site-form{display:grid;grid-template-columns:1.5fr 1fr 1fr auto;gap:14px;align-items:end}
.site-form-actions{display:flex;gap:8px}
.site-form .btn{padding:10px 20px;font-size:14px}
table.sites td{font-size:13.5px}
table.sites th,table.sites td{padding-left:10px;padding-right:10px}
table.sites td:nth-child(4){min-width:200px}
table.sites select{min-width:0;max-width:170px}
table.sites .cell-input{width:120px}
table.sites .cell-input.wide{width:190px}
.label-chips{display:flex;flex-wrap:wrap;gap:5px}
.label-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;padding:3px 4px 3px 10px;border-radius:999px;background:#e8f1fb;color:var(--blue-500);white-space:nowrap}
.label-chip.static{padding-right:10px}
.label-chip button{border:0;background:transparent;color:inherit;font-size:15px;line-height:1;width:18px;height:18px;border-radius:50%;cursor:pointer;opacity:.6;padding:0}
.label-chip button:hover:not(:disabled){opacity:1;background:rgba(27,79,140,.12)}
.label-chip button:disabled{cursor:default}
/* ===================== VISITS: SITES ===================== */
.tool-select{font-size:13px;font-weight:600;padding:7px 12px;color:var(--navy-800)}
.scope-bar{margin:-10px 0 18px}
.pill.info{color:var(--blue-500);background:#e8f1fb;border-color:transparent}
.unmapped-tag{margin-left:8px;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:1px 7px;border-radius:999px;border:1px dashed var(--border-strong);color:var(--faint);vertical-align:1px}
.unmapped-tag:hover{border-color:var(--warn);color:var(--warn)}
td.region-cell{color:var(--muted);white-space:nowrap}
/* ===================== DATA SOURCES ===================== */
.pill.bad{color:var(--bad);background:var(--bad-bg);border-color:transparent}
.pill-sm{font-size:11px;padding:3px 10px;margin-left:8px;vertical-align:2px}
.pill.live.pill-sm::before{width:6px;height:6px;margin-right:6px}
.feed-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:4px 0 18px}
.fact{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-md);padding:12px 14px;min-width:0}
.fact-val{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:18px;font-weight:750;color:var(--navy-800);margin:4px 0 2px;font-variant-numeric:tabular-nums}
.fact-val .flag{font-size:11px}
.fact-err{margin-top:6px;font-size:12px;color:var(--bad);overflow-wrap:anywhere}
.k-sub.warn,.fact-link.warn{color:var(--warn)}
.fact-link{color:var(--teal-600);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.feed-sec{margin-bottom:16px}
.feed-sec>.feed-sec-lab{display:block;margin-bottom:8px}
.kpi-row-3{grid-template-columns:repeat(3,1fr)}
.feed-sec-lab{font-size:11.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--faint);margin-right:6px}
.strip{display:grid;grid-template-columns:repeat(30,minmax(0,1fr));gap:4px}
.strip-day{display:block;height:26px;border-radius:5px;background:var(--skel)}
.strip-day.saved{background:var(--teal-500)}
.strip-day.rejected{background:var(--bad)}
.strip-day.missing{background:var(--skel);box-shadow:inset 0 0 0 1px var(--border-strong)}
.strip>.strip-day:hover{outline:2px solid var(--navy-800);outline-offset:1px}
.strip-axis{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}
.strip-legend{display:flex;gap:14px;flex-wrap:wrap}
.strip-legend>span{display:inline-flex;align-items:center;gap:6px}
.strip-legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.feed-meta{display:flex;flex-direction:column;gap:8px;font-size:13.5px;color:var(--text);border-top:1px solid var(--border);padding-top:14px}
.feed-meta-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px}
.label-chip.link{text-decoration:none}
.label-chip.link:hover{background:#d6e6f7}
.runs{border-top:1px solid var(--border)}
.runs-toggle{display:flex;align-items:center;gap:8px;width:100%;background:transparent;border:0;padding:13px 20px;font-size:13.5px;font-weight:650;color:var(--navy-800);cursor:pointer;text-align:left}
.runs-toggle:hover{background:var(--surface-2)}
.caret{display:inline-block;font-size:17px;line-height:1;color:var(--faint);transition:transform .15s}
.caret.open{transform:rotate(90deg)}
.runs-note{padding:0 20px 16px}
.runs-table td{font-size:13px}
td.run-error{color:var(--bad);font-size:12.5px;max-width:420px}
/* Freshness banner (Visit counts) */
.fresh-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:-8px 0 18px;padding:9px 14px;border-radius:10px;background:var(--warn-bg);color:var(--warn);font-size:13.5px;font-weight:600;border:1px solid #f5ddb0}
.fresh-bar.failing{background:var(--bad-bg);color:var(--bad);border-color:#f4c7c2}
.fresh-bar svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.fresh-bar a{margin-left:auto;color:inherit;text-decoration:underline;text-underline-offset:3px}
/* ===================== FEEDBACK (button, annotate mode, pins, bug report) ===================== */
.fb-x{border:0;background:transparent;font-size:20px;line-height:1;color:var(--faint);cursor:pointer;padding:0 2px}
.fb-x:hover{color:var(--navy-800)}
.fb-phi{margin:0 0 12px;padding:8px 11px;border-radius:8px;background:var(--warn-bg);color:var(--warn);font-size:12.5px;line-height:1.45}
.fb-phi-sm{margin:8px 0 6px;padding:5px 9px;font-size:12px}
.fb-err{margin-top:8px;padding:7px 10px;border-radius:8px;background:var(--bad-bg);color:var(--bad);font-size:12.5px;font-weight:600}
.fb-pop textarea,.fb-modal textarea,.fb-reply-input{display:block;width:100%;font-family:inherit;font-size:14px;line-height:1.45;padding:9px 11px;border:1px solid var(--border-strong);border-radius:9px;background:var(--surface);color:var(--text);resize:vertical}
.fb-pop textarea:focus,.fb-modal textarea:focus,.fb-reply-input:focus{outline:none;border-color:var(--teal-500);box-shadow:var(--ring)}
/* Kind colours: idea teal, something's wrong red, question blue. */
.kind-idea{--k:var(--teal-500);--k-bg:var(--good-bg);--k-fg:var(--teal-600)}
.kind-problem{--k:#d0453b;--k-bg:var(--bad-bg);--k-fg:var(--bad)}
.kind-question{--k:var(--blue-500);--k-bg:#e8f1fb;--k-fg:var(--blue-500)}

.fb-fab-wrap{position:fixed;right:22px;bottom:22px;z-index:60}
.fb-fab{display:inline-flex;align-items:center;gap:9px;background:var(--navy-800);color:#fff;border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:11px 18px 11px 15px;font-size:14px;font-weight:650;cursor:pointer;box-shadow:var(--sh-3);transition:background .15s,transform .15s}
.fb-fab:hover{background:var(--navy-700)}
.fb-fab svg{width:18px;height:18px;stroke:var(--teal-400);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fb-fab.on{background:var(--surface);color:var(--navy-800);border-color:var(--border-strong)}
.fb-fab.on svg{stroke:var(--teal-600)}
.fb-count{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--grad-teal);color:#04231a;font-size:11.5px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.fb-menu{position:absolute;right:0;bottom:calc(100% + 10px);width:310px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--sh-3);padding:6px}
.fb-menu>button,.fb-menu-toggle{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:transparent;border:0;border-radius:10px;padding:10px 12px;cursor:pointer;font-family:inherit;color:var(--text)}
.fb-menu>button:hover,.fb-menu-toggle:hover{background:var(--surface-2)}
.fb-menu svg{width:18px;height:18px;flex:none;stroke:var(--teal-600);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fb-menu strong{display:block;font-size:13.5px;color:var(--navy-800)}
.fb-menu small{display:block;font-size:12px;color:var(--faint);margin-top:1px}
.fb-menu-toggle>span:nth-child(2){flex:1}
.fb-menu-toggle .switch svg{display:none}

.fb-picking,.fb-picking *{cursor:crosshair !important}
.fb-picking .fb-ui,.fb-picking .fb-ui *{cursor:auto !important}
.fb-picking .fb-ui button{cursor:pointer !important}
/* Pins already on the page must not get in the way of a new one. */
.fb-picking .fb-pin{pointer-events:none;opacity:.55}
.fb-shade{position:fixed;inset:0;background:rgba(11,31,56,.07);pointer-events:none;z-index:55}
.fb-hover{position:fixed;pointer-events:none;z-index:56;border:2px solid var(--teal-500);background:rgba(62,203,156,.08);border-radius:8px;transition:left .07s,top .07s,width .07s,height .07s}
.fb-hover-tag{position:absolute;left:-2px;top:-25px;background:var(--teal-600);color:#fff;font-size:11.5px;font-weight:700;padding:2px 8px;border-radius:6px;white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis}
.fb-hover.below .fb-hover-tag{top:auto;bottom:-25px}
.fb-hint{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:57;display:flex;align-items:center;gap:10px;background:var(--navy-800);color:#e6eef6;border-radius:999px;padding:8px 8px 8px 16px;font-size:13.5px;font-weight:550;box-shadow:var(--sh-3);white-space:nowrap}
.fb-hint svg{width:17px;height:17px;stroke:var(--teal-400);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fb-hint kbd{font-family:inherit;font-size:11.5px;font-weight:700;background:rgba(255,255,255,.12);border-radius:5px;padding:1px 6px}
.fb-hint button{border:0;background:rgba(255,255,255,.12);color:#fff;font-size:12.5px;font-weight:650;border-radius:999px;padding:5px 12px}
.fb-hint button:hover{background:rgba(255,255,255,.2)}

.fb-pin{position:absolute;z-index:50;width:28px;height:28px;margin:-14px 0 0 -14px;border-radius:50%;border:2px solid #fff;background:var(--k);color:#fff;font-size:12.5px;font-weight:800;font-family:var(--font);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 8px rgba(11,31,56,.35);transition:transform .12s;padding:0}
.fb-pin:hover,.fb-pin.on{transform:scale(1.15)}
.fb-pin.on{box-shadow:0 0 0 4px rgba(255,255,255,.9),0 0 0 6px var(--k),0 2px 8px rgba(11,31,56,.35)}
.fb-pin.gone{border-style:dashed;opacity:.75}
.fb-pin.st-done,.fb-pin.st-wont_do{filter:grayscale(.8);opacity:.7}
.fb-pin.draft{animation:fb-drop .2s ease-out;pointer-events:none}
.fb-pin.pulse{animation:fb-pulse 1.1s ease-out 2}
@keyframes fb-drop{from{transform:translateY(-10px) scale(.6);opacity:0}}
@keyframes fb-pulse{0%{box-shadow:0 0 0 0 rgba(31,158,122,.65),0 2px 8px rgba(11,31,56,.35)}100%{box-shadow:0 0 0 22px rgba(31,158,122,0),0 2px 8px rgba(11,31,56,.35)}}

.fb-pop{position:absolute;z-index:62;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--sh-3);padding:14px 16px}
.fb-pop-head{display:flex;align-items:flex-start;gap:10px}
.fb-pop-head>div{flex:1;min-width:0}
.fb-pop-title{font-size:14.5px;font-weight:700;color:var(--navy-800);display:flex;align-items:center;gap:7px}
.fb-pop-where{font-size:12px;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px}
.fb-kinds{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 10px}
.fb-kind{font-size:12.5px;font-weight:600;padding:5px 11px;border-radius:999px;border:1px solid var(--border-strong);background:var(--surface);color:var(--muted);cursor:pointer}
.fb-kind:hover{border-color:var(--k);color:var(--k-fg)}
.fb-kind.on{background:var(--k-bg);border-color:transparent;color:var(--k-fg)}
.fb-pop-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}
.fb-pop-actions>.faint{margin-right:auto;font-size:11.5px}
.fb-pop-actions .btn{white-space:nowrap}
.fb-dot{width:9px;height:9px;border-radius:50%;background:var(--k);flex:none}
.fb-body{margin:10px 0 8px;font-size:14px;white-space:pre-wrap;word-break:break-word;max-height:220px;overflow:auto}
.fb-gone{display:block;white-space:normal;margin-bottom:6px;font-size:11.5px}
.fb-anchor-text{font-size:12.5px;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fb-reply{margin-top:8px;padding:8px 10px;border-radius:8px;background:var(--surface-2);font-size:13px;white-space:pre-wrap}
.fb-status{flex:none;font-size:11px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:2px 9px;border-radius:999px;margin-top:2px}
.fb-status.st-open,.fb-status-select.st-open{background:#e8f1fb;color:var(--blue-500)}
.fb-status.st-planned,.fb-status-select.st-planned{background:var(--warn-bg);color:var(--warn)}
.fb-status.st-done,.fb-status-select.st-done{background:var(--good-bg);color:var(--good)}
.fb-status.st-wont_do,.fb-status-select.st-wont_do{background:var(--surface-2);color:var(--faint)}

.fb-list{position:fixed;right:22px;bottom:80px;z-index:58;width:310px;max-height:48vh;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--sh-3)}
.fb-list-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px 10px;border-bottom:1px solid var(--border)}
.fb-list-head strong{font-size:13.5px;color:var(--navy-800)}
.fb-list-empty{padding:16px 14px;font-size:13px;color:var(--faint)}
.fb-list .fb-err{margin:10px 12px}
.fb-list ol{list-style:none;margin:0;padding:6px;overflow-y:auto}
.fb-list li button{display:flex;gap:10px;width:100%;text-align:left;background:transparent;border:0;border-radius:10px;padding:8px;cursor:pointer;font-family:inherit;color:var(--text)}
.fb-list li button:hover{background:var(--surface-2)}
.fb-list li button.on{background:var(--good-bg)}
.fb-num{width:22px;height:22px;flex:none;border-radius:50%;background:var(--k);color:#fff;font-size:11.5px;font-weight:800;display:flex;align-items:center;justify-content:center;border:1.5px solid transparent}
.fb-num.gone{background:var(--surface);color:var(--k-fg);border:1.5px dashed var(--k)}
.fb-li-text{min-width:0;display:flex;flex-direction:column;gap:1px}
.fb-li-body{font-size:13px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.fb-li-meta{font-size:11.5px;color:var(--faint)}
.fb-li-gone{font-size:11px;font-weight:700;color:var(--warn)}

.fb-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:65;display:flex;align-items:center;gap:10px;background:var(--navy-800);color:#e6eef6;border-radius:12px;padding:10px 12px 10px 14px;font-size:13.5px;font-weight:550;box-shadow:var(--sh-3);white-space:nowrap}
.fb-toast>svg{width:18px;height:18px;stroke:var(--teal-400);fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.fb-toast .linklike{color:var(--teal-300)}
.fb-toast .fb-x{color:#8ba0b8}

.fb-modal-back{position:fixed;inset:0;z-index:70;background:rgba(11,31,56,.45);display:flex;align-items:center;justify-content:center;padding:20px}
.fb-modal{width:100%;max-width:540px;max-height:calc(100vh - 40px);overflow:auto;background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--sh-3);padding:24px 26px}
.fb-modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.fb-modal h2{font-size:20px;margin:0}
.fb-modal .field{margin-bottom:14px}
.fb-details{border:1px solid var(--border);border-radius:10px;background:var(--surface-2);padding:10px 12px}
.fb-details summary{cursor:pointer;font-size:13px;font-weight:650;color:var(--muted)}
.fb-details dl,.fb-bug-details{display:grid;grid-template-columns:110px minmax(0,1fr);gap:5px 12px;margin:10px 0 2px;font-size:12.5px}
.fb-details dt,.fb-bug-details dt{color:var(--faint);font-weight:600}
.fb-details dd,.fb-bug-details dd{margin:0;word-break:break-word}
.fb-events{margin:0;padding-left:16px}
.fb-events li{margin:2px 0}
.fb-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.fb-modal-actions .btn,.fb-done .btn{padding:10px 20px;font-size:14px}
.fb-done{text-align:center;padding:10px 0 4px}
.fb-done-ic{width:52px;height:52px;border-radius:14px;margin:0 auto 14px;background:var(--good-bg);display:flex;align-items:center;justify-content:center}
.fb-done-ic svg{width:26px;height:26px;stroke:var(--good);fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.fb-done .note{margin:0 0 20px}

/* Admin > Feedback */
.fb-filters{display:flex;flex-wrap:wrap;gap:10px}
.fb-filter{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:600;color:var(--muted)}
.fb-filter select{font-size:13px;padding:6px 10px}
table.fb-table td{vertical-align:top;font-size:13.5px}
.fb-note-cell{min-width:260px;max-width:440px}
.fb-note-body{white-space:pre-wrap;word-break:break-word;margin:5px 0 3px;color:var(--text)}
.fb-kind-chip{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:1px 8px;border-radius:999px;background:var(--k-bg);color:var(--k-fg)}
.fb-path{font-size:12.5px;color:var(--navy-800);background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px;white-space:nowrap}
.fb-reply-input{width:190px;font-size:13px;padding:6px 10px;min-height:36px}
.fb-status-select{font-size:13px;padding:6px 10px;font-weight:600;border-color:transparent}
table.fb-table tr.fb-detail-row td{background:var(--surface-2);padding-top:4px}
.fb-bug-details{margin:0;max-width:760px}
.fb-query{max-width:200px;word-break:break-all}
.fb-email-flag{margin-top:8px}
.fb-view{display:block;margin-top:7px;white-space:nowrap}
@media print{.fb-root{display:none}}

/* ===================== RESPONSIVE ===================== */
@media (max-width:1100px){
  .invite,.site-form{grid-template-columns:1fr 1fr}
  .feed-facts{grid-template-columns:1fr 1fr}
}
@media (max-width:900px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .rail{position:sticky;top:0;z-index:10;height:auto;flex-direction:row;flex-wrap:wrap;align-items:center;gap:6px;padding:12px 16px}
  .rail-brand{border:none;margin:0;padding:0 0 6px;flex:1 1 auto}
  .rail-sec,.rail-user{display:none}
  .rail-nav,.rail-admin{flex-direction:row;flex-wrap:wrap;flex:1 1 100%;padding:0;order:2}
  .nav-item{padding:7px 11px;background:rgba(255,255,255,.05)}
  .nav-badge{margin-left:4px}
  .rail-foot{order:1;margin:0;border:none;padding:0}
  .rail-signout{margin:0}
  .content-area{padding:20px 16px 40px}
  .kpi-row{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  .kpi-row,.invite,.site-form{grid-template-columns:1fr}
  .brand-word .my{display:none}
  .coming{flex-direction:column}
}
table.users td:nth-child(3){min-width:300px}
.rail-user .av svg{width:18px;height:18px;stroke:#04231a;fill:none;stroke-width:1.8}

/* Wounds (INFRA-244). Overview: a navy band, a provider panel and the
   patients-and-wounds table; detail: one wound. Improving blue, not improving
   amber (statuses in src/wound-model.ts); text colours pass 4.5:1. */
.content-area:has(> .w-page){padding:0;max-width:none}
.content-area:has(> .w-detail){max-width:1600px}
.w-page{font-size:14px;color:var(--text)}
.w-band{background:var(--navy-800);color:#e6edf5}
.w-band-top{display:flex;flex-wrap:wrap;align-items:flex-end;gap:16px 32px;padding:28px 28px 16px;max-width:1600px}
.w-band .w-sentence{margin:0;padding:0 28px 30px;max-width:936px;font-size:20px;line-height:1.5;color:#e6edf5;text-wrap:pretty}
.w-s-bad{color:#f8c27a;font-weight:600}
.w-s-good{color:#9ccbf0;font-weight:600}
.w-s-muted{color:#afc1d4}
.w-eyebrow{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#9fd9c6}
.w-h1{font-family:var(--serif);font-weight:700;font-size:44px;letter-spacing:-.025em;line-height:1;color:#fff;margin:10px 0 0}
.w-sp{flex:1}
.w-ctl{display:flex;flex-direction:column;gap:4px}
.w-label{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.w-band .w-label{color:#9fd9c6}
.w-select{min-height:44px;font-size:13px}
.w-seg{display:flex;flex-wrap:wrap}
.w-seg button{background:transparent;border:1px solid #4a6383;color:#d5e0ec;font:inherit;font-size:13px;padding:0 14px;min-height:44px;cursor:pointer;margin-right:-1px}
.w-seg button:first-child{border-radius:9px 0 0 9px}
.w-seg button:last-child{border-radius:0 9px 9px 0}
.w-seg button:hover{color:#fff}
.w-seg button.on{background:var(--teal-400);border-color:var(--teal-400);color:#04231a;font-weight:600}
.w-n{font-variant-numeric:tabular-nums;font-size:12px;opacity:.8;margin-left:6px}
.w-wrap{max-width:1600px;padding:24px 28px 56px}
.w-mono{font-variant-numeric:tabular-nums}
.w-muted{color:var(--muted)}
.w-strong{font-weight:600}
.w-bad{color:#7a4800;font-weight:600}
.w-small{font-size:12px}
.w-big{font-size:20px;font-weight:600}
.w-link{color:#11785b;text-decoration:underline;text-underline-offset:3px;font-weight:600}
.w-link:hover{color:var(--navy-800)}
.w-foot{margin:20px 0 0;font-size:12.5px;color:var(--muted)}
/* Wound feed health: amber, one line per problem, under the navy band. #9a5b00 on #fff4e0 is 4.98:1. */
.w-health{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px 10px;margin:0 0 18px;padding:10px 14px;border-radius:10px;background:var(--warn-bg);color:var(--warn);border:1px solid #f5ddb0;font-size:13.5px;font-weight:600;line-height:1.45}
.w-health svg{width:16px;height:16px;margin-top:2px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.w-health ul{flex:1 1 320px;min-width:0;margin:0;padding:0;list-style:none}
.w-health li+li{margin-top:3px}
.w-health-actions{margin-left:auto;display:flex;flex-wrap:wrap;gap:4px 16px;align-items:center}
.w-health-link{background:none;border:0;padding:0;font:inherit;cursor:pointer;color:inherit;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
.w-health-link:hover{color:var(--navy-800)}
.w-empty{padding:32px 20px}
.w-scroll{overflow-x:auto;max-width:100%}
.w-svg{display:block}
.w-fit{max-width:100%;height:auto}
.w-tick{font-size:11px;fill:var(--muted);font-variant-numeric:tabular-nums}
.w-tick-strong{fill:var(--text);font-weight:600}
.w-sw{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:1px;flex:none}
.w-h2{font-size:19px;font-weight:700;color:var(--navy-800);margin:0}
.w-h3{font-size:16px;font-weight:700;color:var(--navy-800);margin:0 0 8px}
.w-r{text-align:right}

/* panels: white blocks on the pale ground */
.w-blk{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:16px 20px;margin-top:12px;overflow:hidden}
.w-blk+.w-blk{margin-top:32px}
.w-panel-head{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 24px;margin-bottom:12px}
.w-panel-note{font-size:13px;padding-bottom:10px}
.w-ftabs{display:flex;gap:4px;align-items:flex-end;border-bottom:1px solid #c5d1dc}
.w-ftab{font:inherit;font-size:17px;letter-spacing:-.01em;padding:10px 18px;min-height:44px;border:1px solid transparent;border-bottom:0;border-radius:6px 6px 0 0;background:#f3f6f9;color:var(--muted);font-weight:500;margin-bottom:-1px;cursor:pointer}
.w-ftab:hover{background:#e6edf3;color:var(--text)}
.w-ftab.on{background:var(--surface);border-color:#c5d1dc;color:var(--navy-800);font-weight:700;box-shadow:inset 0 2px 0 var(--teal-500)}
.w-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;padding-bottom:10px}

/* leaderboard */
.w-board{min-width:940px}
.w-prow{display:grid;grid-template-columns:28px minmax(170px,1.1fr) minmax(260px,3fr) 64px 84px 96px 72px 24px;align-items:center;gap:0 16px;padding:10px 0}
.w-prow.w-head{padding:8px 0;border-bottom:1px solid var(--navy-800)}
.w-rowbtn{background:transparent;border:0;border-bottom:1px solid var(--border-strong);width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer}
.w-rowbtn:hover{background:var(--surface-2)}
.w-bar{display:flex;height:20px;background:var(--skel);border-radius:4px;overflow:hidden}
.w-bar span{display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600}

/* trajectories */
.w-traj-top{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 24px;margin:4px 0 20px}
.w-pills{display:flex;flex-wrap:wrap}
.w-pill{border:1px solid var(--border-strong);background:var(--surface);color:var(--text);font:inherit;font-size:13px;padding:0 14px;min-height:44px;border-radius:999px;margin:0 6px 6px 0;cursor:pointer}
.w-pill:hover{border-color:var(--navy-800)}
.w-pill.on{background:var(--navy-800);border-color:var(--navy-800);color:#fff;font-weight:600}
.w-traj-note{max-width:480px;margin:0;font-size:13px}
.w-traj-note strong{color:var(--text)}
.w-dots{margin-top:36px}
.w-dots-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 20px;margin-bottom:8px}
.w-dots-head .w-h3{margin:0}
.w-drows{min-width:1340px}
.w-drow{display:grid;grid-template-columns:220px 1000px 90px;align-items:center;gap:0 16px;border-bottom:1px solid var(--border-strong)}
.w-drow.w-dhrow{border-bottom-color:var(--navy-800)}
.w-drow.on{background:var(--surface-2)}
.w-dlab{background:transparent;border:0;font:inherit;text-align:left;padding:0;min-height:44px;cursor:pointer;color:var(--text);font-weight:500}
.w-dlab[aria-pressed="true"]{font-weight:700}

/* patients and wounds */
.w-wl-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 20px}
.w-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:16px 28px;padding:18px 0 12px}
.w-search{border:1px solid var(--border-strong);border-radius:8px;background:var(--surface);font:inherit;font-size:14px;padding:0 12px;min-height:44px;width:240px;max-width:100%;color:var(--text)}
.w-search:focus{outline:none;border-color:var(--teal-500);box-shadow:var(--ring)}
.w-tbs{display:flex}
.w-tbs button{border:1px solid var(--border-strong);background:var(--surface);color:var(--text);font:inherit;font-size:13px;padding:0 14px;min-height:44px;cursor:pointer;margin-right:-1px}
.w-tbs button:first-child{border-radius:9px 0 0 9px}
.w-tbs button:last-child{border-radius:0 9px 9px 0}
.w-tbs button.on{background:var(--navy-800);border-color:var(--navy-800);color:#fff;font-weight:600;position:relative}
.w-chip{background:var(--surface);border:1px solid var(--border-strong);border-radius:8px;font:inherit;font-size:13px;padding:0 12px;min-height:44px;cursor:pointer;color:var(--text)}
.w-chip:hover{border-color:var(--navy-800)}
.w-x{margin-left:8px}
.w-saved{max-width:300px}
.w-sheet{margin:0 -20px;border-top:1px solid var(--border)}
.w-table{min-width:1040px}
.w-trow{display:grid;grid-template-columns:minmax(280px,2.6fr) 128px 84px 84px 76px 96px 68px 116px;gap:0 16px;align-items:center;padding:5px 20px;min-height:34px;font-size:13px;border-bottom:1px solid var(--border);color:var(--text)}
.w-thead{background:var(--surface-2);padding:4px 20px;border-bottom:1px solid var(--border);letter-spacing:.04em;white-space:nowrap}
.w-sorth{background:transparent;border:0;padding:0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;cursor:pointer;min-height:32px;text-align:inherit}
.w-sorth:hover,.w-sorth.on{color:var(--text)}
.w-arrow{margin-left:4px}
.w-rowlink:hover{background:var(--surface-2)}
.w-ellip{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.w-gap{font-size:12px;color:var(--muted)}
.w-gap.long{color:#7a4800;font-weight:600}
.w-ghead{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 24px;padding:10px 20px 6px;background:var(--surface-2);border-top:1px solid var(--border-strong);border-bottom:1px solid var(--border)}
.w-ghead-pt{padding:8px 20px 4px;font-size:13px}
.w-gname{font-size:14px;font-weight:700}
.w-gname-pv{font-size:15px}
.w-trow.child{position:relative}
.w-trow.child>span:first-child{padding-left:26px}
.w-trow.child::before{content:"";position:absolute;left:30px;top:0;bottom:0;border-left:1px solid #b8c6d3}
.w-trow.child::after{content:"";position:absolute;left:30px;top:50%;width:10px;border-top:1px solid #b8c6d3}
.w-trow.child.lastc::before{bottom:50%}
.w-more{display:block;width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--border-strong);font:inherit;font-size:13px;color:#11785b;padding:0 20px;min-height:44px;cursor:pointer}
.w-more:hover{background:var(--surface-2)}
.w-note{margin:12px 0 0}

/* one wound */
.w-detail{font-size:14px;color:var(--text)}
.w-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-bottom:14px;font-size:13px}
.w-back{display:inline-flex;align-items:center;min-height:32px}
.w-dhead{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 32px;margin-bottom:18px}
.w-dname{font-size:36px;font-weight:800;letter-spacing:-.02em;margin:0;color:var(--navy-800)}
.w-dsub{margin-top:8px}
.w-verdict{text-align:right}
.w-verdict-main{font-size:15px;font-weight:700}
.w-wtabs{display:flex;flex-wrap:wrap;border-bottom:1px solid var(--navy-800)}
.w-wtab{display:inline-flex;align-items:center;gap:0;color:var(--text);padding:12px 18px;min-height:44px;border:1px solid transparent;border-bottom:0;margin-bottom:-1px;border-radius:6px 6px 0 0}
.w-wtab:hover{background:var(--surface-2)}
.w-wtab.on{background:var(--surface);border-color:var(--navy-800);font-weight:700}
.w-wtab-pct{font-size:12px;margin-left:8px;font-weight:600}
.w-dpanel{background:var(--surface);border:1px solid var(--border);border-top:0;padding:20px 24px}
.w-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));border-top:1px solid var(--border-strong)}
.w-fact{padding:14px 20px 14px 0;border-bottom:1px solid var(--border-strong)}
.w-fnum{font-size:30px;font-weight:600;letter-spacing:-.02em;margin-top:4px}
.w-funit{font-size:14px;font-weight:400}
.w-ftext{font-size:16px;font-weight:600;margin-top:8px}
.w-charts{display:flex;flex-wrap:wrap;gap:32px;margin-top:24px}
.w-chart-main{flex:999 1 620px;min-width:0}
.w-chart-side{flex:1 1 300px;min-width:0}
.w-outline{display:block;max-width:100%;height:auto;background:var(--surface-2);border:1px solid var(--border);margin-bottom:6px}
.w-dims{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;margin-top:28px}
.w-dim{border-top:1px solid var(--navy-800);padding-top:10px}
.w-dim svg{display:block;max-width:100%;margin-top:6px}
.w-dim-head{display:flex;justify-content:space-between;align-items:baseline}
.w-idnotes{margin-top:20px;display:flex;flex-wrap:wrap;gap:6px}
.w-measure{margin-top:32px}
.w-mtable{min-width:880px}
.w-mrow{display:grid;grid-template-columns:90px 150px 90px 80px 70px minmax(220px,1fr) 130px;gap:0 18px;padding:9px 0;border-bottom:1px solid var(--border);align-items:baseline}
.w-mrow.w-mhead{border-bottom-color:var(--navy-800)}

@media (max-width:900px){
  .w-band-top{padding:20px 16px 12px}
  .w-band .w-sentence{padding:0 16px 22px;font-size:17px}
  .w-h1{font-size:34px}
  .w-wrap{padding:16px 16px 40px}
  .w-blk{padding:14px 16px}
  .w-sheet{margin:0 -16px}
  .w-dname{font-size:28px}
  .w-verdict{text-align:left}
  .w-dpanel{padding:16px}
}
@media (max-width:560px){
  .w-ctl,.w-search{width:100%}
  .w-ftab{font-size:15px;padding:10px 12px}
}
.scope-bar .pill+.pill{margin-left:6px}
