:root{
  --c1:#4f46e5;--c2:#0d9488;--c3:#d97706;--c4:#e11d6a;--c5:#64748b;
  --bg:#f4f5f9;--surface:#fff;--surface-2:#f8f9fc;--ink:#171b2c;--ink-2:#4a5068;--mute:#7b8196;--line:#e4e7f0;--line-2:#eef0f6;
  --acc:#4f46e5;--acc-hover:#4338ca;--acc-soft:#eef0ff;--acc-ink:#fff;
  --ok:#0f9d6b;--ok-soft:#e5f6ef;--bad:#d4403a;--bad-soft:#fdeceb;--warn:#b7791f;--warn-soft:#fdf3e0;
  --r:12px;--shadow:0 1px 2px rgba(23,27,44,.05),0 4px 16px rgba(23,27,44,.05);
  --font:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
  --bg:#0f1220;--surface:#171b2e;--surface-2:#1c2136;--ink:#eceefa;--ink-2:#b4b9d0;--mute:#838aa6;--line:#2a3050;--line-2:#222742;
  --acc:#818cf8;--acc-hover:#9aa3fb;--acc-soft:#23294d;--acc-ink:#0f1220;
  --c1:#818cf8;--c2:#2dd4bf;--c3:#fbbf24;--c4:#fb7185;--c5:#94a3b8;--ok:#3ccf9a;--ok-soft:#12302a;--bad:#ff7d75;--bad-soft:#3a1d22;--warn:#f0b955;--warn-soft:#352a14;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 4px 16px rgba(0,0,0,.25);color-scheme:dark}}
:root[data-theme=dark]{
  --bg:#0f1220;--surface:#171b2e;--surface-2:#1c2136;--ink:#eceefa;--ink-2:#b4b9d0;--mute:#838aa6;--line:#2a3050;--line-2:#222742;
  --acc:#818cf8;--acc-hover:#9aa3fb;--acc-soft:#23294d;--acc-ink:#0f1220;
  --c1:#818cf8;--c2:#2dd4bf;--c3:#fbbf24;--c4:#fb7185;--c5:#94a3b8;--ok:#3ccf9a;--ok-soft:#12302a;--bad:#ff7d75;--bad-soft:#3a1d22;--warn:#f0b955;--warn-soft:#352a14;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 4px 16px rgba(0,0,0,.25);color-scheme:dark}
:root[data-theme=light]{color-scheme:light}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased}
h1,h2,h3{margin:0;font-weight:650;letter-spacing:-.01em}
h1{font-size:22px}h2{font-size:18px}h3{font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:var(--mute);font-weight:600}
a{color:var(--acc)}
.mute{color:var(--mute)}.bad{color:var(--bad)}.ok{color:var(--ok)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}

/* top bar */
.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:14px;height:56px;padding:0 20px;background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px;letter-spacing:-.02em}
.brand svg{width:26px;height:26px;color:var(--acc)}
.topbar .grow{flex:1}
.user{display:flex;align-items:center;gap:9px;color:var(--ink-2);font-weight:500}
.avatar{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--acc-soft);color:var(--acc);font-weight:700;font-size:13px;flex:none}
.avatar.lg{width:52px;height:52px;font-size:20px}

main{max-width:1180px;margin:0 auto;padding:28px 20px 60px}
.page-title{display:flex;align-items:baseline;gap:12px;margin-bottom:16px}
.page-title p{margin:0;color:var(--mute)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);margin-bottom:18px;overflow:hidden}
.card-pad{padding:20px}

/* controls */
select,input,button{font:inherit;color:var(--ink)}
select,input{height:42px;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:0 12px;transition:border-color .15s,box-shadow .15s}
select{appearance:none;padding-inline-end:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%237b8196' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;font-weight:500}
[dir=rtl] select{background-position:left 12px center}
input::placeholder{color:var(--mute)}
select:hover,input:hover{border-color:color-mix(in srgb,var(--acc) 40%,var(--line))}
select:focus-visible,input:focus-visible,button:focus-visible,tr.click:focus-visible{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent)}
button{height:42px;padding:0 18px;border-radius:10px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-weight:600;transition:background .15s,border-color .15s,transform .05s}
button:hover{background:var(--surface-2)}button:active{transform:translateY(1px)}
button:disabled{opacity:.6;cursor:default}
button.primary{background:var(--acc);border-color:var(--acc);color:var(--acc-ink)}
button.primary:hover{background:var(--acc-hover);border-color:var(--acc-hover)}
button.ghost{border-color:transparent;background:transparent;color:var(--ink-2);height:34px;padding:0 12px}
button.ghost:hover{background:var(--acc-soft);color:var(--acc)}
label{display:grid;gap:6px;font-weight:600;font-size:13px;color:var(--ink-2)}

.search{display:grid;grid-template-columns:210px 1fr auto;gap:10px}
.search .field{position:relative}
.search .field svg{position:absolute;inset-inline-start:13px;top:50%;translate:0 -50%;width:18px;height:18px;color:var(--mute);pointer-events:none}
.search .field input{width:100%;padding-inline-start:40px}
.hint{margin-top:10px;min-height:20px;color:var(--mute);font-size:13px}

