/* Zidos Trail pages, round 4 (after independent slop critique). v8 tokens only (css/v8.css). */
:root { --pad-card: 24px; --text-light-2: #94A3B8; --ok: #059669; }
html { touch-action: manipulation; -webkit-tap-highlight-color: rgba(15, 23, 42, .06); }
html.dark { color-scheme: dark; }
body { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 90; padding: 8px 12px; border-radius: 10px; background: var(--brand-pill-active); color: var(--brand-pill-active-text); font: 600 13px var(--font-sans); }
.skip-link:focus { top: 12px; }
.zt-wordmark { height: 28px; width: auto; display: block; }
html.dark .zt-wordmark { content: url(../img/wordmark-full-dark.svg); }

/* numbers: sans + tabular everywhere; mono only for card number, card balance and the one hero figure */
.num { font-family: var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-num { font: 700 32px/1.1 var(--font-mono); letter-spacing: -0.02em; color: var(--text-main); white-space: nowrap; }
.cur { font-size: .7em; color: var(--text-muted); font-weight: 600; margin-left: 2px; }
.muted { color: var(--text-muted); }
.pos { color: var(--ok); }
.neg { color: #DC2626; }

.page { display: none; }
.page.active { display: block; }
.page-inner { display: grid; gap: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--text-main); text-wrap: balance; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* card anatomy: title + muted tail on one line, no subtitle, no divider */
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px var(--pad-card) 8px; }
.ch h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-main); }
.ch h2 .tail { font-weight: 400; color: var(--text-muted); }
.more { display: inline-flex; align-items: center; gap: 2px; font: 500 13px var(--font-sans); color: var(--text-muted); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 4px 0; }
.more:hover { color: var(--text-main); }
.more svg { width: 14px; height: 14px; }
.cb { padding: 4px var(--pad-card) 20px; }

/* icons, avatars */
.ava { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; font: 600 13px var(--font-sans); }
.catic { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; }
.catic svg { width: 15px; height: 15px; }
.tile-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-subtle); display: grid; place-items: center; color: var(--text-muted); }
.tile-ic svg { width: 15px; height: 15px; }

/* buttons */
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-main); font: 600 13px var(--font-sans); cursor: pointer; }
.btn-ghost:not(:disabled):not([aria-disabled="true"]):hover { background: var(--bg-hover); }
.btn-ghost svg { width: 16px; height: 16px; }
.sync-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.demo-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--warning-bg); color: #92400E; font: 700 10px var(--font-sans); letter-spacing: .04em; }
.pro-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-main); font: 600 13px var(--font-sans); cursor: pointer; }
.pro-link b { font-size: 10px; letter-spacing: .04em; padding: 2px 5px; border-radius: 4px; background: var(--brand-pill-active); color: #fff; }

/* ===== Overview ===== */
.ov-r1 { display: grid; grid-template-columns: 4fr 8fr; gap: 24px; }
.ov-card { max-width: none; min-height: 0; height: 100%; aspect-ratio: auto; }
.ov-card-bal { display: grid; gap: 2px; position: relative; z-index: 1; }
.ov-card-lbl { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.62); }
.ov-card-val { font: 700 30px var(--font-mono); letter-spacing: -0.02em; color: #fff; }
.ov-card-val .cur { color: rgba(255,255,255,.6); }
.ov-card-sub { font-size: 12px; color: rgba(255,255,255,.6); }
.ov-card .card-network-logo { display: flex; }
.month { display: flex; flex-direction: column; padding: 22px var(--pad-card) 16px; cursor: default; } /* r22 C6: only the chart opens details. */
#paceChart { cursor: pointer; }
.month:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.month-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.month-lbl { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.month-fig { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; font: 600 12px var(--font-sans); white-space: nowrap; }
.pill.over { background: #FEE2E2; color: #B91C1C; }
.pill.warn { background: #FEF3C7; color: #B45309; }
.pill.fine { background: #DCFCE7; color: #15803D; }
.month-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.chart { position: relative; height: 176px; margin-top: 14px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .lbl { position: absolute; font: 500 11px var(--font-sans); color: var(--text-light-2); white-space: nowrap; pointer-events: none; }
.chart .ylbl { left: 0; width: 34px; text-align: right; transform: translateY(-50%); }
.chart .xlbl { bottom: -2px; transform: translateX(-50%); }
.chart .tag { position: absolute; transform: translate(-50%, -100%); margin-top: -12px; padding: 3px 7px; border-radius: 6px; background: var(--text-main); color: #fff; font: 600 12px var(--font-sans); white-space: nowrap; pointer-events: none; }
.chart .endlbl { font: 500 12px var(--font-sans); color: var(--text-muted); transform: translateY(-50%); }
.chart .aug { color: var(--text-light-2); }
.tip-box { position: absolute; z-index: 5; min-width: 150px; padding: 8px 10px; border-radius: 8px; background: var(--bg-card); box-shadow: var(--shadow-hover); border: 1px solid var(--border-subtle); font-size: 12px; pointer-events: none; display: none; }
.tip-box.on { display: block; }
.tip-box div { display: flex; justify-content: space-between; gap: 12px; }
.tip-box .d { font-weight: 600; margin-bottom: 4px; }

.ov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; }
.tile { display: grid; gap: 8px; padding: 18px 20px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--border-focus); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-lbl { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.tile-val { font: 700 24px var(--font-sans); letter-spacing: -0.01em; color: var(--text-main); }
.chip-s { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font: 600 12px var(--font-sans); background: var(--bg-subtle); color: var(--text-muted); justify-self: start; }
.chip-s.ok { background: #DCFCE7; color: #15803D; }
.chip-s.warn { background: #FEF3C7; color: #B45309; }

.ov-r3 { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: start; }
.strip { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 14px; background: var(--bg-subtle); font-size: 14px; color: var(--text-main); min-width: 0; }
.strip .k { font-weight: 600; flex: none; }
.strip .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip a { color: inherit; text-decoration: none; display: flex; gap: 12px; flex: 1; min-width: 0; }
.strip a:hover .t { text-decoration: underline; }
.strip .x { border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; }
.ov-r4 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* operation rows (overview + transactions) */
.dayh { display: flex; justify-content: space-between; padding: 12px var(--pad-card) 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.dayh .num { color: var(--text-main); font-weight: 600; }
.op { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 8px var(--pad-card); cursor: pointer; border-top: 1px solid var(--bg-subtle); }
.op:hover { background: var(--bg-hover); }
.op:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: -2px; }
.op-m { min-width: 0; display: grid; gap: 1px; }
.op-m b { font-weight: 600; font-size: 14px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-m span { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.op-m span svg { width: 13px; height: 13px; flex: none; }
.tag-p { font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--bg-subtle); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.op-a { text-align: right; font-size: 14px; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.op-a small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* categories vs limits (overview) */
.catrow { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 8px 12px; align-items: center; padding: 9px var(--pad-card); }
.catrow .nm { font-size: 14px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catrow .v { font-size: 14px; font-weight: 600; text-align: right; white-space: nowrap; }
.catrow .v small { font-weight: 400; color: var(--text-muted); }
.catrow .tr { grid-column: 2 / -1; }
.track { position: relative; height: 6px; border-radius: 3px; background: var(--bg-subtle); overflow: hidden; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--text-main); }
.track.over i { background: #DC2626; }

/* ===== Transactions ===== */
.tx-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-card); }
.search svg { width: 16px; height: 16px; color: var(--text-muted); }
.search input { border: 0; background: transparent; outline: none; font: 500 14px var(--font-sans); color: var(--text-main); width: 100%; }
.search:focus-within { border-color: var(--text-main); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--border-subtle); background: var(--bg-card); font: 500 13px var(--font-sans); color: var(--text-muted); cursor: pointer; }
.chip:not(:disabled):not([aria-disabled="true"]):hover { color: var(--text-main); }
.chip[aria-pressed="true"] { background: var(--brand-pill-active); color: #fff; border-color: var(--brand-pill-active); }
.chip .cnt { font-weight: 600; }
.sum-line { font-size: 13px; color: var(--text-muted); }
.sum-line b { color: var(--text-main); font-weight: 600; }
.txt { width: 100%; border-collapse: collapse; }
.txt td { padding: 8px 12px; border-top: 1px solid var(--bg-subtle); font-size: 14px; vertical-align: middle; }
.txt tr.day td { border-top: 0; padding: 16px 12px 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.txt tr.day td:last-child { color: var(--text-main); text-align: right; padding-right: 24px; }
.txt tr.r { cursor: pointer; }
.txt tr.r:hover { background: var(--bg-hover); }
.txt tr.r.sel { background: #F1F5F9; }
.txt tr.r.open { background: var(--bg-hover); box-shadow: inset 3px 0 0 var(--text-main); }
.txt tr.r:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: -2px; }
.txt td.c0 { width: 40px; padding-left: 20px; }
.txt td.c2 { width: 240px; }
.txt td.c3 { width: 150px; text-align: right; padding-right: 24px; }
.mcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cat-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; font: 500 13px var(--font-sans); color: var(--text-main); cursor: pointer; }
.cat-btn svg { width: 14px; height: 14px; flex: none; }
.cat-btn:hover, .cat-btn:focus-visible { border-color: var(--border-subtle); background: var(--bg-card); }
.cat-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-btn.none { color: var(--text-muted); border: 1px dashed var(--border-focus); }
.txt td.c2 .cat-btn.none { border: 1px dashed var(--border-focus); background: transparent; }
.txt td.c2 .cat-btn.none.done { border: 1px solid var(--border-subtle); background: var(--panel-2); }
.check { width: 16px; height: 16px; accent-color: var(--text-main); }
.popover { position: absolute; z-index: 75; width: 300px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: var(--shadow-hover); padding: 8px; }
.popover input[type=search] { width: 100%; height: 34px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0 10px; font: 500 13px var(--font-sans); background: var(--bg-subtle); color: var(--text-main); }
.popover .opts { max-height: 260px; overflow: auto; margin: 6px 0; overscroll-behavior: contain; }
.popover .opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: transparent; border-radius: 8px; font: 500 13px var(--font-sans); color: var(--text-main); cursor: pointer; text-align: left; }
.popover .opt svg { width: 14px; height: 14px; }
.popover .opt:hover, .popover .opt[aria-selected="true"] { background: var(--bg-subtle); }
.popover .scope { border-top: 1px solid var(--border-subtle); padding: 8px 4px 2px; display: grid; gap: 6px; font-size: 13px; }
.popover .scope label { display: flex; gap: 8px; align-items: flex-start; }
.bulkbar { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: none; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 9999px; background: var(--brand-pill-active); color: #fff; box-shadow: var(--shadow-hover); font: 600 13px var(--font-sans); }
.bulkbar.on { display: flex; }
.bulkbar button { height: 32px; padding: 0 12px; border-radius: 9999px; border: 0; background: rgba(255,255,255,.12); color: inherit; font: 600 12px var(--font-sans); cursor: pointer; }

/* slide-over panel */
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: 420px; max-width: 100%; background: var(--bg-card); box-shadow: -20px 0 50px -20px rgba(15,23,42,.35); transform: translateX(105%); visibility: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s linear .2s; overflow: auto; overscroll-behavior: contain; }
.panel.on, .panel.drag { visibility: visible; transition: transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.panel.on { transform: none; }
/* r23 C-08 / J-08: the same details panel docks beside the operations list.
   Other routes continue to use its drawer/sheet presentation. */
.tx-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start;min-width:0}
.tx-layout>.tx-list{min-width:0;width:100%}
@media (min-width:1200px){
  #page-transactions .tx-layout:has(>#opPanel.on){grid-template-columns:minmax(0,1fr) 380px}
  #page-transactions .tx-layout>#opPanel.on{position:sticky;top:80px;right:auto;bottom:auto;left:auto;width:380px;max-width:100%;max-height:calc(100dvh - 100px);transform:none;z-index:10;border-radius:var(--r-panel)}
  #page-transactions .tx-layout>#opPanel:not(.on){display:none}
  #page-transactions .tx-layout>#opPanel .dr-grab{display:none}
  html #page-transactions .tx-layout:has(>#opPanel.on) col.k0{width:40px}
  html #page-transactions .tx-layout:has(>#opPanel.on) col.k2{width:220px}
  html #page-transactions .tx-layout:has(>#opPanel.on) col.k3{width:142px}
  html #page-transactions .tx-layout:has(>#opPanel.on) col.k4{width:32px}
  html #page-transactions .tx-layout:has(>#opPanel.on) td{padding-inline:8px}
}
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-muted); display: inline-grid; place-items: center; cursor: pointer; }
.iconbtn svg { width: 16px; height: 16px; }
.p-hero { padding: 4px 24px 18px; display: grid; gap: 6px; }
.p-merch { display: flex; align-items: center; gap: 12px; }
.p-merch b { font-size: 17px; }
.p-amt { font: 700 30px var(--font-sans); letter-spacing: -0.02em; margin-top: 6px; }
.p-sub { font-size: 13px; color: var(--text-muted); }
.p-sec { padding: 14px 24px; border-top: 1px solid var(--bg-subtle); display: grid; gap: 10px; }
.p-sec h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.row2 { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.row2 .k { color: var(--text-muted); }
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-subtle); justify-self: start; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; font: 600 13px var(--font-sans); color: var(--text-muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-sm); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.field input, .field select { height: 38px; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0 12px; font: 500 14px var(--font-sans); color: var(--text-main); background: var(--bg-card); }
.field input:focus, .field select:focus { outline: none; border-color: var(--text-main); }
.scrim { position: fixed; inset: 0; z-index: 65; background: rgba(15,23,42,.18); display: none; }
.scrim.on { display: block; }

/* ===== Budgets ===== */
.b-sum { display: flex; gap: 32px; flex-wrap: wrap; align-items: baseline; padding: 20px var(--pad-card); }
.b-sum div { display: grid; gap: 2px; }
.b-sum .l { font-size: 13px; color: var(--text-muted); }
.b-sum .v { font: 700 22px var(--font-sans); }
.brow { display: grid; grid-template-columns: 28px minmax(140px, 210px) minmax(0,1fr) 116px; gap: 8px 16px; align-items: center; padding: 14px var(--pad-card); border-top: 1px solid var(--bg-subtle); }
.brow .nm { font-size: 14px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bbar { display: grid; gap: 6px; }
.bbar .rail { position: relative; height: 24px; display: flex; align-items: center; }
.bbar .track { width: 100%; height: 8px; border-radius: 4px; }
.bbar .today { position: absolute; top: 3px; height: 18px; width: 2px; margin-left: -1px; background: var(--text-light-2); border-radius: 1px; pointer-events: none; }
.bbar .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.bbar .meta b { color: var(--text-main); font-weight: 600; }
.lim-range { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 24px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; }
.lim-range:focus { outline: none; }
.lim-range::-webkit-slider-runnable-track { height: 24px; background: transparent; }
.lim-range::-moz-range-track { height: 24px; background: transparent; }
.lim-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 4px; border-radius: 50%; background: var(--text-main); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15,23,42,.35); }
.lim-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text-main); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15,23,42,.35); }
.lim-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(15,23,42,.18); }
.limval { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; font-size: 13px; color: var(--text-muted); }
.limval input { width: 68px; height: 30px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0 8px; font: 600 13px var(--font-sans); color: var(--text-main); text-align: right; background: var(--bg-card); }
.limval input:focus { outline: none; border-color: var(--text-main); }
.rule, .sug { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--pad-card); border-top: 1px solid var(--bg-subtle); font-size: 14px; }
.sug small { display: block; font-size: 12px; color: var(--text-muted); }
.b-split { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; align-items: start; }

/* ===== Cash flow ===== */
.cf-nums { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 24px; padding: 4px var(--pad-card) 8px; }
.cf-nums .l { font-size: 13px; color: var(--text-muted); }
.cf-nums .v { font: 700 22px var(--font-sans); margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; height: 220px; align-items: end; padding: 24px var(--pad-card) 16px; }
.bars .m { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; }
.bars .pair { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.bars .b { width: 28px; border-radius: 4px 4px 0 0; position: relative; }
.bars .b span { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px); font: 600 12px var(--font-sans); color: var(--text-main); white-space: nowrap; }
.bars .b.in { background: #10B981; }
.bars .b.out { background: var(--text-main); }
.bars .b.cur { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.3) 0 2px, transparent 2px 6px); }
.bars .zero { font-size: 12px; color: var(--text-muted); width: 28px; text-align: center; }
.bars .ml { text-align: center; font-size: 12px; color: var(--text-muted); }
.rank-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 6px 12px; align-items: center; padding: 8px var(--pad-card); }
.rank-row .tr { grid-column: 2 / -1; }
.ifrow { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px var(--pad-card); border-top: 1px solid var(--bg-subtle); }
.ifrow .op-m > span { min-width: 0; }
.ifrow .op-m .sub-t:last-child { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* ===== Receipts ===== */
.rc-split { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 24px; align-items: start; }
.rcrow { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px var(--pad-card); border-top: 1px solid var(--bg-subtle); cursor: pointer; }
.rcrow:hover, .rcrow.open { background: var(--bg-hover); }
.rcrow:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: -2px; }
#rcCandidates .rc-candidate { width: 100%; min-height: 52px; padding: 10px 12px; border-bottom: 1px solid var(--line, var(--well-deep)); font-variant-numeric: tabular-nums; text-align: left; }
#rcCandidates .rc-candidate > span { min-width: 0; overflow-wrap: anywhere; }
.paper { padding: 4px var(--pad-card) 20px; font-size: 14px; }
.paper .ln { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border-subtle); }
.paper .ln:last-child { border-bottom: 0; font-weight: 700; }
.help { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-muted); font: 700 11px var(--font-sans); cursor: help; vertical-align: 2px; margin-left: 4px; }

