/* Nudge lender console. Builds on nudge.css tokens. */
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; background: var(--bg-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Sidebar — white, hairline, like a bank's back office */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; background: #fff; border-right: 1px solid var(--line-2); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 24px; }
.side-brand span { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; line-height: 1; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
@media (hover: hover) and (pointer: fine) { .side-nav a:hover { background: var(--bg-2); } }
.side-nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-deep); }
.side-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 14px; padding: 0 4px; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg-2); font-size: 13px; font-weight: 500; }
.side-org .muted { font-size: 12px; font-weight: 400; }
.org-dot { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.side-db { padding-left: 8px; color: var(--muted); }

/* Main */
.main { min-width: 0; padding: 18px clamp(16px, 3vw, 36px) 40px; outline: none; }
.demo-banner { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin-bottom: 18px; padding: 7px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }
.demo-banner svg { flex: none; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top-kicker { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.top-title { font-family: var(--font-display); font-weight: 600; font-size: 38px; line-height: 1.1; letter-spacing: -.035em; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line-2); color: var(--muted); width: 280px; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(55,48,196,.1); }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; color: var(--ink); }

.view[data-entering] { animation: viewIn 320ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.view-intro { color: var(--muted); max-width: 70ch; margin-bottom: 16px; font-size: 15px; }

.box { padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); min-width: 0; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.box-head h3 { font-size: 15px; font-weight: 600; }
.link { font-size: 13px; font-weight: 500; color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { position: relative; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.kpi p { font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 36px; line-height: 1.2; letter-spacing: -.03em; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi .sample { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: var(--bg-2); color: var(--muted); }

/* Buckets */
.buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.bucket { text-align: left; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; gap: 10px; transition: border-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.bucket:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .bucket:hover { border-color: var(--accent); } }
.bucket-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bucket-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bucket-name i { width: 10px; height: 10px; border-radius: 3px; }
.bucket-count { font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.bucket-sub { font-size: 13px; color: var(--muted); }
.bar { height: 6px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; transform: scaleX(var(--p)); transition: transform 900ms var(--ease-out); }
.bar[data-pre] i { transform: scaleX(0); }
.c-soon { background: #8C88E8; } .c-today { background: var(--accent); } .c-late { background: #C98A1B; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }

/* Lists */
.ptp-list li, .need-list li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; transition: background-color var(--t-fast) ease; }
.ptp-list li + li, .need-list li + li { border-top: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .ptp-list li:hover, .need-list li:hover { background: var(--bg-2); } }
.ptp-list li:focus-visible, .need-list li:focus-visible, .q-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.date-chip { display: grid; place-items: center; height: 44px; border-radius: 9px; background: var(--ok-soft); color: var(--ok); line-height: 1.05; }
.date-chip b { font-family: var(--font-display); font-size: 18px; letter-spacing: -.02em; }
.date-chip span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.li-main { min-width: 0; }
.li-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-amt { font-family: var(--font-mono); font-size: 13px; }
.need-list .reason { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--staff-soft); color: var(--staff); }
.empty-li { padding: 16px 0; color: var(--muted); font-size: 14px; }

/* Outcome mix */
.mix-bar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--bg-2); }
.mix-bar i { height: 100%; transform-origin: left; transition: transform 900ms var(--ease-out); }
.mix-bar[data-pre] i { transform: scaleX(0); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.mix-legend li { display: flex; align-items: center; gap: 8px; }
.mix-legend i { width: 10px; height: 10px; border-radius: 3px; }
.mix-legend b { font-weight: 600; }

/* Tags */
.t-ok { background: var(--ok-soft); color: var(--ok); }
.t-review { background: var(--warn-soft); color: var(--warn); }
.t-draft { background: var(--bg-2); color: var(--muted); }

/* Queue */
.q-bar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.seg button:active { transform: scale(.97); }
.seg button b { font-weight: 600; font-size: 12px; color: var(--muted); }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.seg button[aria-pressed='true'] b { color: rgba(255,255,255,.7); }
@media (hover: hover) and (pointer: fine) { .seg button:not([aria-pressed='true']):hover { background: var(--bg-2); } }
.table-wrap { border-radius: 16px; background: #fff; border: 1px solid var(--line); overflow: auto; }
.table-wrap.flat { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fff; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.q-table tbody tr { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .q-table tbody tr:hover { background: var(--bg-2); } }
.num { text-align: right; font-family: var(--font-mono); font-size: 13px; }
th.num { font-family: var(--font-ui); font-size: 12px; }
.nm { font-weight: 600; white-space: nowrap; }
.ph { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.lid { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.prod { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due { white-space: nowrap; }
.due small { display: block; font-size: 12px; color: var(--muted); }
.due.late small { color: var(--warn); font-weight: 600; }
.lang-tag { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); white-space: nowrap; }
.next { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Hand-offs */
.handoffs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ho { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.ho-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ho-reason { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--staff); }
.ho-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.ho-sub { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.ho p.ho-sum { font-size: 14px; color: var(--ink-2); }
.ho-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.ho-foot .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.ho-assigned { color: var(--ok); font-weight: 600; }
.ho-unassigned { color: var(--warn); font-weight: 600; }

/* Settings */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set-wide { grid-column: 1 / -1; }
.set-note { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.set-times { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.set-times label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
select { height: 38px; padding: 0 30px 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%23595F7E' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center no-repeat; appearance: none; -webkit-appearance: none; font-size: 14px; color: var(--ink); cursor: pointer; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mini-hours { position: relative; height: 30px; margin-bottom: 26px; border-radius: 8px; background: var(--accent-soft); border: 1.5px dashed var(--accent); }
.mh-inner { position: absolute; top: 5px; bottom: 5px; border-radius: 5px; background: var(--accent); left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); transition: left 300ms var(--ease-in-out), width 300ms var(--ease-in-out); }
.mini-hours span { position: absolute; top: calc(100% + 5px); left: calc(var(--t) * 100%); transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.mini-hours span:first-of-type { transform: none; }
.mini-hours span:last-of-type { transform: translateX(-100%); }
.set-summary { font-size: 12.5px; color: var(--ink-2); }
.days { border: 0; padding: 0; margin: 0 0 12px; }
.days legend { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 8px; padding: 0; }
.days div { display: flex; flex-wrap: wrap; gap: 6px; }
.day { height: 34px; min-width: 46px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.day:active { transform: scale(.97); }
.day[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-rows { display: grid; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); cursor: pointer; }
.set-row:first-child { border-top: 0; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); cursor: pointer; transition: background-color var(--t-fast) ease; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,20,51,.25); transition: transform var(--t-ui) var(--ease-out); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: .6; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.s-table td { font-size: 14px; }
.s-table .s-name { font-weight: 600; }
.s-table .s-ver { display: block; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.s-langs { display: flex; flex-wrap: wrap; gap: 4px; }
.s-status { white-space: nowrap; }
.s-status small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.route li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.route li:first-child { border-top: 0; }
.route b { font-weight: 600; display: block; }
.route span { color: var(--muted); font-size: 13px; }
.route .route-to { text-align: right; color: var(--ink-2); font-size: 13px; }
.set-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.demo-note { margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }

/* Drawer */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(15,20,51,.3); opacity: 0; transition: opacity 260ms ease; }
.scrim[data-open] { opacity: 1; }
.drawer { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: #fff; box-shadow: -30px 0 80px -30px rgba(15,20,51,.4); transform: translateX(100%); visibility: hidden; transition: transform 400ms var(--ease-drawer), visibility 0s 400ms; outline: none; }
.drawer[data-open] { transform: none; visibility: visible; transition: transform 400ms var(--ease-drawer); }
.dr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dr-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dr-av { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; font-size: 14px; }
.dr-name { font-weight: 600; font-size: 17px; }
.dr-meta { font-size: 12px; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.icon-btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg-2); } }
.dr-body { flex: 1; overflow: auto; padding: 18px 20px 24px; display: grid; gap: 22px; align-content: start; }
.dr-h { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dr-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--bg-2); }
.dr-status b { display: block; font-size: 15px; }
.dr-status span.s2 { font-size: 13px; color: var(--ink-2); }
.dr-status.ok { background: var(--ok-soft); }
.dr-status.staff { background: var(--staff-soft); }
.dr-status.warn { background: var(--warn-soft); }
.dr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.dr-facts div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.dr-facts dt { font-size: 11.5px; color: var(--muted); }
.dr-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
.sched td, .sched th { padding: 8px 10px; font-size: 13px; }
.sched th { padding-top: 0; }
.sched tr.cur td { background: var(--accent-soft); }
.sched tr.cur td:first-child { border-radius: 8px 0 0 8px; }
.sched tr.cur td:last-child { border-radius: 0 8px 8px 0; }
.st { font-size: 12.5px; font-weight: 600; }
.st-paid { color: var(--ok); } .st-due { color: var(--accent-deep); } .st-late { color: var(--warn); } .st-up { color: var(--muted); font-weight: 500; }
.hist li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hist li:first-child { border-top: 0; }
.hist .mono { font-size: 12px; color: var(--muted); }
.tx { display: grid; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.tx li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.tx li:first-child { border-top: 0; }
.tx li.agent { background: var(--bg-2); }
.tx .who { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.tx li.agent .who { color: var(--accent); }
.tx .txt { font-size: 14.5px; line-height: 1.55; }
.tx .gl { display: block; font-family: var(--font-ui); font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tx-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ptp-box { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--ok); background: var(--ok-soft); }
.ptp-box .date-chip { width: 58px; background: #fff; }
.ptp-box p { font-size: 14px; color: var(--ink-2); }
.ptp-box b { display: block; font-size: 15px; color: var(--ink); }
.dr-foot { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.assign { display: flex; gap: 8px; flex: 1 1 300px; min-width: 0; }
.assign select { flex: 1; min-width: 0; }
.pause-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.pause-row small { display: block; font-size: 12px; color: var(--muted); }

/* Mobile tab bar (hidden on desktop) */
.tabbar { display: none; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  body.app { grid-template-columns: minmax(0, 1fr); padding-bottom: 76px; }
  .side { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line-2); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 10px; font-size: 11.5px; font-weight: 500; color: var(--muted); transition: color var(--t-fast) ease, background-color var(--t-fast) ease; }
  .tabbar a:active { transform: scale(.97); }
  .tabbar a[aria-current='page'] { color: var(--accent-deep); background: var(--accent-soft); }
  .tabbar .side-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 16px; font-size: 10px; margin: 0; }
  .grid-2, .set-grid, .handoffs { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
  .top-actions { width: 100%; }
  .search { flex: 1; }
  .drawer { width: 100%; }
}
@media (max-width: 720px) {
  .top-title { font-size: 30px; }
  .buckets { grid-template-columns: minmax(0, 1fr); }
  .bucket { grid-template-columns: 1fr; }
  .kpi b { font-size: 30px; }
  .top-actions .btn { padding: 0 12px; }
  .dr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist li { grid-template-columns: minmax(0, 1fr) auto; }
  .hist li .mono { grid-column: 1 / -1; }
  /* Queue rows become cards */
  .q-table thead { display: none; }
  .q-table, .q-table tbody, .q-table tr, .q-table td { display: block; }
  .q-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px; border-bottom: 1px solid var(--line); }
  .q-table tbody tr:last-child { border-bottom: 0; }
  .q-table td { padding: 0; border: 0; }
  .q-table td.c-bor { grid-column: 1; }
  .q-table td.c-emi { grid-column: 2; grid-row: 1; text-align: right; }
  .q-table td.c-loan { grid-column: 1; }
  .q-table td.c-due { grid-column: 2; grid-row: 2; text-align: right; }
  .q-table td.c-lang { display: none; }
  .q-table td.c-last { grid-column: 1; margin-top: 6px; }
  .q-table td.c-next { grid-column: 2; margin-top: 6px; align-self: center; text-align: right; }
  .q-table .next { white-space: normal; }
  .q-table .prod { display: inline; margin-left: 6px; }
  .s-table thead { display: none; }
  .s-table, .s-table tbody, .s-table tr, .s-table td { display: block; }
  .s-table tr { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
  .s-table tr:first-child { border-top: 0; }
  .s-table td { padding: 0; border: 0; }
  .demo-banner { font-size: 12px; }
}

/* Display-font numbers: proportional figures (tabular commas look gappy in Schibsted Grotesk) */
.kpi b, .bucket-count, .date-chip b { font-variant-numeric: normal; }
.li-name, .li-sub { display: block; }
@media (max-width: 720px) {
  .kpi .sample { position: static; display: inline-block; margin-bottom: 6px; }
  .kpi { padding: 14px; }
}
@media (max-width: 560px) {
  .dr-foot { flex-direction: column; align-items: stretch; }
  .assign { flex: none; }
  .dr-foot .btn-line { width: 100%; }
  .dr-status { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 560px) {
  .assign { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .assign select { width: 100%; }
}