/* tables */
table{width:100%;border-collapse:collapse}
th{position:sticky;top:0;background:var(--surface-2);text-align:start;font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--mute);font-weight:600;padding:10px 16px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:12px 16px;border-bottom:1px solid var(--line-2);vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
th.num,td.num{text-align:end;font-variant-numeric:tabular-nums}
tr.click{cursor:pointer;transition:background .12s}
tr.click:hover{background:var(--acc-soft)}
.who{display:flex;align-items:center;gap:12px;min-width:240px}
.who b{display:block;font-weight:600}.who small{color:var(--mute)}
.results-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.chip{display:inline-block;padding:2px 9px;border-radius:999px;background:var(--acc-soft);color:var(--acc);font-weight:600;font-size:12px;white-space:nowrap}
.chip.closed{background:var(--bad-soft);color:var(--bad)}
.chip.ok{background:var(--ok-soft);color:var(--ok)}
.chip.neutral{background:var(--line-2);color:var(--ink-2)}
.empty{padding:34px 20px;text-align:center;color:var(--mute)}

/* detail */
.detail-head{display:flex;gap:16px;align-items:center;padding:22px 22px 18px}
.detail-head h2{margin-bottom:4px}
.detail-head .meta{display:flex;gap:8px;flex-wrap:wrap;align-items:center;color:var(--mute)}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;padding:0 22px 20px}
.tile{background:var(--surface-2);border:1px solid var(--line-2);border-radius:10px;padding:12px 14px}
.tile .k{font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--mute);font-weight:600}
.tile .v{font-size:20px;font-weight:650;margin-top:2px;font-variant-numeric:tabular-nums}
.info{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:0;border-top:1px solid var(--line)}
.info section{padding:18px 22px}
.info section+section{border-inline-start:1px solid var(--line)}
.info h3{margin-bottom:10px}
dl{display:grid;grid-template-columns:128px 1fr;gap:8px 12px;margin:0}
dt{color:var(--mute)}dd{margin:0;word-break:break-word}
.tabs{display:flex;gap:2px;padding:0 14px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);overflow-x:auto}
.tabs button{height:46px;border:0;border-radius:0;background:none;color:var(--mute);border-bottom:2px solid transparent;padding:0 14px;white-space:nowrap}
.tabs button:hover{color:var(--ink);background:none}
.tabs button[aria-selected=true]{color:var(--acc);border-bottom-color:var(--acc)}
.tabs .count{margin-inline-start:6px;font-size:12px;padding:1px 7px;border-radius:999px;background:var(--line-2);color:var(--ink-2)}
.pos{color:var(--ok)}.neg{color:var(--bad)}

/* auth pages */
.auth{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(900px 500px at 15% -10%,color-mix(in srgb,var(--acc) 16%,transparent),transparent),radial-gradient(700px 420px at 100% 110%,color-mix(in srgb,var(--acc) 12%,transparent),transparent),var(--bg)}
.auth-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 10px 40px rgba(23,27,44,.12);padding:32px}
.auth-card .brand{justify-content:center;margin-bottom:6px;font-size:20px}
.auth-card .brand svg{width:34px;height:34px}
.auth-card .sub{text-align:center;color:var(--mute);margin:0 0 24px}
.auth-card form{display:grid;gap:14px}
.auth-card input{width:100%}
.auth-card button.primary{width:100%;height:44px}
.msg{min-height:20px;font-size:13px}
.steps{display:flex;gap:6px;justify-content:center;margin-bottom:18px}
.steps i{width:28px;height:4px;border-radius:2px;background:var(--line)}.steps i.on{background:var(--acc)}
.qr{display:grid;place-items:center;padding:12px;background:#fff;border:1px solid var(--line);border-radius:12px;width:fit-content;margin:0 auto}
code{background:var(--line-2);padding:2px 6px;border-radius:6px;font-size:12.5px;word-break:break-all}
.footer-link{text-align:center;margin-top:14px}

@media (max-width:760px){
  .search{grid-template-columns:1fr}.search button{width:100%}
  main{padding:18px 12px 40px}.topbar{padding:0 12px}.user span.name{display:none}
  .info section+section{border-inline-start:0;border-top:1px solid var(--line)}
  dl{grid-template-columns:110px 1fr}
  .detail-head{padding:18px 16px 14px}.tiles{padding:0 16px 16px}
  td,th{padding:10px 12px}
}
@media (max-width:760px){.page-title{flex-direction:column;gap:2px}.page-title p{font-size:13px}}

/* ---- design system pass: buttons, inputs, tables, states ---- */
button{display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1;white-space:nowrap;user-select:none}
button.primary{box-shadow:0 1px 0 rgba(255,255,255,.18) inset,0 1px 2px rgba(79,70,229,.35)}
button.secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
button.sm{height:32px;padding:0 12px;font-size:13px;border-radius:8px}
button[aria-busy=true]{pointer-events:none;opacity:.85}
button[aria-busy=true]::before{content:"";width:14px;height:14px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){button[aria-busy=true]::before{animation-duration:2s}*{scroll-behavior:auto!important}}
input[aria-invalid=true]{border-color:var(--bad);box-shadow:0 0 0 3px color-mix(in srgb,var(--bad) 18%,transparent)}
.pwd{position:relative}.pwd input{padding-inline-end:64px;padding-right:calc(50% + 30px)}
.pwd button{position:absolute;left:50%;transform:translateX(-50%);top:4px;height:34px;padding:0 10px;font-size:12px;font-weight:600;color:var(--mute);background:transparent;border:0}
.pwd button:hover{color:var(--acc);background:transparent}
.field-help{font-weight:400;color:var(--mute);font-size:12.5px}
.alert{padding:10px 12px;border-radius:10px;background:var(--bad-soft);color:var(--bad);font-size:13px}
.alert:empty{display:none}

.statusbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.statusbar .chip{background:var(--surface);border:1px solid var(--line);color:var(--ink-2);font-weight:500}
.statusbar .chip b{color:var(--ink);font-weight:600}
.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok);margin-inline-end:6px}
.dot.stale{background:var(--warn)}