/* ===== Integrations / family ===== */
.setrow { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 14px var(--pad-card); border-top: 1px solid var(--bg-subtle); font-size: 14px; }
.setrow .d { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.state { font-size: 13px; font-weight: 600; white-space: nowrap; }
.state.ok { color: var(--ok); }
.state.miss { color: #B45309; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--border-focus); border: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.2); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--text-main); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.logo { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font: 800 11px var(--font-sans); flex: none; }
.ch .ttl { display: flex; align-items: center; gap: 10px; }

/* ===== Modals ===== */
.zm-back { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.42); display: none; align-items: center; justify-content: center; padding: 24px; }
.zm-back.on { display: flex; }
.zm { width: min(860px, 100%); max-height: min(86vh, 740px); display: flex; flex-direction: column; background: var(--bg-card); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(15,23,42,.45); overflow: hidden; }
.zm.small { width: min(440px, 100%); }
.zm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.zm-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.zm-body { display: grid; grid-template-columns: 190px minmax(0,1fr); min-height: 0; flex: 1; }
.zm-body.single { display: block; overflow: auto; overscroll-behavior: contain; }
.zm-nav { padding: 8px 12px; display: grid; align-content: start; gap: 2px; }
.zm-nav button { text-align: left; height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; font: 500 14px var(--font-sans); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.zm-nav button[aria-current="true"] { background: var(--bg-subtle); color: var(--text-main); font-weight: 600; }
.zm-main { overflow: auto; overscroll-behavior: contain; padding: 0 8px 16px 0; }
.zm-sec { padding: 12px 20px; display: grid; gap: 12px; }
.zm-sec h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.kv .d { font-size: 13px; color: var(--text-muted); }
.zm-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; }
.confirm { padding: 12px; border: 1px solid #FECACA; background: #FEF2F2; border-radius: 10px; display: grid; gap: 8px; font-size: 13px; }
.btn-danger { height: 34px; padding: 0 14px; border-radius: 10px; border: 0; background: #DC2626; color: #fff; font: 600 13px var(--font-sans); cursor: pointer; }
.finding { padding: 14px 20px; display: grid; gap: 4px; border-top: 1px solid var(--bg-subtle); }
.finding b { font-size: 14px; }
.finding span { font-size: 13px; color: var(--text-muted); }
.empty { padding: 28px 20px; text-align: center; font-size: 14px; color: var(--text-muted); display: grid; gap: 8px; justify-items: center; }
.empty b { color: var(--text-main); }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }

/* ===== responsive ===== */
@media (max-width: 1180px) {
  .ov-r1 { grid-template-columns: 1fr; } .ov-card { max-width: 420px; }
  .ov-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ov-r3, .b-split, .rc-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --pad-card: 16px; }
  .page-inner { gap: 12px; }
  .app-topbar { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 8px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
  .app-topbar .topbar-controls { justify-self: end; gap: 6px; }
  .app-topbar .nav-pill-container { grid-column: 1 / -1; overflow-x: auto; scrollbar-width: none; }
  .nav-pill-container::-webkit-scrollbar { display: none; }
  .topbar-controls .period-select, .topbar-controls #themeToggleBtn, .sync-time, .pro-link span, .demo-badge { display: none; }
  .zt-wordmark { height: 22px; }
  .page-head h1 { font-size: 22px; }
  .ov-card { max-width: none; padding: 16px 18px; border-radius: 16px; gap: 8px; }
  .ov-card .card-status-badge { display: none; }
  .ov-card-val { font-size: 26px; }
  .hero-num { font-size: 28px; }
  .chart { height: 150px; }
  .ov-page { display: flex; flex-direction: column; gap: 12px; }
  .ov-page > .ov-r1, .ov-page > .ov-r3, .ov-page > .ov-r4 { display: contents; }
  .ov-card { order: 1; } .month { order: 2; } .review-strip { order: 3; } .ov-ops { order: 4; } .ov-cats { order: 5; } .ov-tiles { order: 6; } .ov-tip { order: 7; } .ov-news { order: 8; }
  .ov-tiles { gap: 10px; }
  .tile { padding: 14px; } .tile-val { font-size: 20px; }
  .strip .t { white-space: normal; }
  .txt td.c2, .txt td.c0 { display: none; }
  .txt td.c3 { width: auto; padding-right: 16px; }
  .brow { grid-template-columns: 28px minmax(0,1fr) auto; }
  .brow .bbar { grid-column: 1 / -1; }
  .cf-nums { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .bars { gap: 6px; } .bars .b { width: 22px; }
  .g2 { grid-template-columns: 1fr; }
  .panel { top: auto; left: 0; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; transform: translateY(calc(100% + 32px + env(safe-area-inset-bottom,0px))); }
  .zm-back { padding: 0; align-items: flex-end; }
  .zm { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .zm-body { grid-template-columns: 1fr; }
  .zm-nav { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .bulkbar { left: 12px; right: 12px; transform: none; overflow-x: auto; }
}
@media (min-width: 761px) { .review-strip { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.lg-in { background: #10B981; } .lg-out { background: var(--text-main); }
.ava-dark { background: #0F172A1f; color: #0F172A; } .ava-sky { background: #0EA5E91f; color: #0369A1; }
.logo-bybit { background: #0F172A; color: #F7A600; } .logo-mail { background: #F1F5F9; color: #475569; }
a.nav-pill-btn, a.nav-pill-btn:hover { text-decoration: none; }
.strip .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 760px) {
  .app-topbar { grid-template-columns: minmax(0, auto) minmax(0, 1fr); width: 100%; box-sizing: border-box; }
  .app-topbar > * { min-width: 0; }
  .app-topbar .nav-pill-container { max-width: 100%; }
  .app-topbar .topbar-controls { flex-wrap: nowrap; }
}
@media (max-width: 760px) {
  body header.app-topbar { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 10px 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
  body header.app-topbar nav.nav-pill-container { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  body header.app-topbar .topbar-controls { grid-column: 2; grid-row: 1; justify-self: end; }
}
.strip svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.review-strip { background: var(--warning-bg); }

/* ===== period picker + interactive chart ===== */
.per-wrap { position: relative; }
.per-btn { gap: 6px; } .per-btn svg { width: 14px; height: 14px; color: var(--text-muted); }
.per-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 520px; display: grid; grid-template-columns: 150px 1fr; gap: 0; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; box-shadow: var(--shadow-hover); overflow: hidden; }
.per-pop[hidden] { display: none; }
.per-presets { display: grid; align-content: start; gap: 2px; padding: 10px; background: var(--bg-subtle); }
.per-presets button { text-align: left; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 500 13px var(--font-sans); color: var(--text-main); cursor: pointer; }
.per-presets button[aria-pressed="true"], .per-presets button:hover { background: var(--bg-card); font-weight: 600; }
.per-cal { padding: 12px 14px; display: grid; gap: 8px; }
.per-cal-h { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.per-wd, .per-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.per-wd span { font-size: 11px; color: var(--text-muted); }
.cd { height: 34px; border: 0; border-radius: 8px; background: transparent; font: 500 13px var(--font-sans); color: var(--text-main); cursor: pointer; }
.cd:hover:not([disabled]) { background: var(--bg-subtle); }
.cd.in { background: #F1F5F9; border-radius: 0; }
.cd.edge { background: var(--text-main); color: #fff; border-radius: 8px; }
.cd[disabled] { color: #CBD5E1; cursor: default; }
.per-inputs { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.per-inputs label { display: grid; gap: 4px; }
.per-inputs input { height: 32px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0 8px; font: 500 13px var(--font-sans); color: var(--text-main); }
.per-inputs .btn-brand { height: 32px; }
.note-line { font-size: 12px; color: var(--text-muted); }
.month-top .seg { flex: none; }
.legend-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.lg { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 9999px; border: 1px solid var(--border-subtle); background: var(--bg-card); font: 500 12px var(--font-sans); color: var(--text-main); cursor: pointer; }
.lg i { width: 10px; height: 10px; border-radius: 3px; }
.lg[aria-pressed="false"] { color: var(--text-muted); opacity: .55; }
.lg[aria-pressed="false"] i { background: transparent !important; outline: 1.5px solid #CBD5E1; }
.chart { cursor: crosshair; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 4px; border-radius: 6px; }
.brush { position: absolute; top: 12px; bottom: 22px; background: rgba(15,23,42,.08); border-left: 1px solid #94A3B8; border-right: 1px solid #94A3B8; display: none; pointer-events: none; }
.brush.on { display: block; }
.chart-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.tip-box { min-width: 180px; }
@media (max-width: 760px) {
  .per-pop { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; grid-template-columns: 1fr; }
  .per-presets { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .per-presets button { white-space: nowrap; text-align: center; }
  .month-top { flex-direction: column; }
  .per-btn span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.pill.info { background: #EEF1F5; color: #475569; }
.seg button { white-space: nowrap; }
@media (max-width: 520px) { .month-top .seg { justify-self: stretch; } .seg button { padding: 0 8px; font-size: 12px; } }

/* ===== round 5: several different charts, every mark interactive ===== */
:root { --h0: #F1F5F9; --h1: #DCE5F0; --h2: #B3C5DC; --h3: #7D9BC0; --h4: #46699A; --h5: #1E3A63; --grid: #F1F5F9; --grid-strong: #E2E8F0; }
html.dark { --h0: #1E293B; --h1: #22324A; --h2: #2F4D73; --h3: #44709F; --h4: #6C98C8; --h5: #A9C6E8; --grid: #1E293B; --grid-strong: #334155; }
.viz-tip { position: fixed; z-index: 80; min-width: 190px; max-width: 280px; padding: 9px 11px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-hover); font: 400 12px/1.45 var(--font-sans); color: var(--text-main); pointer-events: none; display: none; }
.viz-tip.on { display: block; }
.viz-tip > div { display: flex; justify-content: space-between; gap: 14px; }
.viz-tip .d { font-weight: 600; margin-bottom: 4px; display: block; }
.viz-tip .sep { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-subtle); }
.viz-tip .hint { display: block; margin-top: 6px; font-size: 11px; }
.ch-r { display: inline-flex; align-items: center; gap: 10px; }
.seg.sm button { height: 26px; padding: 0 10px; font-size: 12px; }
.chip.foc { height: 24px; padding: 0 9px; font-size: 12px; vertical-align: middle; margin-left: 6px; }
.empty-s { padding: 18px 0; font-size: 13px; color: var(--text-muted); text-wrap: pretty; }
[data-go], [data-focus], [data-opid] { cursor: pointer; }
[data-go]:focus-visible, [data-focus]:focus-visible, .whc:focus-visible, .cc:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 1px; }

.ov-r3 { grid-template-columns: 1fr 1fr; align-items: stretch; }
.ov-r5 { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: start; }

/* bullet rows: fact bar, red part over the limit, limit tick, previous-period tick */
.bul { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 6px; padding: 8px 6px; margin: 0 -6px; border-radius: 10px; transition: background-color .15s, opacity .15s; }
.bul:hover, .bul.on { background: var(--bg-subtle); }
.bul.dim { opacity: .4; }
.bul .nm { font-size: 13px; color: var(--text-main); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bul .v { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bul .v small { font-weight: 400; color: var(--text-muted); }
.bt { grid-column: 2 / -1; position: relative; height: 8px; border-radius: 4px; background: var(--bg-subtle); }
.bul:hover .bt, .bul.on .bt { background: var(--border-subtle); }
.bt i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.bt .f { background: var(--text-main); }
.bt .o { background: #DC2626; border-radius: 0 4px 4px 0; }
.bt b, .bul-foot b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; }
.bt .lim, .bul-foot .lim { background: var(--text-main); box-shadow: 0 0 0 1.5px var(--bg-card); }
.bt .pv, .bul-foot .pv { background: #94A3B8; }
.bul-foot { display: flex; align-items: center; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.bul-foot .key, .heat-key .key, .keys .key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.bul-foot b { position: static; display: inline-block; height: 12px; margin: 0; }
.bul-foot .more { margin-left: auto; }

/* diverging change bars */
.dv-axis { display: grid; grid-template-columns: 1fr 1fr; margin-left: 38%; margin-right: 76px; font-size: 11px; color: var(--text-light-2); padding-bottom: 4px; }
.dv-axis span:first-child { text-align: left; } .dv-axis span:last-child { text-align: right; }
.dv { display: grid; grid-template-columns: 38% minmax(0, 1fr) 76px; align-items: center; gap: 10px; padding: 7px 6px; margin: 0 -6px; border-radius: 10px; }
.dv:hover { background: var(--bg-subtle); }
.dv.dim { opacity: .4; }
.dv .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv .v { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.dt { position: relative; height: 14px; }
.dt::before { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--grid-strong); }
.dt i { position: absolute; top: 0; bottom: 0; }
.dt .up { background: var(--text-main); border-radius: 0 4px 4px 0; }
.dt .dn { background: #94A3B8; border-radius: 4px 0 0 4px; }

/* heat scales */
.heat-key { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 12px; font-size: 11px; color: var(--text-muted); }
.heat-key > i { width: 14px; height: 10px; border-radius: 3px; }
.heat-key > span:nth-child(2) { margin-right: 2px; }
.heat-key .key { margin-left: 14px; }
.heat-key .spk { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--text-main); }
.heat-key .typ { width: 2px; height: 12px; background: var(--text-main); }

/* calendar */
.cal-wrap { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.cal-m { flex: 1 1 220px; max-width: 300px; }
.cal-t { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; user-select: none; }
.cw { font-size: 10px; color: var(--text-light-2); text-align: center; padding-bottom: 2px; }
.cc { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 500; touch-action: none; }
.cc.out { color: var(--text-light-2); opacity: .45; background: transparent; }
.cc.spike { box-shadow: inset 0 0 0 2px var(--text-main); }
.cc.rng { box-shadow: inset 0 0 0 2px var(--brand-orange); }
.cc[data-cday]:hover { box-shadow: inset 0 0 0 2px var(--text-muted); }

/* weekday × hour */
.wh { display: grid; grid-template-columns: 30px repeat(var(--nc), minmax(0, 1fr)) minmax(92px, 22%); gap: 2px; align-items: center; }
.wh .wx { font-size: 10px; color: var(--text-light-2); text-align: left; white-space: nowrap; overflow: visible; }
.wh.blk .wx { text-align: center; }
.wh .wx.r { padding-left: 10px; }
.wy { border: 0; background: none; padding: 0; font: 500 12px var(--font-sans); color: var(--text-muted); text-align: left; height: 100%; }
.wy:hover { color: var(--text-main); }
.whc { height: 22px; border-radius: 4px; }
.wh.blk .whc { height: 26px; }
.whc[data-go]:hover { box-shadow: inset 0 0 0 2px var(--text-main); }
.whr { position: relative; height: 12px; margin-left: 10px; margin-right: 58px; border-radius: 3px; background: var(--bg-subtle); }
.whr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--h4); }
.whr b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-main); }
.whr em { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); padding-left: 8px; font: 600 12px var(--font-sans); font-style: normal; white-space: nowrap; }

/* merchants */
.mr-h, .mr { display: grid; grid-template-columns: minmax(150px, 22%) minmax(120px, 24%) minmax(0, 1fr); gap: 16px; align-items: center; }
.mr-h { font-size: 11px; padding-bottom: 6px; }
.mr-tl { display: flex; justify-content: space-between; }
.mr { padding: 5px 0; border-top: 1px solid var(--grid); }
.mr-n { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; font: 500 13px var(--font-sans); color: var(--text-main); text-align: left; min-width: 0; }
.mr-n span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-n:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.mr-b { position: relative; height: 10px; border-radius: 3px; background: var(--bg-subtle); margin-right: 64px; }
.mr-b i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--text-main); }
.mr-b em { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); padding-left: 8px; font: 600 12px var(--font-sans); font-style: normal; white-space: nowrap; }
.mr-t { position: relative; height: 24px; }
.mr-t::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid-strong); }
.mr-t .dot { position: absolute; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--h4); box-shadow: 0 0 0 1.5px var(--bg-card); }
.mr-t .dot.hold { background: var(--bg-card); box-shadow: inset 0 0 0 1.5px var(--h4); }
.mr-t .dot:hover { background: var(--text-main); z-index: 2; }

/* scatter + fees */
.chart.out { height: 320px; cursor: crosshair; touch-action: pan-y; }
.chart.fees { height: 200px; cursor: default; }
.chart.out .ylbl, .chart.fees .ylbl { width: 42px; }
.chart .ptl { font-size: 11px; color: var(--text-muted); transform: translate(8px, -50%); }
.chart .xing { font: 600 11px var(--font-sans); color: #DC2626; transform: translate(-50%, 8px); }
.pt:hover circle:last-child { stroke-width: 3; }
.keys { margin-top: 0; margin-bottom: 4px; gap: 14px; }
.keys .key i { width: 10px; height: 10px; border-radius: 50%; }
.keys .key i.ring { background: transparent; box-shadow: inset 0 0 0 2px var(--text-main); }
.keys .key i.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.wkb:hover rect:nth-child(2), .wkb:hover rect:nth-child(3) { opacity: .75; }

.an-r1 { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .an-r1, .ov-r5 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .ov-r3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .ov-page > .ov-r5 { display: contents; }
  .ov-card { order: 1; } .month { order: 2; } .review-strip { order: 3; } .ov-cats { order: 4; } .ov-delta { order: 5; } .ov-ops { order: 6; } .ov-week { order: 7; } .ov-tiles { order: 8; } .ov-tip { order: 9; } .ov-news { order: 10; }
  .dv { grid-template-columns: 40% minmax(0, 1fr) 64px; } .dv-axis { margin-left: 40%; margin-right: 64px; }
  .mr-h { display: none; }
  .mr { grid-template-columns: minmax(0, 1fr) 42%; row-gap: 4px; padding: 8px 0; }
  .mr-t { grid-column: 1 / -1; }
  .chart.out { height: 260px; }
  .wh { grid-template-columns: 26px repeat(var(--nc), minmax(0, 1fr)) 84px; }
  .whr { margin-right: 0; } .whr em { display: none; }
  .cal-m { max-width: none; }
  .ch-r .more { display: none; }
}
.dv-axis { grid-template-columns: 38% minmax(0, 1fr) 76px; gap: 10px; margin: 0; padding: 0 6px 4px; }
.dv-axis > span:nth-child(2) { display: flex; justify-content: space-between; }
.chart .xing { transform: translate(-100%, 6px); padding-right: 6px; }
@media (max-width: 700px) { .dv-axis { grid-template-columns: 40% minmax(0, 1fr) 64px; margin: 0; } }
.mr-t { margin: 0 12px; }
.chart .ptl { font-weight: 500; }
@media (max-width: 700px) { .ch { flex-wrap: wrap; row-gap: 8px; } .chart .xing { display: none; } }
.keys .key i.cross { background: none; width: 10px; height: 10px; position: relative; }
.keys .key i.cross::before, .keys .key i.cross::after { content: ""; position: absolute; left: 4px; top: -1px; width: 1.5px; height: 12px; background: #94A3B8; transform: rotate(45deg); }
.keys .key i.cross::after { transform: rotate(-45deg); }
.keys .key i.ln { width: 16px; height: 2px; border-radius: 1px; background: var(--text-main); }
.mr-t .dot.ref { background: var(--ok); }
.pt:focus-visible, .wkb:focus-visible, .mr-t .dot:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.whr[data-go]:hover i, .mr-b[data-go]:hover i { opacity: .8; }
@media (max-width: 700px) {
  .wh { grid-template-columns: 26px repeat(var(--nc), minmax(0, 1fr)) 96px; }
  .whr { margin-right: 44px; } .whr em { display: block; font-size: 11px; padding-left: 6px; }
  .mr-h { display: grid; grid-template-columns: 1fr; padding: 0 12px 4px; } .mr-h > span:not(.mr-tl) { display: none; }
}

/* ===== round 6: limits without sliders, category rules, safe selection ===== */
.btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--text-main); background: var(--text-main); color: var(--bg-card); font: 600 13px var(--font-sans); cursor: pointer; white-space: nowrap; }
.btn-dark:not(:disabled):not([aria-disabled="true"]):hover { opacity: .9; }
.btn-ghost.sm { height: 32px; font-size: 12px; padding: 0 10px; }
.btn-ghost .cnt { font-weight: 700; }
.h-sub { font-size: 15px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; margin-left: 6px; }
:where(button, a, input, select, [tabindex]):focus-visible { outline: 2px solid #1E3A63; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#zToast { display: flex; align-items: center; gap: 12px; }
#zToast[hidden] { display: none; }
.t-undo { border: 0; background: none; color: #93C5FD; font: 700 13px var(--font-sans); cursor: pointer; padding: 4px 2px; }

/* budgets */
.b-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; border-bottom: 1px solid var(--grid); }
.b-sum .s { font-size: 12px; color: var(--text-muted); }
.b-free { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--text-muted); }
.brow2 { display: grid; grid-template-columns: 32px minmax(0, 1fr) 112px; gap: 14px; align-items: center; padding: 12px var(--pad-card); border-top: 1px solid var(--grid); }
#bRows > .brow2:first-child { border-top: 0; }
.brow2 .catic { width: 32px; height: 32px; }
.b-main { display: grid; gap: 2px; min-width: 0; }
.b-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.b-top .nm { font-size: 14px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-fig { font-size: 14px; white-space: nowrap; }
.b-bar { height: 6px; border-radius: 3px; background: var(--bg-subtle); overflow: hidden; }
.b-bar i { display: block; height: 100%; border-radius: 3px; background: var(--h4); }
.b-bar.over i { background: #DC2626; }
.b-st { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.b-st [data-cover] { margin-left: auto; flex: none; }
.b-st .pos, .b-st .neg { font-weight: 600; }
.warn-t { color: #B45309; }
.lim-btn { justify-self: end; display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 104px; justify-content: flex-end; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card); font: 700 15px var(--font-sans); color: var(--text-main); cursor: pointer; font-variant-numeric: tabular-nums; }
.lim-btn svg { width: 14px; height: 14px; color: var(--text-muted); }
.lim-btn:hover { border-color: var(--text-muted); background: var(--bg-hover); }
.b-free-g { border-top: 1px solid var(--grid); }
.b-free-g summary { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--pad-card); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); list-style: none; }
.b-free-g summary::-webkit-details-marker { display: none; }
.b-free-g summary svg { width: 16px; height: 16px; transition: transform .15s; }
.b-free-g[open] summary svg { transform: rotate(180deg); }
.brow2.free .btn-ghost { justify-self: end; }

/* limit editor */
.lim-ed { position: absolute; z-index: 76; width: 360px; padding: 16px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-hover); display: grid; gap: 12px; }
.lim-ed.menu { width: 320px; padding: 10px; gap: 2px; }
.lim-ed.menu .le-h { padding: 4px 6px 8px; }
.lim-ed.menu .opt { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: 10px; background: none; font: 500 14px var(--font-sans); color: var(--text-main); text-align: left; cursor: pointer; }
.lim-ed.menu .opt:hover { background: var(--bg-subtle); }
.le-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.le-h b { font-size: 15px; }
.le-h .muted { font-size: 12px; }
.le-f { position: relative; display: block; }
.le-f input { width: 100%; height: 48px; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0 40px 0 14px; font: 700 22px var(--font-sans); color: var(--text-main); background: var(--bg-card); font-variant-numeric: tabular-nums; }
.le-f input:focus { outline: none; border-color: #1E3A63; box-shadow: 0 0 0 3px rgba(30,58,99,.15); }
.le-f .cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 600 16px var(--font-sans); color: var(--text-muted); }
.le-err { min-height: 0; font-size: 13px; color: #DC2626; }
.le-err:empty { display: none; }
.le-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.le-chips button { height: 30px; padding: 0 10px; border-radius: 9999px; border: 1px solid var(--border-subtle); background: var(--bg-subtle); font: 500 12px var(--font-sans); color: var(--text-main); cursor: pointer; white-space: nowrap; }
.le-chips button:hover { border-color: var(--text-muted); }
.le-scope { display: grid; grid-template-columns: 1fr 1fr; }
.le-note { margin: -4px 0 0; font-size: 12px; color: var(--text-muted); }
.le-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.le-act > span { display: flex; gap: 8px; }
.le-del { color: #B91C1C; }
.lim-ed.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90; }
.lim-ed.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border-focus); justify-self: center; margin-bottom: 4px; }
.lim-ed.sheet .le-f input { height: 56px; font-size: 30px; text-align: center; padding: 0 40px; }
.lim-ed.sheet .le-chips { flex-wrap: wrap; }
.lim-ed.sheet .le-act button { height: 48px; }
.lim-ed.sheet .le-act > span { flex: 1; justify-content: flex-end; }
#scrim.le { z-index: 85; }

/* category picker, step 2 */
.popover .opt svg:last-child:not(:first-child) { margin-left: auto; }
.pk2 { display: grid; gap: 10px; padding: 6px; font-size: 13px; }
.pk2 p { margin: 0; color: var(--text-main); line-height: 1.45; }
.pk2-ok { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); }
.pk2-ok svg { width: 16px; height: 16px; }
.pk2-a { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pk2 .more { justify-self: start; padding: 0; }
.popover.up { position: fixed; bottom: 150px; top: auto; }

/* rules */
.rules-pg .back { justify-self: start; padding: 0; margin-bottom: -12px; }
.rules-pg .back svg { width: 14px; height: 14px; }
.rl-hint { margin: -8px 0 0; font-size: 13px; color: var(--text-muted); }
.rl { display: grid; grid-template-columns: 20px 22px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--grid); background: var(--bg-card); }
.rl:first-child { border-top: 0; border-radius: 16px 16px 0 0; }
.rl.off .rl-p { opacity: .5; }
.rl.drag { opacity: .5; } .rl.dropto { box-shadow: inset 0 2px 0 #1E3A63; }
.rl-grip { color: var(--text-light-2); cursor: grab; display: grid; } .rl-grip svg { width: 16px; height: 16px; }
.rl-n { font: 700 13px var(--font-sans); color: var(--text-muted); text-align: center; }
.rl-t { min-width: 0; display: grid; gap: 4px; }
.rl-p { font-size: 14px; line-height: 1.9; color: var(--text-main); }
.rl-p .pl { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--bg-subtle); font-weight: 600; }
.rl-p .catic { width: 22px; height: 22px; vertical-align: middle; margin: 0 4px; } .rl-p .catic svg { width: 12px; height: 12px; }
.rl-s { font-size: 12px; }
.rl-a { display: flex; gap: 6px; align-items: center; }
.rl-a .iconbtn { width: 32px; height: 32px; } .rl-a .iconbtn[disabled] { opacity: .35; cursor: default; }
.rl-h { font-size: 15px; font-weight: 600; margin: 8px 0 10px; }
.rl-sug { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; margin-bottom: 8px; border-radius: 14px; background: var(--bg-card); border: 1px dashed var(--border-focus); font-size: 14px; }
.rl-sug .muted { font-size: 12px; margin-top: 3px; }
#rlList .empty-s { padding: 24px 20px; }

/* rule editor */
.rule-ed { width: min(720px, 100%); }
.re-h { margin: 4px 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.re-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.re-row label { font-size: 13px; font-weight: 600; }
.re-row input, .re-row select { height: 38px; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0 10px; font: 500 14px var(--font-sans); color: var(--text-main); background: var(--bg-card); min-width: 0; }
.re-row input::placeholder { color: var(--ink-3); opacity: 1; }
.re-row input:only-of-type:last-child, .re-row > select:last-child:nth-child(2) { grid-column: 2 / -1; }
.re-row #reMcc, .re-row #reCo, .re-row #reCat { grid-column: 2 / -1; }
#reMv::-webkit-calendar-picker-indicator { display: none; }
.re-row input:focus, .re-row select:focus { outline: none; }
.re-pv { border-radius: 12px; background: var(--bg-subtle); padding: 12px; font-size: 13px; display: grid; gap: 8px; }
.pv-t { display: grid; gap: 0; }
.pv-r { display: grid; grid-template-columns: 56px minmax(0, 1fr) 70px; column-gap: 8px; row-gap: 2px; padding: 8px 0; }
.pv-r + .pv-r { border-top: 1px solid var(--line, var(--well)); }
.pv-c { font-size: 12px; color: var(--ink-3); }
.pv-c b { color: var(--ink); }
.pv-r > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-r > .pv-c { grid-column: 2 / -1; white-space: normal; overflow: visible; }
.pv-r .num { text-align: right; }
.re-past { display: flex; gap: 8px; align-items: center; font-size: 14px; padding-bottom: 12px; }
.re-past input { width: 18px; height: 18px; }
.zm.confirm { width: min(520px, 100%); }
.zm.confirm p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }

/* operations: selection zone, chevron, bar */
.txt td.c0 { width: 48px; padding: 0; }
.selz { display: grid; place-items: center; width: 48px; min-height: 52px; height: 100%; cursor: default; }
.txt tr.r td.c0:hover { background: var(--bg-subtle); }
.selz input { width: 18px; height: 18px; margin: 0; pointer-events: none; accent-color: #0F172A; }
.txt td.c4 { width: 44px; padding: 0 8px 0 0; }
.chev { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-light-2); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.chev svg { width: 16px; height: 16px; }
.txt tr.r:hover .chev, .txt tr.r:focus-within .chev, body.selmode .chev { opacity: 1; }
.chev:hover { background: var(--bg-subtle); color: var(--text-main); }
.txt tr.r.sel { background: #EEF2F7; }
.txt tr.r:focus-visible { outline: 2px solid #1E3A63; outline-offset: -2px; }
body.selmode .txt tr.r { cursor: default; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.selall { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: 500 13px var(--font-sans); color: var(--text-muted); cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.selall input { width: 16px; height: 16px; margin: 0; pointer-events: none; accent-color: #0F172A; }
body:not(.selmode) .selall { display: none; }
#selStart { display: none; }
.selbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-card); }
.selbar[hidden] { display: none; }
.sel-n { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.sel-a { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tx-top.sel { pointer-events: none; }

@media (max-width: 1100px) { .b-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .brow2 { grid-template-columns: 28px minmax(0, 1fr); padding: 12px 16px; }
  .brow2 .catic { width: 28px; height: 28px; }
  .brow2 .lim-btn, .brow2.free .btn-ghost { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; height: 44px; }
  .lim-btn::before { content: "Лимит"; font: 500 13px var(--font-sans); color: var(--text-muted); margin-right: auto; }
  .b-sum { padding: 16px; gap: 12px; }
  .b-sum .v { font-size: 20px; }
  .rl { grid-template-columns: 22px minmax(0, 1fr) auto; padding: 14px 16px; align-items: start; }
  .rl-n { line-height: 24px; margin-top: 3px; }
  #page-rules .back { display: block; margin-bottom: 12px; }
  .rl-grip { display: none; }
  .rl-a { grid-column: 1 / -1; flex-wrap: wrap; }
  .rl-sug { flex-direction: column; align-items: stretch; }
  .re-row { grid-template-columns: 1fr 1fr; } .re-row label { grid-column: 1 / -1; }
  .re-row #reMcc, .re-row #reCo, .re-row #reCat, .re-row input:only-of-type:last-child { grid-column: 1 / -1; }
  .pv-r { grid-template-columns: 48px minmax(0, 1fr) 60px; } .pv-c { grid-column: 2 / -1; }
  #rlNew { height: 44px; }
  #selStart { display: inline-flex; height: 36px; }
  body.selmode #selStart { display: none; }
  .txt td.c4 { display: none; }
  body.selmode .txt td.c0 { display: table-cell; width: 44px; }
  body.selmode .selz { width: 44px; min-height: 64px; }
  .selbar { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; z-index: 60; box-shadow: var(--shadow-hover); }
  .sel-a { width: 100%; margin: 0; } .sel-a button { flex: 1; height: 44px; }
  body.selmode .page-inner { padding-bottom: 120px; }
  .page-head .page-actions a.btn-ghost { order: 2; }
}
#zToast:not([hidden]) { opacity: 1; transform: none; pointer-events: auto; font-size: 13px; }
@media (max-width: 700px) { #zToast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; } body.selmode #zToast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); } }
a.btn-ghost, a.btn-dark { text-decoration: none; color: var(--text-main); }
.mb { display: none; }
@media (max-width: 700px) { .dk { display: none; } .mb { display: inline; } }
@media (max-width: 760px) { #selStart { display: inline-flex; height: 36px; } body.selmode #selStart { display: none; } body.selmode .txt td.c0 { display: table-cell; width: 44px; } body.selmode .selz { width: 44px; min-height: 64px; } }
/* cash flow: fixed month slots */
.chart.cf { height: 280px; cursor: default; margin-top: 8px; }
.chart.cf .ylbl { width: 46px; }
.cfm .cfbg { fill: transparent; }
.cfm[data-cfm] { cursor: pointer; }
.cfm[data-cfm]:hover .cfbg { fill: var(--bg-subtle); }
.cfm.on .cfbg { fill: var(--bg-subtle); stroke: var(--grid-strong); }
.cfm:focus-visible { outline: none; } .cfm:focus-visible .cfbg { stroke: #1E3A63; stroke-width: 2; }
.chart .cfv { font: 600 11px var(--font-sans); color: var(--text-muted); transform: translate(-50%, -130%); }
.chart .cfx { bottom: 22px; font: 500 12px var(--font-sans); color: var(--text-muted); }
.chart .cfx.on { color: var(--text-main); font-weight: 700; }
.chart .cfnet { font: 600 12px var(--font-sans); transform: translate(-50%, 0); }
.chart .cfnet.pos { color: var(--ok); } .chart .cfnet.neg { color: #DC2626; }
.keys .key i.dash { background: none; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.cf-nums { border-top: 1px solid var(--grid); padding: 16px var(--pad-card) 20px; }
.cf-sel { grid-column: 1 / -1; font-size: 14px; font-weight: 600; }
.cf-nums .s { font-size: 12px; }
@media (max-width: 700px) { .chart.cf { height: 240px; } .chart .cfv { display: none; } .chart .cfnet { font-size: 10px; } }

/* ===== round 8/9: liquid glass limit sliders ===== */
@property --f-lim { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --f-sp { syntax: '<number>'; inherits: true; initial-value: 0; }
:root { --sl-track: #E8EDF3; --sl-spent: var(--h4); --sl-left: #10B981; --sl-over: #DC2626; --sl-shadow: rgba(15,23,42,.26); --sl-tick: rgba(15,23,42,.34); --sl-lens-bg: linear-gradient(180deg, #FFFFFF 0%, #F3F6FA 100%); }
html.dark { --sl-track: rgba(255,255,255,.08); --sl-spent: #6C98C8; --sl-left: #34D399; --sl-over: #F87171; --sl-shadow: rgba(0,0,0,.6); --sl-tick: rgba(255,255,255,.4); --sl-lens-bg: linear-gradient(180deg, #1B2433 0%, #111827 100%); }
.brow2 { overflow-x: clip; }
.brow2:not(.free) { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
.brow2:not(.free) > .catic { margin-top: 0; }
.b-main { gap: 2px; }
.b-top { align-items: center; min-height: 32px; }
.b-fig { display: inline-flex; align-items: center; gap: 6px; }
.brow2 .b-fig .lim-btn { position: relative; justify-self: auto; grid-column: auto; height: 30px; min-width: 0; padding: 0 10px 0 11px; gap: 6px; justify-content: center; border: 0; border-radius: 999px; background: var(--bg-subtle); font: 700 14px var(--font-sans); color: var(--text-main); font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .15s; }
.brow2 .b-fig .lim-btn::before { content: none; }
.brow2 .b-fig .lim-btn::after { content: ""; position: absolute; inset: -7px -4px; }
.brow2 .b-fig .lim-btn svg { width: 13px; height: 13px; opacity: .65; color: var(--text-muted); transition: opacity .15s; }
.brow2 .b-fig .lim-btn:hover, .brow2 .b-fig .lim-btn:focus-visible { background: var(--border-subtle); }
.brow2 .b-fig .lim-btn:hover svg, .brow2 .b-fig .lim-btn:focus-visible svg { opacity: 1; }
.sl { --pad: 24px; --h: 10px; --tw: 48px; --th: 32px; --slh: 44px; --mx: 1; --my: 1; position: relative; height: var(--slh); touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  --xl: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--f-lim)); --xs: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--f-sp)); }
.sl.glide { transition: --f-lim 200ms cubic-bezier(.2,.8,.2,1), --f-sp 200ms cubic-bezier(.2,.8,.2,1); }
.sl.glide.slow { transition-duration: 240ms; }
.sl-track { position: absolute; left: 0; right: 0; top: calc((var(--slh) - var(--h)) / 2); height: var(--h); border-radius: 999px; background: var(--sl-track); box-shadow: inset 0 1px 2px rgba(15,23,42,.06); }
.sl-seg { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.sl-spent { left: 0; width: calc(min(var(--f-sp) * 1000, 1) * (var(--pad) + (100% - 2 * var(--pad)) * min(var(--f-sp), var(--f-lim)))); background: var(--sl-spent); z-index: 1; }
.sl-left { left: calc(var(--xs) - var(--h) / 2); right: calc(100% - var(--xl)); background: var(--sl-left); }
.sl-over { left: calc(var(--xl) - var(--h) / 2); right: calc(100% - var(--xs)); background: var(--sl-over); display: none; }
.sl.is-over .sl-left { display: none; }
.sl.is-over .sl-over { display: block; }
.sl.is-over .sl-spent { z-index: 2; }
/* History labels remain visible; near-thumb labels still avoid the lens. */
.sl-tick { position: absolute; z-index: 3; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; border-radius: 1px; left: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--f)); background: rgba(255,255,255,.75); box-shadow: 0 0 0 .5px var(--sl-tick); transition: background .15s; }
.sl-tick[hidden], .sl-tick span[hidden] { display: none; }
.sl-tick.on { background: #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.6); }
.sl-tick.pulse { animation: slPulse 120ms ease-out; }
@keyframes slPulse { 50% { transform: scaleY(1.3); } }
.sl-tick span { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); font: 500 11px/1 var(--font-sans); color: var(--text-light, #94A3B8); white-space: nowrap; opacity: 1; transition: opacity .15s; pointer-events: none; }
.sl-tick.on span { color: var(--text-main); }
.sl:is(.is-drag, :focus-within) .sl-tick:not(.near) span { opacity: 1; }
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .sl:hover .sl-tick:not(.near) span { opacity: 1; }
}
/* glass thumb: a lens over a magnified copy of the fill */
.sl-th { position: absolute; z-index: 4; top: calc((var(--slh) - var(--th)) / 2); left: var(--xl); width: var(--tw); height: var(--th); margin-left: calc(var(--tw) / -2); border-radius: 999px; cursor: grab; touch-action: none; outline: none;
  transform: scale(var(--s, 1));
  transition: transform 380ms linear(0, .063, .204, .373, .537, .681, .796, .883, .944, .985, 1.008, 1.021, 1.025, 1.025, 1.022, 1.017, 1.013, 1.009, 1.006, 1.004, 1.002, 1.001, 1, 1, 1); }
@supports not (transition-timing-function: linear(0, 1)) { .sl-th { transition-timing-function: cubic-bezier(.3, 1.25, .5, 1); } }
.sl-th::before { content: ""; position: absolute; inset: -7px -4px; border-radius: 24px; }
.sl-th::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 1px rgba(20,24,40,.16), inset 0 0 0 1px rgba(255,255,255,.85); opacity: 0; transform: scale(.96); transition: opacity var(--t-fast), transform var(--t-mid) var(--ease-out); }
.sl.is-drag .sl-th::after { opacity: 1; transform: scale(1); }
.sl-lens { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; background: rgba(255,255,255,.18); box-shadow: 0 0 0 .5px rgba(15,23,42,.10), 0 1.5px 3px rgba(15,23,42,.10), 0 6px 14px -5px var(--sl-shadow); transition: box-shadow 200ms ease-out; }
.sl-lens-in { position: absolute; top: calc((var(--th) - var(--h)) / 2); width: var(--slw, 600px); height: var(--h); border-radius: 0; background: var(--sl-track);
  left: calc(var(--tw) / 2 - var(--pad) - (var(--slw, 600px) - 2 * var(--pad)) * var(--f-lim));
  transform-origin: calc(var(--pad) + (var(--slw, 600px) - 2 * var(--pad)) * var(--f-lim)) 50%;
  transform: scale(var(--mx), var(--my)); transition: transform 380ms cubic-bezier(.3, 1.3, .5, 1); }
.sl-lens-in .sl-seg { border-radius: 0; box-shadow: inset 0 2px 3px -1px rgba(255,255,255,.35), inset 0 -2px 3px -1px rgba(0,0,0,.12); }
.sl-body { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(90% 70% at 32% 8%, rgba(255,255,255,.75) 0%, rgba(255,255,255,.18) 38%, rgba(255,255,255,0) 60%), linear-gradient(180deg, rgba(255,255,255,0) 62%, rgba(255,255,255,.34) 100%);
  box-shadow:
    inset 1.25px 1.25px 0 -.25px rgba(255,255,255,1),
    inset -1px -1px 0 -.25px rgba(255,255,255,.75),
    inset 0 0 5px 0 rgba(15,23,42,.10),
    inset 0 0 1px 1px rgba(255,255,255,.55);
  transition: box-shadow 200ms ease-out, opacity 200ms ease-out; }
html.dark .sl-body { background: radial-gradient(90% 70% at 32% 8%, rgba(255,255,255,.28) 0%, rgba(255,255,255,.06) 40%, rgba(255,255,255,0) 60%); box-shadow: inset 1px 1px 0 -.25px rgba(255,255,255,.7), inset -1px -1px 0 -.25px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,.35); }
/* coloured refraction along the edges: the fill colour bends into the rim */
.sl-rim { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .9;
  box-shadow: inset 3px 0 4px -2px color-mix(in srgb, var(--rim-a, var(--sl-spent)) 55%, transparent), inset -3px 0 4px -2px color-mix(in srgb, var(--rim-b, var(--sl-left)) 42%, transparent), inset 0 -5px 6px -4px color-mix(in srgb, var(--rim-b, var(--sl-left)) 18%, transparent); }
/* pressed: the capsule swells on a spring, the lens magnifies more, the glass clears and lifts */
.sl.is-drag .sl-th { --s: 1.10; cursor: grabbing; }
.sl.is-drag .sl-lens-in { --mx: 1.04; --my: 1.04; }
.sl.is-drag .sl-lens { background: rgba(255,255,255,.18); box-shadow: 0 0 0 .5px rgba(15,23,42,.08), 0 3px 5px rgba(15,23,42,.08), 0 12px 22px -6px var(--sl-shadow); }
.sl.is-drag .sl-body { box-shadow: inset 1.5px 1.5px 0 -.25px #fff, inset -1px -1px 0 -.25px rgba(255,255,255,.9), inset 0 0 4px 0 rgba(15,23,42,.07), inset 0 0 1px 1px rgba(255,255,255,.7); }
.sl-th.kf .sl-lens { box-shadow: 0 0 0 .5px rgba(15,23,42,.10), 0 6px 14px -5px var(--sl-shadow), 0 0 0 3px var(--bg-card), 0 0 0 5px #3B82F6; }
.sl .sl-th:focus, .sl .sl-th:focus-visible { outline: none !important; }
/* SLIDER-SPEC 3.6: keep the bubble above the thumb and the live status below it. */
.sl-tip { position: absolute; z-index: 5; top: auto; bottom: calc(var(--slh) / 2 + var(--th) * .55 + 6px); left: 0; transform: translate(var(--tip-x, 0px), 4px); padding: 4px 9px; border-radius: 9px; background: #0F172A; color: #fff; font: 600 13px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; pointer-events: none; box-shadow: 0 4px 12px -4px rgba(15,23,42,.4); transition: opacity 100ms ease-out, transform 120ms ease-out; }
.sl-tip::after { content: ""; position: absolute; top: 100%; bottom: auto; left: var(--tip-a, 50%); margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ctl); }
.sl:is(.is-drag, :has(.sl-th.kf)) .sl-tip { opacity: 1; transform: translate(var(--tip-x, 0px), 0); transition-duration: 120ms; }
.sl + .b-st { min-height: 28px; }
.sl.is-drag .sl-tip { transition-property: opacity; }
html.dark .sl-tip { background: #F8FAFC; color: #0B0F19; } html.dark .sl-tip::after { border-top-color: #F8FAFC; }
.brow2.free .btn-ghost svg { width: 14px; height: 14px; margin-right: 4px; }
.brow2.fresh { animation: slFresh 1.6s ease-out; }
@keyframes slFresh { 0%, 40% { background: rgba(16,185,129,.08); } 100% { background: transparent; } }
.t-ext { color: #fff; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .sl-th, .sl-tip, .sl-lens-in { transition: none; } .sl.is-drag .sl-th { --s: 1.10; } .sl-tick.pulse, .brow2.fresh { animation: none; } }
@media (prefers-reduced-transparency: reduce) { .sl-body, .sl-rim { display: none; } }
@media (forced-colors: active) { .sl-lens { background: Canvas; border: 2px solid ButtonText; } .sl-lens-in, .sl-body, .sl-rim { display: none; } }
@media (max-width: 760px) {
  .sl { --h: 10px; --tw: 44px; --th: 30px; --pad: 22px; --slh: 44px; }
  .sl-th::before { inset: -8px -4px; }
  .brow2:not(.free) { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .brow2:not(.free) .catic { margin-top: 2px; }
  .brow2:not(.free) .b-top .nm { white-space: normal; line-height: 1.3; }
  .brow2:not(.free) .b-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .brow2:not(.free) .b-top .b-fig { font-size: 13px; }
  .brow2 .b-fig .lim-btn { height: 30px; font-size: 14px; justify-self: auto; grid-column: auto; }
  .brow2 .b-fig .dk { display: inline; }
}
/* J8: the side column follows the list; a second card fills it */
.b-side { display: grid; gap: 24px; align-content: start; position: sticky; top: 24px; }
.b-side:has(#drill:not([hidden])) { position: static; }
.bc-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 5px; align-items: center; padding: 7px 0; }
.bc-row + .bc-row { border-top: 1px solid var(--grid); }
.bc-row .catic { width: 24px; height: 24px; grid-row: span 2; }
.bc-row .catic svg { width: 13px; height: 13px; }
.bc-row .nm { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-row .d { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bc-bars { grid-column: 2 / 4; display: grid; gap: 3px; }
.bc-bars i { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.bc-bars .s { background: var(--h4); }
.bc-bars .a { background: #CBD5E1; }
html.dark .bc-bars .a { background: #475569; }
.bc-key { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.bc-key i { display: inline-block; width: 12px; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
/* heatmap: the usual-level mark is readable next to the value bar */
.whr b { width: 3px; margin-left: -1.5px; border-radius: 2px; box-shadow: 0 0 0 1.5px var(--bg-card); }
.heat-key .typ { width: 3px; border-radius: 2px; }

/* ===== R8: in-place drill-down panel "Разбор" (one per page, under the source chart; bottom sheet on phones) ===== */
.drill { position: relative; overflow: visible; animation: drIn .18s ease-out both; }
.drill[hidden] { display: none; }
.drill.out { animation: drOut .14s ease-in both; }
@keyframes drIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes drOut { to { opacity: 0; transform: translateY(4px); } }
.drill:not(.sheet)::before { content: ''; position: absolute; top: -8px; left: var(--nose, 50%); width: 14px; height: 14px; margin-left: -7px; background: var(--bg-card); border-left: 1px solid var(--border-subtle); border-top: 1px solid var(--border-subtle); transform: rotate(45deg); border-radius: 3px 0 0 0; }
.dr-grab { display: none; }
.dr-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 14px var(--pad-card) 0; }
.dr-hl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dr-hl h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-chip { flex: none; height: 28px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.dr-hr { display: flex; align-items: center; gap: 14px; flex: none; }
.dr-sum { padding: 10px var(--pad-card) 4px; }
.dr-bigrow { display: flex; align-items: center; justify-content: flex-start; gap: 8px 16px; flex-wrap: wrap; }
#drillSum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dr-num { font: 600 32px/1.1 var(--font-sans); letter-spacing: -.01em; color: var(--text-main); font-variant-numeric: tabular-nums; }
.dr-of { font-size: 13px; color: var(--text-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dr-cmprow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 4px; }
.dr-cmp { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bg-subtle); font: 600 12px var(--font-sans); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-cmp.bad { color: var(--danger); background: var(--danger-bg, #FEF2F2); }
.dr-cmp.good { color: var(--ok); background: var(--success-bg, #ECFDF5); }
.dr-cmp.muted { font-weight: 500; }
.dr-meta { margin-top: 6px; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dr-note { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.dr-lim { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg-subtle); }
.dr-limbar { display: flex; gap: 2px; height: 10px; }
.dr-limbar i { display: block; flex-grow: 0; flex-shrink: 1; min-width: 4px; border-radius: 999px; }
.dr-limbar .sel, .dr-limk .sel { background: var(--text-main); }
.dr-limbar .rest, .dr-limk .rest { background: #CBD5E1; }
.dr-limbar .left, .dr-limk .left { background: var(--ok); }
.dr-limbar .over, .dr-limk .over { background: var(--danger); }
.dr-limt { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.dr-limt b { color: var(--text-main); font-weight: 600; }
.dr-limt .pos, .dr-limt .neg { font-weight: 600; }
.dr-limk { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.dr-limk span { display: inline-flex; align-items: center; gap: 6px; }
.dr-limk i { width: 10px; height: 6px; border-radius: 999px; display: inline-block; }
.dr-wkw { margin-top: 14px; }
.dr-wkh { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.dr-wkh .muted { font-weight: 400; }
.dr-wk { display: flex; gap: 6px; max-width: 560px; }
.dr-wkb { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: 16px 44px 16px; gap: 3px; padding: 4px 2px; border: 0; background: none; cursor: pointer; border-radius: 8px; font: inherit; }
.dr-wkb:hover { background: var(--bg-subtle); }
.dr-wkb em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dr-wkb .b { display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border-subtle); }
.dr-wkb .b i { display: block; width: min(28px, 70%); border-radius: 4px 4px 1px 1px; background: #94A3B8; }
.dr-wkb small { font-size: 11px; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-wk.has .dr-wkb:not([aria-pressed="true"]) .b i { background: #CBD5E1; }
.dr-wkb[aria-pressed="true"] .b i { background: var(--text-main); }
.dr-wkb[aria-pressed="true"] em, .dr-wkb[aria-pressed="true"] small { color: var(--text-main); }
.dr-tops { padding: 8px var(--pad-card) 4px; }
.dr-tabs { display: none; margin-bottom: 8px; }
.dr-tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 32px; }
.dr-tcols.one { grid-template-columns: 1fr; }
.dr-tch { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 6px 0 4px; }
.dr-tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto 3px; column-gap: 10px; row-gap: 4px; align-items: center; width: 100%; padding: 6px; margin: 0 -6px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; color: var(--text-main); box-sizing: content-box; }
.dr-tr:hover { background: var(--bg-subtle); }
.dr-tr[aria-pressed="true"] { background: var(--bg-subtle); box-shadow: inset 0 0 0 1.5px var(--text-main); }
.dr-tr .catic, .dr-tr .ava { grid-row: 1 / 3; width: 28px; height: 28px; }
.dr-tr .nm { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-tr .num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dr-tb { grid-column: 2 / 4; height: 3px; border-radius: 2px; background: var(--bg-subtle); overflow: hidden; }
.dr-tb i { display: block; height: 100%; background: var(--text-muted); border-radius: 2px; }
.dr-flt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px var(--pad-card) 10px; margin-top: 8px; border-top: 1px solid var(--bg-subtle); }
.dr-flt[hidden] { display: none; }
.dr-q { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-muted); flex: 1 1 280px; max-width: 320px; min-width: 0; }
.dr-q:focus-within { border-color: var(--text-main); }
.dr-q svg { width: 15px; height: 15px; flex: none; }
.dr-q input { border: 0; outline: 0; background: none; font: 500 13px var(--font-sans); color: var(--text-main); width: 100%; min-width: 0; }
.dr-chips { display: contents; }
.dr-flt .chip { height: 32px; }
.dr-flt select { height: 32px; padding: 0 28px 0 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--bg-card); font: 500 13px var(--font-sans); color: var(--text-main); max-width: 200px; }
.dr-lists { padding: 0 0 4px; }
.dr-lh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px var(--pad-card) 2px; font-size: 13px; color: var(--text-muted); }
.dr-lh b { color: var(--text-main); font-weight: 600; }
.dr-cols.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1px; background: var(--bg-subtle); }
.dr-cols.two .dr-col { background: var(--bg-card); min-width: 0; }
.dr-colh { display: flex; justify-content: space-between; gap: 8px; padding: 10px var(--pad-card) 6px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.dr-dayh { display: flex; justify-content: space-between; padding: 14px var(--pad-card) 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.dr-dayh .num { color: var(--text-main); font-variant-numeric: tabular-nums; }
.dr-op { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 8px var(--pad-card); cursor: pointer; border-top: 1px solid var(--bg-subtle); }
.dr-op:hover { background: var(--bg-hover); }
.dr-op:focus-visible { outline: 2px solid var(--text-main); outline-offset: -2px; }
.dr-op .op-a { font-variant-numeric: tabular-nums; }
.dr-op.dec .op-m b { color: var(--text-muted); }
.tag-p.tag-x { background: var(--bg-subtle); color: var(--text-muted); }
.tag-p.tag-r { background: #ECFDF5; color: var(--ok); }
.op-m b .tag-p:not(.tag-x):not(.tag-r) { background: #FEF3C7; color: #B45309; }
.dr-more { margin: 10px var(--pad-card) 4px; }
.dr-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px var(--pad-card); font-size: 13px; }
.dr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--pad-card) 16px; font-size: 12px; border-top: 1px solid var(--bg-subtle); }
.dr-foot:empty { display: none; }
.dr-scrim { position: fixed; inset: 0; z-index: 58; background: rgba(15,23,42,.24); display: none; }
.dr-scrim.on { display: block; }
/* selection on the charts: chosen marks keep full opacity + an outline, the rest fade */
.dr-on .cc[data-cday]:not(.dr-sel), .dr-on .whc:not(.dr-sel), .dr-on .dv:not(.dr-sel), .dr-on rect.wb:not(.dr-sel), .dr-on .pt:not(.dr-sel), .dr-on .mr:not(.dr-sel) { opacity: .35; }
.dr-on .cc, .dr-on .whc, .dr-on .dv, .dr-on .wb, .dr-on .pt, .dr-on .mr { transition: opacity .15s; }
.cc.dr-sel, .whc.dr-sel { box-shadow: 0 0 0 2px var(--text-main); position: relative; z-index: 1; }
.dv.dr-sel, .bul.dr-sel { background: var(--bg-subtle); box-shadow: inset 0 0 0 1.5px var(--text-main); border-radius: 10px; }
rect.wb.dr-sel { stroke: var(--text-main); stroke-width: 2; }
.pt.dr-sel circle:last-child { stroke: var(--text-main); stroke-width: 2.5; }
.wy.dr-sel, .whr.dr-sel { color: var(--text-main); font-weight: 700; }
.whr.dr-sel { box-shadow: inset 0 0 0 1.5px var(--text-main); border-radius: 6px; }
.mr.dr-sel .mr-b { box-shadow: inset 0 0 0 1.5px var(--text-main); border-radius: 6px; }
.brush.sel { display: block; background: rgba(15,23,42,.07); border-color: var(--text-main); border-radius: 4px; }
html.dark .brush.sel { background: rgba(248,250,252,.10); }
.chart .drx { bottom: -6px; padding: 2px 7px; border-radius: 6px; background: var(--text-main); color: var(--bg-card); font-weight: 600; z-index: 2; }
/* Overview categories: magnifier "Разобрать" inside the row, keeps the focus click on the rest */
.bul-dr { width: 28px; height: 28px; margin: -4px -2px -4px 4px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-light-2); cursor: pointer; vertical-align: middle; opacity: 0; transition: opacity .15s, background-color .15s; }
.bul:hover .bul-dr, .bul:focus-within .bul-dr, .bul-dr.dr-sel, .bul-dr:focus-visible { opacity: 1; }
.bul-dr:hover { background: var(--bg-card); color: var(--text-main); }
.bul-dr.dr-sel { color: var(--text-main); background: var(--bg-card); }
.bul-dr svg { width: 15px; height: 15px; }
@media (pointer: coarse) { .bul-dr { opacity: 1; } }
#cfOut .rank-row[data-drcat] { cursor: pointer; border-radius: 10px; }
#cfOut .rank-row[data-drcat]:hover { background: var(--bg-subtle); }
/* r22 V12 (J9): income rows are role=button and expand in place, so they get the same pointer and hover as the «Куда ушло» rows. */
#cfIn .rank-row[data-cf-in] { cursor: pointer; border-radius: 10px; }
#cfIn .rank-row[data-cf-in]:hover { background: var(--bg-subtle); }
#cfOut .rank-row[aria-pressed="true"] { background: var(--bg-subtle); box-shadow: inset 0 0 0 1.5px var(--text-main); }
@media (max-width: 760px) {
  .drill.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; margin: 0; width: auto; height: 55vh; height: 55dvh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; border: 0; box-shadow: 0 -8px 32px rgba(15,23,42,.12); padding-bottom: env(safe-area-inset-bottom, 0px); animation: drUp .26s cubic-bezier(.2,.8,.2,1) both; transition: height .26s cubic-bezier(.2,.8,.2,1); }
  .drill.sheet.drag { transition: none; }
  .drill.sheet.full { height: 92vh; height: 92dvh; }
  .drill.sheet.out { animation: drDown .18s ease-in both; }
  @keyframes drUp { from { transform: translateY(100%); } }
  @keyframes drDown { to { transform: translateY(100%); } }
  .drill.sheet .dr-grab { display: flex; justify-content: center; padding: 8px 0 0; cursor: grab; touch-action: none; }
  .dr-grab i { width: 36px; height: 4px; border-radius: 2px; background: #CBD5E1; }
  .drill.sheet .dr-h { min-height: 44px; padding-top: 4px; touch-action: none; }
  .drill.sheet .dr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .dr-hl h2 { font-size: 14px; }
  .dr-go { display: none; }
  .dr-foot .dr-go { display: inline-flex; }
  .dr-num { font-size: 28px; }
  .dr-tabs { display: inline-grid; }
  .dr-tcols:not(.one) { grid-template-columns: 1fr; }
  .dr-tcols:not(.one)[data-tab="cat"] .dr-tc[data-k="merch"], .dr-tcols:not(.one)[data-tab="merch"] .dr-tc[data-k="cat"] { display: none; }
  .dr-tcols .dr-tch { display: none; }
  .dr-tcols.one .dr-tch { display: block; }
  .dr-flt { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .dr-flt::-webkit-scrollbar { display: none; }
  .dr-flt > * { flex: none; }
  .dr-q { flex: 0 0 250px; }
  .dr-cols.two { grid-template-columns: 1fr; gap: 1px 0; }
  body.dr-sheet .page-inner { padding-bottom: calc(55vh + 12px); padding-bottom: calc(55dvh + 12px); }
  .dr-scrim { z-index: 58; }
}
/* panel living in a narrow column (Budgets): phone-like inner layout */
.drill.inner { border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: none; margin-top: 12px; }
.drill.inner::before { display: none; }
.drill.narrow .dr-h { align-items: flex-start; }
.drill.narrow .dr-hl { flex-wrap: wrap; row-gap: 6px; }
.drill.narrow .dr-hl h2 { white-space: normal; }
.dr-flt .chip { white-space: nowrap; flex: none; }
.drill.narrow .dr-h .dr-go { display: none; }
.drill.narrow .dr-tabs { display: inline-grid; }
.drill.narrow .dr-tcols:not(.one) { grid-template-columns: 1fr; }
.drill.narrow .dr-tcols:not(.one)[data-tab="cat"] .dr-tc[data-k="merch"], .drill.narrow .dr-tcols:not(.one)[data-tab="merch"] .dr-tc[data-k="cat"] { display: none; }
.drill.narrow .dr-tcols:not(.one) .dr-tch { display: none; }
.drill.narrow .dr-flt { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.drill.narrow .dr-flt > * { flex: none; }
.drill.narrow .dr-q { flex: 0 0 240px; }
.drill.narrow .dr-cols.two { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) { .drill, .drill.out, .drill.sheet, .drill.sheet.out { animation-duration: .08s; animation-name: drFade; } @keyframes drFade { from { opacity: 0; } } }

/* ===== round 9 ===== */
/* C6: category row = plain container with two sibling buttons */
.bul { cursor: pointer; }
.bul-nm { appearance: none; border: 0; background: none; padding: 0; margin: 0; text-align: left; font: inherit; cursor: pointer; border-radius: 6px; }
.bul-nm:focus-visible { outline: 2px solid #3B82F6; outline-offset: 2px; }
/* A1: a closed sheet really goes away */
.drill[hidden], .drill.sheet[hidden] { display: none !important; }
/* J13: no-comparison state is plain text; "make it the page period" looks tappable */
.dr-sumh { width: 100%; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: -6px; }
.dr-sumh[hidden], .dr-cmprow[hidden] { display: none; }
.dr-per { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--border, #E2E8F0); border-radius: 999px; background: var(--bg-card); color: var(--text-main); font: 600 12px var(--font-sans); cursor: pointer; }
.dr-per:hover { background: var(--bg-subtle); }
.dr-per svg { width: 14px; height: 14px; }
/* J12: one colour rule for bars: categories coloured, merchants neutral */
.dr-tc[data-k="merch"] .dr-tb i { background: #94A3B8; }
/* J9: undo toast never wraps its action, and sits above the phone sheet */
#zToast .t-undo { white-space: nowrap; flex: none; }
@media (max-width: 760px) { body.dr-sheet #zToast { bottom: calc(55dvh + 12px); } body.dr-sheet.dr-full #zToast { bottom: calc(92dvh + 12px); } }
/* J14: heatmap hour headers never touch */
.wh.blk .wx { text-align: left; padding-left: 2px; }
/* C2: the calendar lets the page scroll on touch */
.cc { touch-action: pan-y; }

/* R16 r1-css W6: phone toast puts the message on its own full-width line and the actions right-aligned below. */
@media (max-width: 700px) {
  #zToast { flex-wrap: wrap; row-gap: 2px; column-gap: 16px; }
  #zToast > span { flex: 1 1 100%; }
  #zToast .t-ext { margin-left: auto; }
  #zToast > span + .t-undo:not(.t-ext) { margin-left: auto; }
}

/* r27 #6: repeat uncategorised merchant, compact nudge right in Операции */
.op-nudge { display: grid; gap: 8px; margin: 0 0 12px; }
/* r27 review #6: no dashed border (r9.css 1px-border budget is full) — same tinted-band look as .ov-news */
.op-nudge-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 10px 16px; border-radius: 14px; background: var(--band); font-size: 13px; line-height: 1.5; }
.op-nudge-row b { font-weight: 600; }

/* r27 #19: how receipts match, inline example on the empty/new state of Чеки */
/* r27 review: no dashed border (max 1px-border budget in r9.css) — same tinted-band look as .ov-news;
   "Понятно" stays on the same row at desktop widths, only wraps under the text on narrow phones. */
.rc-how { display: flex; align-items: center; gap: 8px 16px; flex-wrap: nowrap; padding: 10px 16px; margin-bottom: 12px; border-radius: 14px; background: var(--band); font-size: 13px; line-height: 1.5; }
.rc-how .rc-how-t { flex: 1 1 auto; min-width: 0; }
.rc-how .rc-how-x { margin-left: auto; flex: none; }
@media (max-width: 600px) { .rc-how { flex-wrap: wrap; } .rc-how .rc-how-x { margin-left: 0; } }