/* tables */
th[data-sort]{cursor:pointer;user-select:none}
th[data-sort]:hover{color:var(--ink)}
th[data-sort]::after{content:"";display:inline-block;margin-inline-start:6px;border:4px solid transparent;vertical-align:middle;opacity:.0}
th[aria-sort=ascending]::after{border-bottom-color:currentColor;border-top-width:0;opacity:1}
th[aria-sort=descending]::after{border-top-color:currentColor;border-bottom-width:0;opacity:1}
th[aria-sort=ascending],th[aria-sort=descending]{color:var(--acc)}
tfoot td{font-weight:650;background:var(--surface-2);border-top:1px solid var(--line);border-bottom:0}
.subtotal td{font-weight:650;background:var(--surface-2)}
.table-title{display:flex;justify-content:space-between;align-items:baseline;padding:16px 22px 8px}
.table-title h3{margin:0}.table-title span{color:var(--mute);font-size:12.5px}
.section-gap{height:8px}
.skeleton{display:grid;gap:12px;padding:22px}
.skeleton i{display:block;height:16px;border-radius:6px;background:linear-gradient(90deg,var(--line-2),var(--line),var(--line-2));background-size:200% 100%;animation:sh 1.2s infinite}
.skeleton i:nth-child(1){width:40%;height:22px}.skeleton i:nth-child(2){width:100%}.skeleton i:nth-child(3){width:85%}.skeleton i:nth-child(4){width:92%}
@keyframes sh{to{background-position:-200% 0}}
.note{padding:10px 22px 16px;color:var(--mute);font-size:12.5px}
.tiles .tile .s{font-size:12px;color:var(--mute);margin-top:2px}
.tile.accent{background:var(--acc-soft);border-color:transparent}.tile.accent .k{color:var(--acc)}
.strong{font-weight:650}.indent{display:inline-block;padding-inline-start:16px;color:var(--ink-2)}
.or{display:flex;align-items:center;gap:10px;color:var(--mute);font-size:12px}.or::before,.or::after{content:"";flex:1;height:1px;background:var(--line)}
button.wide{width:100%;height:44px}
.navlink{color:var(--ink-2);text-decoration:none;font-weight:600;padding:6px 10px;border-radius:8px}.navlink:hover{background:var(--acc-soft);color:var(--acc)}
.keyrow{display:flex;align-items:center;gap:14px;padding:14px 22px;border-bottom:1px solid var(--line-2)}.keyrow:last-child{border-bottom:0}.keyrow .grow{flex:1}.keyrow small{color:var(--mute);display:block}
.search.one{grid-template-columns:1fr auto}
@media (max-width:760px){.search.one{grid-template-columns:1fr}.keyrow{padding:14px 16px;flex-wrap:wrap}}
.avatar svg{width:16px;height:16px}
.card-pad .hint{margin-top:12px}
.navlink{display:inline-flex;align-items:center;height:34px}

/* bidi: text keeps the PAGE direction for alignment, but mixed Hebrew/English content orders correctly per paragraph */
.bidi{unicode-bidi:plaintext}
.ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
html[dir=rtl] body{font-family:"Heebo","Assistant","Segoe UI",Arial,"Noto Sans Hebrew",system-ui,sans-serif}
html[dir=rtl] th,html[dir=rtl] h3,html[dir=rtl] .tile .k{letter-spacing:0;text-transform:none}
html[dir=rtl] th{font-size:12.5px}
/* toggles */
.tools{display:flex;gap:4px;align-items:center}
.toolbtn{min-width:34px}.toolbtn.icon{width:34px;padding:0}.toolbtn svg{width:18px;height:18px}
.auth-tools{position:fixed;top:14px;inset-inline-end:14px;z-index:6}
html[dir=rtl] .tabs .count{margin-inline-start:6px}
html[dir=rtl] button[aria-busy=true]::before{margin-inline-end:0}
.bidi{text-align:left}html[dir=rtl] .bidi{text-align:right}

.filterrow{display:flex;align-items:center;gap:16px;margin-top:12px;flex-wrap:wrap}.filterrow .hint{margin:0;flex:1;min-width:200px}
.segmented{display:inline-flex;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px}
.segmented button{height:30px;border:0;border-radius:8px;background:transparent;color:var(--ink-2);padding:0 14px;font-size:13px}
.segmented button:hover{background:var(--acc-soft);color:var(--acc)}
.segmented button[aria-checked=true]{background:var(--surface);color:var(--acc);box-shadow:0 1px 2px rgba(23,27,44,.12)}
.banner{display:flex;gap:10px;align-items:flex-start;margin:0 22px 14px;padding:11px 14px;border-radius:10px;background:var(--warn-soft);color:var(--warn);font-size:13px;font-weight:500}
.banner svg{width:18px;height:18px;flex:none;margin-top:1px}
@media (max-width:760px){.banner{margin:0 16px 14px}}

.chip.warn{background:var(--warn-soft);color:var(--warn);margin-inline-start:8px}
.stale{color:var(--warn);font-weight:600}
.banner.inline{margin:14px 22px 6px}
@media (max-width:760px){.banner.inline{margin:12px 16px 6px}}
.ltr{white-space:nowrap}

/* overview */
.navlink.active{background:var(--acc-soft);color:var(--acc)}
.kpis{padding:0;margin-bottom:18px}
.kpis .tile{background:var(--surface);box-shadow:var(--shadow)}
.grid2{display:grid;grid-template-columns:1.4fr 1fr;gap:18px}
.grid2 .card{margin-bottom:18px}
@media (max-width:900px){.grid2{grid-template-columns:1fr}}
.pad{padding:6px 22px 22px}
.stack{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--line-2);margin:6px 0 16px;gap:2px}
.stack i{display:block;height:100%;min-width:3px}
.legend{display:grid;gap:10px}
.legend .row{display:grid;grid-template-columns:14px 1fr auto auto;gap:12px;align-items:center}
.legend .sw{width:10px;height:10px;border-radius:3px}
.legend .num{font-variant-numeric:tabular-nums;text-align:end}.legend .pct{color:var(--mute);min-width:52px}
.barcell{display:flex;align-items:center;gap:10px;min-width:90px}
.bar{flex:1;height:8px;border-radius:4px;background:var(--line-2);overflow:hidden;min-width:40px}.bar i{display:block;height:100%;background:var(--c1);border-radius:4px}
.bars{display:flex;align-items:flex-end;gap:3px;height:120px;padding-top:6px}
.bars .col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:stretch;height:100%;min-width:4px}
.bars .col i{display:block;background:var(--c1);border-radius:3px 3px 0 0;min-height:2px;opacity:.9}
.bars .col:hover i{opacity:1}
.axis{display:flex;justify-content:space-between;color:var(--mute);font-size:12px;margin-top:6px}
.dim{color:var(--mute)}
/* mobile top bar: brand + tools on row 1, navigation on row 2 (no horizontal page scroll) */
@media (max-width:760px){
  .topbar{flex-wrap:wrap;height:auto;row-gap:2px;padding:8px 12px}
  .topbar .grow{display:none}
  .topbar .brand{order:1;margin-inline-end:auto}
  .topbar .tools{order:2}
  .topbar::before{content:"";order:4;flex-basis:100%;height:0}
  .topbar .navlink{order:5;height:32px;padding:0 8px}
}
@media (max-width:760px){.hide-sm{display:none}.who{min-width:0}}

/* ---- shared top bar + profile menu ---- */
.topbar .brand{text-decoration:none;color:inherit}
.mainnav{display:flex;align-items:center;gap:2px;margin-inline-start:14px}
.profile{position:relative}
.profile-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 8px;border:1px solid transparent;background:transparent;border-radius:999px;color:var(--ink-2);font-weight:500}
.profile-btn:hover,.profile-btn[aria-expanded=true]{background:var(--acc-soft);border-color:var(--line)}
.profile-btn svg{width:16px;height:16px;color:var(--mute)}
.menu{position:absolute;top:calc(100% + 8px);inset-inline-end:0;z-index:20;width:280px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 32px rgba(23,27,44,.18);padding:8px}
.menu[hidden]{display:none}
.menu-head{display:flex;align-items:center;gap:12px;padding:10px 10px 12px}.menu-head small{display:block;color:var(--mute)}
.menu-section{padding:6px 10px 2px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--mute)}
.menu-group{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 10px}
.menu-label{color:var(--ink-2);font-size:13px}
.menu .segmented button{padding:0 11px;height:28px}
.menu hr{border:0;border-top:1px solid var(--line);margin:8px 0}
.menu-item{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;height:38px;padding:0 10px;border:0;background:transparent;border-radius:8px;color:var(--ink);font:inherit;font-weight:500;text-decoration:none;cursor:pointer;text-align:start}
.menu-item:hover,.menu-item.on{background:var(--acc-soft);color:var(--acc)}
.menu-item svg{width:18px;height:18px;flex:none}
.menu-item.danger:hover{background:color-mix(in srgb,var(--bad,#d33) 12%,transparent);color:var(--bad,#d33)}
@media (max-width:760px){
  .topbar .profile{order:2}.profile-btn .name,.profile-btn svg{display:none}.profile-btn{padding:0 4px}
  .mainnav{order:5;flex-basis:100%;margin:0;overflow-x:auto}
  .menu{position:fixed;top:56px;inset-inline:12px;width:auto}
}

/* ---- settings page ---- */
main.narrow{max-width:760px}
.setrow{display:flex;align-items:center;gap:14px;padding:14px 22px;border-top:1px solid var(--line-2)}
.setrow .grow{flex:1;min-width:0}.setrow small{display:block;color:var(--mute);margin-top:2px}
.switch{position:relative;flex:none;width:44px;height:26px;padding:0;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);cursor:pointer;transition:background .15s}
.switch .knob{position:absolute;top:2px;inset-inline-start:2px;width:20px;height:20px;border-radius:50%;background:var(--mute);transition:transform .15s,background .15s}
.switch[aria-checked=true]{background:var(--acc);border-color:var(--acc)}
.switch[aria-checked=true] .knob{background:#fff;transform:translateX(18px)}
html[dir=rtl] .switch[aria-checked=true] .knob{transform:translateX(-18px)}
.switch[aria-disabled=true]{opacity:.55;cursor:not-allowed}
.switch:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
@media (max-width:760px){.setrow{padding:14px 16px;flex-wrap:wrap}}

/* what's new page + new-version toast */
.release .table-title span{display:flex;align-items:center;gap:10px}
.changes{margin:0;padding:6px 22px 18px 22px;padding-inline-start:42px;color:var(--ink-2);line-height:1.55}
.changes li{margin:6px 0}
.toast{position:fixed;inset-block-end:16px;inset-inline-end:16px;z-index:30;max-width:min(380px,calc(100vw - 32px));display:flex;flex-direction:column;gap:10px;padding:14px 16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 30px rgba(15,18,32,.18);animation:toast-in .25s ease-out}
.toast b{display:block;font-size:14px}.toast span.t-text{display:block;color:var(--mute);font-size:13px;margin-top:2px}
.toast .toast-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.toast .toast-actions .upd{height:34px;padding:0 14px;background:var(--acc);border-color:var(--acc);color:var(--acc-ink)}
.toast .toast-actions .upd:hover{background:var(--acc-hover)}
.toast .toast-actions a{font-size:13px;font-weight:600}
.toast .toast-x{position:absolute;inset-block-start:6px;inset-inline-end:6px;width:30px;height:30px;padding:0;display:grid;place-items:center;border-color:transparent;background:transparent;color:var(--mute)}
.toast .toast-x svg{width:16px;height:16px}
.toast .toast-head{padding-inline-end:26px}
@keyframes toast-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.toast{animation:none}}

/* ---- profile picture ---- */
.avatar.has-img{background:var(--line-2);overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}
.avatar.xl{width:88px;height:88px;font-size:34px}
.avrow{flex-wrap:wrap}.avbtns{display:flex;gap:8px;flex-wrap:wrap}.avbtns [hidden]{display:none}

/* holdings breakdown */
.hb-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px 24px;padding:18px 22px 6px}
.hb-top .k{font-size:12.5px;color:var(--mute);font-weight:600}
.hb-total{font-size:28px;font-weight:700;font-variant-numeric:tabular-nums}
.hb-date{color:var(--mute);font-size:13px}
.hb-table th[scope=row]{position:static;text-align:start;text-transform:none;letter-spacing:0;font-size:inherit;color:inherit}
.hb-table tr.subtotal th,.hb-table tr.subtotal td{font-weight:650;background:var(--surface-2)}
.hb-table tr.class th,.hb-table tr.class td{border-top:1px solid var(--line)}
.hb-table tr.grand th,.hb-table tr.grand td{font-weight:700;background:var(--acc-soft);color:var(--acc);border-top:2px solid var(--line)}
.hb-table .mute{color:var(--mute)}
.hb-table td{padding:10px 14px}
@media (max-width:640px){.hb-total{font-size:24px}.hb-table td,.hb-table th{padding:8px 10px}}
/* intake exceptions + paper definition */
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:end;padding:6px 22px 14px}
.flt,.fld{display:grid;gap:5px;font-size:12.5px;font-weight:600;color:var(--ink-2)}
.flt select{min-width:170px}
.pd-form{display:grid;gap:14px;padding:6px 22px 20px}
.fld input,.fld select{width:100%}
.pd-actions{display:flex;flex-wrap:wrap;gap:14px;align-items:center}
.btn-link{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border-radius:9px;border:1px solid var(--line);font-weight:600;color:var(--acc);text-decoration:none;background:var(--surface)}
.btn-link:hover{background:var(--surface-2)}
.btn-link:focus-visible{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent)}
.exc-note{color:var(--bad);font-weight:600}
.navbadge{display:inline-block;min-width:18px;padding:0 6px;margin-inline-start:6px;border-radius:999px;background:var(--bad);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
@media (max-width:760px){.filters{padding-inline:14px}.flt,.flt select{width:100%}.pd-form{padding-inline:14px}}

/* accounts screen + portfolio header */
.grow-flt{flex:1;min-width:220px}.grow-flt input{width:100%}
.pager{display:flex;gap:12px;align-items:center;justify-content:center;padding:14px}
.detail-head .meta .sep::before{content:"·";margin-inline-end:8px;color:var(--mute)}
.tiles .tile .s{overflow-wrap:anywhere}
@media (max-width:760px){.filters .primary{width:100%}.pager{flex-wrap:wrap}}

/* plan 22: exceptions table fits the screen; first column (define link) pinned */
@media (max-width:1500px){.exc-table .hide-md{display:none}}
.exc-notecol{min-width:180px;max-width:320px;white-space:normal}
.exc-table td.exc-first,.exc-table th.exc-first{white-space:nowrap}
.exc-table .btn-link.exc-def{min-height:30px;padding:0 10px;font-size:12.5px;white-space:nowrap}
.exc-hint{display:none;margin:0;padding:0 14px 8px;font-size:12px;color:var(--mute)}
@media (max-width:760px){.exc-hint{display:block}.exc-table td.exc-first{box-shadow:inset -1px 0 0 var(--line),4px 0 6px -4px rgba(0,0,0,.25)}[dir=rtl] .exc-table td.exc-first{box-shadow:inset 1px 0 0 var(--line),-4px 0 6px -4px rgba(0,0,0,.25)}}

/* plan 23: grouped new-paper rows */
.exc-accs{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center}
.linkbtn{background:none;border:0;padding:2px 4px;color:var(--acc);font:inherit;font-weight:600;text-decoration:underline;cursor:pointer;min-height:28px}
.linkbtn:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent);border-radius:6px}
.exc-expand td{background:var(--surface-2);white-space:normal}
.exc-acclist{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px 18px}
/* account card */
.ac-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:16px;align-items:start}
.ac-sec h3{margin:0 0 10px}.ac-sec h3:not(:first-child){margin-top:16px}
.ac-sec dl{grid-template-columns:minmax(90px,130px) 1fr}
.ac-others{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.ac-others a{color:var(--acc);font-weight:600;text-decoration:none}.ac-others a:hover{text-decoration:underline}
tr.rowlink{cursor:pointer}tr.rowlink:hover td{background:var(--surface-2)}

/* plan 32: the ONE table wrapper. Full card width, scrollbars only when needed, bounded height, pinned header and first column */
.tbl-wrap{--tbl-above:190px;width:100%;overflow:auto;max-height:max(240px,calc(100vh - var(--topbar-h,56px) - var(--tbl-above)));max-height:max(240px,calc(100dvh - var(--topbar-h,56px) - var(--tbl-above)));overscroll-behavior:contain}
#detail .tbl-wrap,dialog .tbl-wrap{--tbl-above:300px}
.tbl-wrap:focus-visible{outline:2px solid var(--acc);outline-offset:-2px}
.tbl-wrap th{top:0;z-index:3;box-shadow:inset 0 -1px 0 var(--line)}
.tbl-wrap td:first-child,.tbl-wrap th:first-child{position:sticky;inset-inline-start:0;background:var(--surface);box-shadow:1px 0 0 var(--line)}
.tbl-wrap th:first-child{background:var(--surface-2);z-index:4;box-shadow:inset 0 -1px 0 var(--line),1px 0 0 var(--line)}
.tbl-wrap td:first-child{z-index:2}
/* a row-header cell inside the body (subtotal / total rows) must not stick to the top: it would cover the real column headers */
tbody th{top:auto}
.tbl-wrap tbody th{top:auto;z-index:2}
.tbl-wrap tbody th:first-child{z-index:2}
tr.rowlink:hover td:first-child,tr.click:hover td:first-child{background:var(--surface-2)}
@media print{.tbl-wrap{max-height:none!important;overflow:visible!important}.tbl-wrap td:first-child,.tbl-wrap th:first-child,.tbl-wrap th{position:static}}

/* ---- settings drop-down in the main bar + paper settings list (plan 27) ---- */
.setlink{gap:6px;border:0;background:transparent;font:inherit;font-weight:600;cursor:pointer}
.setlink svg{width:14px;height:14px;flex:none}
.setlink[aria-expanded=true]{background:var(--acc-soft);color:var(--acc)}
.setmenu{position:fixed;inset-inline-end:auto;z-index:40}
.setmenu .menu-item{height:40px}
.pl{display:flex;flex-direction:column}
.pl-row{display:grid;grid-template-columns:110px minmax(0,1fr);gap:4px 14px;padding:12px 22px;border-bottom:1px solid var(--line-2);color:var(--ink);text-decoration:none}
.pl-row:last-child{border-bottom:0}.pl-row:hover,.pl-row:focus-visible{background:var(--acc-soft)}
.pl-no{font-weight:700;color:var(--acc)}.pl-name{font-weight:600;overflow-wrap:anywhere}
.pl-meta{grid-column:2;display:flex;flex-wrap:wrap;gap:6px 16px;color:var(--ink-2);font-size:13px}.pl-meta small{color:var(--mute);font-size:13px}
@media (max-width:760px){.pl-row{grid-template-columns:minmax(0,1fr);padding:12px 16px}.pl-meta{grid-column:1}}

/* new account intake (plan 28) */
.an-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;align-items:start}
.an-grid[hidden],#anSummary[hidden]{display:none}
.an-fields{display:grid;gap:12px}
.an-actions{grid-column:1/-1}
.an-tik{font-size:16px;margin:0 0 14px}.an-tik b{font-size:20px;margin-inline:4px}
.fld-err{color:var(--bad);font-weight:600;min-height:0}.fld-err:empty{display:none}
.fld input[aria-invalid="true"],.fld select[aria-invalid="true"]{border-color:var(--bad)}
#anSummary h2{margin:0 0 6px;font-size:20px}
@media (prefers-reduced-motion:no-preference){#anSummary{animation:none}}

/* breadcrumbs + Back (plan 31) */
.crumbbar{display:flex;align-items:center;gap:12px;max-width:1180px;margin:0 auto;padding:12px 20px 0;min-width:0}
.crumbs{min-width:0;flex:1}
.crumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;list-style:none;margin:0;padding:0;font-size:13px}
.crumb-item{display:inline-flex;align-items:center;min-width:0;max-width:100%}
.crumb-item+.crumb-item::before{content:"";width:6px;height:6px;margin-inline:9px;border-inline-end:1.5px solid var(--mute);border-block-start:1.5px solid var(--mute);transform:rotate(45deg);flex:none}
[dir=rtl] .crumb-item+.crumb-item::before{transform:rotate(-135deg)}
.crumb-link{color:var(--ink-2);text-decoration:none;border-radius:6px;padding:2px 4px}
.crumb-link:hover{color:var(--acc);text-decoration:underline}
.crumb-link:focus-visible,.crumb-back:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.crumb-cur{color:var(--ink);font-weight:600;padding:2px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46ch}
.crumb-back{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px 0 10px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--ink);font-weight:600;flex:none}
[dir=rtl] .crumb-back{padding:0 10px 0 14px}
[dir=rtl] .crumb-back svg{transform:scaleX(-1)}
.crumb-back svg{width:16px;height:16px}
.crumb-back:hover{border-color:var(--acc);color:var(--acc)}
@media (max-width:760px){
  .crumbbar{padding:10px 14px 0;gap:8px}
  .crumb-item:not(:nth-last-child(-n+2)){display:none}
  .crumb-item:nth-last-child(2)+.crumb-item::before{margin-inline:6px}
  .crumb-item:nth-last-child(2):first-child::before{display:none}
  .crumb-item{flex:0 1 auto}.crumb-cur,.crumb-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:34vw}
}
@media (prefers-reduced-motion:no-preference){.crumb-back{transition:border-color .15s,color .15s}}

/* What's new dialog */
.news-open{overflow:hidden}
.news-dlg{max-width:none;padding:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);width:min(640px,calc(100vw - 32px));max-height:min(720px,calc(100vh - 48px));box-shadow:0 20px 60px rgba(15,18,32,.3)}
.news-dlg[open]{display:flex;flex-direction:column;animation:toast-in .2s ease-out}
.news-dlg::backdrop{background:rgba(10,12,20,.55)}
.news-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 18px 12px;border-block-end:1px solid var(--line);flex:none}
.news-head h2{margin:0;font-size:18px}.news-sub{margin:2px 0 0;color:var(--mute);font-size:13px}
.news-x{width:34px;height:34px;padding:0;display:grid;place-items:center;border-color:transparent;background:transparent;color:var(--mute);flex:none}
.news-x svg{width:18px;height:18px}
.news-body{flex:1 1 auto;overflow-y:auto;padding:14px 18px;display:flex;flex-direction:column;gap:12px;overscroll-behavior:contain}
.news-body .release{margin:0;flex:none}
.news-foot{flex:none;display:flex;justify-content:flex-end;padding:12px 18px;border-block-start:1px solid var(--line)}
@media (max-width:600px){.news-dlg{width:calc(100vw - 12px);max-height:calc(100vh - 12px);border-radius:12px}}
@media (prefers-reduced-motion:reduce){.news-dlg[open]{animation:none}}
.pd-fields{display:grid;gap:14px}
.in-table th[scope=row]{text-align:start;font-weight:600}
.in-why{color:var(--mute);font-size:12.5px}
.in-late .in-why{color:var(--bad)}.in-failed .in-why{color:var(--warn)}
tr.in-failed td{background:var(--warn-soft)}

/* ---- mobile responsiveness, step 1: hamburger + side drawer ---- */
.hamburger,.drawer,.drawer-scrim{display:none}
@media (max-width:760px){
  .topbar{flex-wrap:nowrap;height:56px;row-gap:0;padding:0 8px;gap:6px}
  .topbar::before{display:none}
  .mainnav{display:none}
  .topbar .brand{order:0;margin-inline-end:auto;min-width:0}.topbar .brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar .profile{order:3}
  .hamburger{display:inline-flex;order:-1;width:44px;height:44px;padding:0;border:0;background:transparent;border-radius:10px;color:var(--ink);flex:none}
  .hamburger svg{width:24px;height:24px}
  .hamburger:hover,.hamburger[aria-expanded=true]{background:var(--acc-soft);color:var(--acc)}
  .drawer{display:flex;flex-direction:column;gap:2px;position:fixed;z-index:30;top:56px;bottom:0;inset-inline-start:0;width:min(300px,86vw);overflow-y:auto;overscroll-behavior:contain;padding:10px 10px 24px;background:var(--surface);border-inline-end:1px solid var(--line);box-shadow:0 12px 32px rgba(23,27,44,.22)}
  .drawer[hidden],.drawer-scrim[hidden]{display:none}
  .drawer-scrim{display:block;position:fixed;z-index:29;inset:56px 0 0 0;background:rgba(10,12,24,.45)}
  .drawer-link{display:flex;align-items:center;gap:8px;min-height:46px;padding:0 14px;border-radius:10px;color:var(--ink);font-weight:600;text-decoration:none}
  .drawer-link:hover,.drawer-link.active{background:var(--acc-soft);color:var(--acc)}
  .drawer-link.sub{min-height:42px;padding-inline-start:26px;font-weight:500}
  .drawer-group{display:flex;flex-direction:column;gap:2px;margin-top:8px;padding-top:6px;border-top:1px solid var(--line)}
  .drawer-link .navbadge{margin-inline-start:auto}
  html.drawer-open{overflow:hidden}
  .menu{top:60px}
}

/* mobile step 2: the data-freshness chips become one swipeable row instead of five stacked lines */
@media (max-width:760px){
  .statusbar{flex-wrap:nowrap;overflow-x:auto;margin-inline:-12px;padding:2px 12px 6px;scroll-snap-type:x proximity;scroll-padding-inline:12px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .statusbar::-webkit-scrollbar{display:none}
  .statusbar .chip{flex:none;scroll-snap-align:start;font-size:12px;padding:3px 10px}
}

/* mobile step 5: customer card. When a customer is open the search form, title and freshness strip step aside so the data starts under the breadcrumb */
@media (max-width:760px){
  main:has(#detail:not([hidden])) > .page-title,main:has(#detail:not([hidden])) > .statusbar,main:has(#detail:not([hidden])) > section:has(#sf),main:has(#detail:not([hidden])) > #resultsCard{display:none}
  .detail-head{gap:12px;align-items:flex-start}.detail-head .avatar.lg{width:44px;height:44px;font-size:17px}
  .detail-head h2{font-size:18px;overflow-wrap:anywhere}
  .detail-head .meta{gap:4px 8px;font-size:13px}
  .tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tile{padding:10px 12px}.tile .v{font-size:17px;overflow-wrap:anywhere}
}

/* mobile step 6: accounts list as cards (name + number on top, bank and status under it, account and open link at the bottom) */
@media (max-width:760px){
  .acc-table,.acc-table tbody{display:block}.acc-table thead{display:none}
  .acc-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line-2)}
  .acc-table td{display:block;padding:0;border:0;min-width:0}
  .acc-table td:nth-child(2){grid-row:1;grid-column:1;font-size:15px;overflow-wrap:anywhere}
  .acc-table td:nth-child(1){grid-row:1;grid-column:2;justify-self:end}
  .acc-table td:nth-child(3){grid-row:2;grid-column:1}
  .acc-table td:nth-child(8){grid-row:2;grid-column:2;justify-self:end}
  .acc-table td:nth-child(5){grid-row:3;grid-column:1}
  .acc-table td:nth-child(15){grid-row:3;grid-column:2;justify-self:end}
  .acc-table td:nth-child(1) a{font-weight:700}
}
@media (max-width:760px){.acc-table td.hide-sm{display:none}.acc-table td:first-child{box-shadow:none!important;position:static!important}}

/* mobile step 7: plain data tables become stacked cards (label left, value right); the first cell is the card title */
@media (max-width:760px){
  .tbl-wrap:has(> .m-cards){overflow:visible;max-height:none}
  .m-cards,.m-cards tbody{display:block;width:100%}
  .m-cards thead{display:none}
  .m-cards tr{display:block;padding:12px 16px;border-bottom:1px solid var(--line-2)}
  .m-cards tbody tr:last-child{border-bottom:0}
  .m-cards td,.m-cards td.hide-sm,.m-cards td.hide-md{display:flex;align-items:baseline;justify-content:space-between;gap:14px;padding:3px 0;border:0;text-align:end;min-width:0;overflow-wrap:anywhere}
  .m-cards td::before{content:attr(data-label);flex:none;max-width:46%;color:var(--mute);font-size:12px;font-weight:600;text-align:start}
  .m-cards td:empty{display:none}
  .m-cards td:first-child{position:static!important;box-shadow:none!important;background:none!important;justify-content:flex-start;text-align:start;font-weight:650;font-size:15px;padding-bottom:6px}
  .m-cards td:first-child::before{display:none}
  .m-cards td.num{font-variant-numeric:tabular-nums}
  .m-cards tr.click:active{background:var(--acc-soft)}
}
@media (max-width:760px){.m-cards tbody th:first-child{display:block;position:static;box-shadow:none;background:none;padding:0 0 6px;font-size:15px;font-weight:650;text-transform:none;letter-spacing:0;color:var(--ink);text-align:start}}
@media (max-width:760px){#exc:has(.m-cards) .exc-hint{display:none}.exc-table.m-cards td.exc-first{box-shadow:none}.exc-table.m-cards tr{padding:14px 16px}}
/* plan 57: transaction report */
.rpt-types{border:0;margin:0;padding:0;min-width:0}.rpt-types legend{padding:0;font-size:12.5px;font-weight:600;color:var(--ink-2)}
.rpt-types>div{display:flex;flex-wrap:wrap;gap:6px 14px;font-weight:400}.rpt-chk{display:inline-flex;align-items:center;gap:4px;min-height:32px;font-weight:400}
.rpt-group{padding:0 22px 14px}.rpt-group h4{margin:14px 0 6px}.rpt-total{margin:8px 0 0;color:var(--ink-2)}
.flt input[type=text],.flt input[type=date]{min-width:150px}
@media (max-width:760px){.rpt-group{padding-inline:14px}.flt input{width:100%;min-width:0}.rpt-types{width:100%}}
/* plan 62: groups */
.grp-list{padding:6px 0}
.grp-row{display:grid;grid-template-columns:34px 90px minmax(120px,1fr) 150px minmax(160px,2fr);gap:10px;align-items:center;padding:8px 18px;border-bottom:1px solid var(--line-2);cursor:pointer}
.grp-row:hover{background:var(--acc-soft)}
.grp-head{color:var(--mute);font-size:12px;font-weight:600;cursor:default}.grp-head:hover{background:transparent}
.grp-row.closed{opacity:.7}
.grp-row input[type=checkbox]{width:18px;height:18px;accent-color:var(--acc)}
.grp-actions{display:flex;gap:10px;align-items:center;padding:14px 18px;flex-wrap:wrap}
.flt.chk{flex-direction:row;align-items:center;gap:8px;align-self:flex-end;height:36px}
@media (max-width:760px){.grp-head{display:none}.grp-row{grid-template-columns:30px 1fr;grid-template-areas:"c t" "c b" "c a" "c n";gap:2px 10px;padding:12px 16px}.grp-row>:nth-child(1){grid-area:c}.grp-row>:nth-child(2){grid-area:t}.grp-row>:nth-child(3){grid-area:b;color:var(--ink-2)}.grp-row>:nth-child(4){grid-area:a}.grp-row>:nth-child(5){grid-area:n}.grp-actions .primary{width:100%}}

/* plan 66: data-quality cards jump to their list */
a.tile-link{display:block;color:inherit;text-decoration:none}
a.tile-link:hover{border-color:var(--acc)}
a.tile-link:focus-visible{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent)}
#sec-exc,#sec-miss,#sec-contact{scroll-margin-top:72px}
