/* Magnus × ADL — «sage» (owner 11-28): flat sage paper, dark olive ink, squared display figures with a dim tail,
   hairline rules and hatching instead of boxes, terracotta only for alarms. No text under 14px. */
:root {
  --bg: #c3c5b2; --panel: #cacdb9; --ink: #1f231b; --muted: #555b4c; --line: #a3a691; --soft: #b9bca7; --hover: #bec1ac;
  --accent: #1f231b; --accent-ink: #d6d8c6; --accent-line: #1f231b; --accent-soft: rgba(31,35,27,.08);
  --alarm: #df7150; --alarm-ink: #f6eadb;
  --ok: #2f6b45; --warn: #9a6514; --bad: #b9492c; --info: #3a5a78;
  /* payout stages */
  --st-open: #3a5a78; --st-taken: #4b5c26; --st-review: #9a6514; --st-closed: #2f6b45; --st-off: #7c7f70; --st-overdue: #c4522f;
  --shadow: none;
  --radius: 18px; --ease: cubic-bezier(.2,.7,.2,1);
  --mono: 'Saira', 'Bahnschrift', 'Segoe UI Variable Display', system-ui, sans-serif;
  --sans: 'Saira', 'Bahnschrift', 'Segoe UI Variable Text', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161913; --panel: #1c2018; --ink: #d3d6c3; --muted: #8e937f; --line: #343a2c; --soft: #22271d; --hover: #20251b;
    --accent: #d3d6c3; --accent-ink: #161913; --accent-line: #d3d6c3; --accent-soft: rgba(211,214,195,.08);
    --alarm: #df7150; --alarm-ink: #fbefe2;
    --ok: #86c79b; --warn: #e2b462; --bad: #ef8a6c; --info: #93b3cf;
    --st-open: #93b3cf; --st-taken: #b8c486; --st-review: #e2b462; --st-closed: #86c79b; --st-off: #7c8172; --st-overdue: #ef8a6c;
    color-scheme: dark;
  }
}
.st-open { --sc: var(--st-open); } .st-taken { --sc: var(--st-taken); } .st-review { --sc: var(--st-review); }
.st-parked { --sc: var(--st-overdue); }
/* password field with a show / hide eye (12-04) */
.pwf { display: inline-grid; vertical-align: middle; min-width: 0; }
label > .pwf, .dlg-f .pwf, .row .pwf { display: grid; }
.pwf > input { grid-area: 1 / 1; width: 100%; box-sizing: border-box; padding-right: 40px !important; }
.pwf > .pw-eye { grid-area: 1 / 1; justify-self: end; align-self: center; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); }
.pw-eye[aria-pressed=true] { color: var(--ink); }
.pw-eye[aria-pressed=true] .pw-x { display: none; }
.st-closed, .st-partial { --sc: var(--st-closed); } .st-cancelled, .st-expired { --sc: var(--st-off); } .st-overdue { --sc: var(--st-overdue); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.right { text-align: right; }
.hide { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }

/* ---------- motion ---------- */
.enter { animation: enter .28s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
main { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(page) { animation-duration: .3s; animation-timing-function: var(--ease); }
::view-transition-old(page) { animation: vt-out .14s ease-in both; }
::view-transition-new(page) { animation: vt-in .3s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 22%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sc) 8%, transparent); } }
@keyframes glow { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { max-width: 1360px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.brand img { width: 24px; height: 24px; }
.brand .x { color: var(--accent-line); font-weight: 400; }
nav.tabs { position: relative; display: flex; gap: 2px; flex: 1; min-width: 0; }
nav.tabs a { position: relative; z-index: 1; text-decoration: none; padding: 7px 11px; border-radius: 9px; color: var(--muted); font-size: 15px; white-space: nowrap; transition: color .2s; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.on { color: var(--ink); font-weight: 600; }
.ind { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 9px; background: var(--ink); opacity: 0;
  transition: transform .32s var(--ease), width .32s var(--ease), height .32s var(--ease), opacity .2s; }
.ind.still { transition: none !important; }   /* beats the motion presets: a new highlight is placed, not slid in from 0 */
nav.tabs > .ind { background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; white-space: nowrap; }
main { max-width: 1360px; margin: 0 auto; padding: 26px 24px 90px; }
h1 { font-size: 24px; font-weight: 650; margin: 0 0 18px; letter-spacing: -.015em; }
h2 { font-size: 15px; font-weight: 600; margin: 28px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
h2:first-child { margin-top: 0; }
h2 .cnt { font: 600 14px var(--mono); color: var(--ink); background: var(--soft); border-radius: 99px; padding: 1px 8px; letter-spacing: 0; }

/* ---------- atoms ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-line); font-weight: 600; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--soft); }
.btn.sm { padding: 3px 10px; font-size: 15px; }
.btn.lg { padding: 11px 22px; font-size: 16px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.soft { opacity: .5; }   /* can't act now, but a press explains why (owner 12-03) */
.btn.soft:hover { opacity: .7; }
input[type=text], input[type=number], input[type=password], input:not([type]), select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 10px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 14px; font-weight: 500; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill[class*="st-"] { color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent); }
.pill[class*="st-"]::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.st-taken::before, .pill.st-review::before, .pill.st-overdue::before { animation: glow 1.6s ease-in-out infinite; }
.pill.st-partial { border: 1px dashed color-mix(in srgb, var(--sc) 50%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; font-size: 14px; line-height: 18px; text-align: center; background: var(--warn); color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); } .dot.hold { background: var(--bad); }

/* ---------- stage tracker ---------- */
.steps { list-style: none; margin: 14px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps li { position: relative; text-align: center; padding-top: 26px; min-width: 0; }
.steps li::before { content: ''; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--line); transition: background .3s; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.cur::before { background: var(--sc); }
.steps li.fail::before { background: linear-gradient(90deg, var(--line), var(--sc)); }
.steps b { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--panel); z-index: 1; display: grid; place-items: center; transition: background .3s, border-color .3s; }
.steps li.done b { background: var(--sc); border-color: var(--sc); }
.steps li.done b::after { content: ''; width: 7px; height: 4px; border: solid var(--panel); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.steps li.cur b { border-color: var(--sc); animation: pulse 1.8s ease-in-out infinite; }
.steps li.cur b::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--sc); }
.steps li.fail b { background: var(--sc); border-color: var(--sc); }
.steps li.fail b::after { content: '✕'; color: var(--panel); font: 700 10px/1 var(--sans); }
.steps.st-overdue li.done { --sc: var(--st-taken); }
.steps .l { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.steps li.done .l { color: var(--ink); }
.steps li.cur .l, .steps li.fail .l { color: var(--sc); }
.steps .s { display: block; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.rail { display: inline-flex; gap: 3px; margin-top: 6px; }
.rail i { width: 12px; height: 4px; border-radius: 2px; background: var(--line); }
.rail i.done, .rail i.fail { background: var(--sc); }
.rail i.cur { background: var(--sc); animation: glow 1.6s ease-in-out infinite; }
.now { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; margin: 0 0 16px;
  background: color-mix(in srgb, var(--sc) 9%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent); }
.now .ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sc); color: var(--panel); font: 700 15px/1 var(--sans); }
.now .tx { flex: 1; min-width: 0; }
.now .t { font-weight: 650; color: var(--ink); }
.now .x { font-size: 15px; color: var(--muted); margin-top: 1px; }
.now .tm { flex: none; text-align: right; }
.now .tm .timer { display: block; font: 650 24px/1.1 var(--mono); letter-spacing: -.02em; }
.now .tm span:last-child { font-size: 14px; color: var(--muted); }
.now .tm .timer.out { font-size: 15px; }
.guide { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--muted); margin: -2px 0 12px; }
.guide span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.guide b { width: 18px; height: 18px; border-radius: 50%; background: var(--soft); color: var(--ink); display: grid; place-items: center; font: 600 14px/1 var(--sans); }
.guide i { width: 14px; height: 1px; background: var(--line); }

/* ---------- stat strip ---------- */
.stats { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 0 0 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; width: fit-content; max-width: 100%; }
.stat { padding: 10px 18px; border-radius: 10px; text-align: left; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.stat .v { font: 650 22px/1.2 var(--mono); letter-spacing: -.02em; }
.stat .k { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.stat[class*="st-"] .k::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.stat.has .v { color: var(--sc); }
.stat.st-taken.has .v { color: var(--ink); }
.stat.warn .v { color: var(--warn); } .stat.bad .v { color: var(--bad); }
button.tile { border: 0; background: transparent; cursor: pointer; transition: background .2s; }
button.tile:hover { background: var(--hover); }
button.tile.on { background: color-mix(in srgb, var(--sc) 11%, transparent); }
button.tile.on::before, button.tile.on + .arr + .stat::before { opacity: 0; }
.stats .arr { align-self: center; width: 16px; height: 16px; flex: none; opacity: .5;
  background: linear-gradient(currentColor, currentColor) center/9px 1.5px no-repeat; color: var(--muted); position: relative; }
.stats .arr::after { content: ''; position: absolute; right: 3px; top: 5px; width: 5px; height: 5px; border: solid var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.stats .arr + .stat::before { display: none; }
.stats.flow { width: auto; }
.stats.flow .stat:last-child { margin-left: auto; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.pcard { position: relative; overflow: hidden; }
.pcard[class*="st-"]::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sc); }
.pcard .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pcard .sum { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pcard .amount { font: 650 32px/1.1 var(--mono); letter-spacing: -.03em; }
.pcard .est { color: var(--muted); font: 500 14px var(--mono); }
.pcard .req { font: 500 20px/1.3 var(--mono); margin: 6px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard .meta { color: var(--muted); font-size: 15px; }
.timer { font: 600 15px var(--mono); font-variant-numeric: tabular-nums; transition: color .3s; }
.timer.low { color: var(--warn); } .timer.out { color: var(--bad); }
.pcard .files, .files { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 10px; border-radius: 9px; background: var(--soft); }
.file::before { content: ''; width: 14px; height: 16px; flex: none; border-radius: 2px; background: linear-gradient(135deg, transparent 70%, color-mix(in srgb, var(--ink) 25%, transparent) 70%), color-mix(in srgb, var(--ink) 14%, transparent); }
.file a { text-decoration: none; font-weight: 500; }
.file a:hover { text-decoration: underline; }
.file .btn.ghost { margin-left: auto; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; text-align: center; color: var(--muted); font-size: 15px; cursor: pointer; margin-top: 12px; transition: border-color .2s, background .2s, color .2s; }
.drop b { color: var(--ink); font-size: 15px; font-weight: 600; }
.drop.big { padding: 20px 12px; border-color: color-mix(in srgb, var(--sc, var(--accent-line)) 55%, var(--line)); background: color-mix(in srgb, var(--sc, var(--accent)) 5%, transparent); }
.drop.over, .drop:hover { border-color: var(--accent-line); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.note { padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: 15px; margin: 8px 0; }
.note.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.note.info { background: var(--soft); }

/* ---------- lists / tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background .15s; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--hover); }
.table tr[class*="st-"] td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc) 70%, transparent); }
.table tr.sel td { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.table tr.sel td:first-child { box-shadow: inset 4px 0 0 var(--accent-line); }
.table .amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.table td .mono, .table td.mono, .table td.nw, .table td .nw { white-space: nowrap; }
.wrap-x { overflow-x: auto; }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.offer { display: grid; grid-template-columns: 70px 1fr 140px 90px 130px 90px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.offer:hover { background: var(--hover); }
.offer:last-child { border-bottom: 0; }
.offer .amt { font: 650 17px var(--mono); }
.empty { color: var(--muted); padding: 26px; text-align: center; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; max-width: 560px; }
.row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; }
.row > label { color: var(--muted); font-size: 15px; }
.row .hint { color: var(--muted); font-size: 14px; margin-top: 3px; }
.row .seg { justify-self: start; }
.seg { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--panel); flex-wrap: wrap; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); white-space: nowrap; transition: color .25s; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--bg); }
.seg > .ind { border-radius: 8px; }
.stat .seg button { font: 500 14px var(--sans); padding: 5px 12px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; }
input[type=checkbox] { accent-color: var(--accent-line); width: 16px; height: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.split.wide { grid-template-columns: minmax(0, 1fr) 470px; }
.split.wide .table th, .split.wide .table td { padding-left: 9px; padding-right: 9px; }
.split.wide .wrap-x { border-radius: var(--radius); }
.panel { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow: auto; border-radius: var(--radius); scrollbar-width: thin; }
.panel .row { grid-template-columns: 150px 1fr; }
.panel .form { max-width: none; }
.panel h2 { margin-top: 22px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 15px; }
.kv .k { color: var(--muted); }
.timeline { font-size: 15px; display: grid; gap: 0; margin-top: 8px; border-left: 2px solid var(--line); padding-left: 12px; }
.timeline > div { position: relative; padding: 3px 0; }
.timeline > div::before { content: ''; position: absolute; left: -17px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--panel); border: 2px solid var(--muted); }
.timeline .t { color: var(--muted); font-family: var(--mono); margin-right: 8px; }
.preview { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--soft); }
.preview img { display: block; max-width: 100%; }
.preview iframe { display: block; width: 100%; height: 360px; border: 0; background: #fff; }
.section { margin-bottom: 22px; }
.section > .title { font-weight: 650; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.calc { font-family: var(--mono); font-size: 15px; padding: 10px 12px; background: var(--soft); border-radius: 10px; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 11vh auto; text-align: center; }
.login img { width: 56px; height: 56px; margin-bottom: 14px; }
.login h1 { margin-bottom: 4px; }
.login .form { margin: 24px auto 0; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.login .devs { margin-top: 26px; display: grid; gap: 6px; text-align: left; }
.login .devs button { display: flex; justify-content: space-between; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 15px;
  opacity: 0; transition: opacity .2s, transform .3s var(--ease); pointer-events: none; max-width: 90vw; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------- dev switch ---------- */
.devsw { position: fixed; left: 12px; bottom: 12px; z-index: 6; }
.devsw select { max-width: 230px; background: var(--panel); box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 5px 8px; font-size: 15px; }

/* ---------- bot simulator ---------- */
.sim { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.chats { display: grid; gap: 2px; align-content: start; }
.chats button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; transition: background .15s; }
.chats button:hover { background: var(--hover); }
.chats button.on { background: var(--soft); }
.chats .kind { color: var(--muted); font-size: 14px; }
.phone { background: #dfe7d3; border-radius: 16px; padding: 14px; min-height: 560px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone { background: #0f1a14; } }
.phone .msgs { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow: auto; max-height: 640px; }
.bubble { max-width: 86%; background: var(--panel); border-radius: 12px; padding: 8px 11px; font-size: 15px; white-space: pre-wrap; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.bubble.in { align-self: flex-end; background: #effdde; color: #0a0b0c; }
.bubble .from { font-size: 14px; color: var(--info); margin-bottom: 2px; }
.bubble .pin { font-size: 14px; color: var(--muted); }
.bubble code { background: var(--soft); padding: 0 4px; border-radius: 4px; }
.bubble .ed { font-size: 14px; color: var(--muted); text-align: right; }
.kbd { display: grid; gap: 4px; margin-top: 6px; max-width: 86%; }
.kbd .r { display: flex; gap: 4px; }
.kbd button, .kbd a { flex: 1; border: 0; border-radius: 8px; padding: 7px 8px; background: color-mix(in srgb, var(--ink) 10%, transparent); cursor: pointer; font-size: 15px; text-align: center; text-decoration: none; transition: background .15s; }
.kbd button:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.compose { display: flex; gap: 6px; }
.compose input[type=text] { flex: 1; }

/* ---------- narrow screens ---------- */
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
  nav.tabs { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  main { padding: 18px 16px 90px; }
  .split, .split.wide, .cols, .sim { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .row, .panel .row { grid-template-columns: 1fr; gap: 4px; }
  .offer { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .offer > .m-hide { display: none; }
  .cards { grid-template-columns: 1fr; }
  .stats { width: 100%; }
  .stats .arr { display: none; }
  .stats.flow .stat:last-child { margin-left: 0; }
  .steps .s { display: none; }
  .now .tm .timer { font-size: 20px; }
}

/* ---------- trader: tabs + compact tiles + full card over the page (Magnus 11-27) ---------- */
.tbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.seg.big button { padding: 8px 16px; font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.seg.big button .c { font: 600 14px var(--mono); min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--ink); text-align: center; transition: background .25s, color .25s; }
.seg.big button.on .c { background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.tiles > .empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.pt { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; padding: 14px 14px 12px 17px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.pt::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--sc, var(--line)); }
.pt:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--sc) 45%, var(--line)); box-shadow: 0 8px 24px rgba(10,11,12,.08); }
.pt:focus-visible { outline: 2px solid var(--sc); outline-offset: 2px; }
.pt .r1, .pt .r4 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt .tag { font-size: 14px; font-weight: 600; color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pt .a { font: 650 22px/1.15 var(--mono); letter-spacing: -.02em; }
.pt .r3 { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt .r4 { margin-top: 2px; }
.pt .rc { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; color: var(--muted); }
.pt .rc i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--sc); opacity: .7; }
.pt .rc i.on { background: var(--sc); opacity: 1; }
.pt .rc span { margin-left: 5px; }
.pt .timer { font-size: 17px; }
.pt.st-overdue .tag, .pt.back .tag { animation: glow 1.6s ease-in-out infinite; }

.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px 16px; pointer-events: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10,11,12,.42); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s; }
.sheet-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: calc(var(--radius) + 4px);
  opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .22s, transform .28s var(--ease); }
.sheet-box > #sheetb > .card { padding: 22px 24px; box-shadow: 0 24px 60px rgba(10,11,12,.25); }
.sheet-box .shx { position: absolute; right: 12px; top: 12px; z-index: 2; font-size: 18px; line-height: 1; padding: 4px 10px; }
.sheet-box .pcard .head { padding-right: 44px; }
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-box { opacity: 1; transform: none; }

.qbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qbar select { padding: 7px 10px; border-radius: 10px; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pt { padding: 12px 12px 10px 15px; }
  .pt .a { font-size: 18px; }
  .sheet { place-items: end center; padding: 0; }
  .sheet-box { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; transform: translateY(40px); }
}
.sheet-box .pcard .head { margin-bottom: 14px; }

/* ---------- sage: shell + flat surfaces (11-28) ---------- */
html, body { font-size: 16px; }
body { font-family: var(--sans); font-feature-settings: 'tnum' 1; }
.num, .mono, code { font-family: var(--mono); }
header.top { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 16px; }
.brand .x { color: var(--muted); }
nav.tabs a { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
nav.tabs { overflow-x: auto; scrollbar-width: none; }
nav.tabs a .ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs > .ind { background: transparent; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.bar .rate { display: flex; align-items: baseline; gap: 6px; font-size: 15px; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.bar .rate:empty { display: none; }
.bar .rate b { font: 600 17px var(--mono); color: var(--ink); letter-spacing: 0; }
.bar .rate .src { font-size: 14px; text-transform: none; }
.who { font-size: 15px; }
.who .av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; }
.who .nm { display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.who .nm:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 99px; }
/* The header tightens until every tab fits (fitBar in app.js; owner 12-03: «Настройки» hid under the rate chip). */
.bar.fit1 nav.tabs a .ic { display: none; }
.bar.fit2 .who .nmt, .bar.fit2 .who .tgbtn { display: none; }
.bar.fit3 nav.tabs a { padding: 7px 8px; letter-spacing: .02em; font-size: 14px; }
.bar.fit4 { flex-wrap: wrap; row-gap: 6px; }
.bar.fit4 nav.tabs { order: 3; flex-basis: 100%; }
.bar.fit4 .who { margin-left: auto; }
/* «Telegram кабинета» (owner 12-03: several Telegrams per cabinet) */
.tgcard h2 { margin: 0 0 6px; }
.tglist { display: grid; gap: 8px; margin: 14px 0; }
.tgrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.tgn { display: grid; gap: 2px; flex: 1; min-width: 0; }
.tgn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgst { font-size: 13px; color: var(--warn); white-space: nowrap; }
.tgst.on { color: var(--ok, var(--muted)); }
.tgadd { display: flex; gap: 8px; margin-bottom: 10px; }
.tgadd input { flex: 1; min-width: 0; }

h1 { font-weight: 500; font-size: 30px; text-transform: uppercase; letter-spacing: .02em; }
h2 { font-weight: 500; font-size: 15px; color: var(--ink); letter-spacing: .06em; }
.card, .table, .list, .stats, .pt { box-shadow: none; border-color: var(--line); }
.card, .list, .stats { background: var(--panel); }
.table { background: transparent; border-radius: 0; border-width: 1px 0; }
.table th { background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.table tr.sel td { background: var(--accent-soft); }
.table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.btn { border-radius: 999px; border-color: var(--line); background: transparent; padding: 8px 18px; font-size: 15px; letter-spacing: .02em; }
.btn.sm { padding: 4px 12px; font-size: 14px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=text], input[type=number], input[type=password], input:not([type]), select, textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 2px; font-size: 16px; }
input:focus, select:focus, textarea:focus { box-shadow: none; border-bottom-color: var(--ink); background: transparent; }
select { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
.seg { border-radius: 999px; background: transparent; border: 1px solid var(--line); padding: 3px; }
.seg button { border-radius: 999px; font-size: 15px; }
.seg button.on { color: var(--bg); }
.seg > .ind { border-radius: 999px; background: var(--ink); }
.seg.big button { text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.seg.big button .c { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .7; }
.seg.big button.on .c { background: transparent; color: var(--bg); }
.pill { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.note { font-size: 15px; border-radius: 0; }
.note.bad { background: var(--alarm); color: var(--alarm-ink); padding: 16px 20px; display: flex; gap: 12px; align-items: center; }
.note.bad::before { content: '!'; flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid currentColor; font-weight: 700; }
.note.info { background: transparent; border-left: 2px solid var(--ink); }
.dec { color: var(--muted); opacity: .6; }
.cur { font-size: .34em; font-weight: 500; letter-spacing: .06em; margin-left: .45em; color: var(--muted); vertical-align: .9em; }
.empty { font-size: 16px; }

/* hatching: vertical hairlines, the filled share drawn darker (meters for limits and time) */
.hatch { position: relative; display: block; height: 46px; background: repeating-linear-gradient(90deg, var(--line) 0 1.5px, transparent 1.5px 9px); }
.hatch > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--f, 0) * 100%); background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 9px); transition: width .6s var(--ease); }

/* trader summary: label, the big figure, ruled rows with hatching — no boxes */
.sum0 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px 56px; align-items: center; margin: 6px 0 34px; }
.sum0 .lab { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.sum0 .huge { font: 500 92px/0.95 var(--mono); letter-spacing: -.02em; margin-top: 12px; white-space: nowrap; }
.sum0 .huge .cur { font-size: .22em; vertical-align: 2.6em; }
.sum0 .sw { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 15px; color: var(--muted); }
.sum0 .rows { display: grid; gap: 0; }
.sum0 .r { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 16px; padding: 14px 0 8px; border-bottom: 1px solid var(--ink); }
.sum0 .r b { font: 500 34px/1 var(--mono); letter-spacing: -.01em; white-space: nowrap; }
.sum0 .r .hatch { grid-column: 1 / -1; height: 34px; margin-top: 4px; }
.sum0 .r .s { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }

/* tiles: flat, ruled, time left as hatching; overdue turns terracotta */
.tiles { gap: 14px; }
.pt { background: var(--panel); border-radius: 16px; padding: 16px 16px 14px 18px; gap: 8px; }
.pt::before { width: 3px; }
.pt:hover { transform: translateY(-2px); box-shadow: none; border-color: var(--ink); }
.pt .tag { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; background: transparent; border: 1px solid currentColor; }
.pt .a { font: 500 30px/1.05 var(--mono); letter-spacing: -.01em; }
.pt .r3 { font-size: 15px; }
.pt .rc { font-size: 14px; }
.pt .timer { font-size: 22px; font-weight: 500; }
.pt .hatch { height: 22px; margin-top: 2px; }
.pt.st-overdue { background: var(--alarm); color: var(--alarm-ink); border-color: var(--alarm); }
.pt.st-overdue::before { display: none; }
.pt.st-overdue .r3, .pt.st-overdue .rc, .pt.st-overdue .muted, .pt.st-overdue .tag, .pt.st-overdue .timer { color: var(--alarm-ink); }
.pt.st-overdue .rc i { border-color: var(--alarm-ink); }
.pt.st-overdue .hatch { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--alarm-ink) 70%, transparent) 0 1.5px, transparent 1.5px 9px); }
.pt .tag.ready { color: var(--st-closed); background: transparent; }

/* payout card + «что сейчас» */
.pcard .amount { font: 500 48px/1 var(--mono); }
.pcard .req { font: 500 26px/1.3 var(--mono); }
.pcard .est, .pcard .meta { font-size: 15px; }
.now { border-radius: 0; background: transparent; border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 14px 2px; }
.now.st-overdue { background: var(--alarm); color: var(--alarm-ink); border: 0; padding: 14px 16px; }
.now.st-overdue .t, .now.st-overdue .x, .now.st-overdue .tm span, .now.st-overdue .timer { color: var(--alarm-ink); }
.now .ic { border-radius: 50%; }
.now .t { font-size: 18px; font-weight: 600; }
.now .x { font-size: 15px; }
.now .tm .timer { font: 500 34px/1 var(--mono); }
.now .tm span:last-child { font-size: 14px; }
.steps .l { font-size: 14px; } .steps .s { font-size: 14px; }
.file { font-size: 15px; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); }
.drop { border-radius: 14px; font-size: 15px; }
.drop b { font-size: 16px; }
.sheet-box > #sheetb > .card { background: var(--bg); border-color: var(--ink); }

/* stat strip (operator) */
.stats { border-radius: 0; background: transparent; border-width: 1px 0; padding: 6px 0; }
.stat .v { font: 500 34px/1.1 var(--mono); }
.stat .k { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
button.tile.on { background: var(--accent-soft); }
.kv { font-size: 15px; }
.timeline { font-size: 15px; }
.row > label { font-size: 15px; }
.row .hint { font-size: 14px; }

/* login */
.login { max-width: 440px; margin: 13vh auto 0; text-align: left; }
.lcard { display: grid; gap: 18px; padding: 6px 0; }
.lbrand { display: flex; align-items: center; gap: 14px; font-size: 28px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.lbrand img { width: 40px; height: 40px; margin: 0; }
.lbrand i { font-style: normal; color: var(--muted); }
.lsub { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin: -8px 0 10px; }
.lcard label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lcard input { font-size: 18px; color: var(--ink); }
.lcard .btn { margin-top: 10px; width: 100%; padding: 13px; }
.login .devs { margin-top: 34px; }
.login .devs .btn { border-radius: 0; border-width: 0 0 1px; padding: 10px 2px; }

@media (max-width: 860px) {
  .sum0 { grid-template-columns: 1fr; gap: 18px; }
  .sum0 .huge { font-size: 64px; }
  .pt .a { font-size: 24px; }
}
.pt .r1 > * { min-width: 0; }
.pt .tag { overflow: hidden; text-overflow: ellipsis; }
.pt .r4 { white-space: nowrap; }
.pt .rc span { white-space: nowrap; }
.pt .timer.out { font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.timer { white-space: nowrap; }
.cur, .sum0 .huge .cur { font-size: max(15px, .34em); }
.sum0 .huge .cur { font-size: max(15px, .22em); }
/* bank badge */
.bk { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin: 0 .4em 0 .1em; border-radius: 50%; vertical-align: .05em;
  background: var(--b); color: var(--bi); font: 700 max(13px, .8em)/1 var(--sans); letter-spacing: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: none; }
.hint { display: none !important; }

/* ---------- skins: the client picks one (11-28). Structure is shared; a skin only sets tokens + a few accents ---------- */
:root { --primary: var(--ink); --primary-ink: var(--bg); --meter: var(--ink); --hatch-a: 90deg; --label: var(--sans); --hero: transparent; --hero-ink: var(--ink); }
:root[data-skin="sage"] {
  --bg: #c3c5b2; --panel: #cacdb9; --ink: #1f231b; --muted: #555b4c; --line: #a3a691; --soft: #b9bca7; --hover: #bec1ac;
  --accent: #1f231b; --accent-ink: #d6d8c6; --accent-line: #1f231b; --accent-soft: rgba(31,35,27,.08); --alarm: #df7150; --alarm-ink: #f6eadb;
  --ok: #2f6b45; --warn: #9a6514; --bad: #b9492c; --info: #3a5a78;
  --st-open: #3a5a78; --st-taken: #4b5c26; --st-review: #9a6514; --st-closed: #2f6b45; --st-off: #7c7f70; --st-overdue: #c4522f;
  --primary: #1f231b; --primary-ink: #c3c5b2; --meter: #1f231b; color-scheme: light;
}
:root[data-skin="olive"] {
  --bg: #161913; --panel: #1c2018; --ink: #d3d6c3; --muted: #8e937f; --line: #343a2c; --soft: #22271d; --hover: #20251b;
  --accent: #d3d6c3; --accent-ink: #161913; --accent-line: #d3d6c3; --accent-soft: rgba(211,214,195,.08); --alarm: #df7150; --alarm-ink: #fbefe2;
  --ok: #86c79b; --warn: #e2b462; --bad: #ef8a6c; --info: #93b3cf;
  --st-open: #93b3cf; --st-taken: #b8c486; --st-review: #e2b462; --st-closed: #86c79b; --st-off: #7c8172; --st-overdue: #ef8a6c;
  --primary: #d3d6c3; --primary-ink: #161913; --meter: #d3d6c3; color-scheme: dark;
}
/* «Сигнал»: light grey paper, black ink, one loud orange block, diagonal hatching, mono labels */
:root[data-skin="signal"] {
  --bg: #e7e6e2; --panel: #f5f5f2; --ink: #161616; --muted: #6b6b66; --line: #cbc9c3; --soft: #deddd8; --hover: #efeeea;
  --accent: #161616; --accent-ink: #f5f5f2; --accent-line: #161616; --accent-soft: rgba(22,22,22,.06);
  --alarm: #161616; --alarm-ink: #ff6a1f;
  --ok: #1f7a4d; --warn: #b5650a; --bad: #e04d00; --info: #2f5fb3;
  --st-open: #2f5fb3; --st-taken: #161616; --st-review: #b5650a; --st-closed: #1f7a4d; --st-off: #8a8a85; --st-overdue: #f25500;
  --primary: #161616; --primary-ink: #f5f5f2; --meter: #161616; --hatch-a: 135deg; --hero: #f25500; --hero-ink: #161616;
  --sans: 'Inter Tight', 'Segoe UI Variable Text', system-ui, sans-serif; --mono: 'Inter Tight', 'Segoe UI Variable Display', system-ui, sans-serif;
  --label: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace; --radius: 12px; color-scheme: light;
}
/* «Графит»: ADL black + lime, technical grotesk */
:root[data-skin="graphite"] {
  /* 11-29: dark = the same «Сигнал» look (fonts, frames, orange balance block, diagonal hatching), only the colours flip */
  --bg: #0f0f0e; --panel: #181817; --ink: #efeee9; --muted: #9a9a93; --line: #31312e; --soft: #222220; --hover: #1c1c1a;
  --accent: #efeee9; --accent-ink: #0f0f0e; --accent-line: #efeee9; --accent-soft: rgba(239,238,233,.07);
  --alarm: #3a1909; --alarm-ink: #ff7a33;
  --ok: #5fc98f; --warn: #e8a04a; --bad: #ff6a1f; --info: #7fa8f0;
  --st-open: #7fa8f0; --st-taken: #efeee9; --st-review: #e8a04a; --st-closed: #5fc98f; --st-off: #8a8a85; --st-overdue: #ff6a1f;
  --primary: #efeee9; --primary-ink: #0f0f0e; --meter: #efeee9; --hatch-a: 135deg; --hero: #f25500; --hero-ink: #161616;
  --sans: 'Inter Tight', 'Segoe UI Variable Text', system-ui, sans-serif; --mono: 'Inter Tight', 'Segoe UI Variable Display', system-ui, sans-serif;
  --label: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace; --radius: 12px; color-scheme: dark;
}
/* shared hooks the skins use */
body { font-family: var(--sans); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.seg > .ind { background: var(--primary); }
.seg button.on { color: var(--primary-ink); }
.seg.big button.on .c { color: var(--primary-ink); }
nav.tabs > .ind { box-shadow: inset 0 -2px 0 var(--primary); }
.hatch { background: repeating-linear-gradient(var(--hatch-a), var(--line) 0 1.5px, transparent 1.5px 9px); }
.hatch > i { background: repeating-linear-gradient(var(--hatch-a), var(--meter) 0 1.5px, transparent 1.5px 9px); }
.sum0 .lab, .table th, .stat .k, h2, nav.tabs a, .seg.big button, .pt .tag, .pill, .lsub, .lcard label, .bar .rate span { font-family: var(--label); }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 .lab, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .table th, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .stat .k, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt .tag,
:root[data-skin="graphite"] .sum0 .lab, :root[data-skin="graphite"] .table th, :root[data-skin="graphite"] .stat .k, :root[data-skin="graphite"] .pt .tag { letter-spacing: .02em; font-weight: 500; }
/* signal: framed panels, the balance as the orange block */
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .card { border: 1.5px solid var(--ink); }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt::before { display: none; }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 > div:first-child { background: var(--hero); color: var(--hero-ink); padding: 26px 30px 28px; border-radius: var(--radius); border: 1.5px solid var(--ink); }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 > div:first-child .dec, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 > div:first-child .cur { color: var(--hero-ink); opacity: .55; }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 .huge { font-weight: 500; letter-spacing: -.045em; }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 .seg { border-color: var(--ink); }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt .a, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pcard .amount { letter-spacing: -.035em; font-weight: 500; }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt.st-overdue .tag, :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .pt.st-overdue .timer { color: var(--alarm-ink); }
/* graphite: lime only where something is yours to press or count */

/* the picker */
.skins { position: fixed; right: 16px; bottom: 16px; z-index: 25; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.18); font: 500 14px var(--label); color: var(--muted); }
.skins button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 999px; padding: 5px 11px 5px 6px; cursor: pointer; font: 500 14px var(--sans); }
.skins button:hover { border-color: var(--line); }
.skins button.on { border-color: var(--ink); }
.skins i { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
@media (max-width: 860px) { .skins { left: 8px; right: 8px; bottom: 8px; overflow-x: auto; } .skins > span { display: none; } }
:is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 > div:first-child .seg button:not(.on) { color: var(--hero-ink); }
/* «Dynasty» wordmark + powered-by line (11-28) */
.brand .dyn { font: 600 19px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.lbrand { font-size: 34px; letter-spacing: .12em; justify-content: flex-start; }
.pw { max-width: 1360px; margin: -60px auto 0; padding: 0 24px 34px; color: var(--muted); font: 400 14px var(--label); letter-spacing: .06em; text-transform: uppercase; }
.pw b { color: var(--ink); font-weight: 600; }
body:has(.login) .pw { text-align: center; margin-top: 30px; }

/* ---------- 11-29: theme switch, withdrawals, widget frame, phone layout ---------- */
html.theming, html.theming * { transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease !important; }
.themer { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: transform .35s var(--ease), border-color .2s; }
.themer:hover { border-color: var(--ink); }
.themer:active { transform: rotate(-30deg) scale(.92); }
.themer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.themer .moon { display: none; }
:root[data-skin="graphite"] .themer .sun, :root[data-skin="olive"] .themer .sun { display: none; }
:root[data-skin="graphite"] .themer .moon, :root[data-skin="olive"] .themer .moon { display: inline; }
.who .nmt { white-space: nowrap; }

/* no clipped text: lines wrap instead of «…» */
.pt .r3 { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.pt .r1 { flex-wrap: wrap; row-gap: 6px; }
.pt .tag { overflow: visible; text-overflow: clip; }
.mt, .kv span, .file a { overflow-wrap: anywhere; }

/* trader: «Вывести» next to the line switch */
.sum0 .sw { flex-wrap: wrap; }
.wdb { text-decoration: none; display: inline-flex; align-items: center; }

/* balance page: withdrawal form + requests */
.sum0.bal { align-items: start; }
.wform { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.wform .fl { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
.wform .frow { display: flex; gap: 10px; align-items: center; }
.wform .frow input { flex: 1; min-width: 0; }
.wform input { font-size: 18px; color: var(--ink); }
.wform input.mono { font-size: 16px; letter-spacing: .01em; }
.wform .btn.lg { width: 100%; padding: 13px; }
.wnote { color: var(--muted); font-size: 15px; }
.wlist { display: grid; gap: 10px; margin-bottom: 8px; }
.wr { display: grid; gap: 6px 18px; grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); animation: enter .3s var(--ease) both; }
.wr .wa { font: 500 28px/1.05 var(--mono); white-space: nowrap; }
.wr .wa .cur { font-size: 15px; vertical-align: .55em; }
.wr .wm { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 15px; }
.wr .wad { grid-column: 1 / -1; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.wr .wn { grid-column: 1 / -1; font-size: 15px; }
.wr .actions { grid-column: 1 / -1; margin-top: 4px; }
.wr.st-requested { border-color: color-mix(in srgb, var(--st-review) 55%, var(--line)); }

/* widget preview inside the bot simulator */
.wgf { display: block; width: 100%; max-width: 420px; height: 560px; border: 0; border-radius: 14px; margin-top: 8px; background: transparent; }

/* smoother page and tab changes */
::view-transition-old(page) { animation: vt-out .16s ease-in both; }
::view-transition-new(page) { animation: vt-in .34s var(--ease) both; }
#tgrid.enter, .enter { animation-duration: .32s; }

/* ---------- phones: bottom tab bar, one column, nothing wider than the screen ---------- */
@media (max-width: 760px) {
  html, body { overflow-x: clip; }
  header.top { position: sticky; top: 0; }
  .bar { flex-wrap: nowrap; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand .dyn { font-size: 17px; letter-spacing: .12em; }
  .bar .rate { display: none; }
  .who { margin-left: auto; gap: 8px; }
  .who .nmt { display: none; }
  .who .btn.sm { padding: 6px 10px; }
  .who .tgbtn { display: none; }   /* phone: the avatar opens «Telegram кабинета» */
  .bar.fit4 { flex-wrap: nowrap; }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 20; order: 0; flex: none; display: flex; flex-direction: row; gap: 0; overflow-x: auto;
    padding: 6px 6px max(8px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(0,0,0,.08); }
  nav.tabs a { flex: 1 0 auto; min-width: 68px; flex-direction: column; gap: 4px; padding: 7px 6px; font-size: 13px; letter-spacing: .02em; text-align: center; justify-content: center; border-radius: 12px; }
  nav.tabs a .ic { width: 22px; height: 22px; }
  nav.tabs > .ind { box-shadow: none; background: var(--accent-soft); border-radius: 12px; }
  main, body.has-side main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .pw { margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); text-align: center; }
  h1 { font-size: 24px; }

  .sum0 { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .sum0 .huge { font-size: clamp(48px, 15vw, 64px); }
  .sum0 .r b { font-size: 26px; }
  .sum0 .r .hatch { height: 26px; }
  :is(:root[data-skin="signal"], :root[data-skin="graphite"]) .sum0 > div:first-child { padding: 20px 20px 22px; }
  .tbar { overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .seg.big { flex-wrap: nowrap; }
  .seg.big button { padding: 8px 12px; font-size: 14px; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .pt .a { font-size: 26px; }
  .offer { grid-template-columns: minmax(0, 1fr) auto; }
  .wform { padding: 18px; }
  .wr { grid-template-columns: 1fr; }
  .wr .wa { font-size: 26px; }
  .stats.flow { display: grid; grid-template-columns: 1fr 1fr; }
  .stats.flow .arr { display: none; }
  .stat .v { font-size: 26px; }
  .qbar { flex-direction: column; align-items: stretch; }
  .qbar .seg { overflow-x: auto; flex-wrap: nowrap; }
  .sheet-box > #sheetb > .card { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .pcard .amount { font-size: 40px; }
  .pcard .req { font-size: 22px; }
  .now .tm .timer { font-size: 26px; }
  .login { margin-top: 9vh; padding: 0 4px; }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (min-width: 761px) and (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  /* a backdrop-filter on the header would trap the fixed tab bar inside it */
  header.top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .tbar { overflow: visible; margin: 0 0 14px; padding: 0; }
  .seg.big { display: flex; width: 100%; }
  .seg.big button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 9px 4px; letter-spacing: .02em; gap: 5px; }
  .seg.big button .c { min-width: 20px; padding: 0 5px; }
}
@media (max-width: 760px) { .devsw { bottom: calc(92px + env(safe-area-inset-bottom)); left: 8px; } }
/* wallet addresses: a real monospace so 34 characters fit on one line */
.wr .wad, .wform input[name=address] { font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: 0; }
/* ---------- 11-29: steady layout on tab changes ---------- */
html { scrollbar-gutter: stable; }                 /* a page without a scrollbar no longer shifts everything sideways */
header.top { position: sticky; top: 0; z-index: 15; view-transition-name: topbar; }
::view-transition-group(topbar), ::view-transition-old(topbar), ::view-transition-new(topbar) { animation: none; }
main { min-height: calc(100vh - 150px); }           /* short and long pages keep the footer in place */
/* only the content cross-fades; its box never stretches or slides between pages of different height */
::view-transition-group(page) { animation: none; }
::view-transition-image-pair(page) { isolation: auto; }
::view-transition-old(page) { animation: vt-out .12s ease-in both; }
::view-transition-new(page) { animation: vt-in .26s var(--ease) both; }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes vt-out { to { opacity: 0; } }
/* «Новая выплата»: the time presets stay together on one line */
.ttl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.ttl .chips { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.ttl .chips .btn.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.form { max-width: 640px; }
/* trader history: one clickable row per payout */
.hlist { display: grid; gap: 8px; }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; text-align: left; width: 100%; padding: 14px 18px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; transition: border-color .2s, transform .18s var(--ease); }
.hrow:hover { border-color: var(--ink); transform: translateY(-1px); }
.hrow .h1 { font: 500 24px/1.1 var(--mono); white-space: nowrap; }
.hrow .h2 { justify-self: end; }
.hrow .h3 { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.hrow .h4 { justify-self: end; font: 500 17px var(--mono); white-space: nowrap; color: var(--st-closed); }
.hrow.st-cancelled .h4, .hrow.st-expired .h4 { color: var(--muted); }
/* detail card */
.verdict { margin: 12px 0 14px; padding: 12px 14px; border-left: 3px solid var(--sc); background: color-mix(in srgb, var(--sc) 9%, transparent); font-size: 16px; }
.verdict b { font-family: var(--mono); }
.dkv { margin: 14px 0 6px; }
.dkv span { overflow-wrap: anywhere; }
/* stage tracker: sub-lines wrap instead of «…» */
.steps .s { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
@media (max-width: 860px) {
  .split, .split.wide, .cols, .sim { grid-template-columns: minmax(0, 1fr); }
  .split > *, .sum0 > * { min-width: 0; }
}
@media (max-width: 760px) { .qbar, .qbar > * { min-width: 0; max-width: 100%; } .qbar .seg { overflow-x: auto; scrollbar-width: none; } }
@media (max-width: 760px) {
  /* bottom bar: every item fits, labels never cut */
  nav.tabs { overflow-x: hidden; }
  nav.tabs a { flex: 1 1 0; min-width: 0; padding: 7px 2px; font: 600 12px/1.15 var(--sans); letter-spacing: 0; text-transform: none; white-space: nowrap; }
  /* queue filters wrap instead of running off the edge */
  .qbar .seg { flex-wrap: wrap; overflow: visible; border-radius: 16px; }
  .qbar .seg > .ind { border-radius: 12px; }
  /* queue on a phone: number, stage, sum, time — the rest is in the payout card */
  .table.qt th:nth-child(3), .table.qt td:nth-child(3), .table.qt th:nth-child(5), .table.qt td:nth-child(5), .table.qt th:nth-child(7), .table.qt td:nth-child(7) { display: none; }
  .table.qt th, .table.qt td { padding: 10px 8px; }
}
@media (max-width: 760px) {
  .table.qt th:nth-child(1), .table.qt td:nth-child(1) { display: none; }
  .table.qt td:nth-child(2) { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc) 70%, transparent); }
  .stats.flow .stat::before { display: none; }
  .stats.flow .stat { padding: 10px 12px; }
}
.hrow .h3 { column-gap: 10px; } .hrow .h3 .nw { white-space: nowrap; display: inline-flex; align-items: center; }
/* ---------- receipt check under each file ---------- */
.ck { display: grid; gap: 8px; margin: -2px 0 10px; padding: 10px 12px 12px; border-left: 2px solid var(--line); }
.ckh { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.cka { font: 600 17px var(--mono); }
.ckd, .ckw { color: var(--muted); font-size: 15px; }
.ckdemo { font: 500 14px var(--label); color: var(--muted); border: 1px dashed var(--line); border-radius: 99px; padding: 1px 8px; }
.ckm { display: flex; flex-wrap: wrap; gap: 6px; }
.mk { font-size: 15px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.mk.y { color: var(--st-closed); border-color: color-mix(in srgb, var(--st-closed) 45%, var(--line)); }
.mk.n { color: var(--st-overdue); border-color: color-mix(in srgb, var(--st-overdue) 55%, var(--line)); font-weight: 600; }
.mk.p { color: var(--st-review); border-color: color-mix(in srgb, var(--st-review) 50%, var(--line)); }
.mk.q { color: var(--muted); }
.cn { font-size: 15px; } .cn.fail { color: var(--st-overdue); font-weight: 600; } .cn.warn { color: var(--st-review); }
.cktot { margin: 0 0 12px; padding: 10px 12px; font-weight: 600; border-radius: 10px; background: var(--soft); }
.cktot.y { color: var(--st-closed); } .cktot.p { color: var(--st-review); } .cktot.n { color: var(--st-overdue); }
.ck.wait .pill::before { animation: glow 1s ease-in-out infinite; }
/* check result as a dot: queue «Чеки» column and trader tiles */
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; background: var(--muted); }
.cdot.ok, .pt .rc i.ck-ok { background: var(--st-closed); border-color: var(--st-closed); }
.cdot.warn, .pt .rc i.ck-warn { background: var(--st-review); border-color: var(--st-review); }
.cdot.bad, .pt .rc i.ck-bad { background: var(--st-overdue); border-color: var(--st-overdue); }
.cdot.wait { background: transparent; border: 1.5px solid var(--muted); animation: glow 1s ease-in-out infinite; }

/* sheet: the card takes the box's own corners (no mismatched radii / clipped border at the corners) */
.sheet-box { box-shadow: 0 24px 60px rgba(10,11,12,.28); }
.sheet-box > #sheetb, .sheet-box > #sheetb > .card { border-radius: inherit; }
.sheet-box > #sheetb > .card { box-shadow: none; }
/* how many receipts the payout may be closed with (operator sets it) */
.rcap { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; }
/* a receipt glyph (paper with a torn edge and lines), not an empty square — Magnus 12-02 «белый квадрат» */
.rcap::before { content: ''; flex: none; width: 13px; height: 15px; background: currentColor; opacity: .75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M6 2.5h12v19l-2.4-1.6-2.4 1.6-2.4-1.6-2.4 1.6-2.4-1.6z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M6 2.5h12v19l-2.4-1.6-2.4 1.6-2.4-1.6-2.4 1.6-2.4-1.6z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.offhint { margin: 0 0 8px; }
.pcard .rcap { margin: 8px 0 2px; }
.offer .rcap { justify-self: start; }

/* «Что происходило»: the line runs exactly from the first dot's centre to the last one's (no tail past the last event) */
.timeline { border-left: 0; padding-left: 24px; }
.timeline > div { line-height: 20px; }
.timeline > div::before { box-sizing: border-box; left: -24px; top: 7px; width: 12px; height: 12px; z-index: 1; }
.timeline > div:not(:last-child)::after { content: ''; position: absolute; left: -19px; top: 13px; bottom: -13px; width: 2px; background: var(--line); }
/* the payout card scrolls without a visible scrollbar */
.sheet-box { scrollbar-width: none; }
.sheet-box::-webkit-scrollbar { display: none; }
.ck .ckw { overflow-wrap: anywhere; }

/* ---------- our own dialogs instead of the browser's confirm() / prompt() ---------- */
.sure { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; animation: sureIn .18s var(--ease); }
.sure-q { color: var(--ink); font-weight: 600; margin-right: 4px; }
@keyframes sureIn { from { opacity: 0; transform: translateY(3px); } }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.dlg { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px 16px; }
.dlg-bg { position: absolute; inset: 0; background: rgba(10,11,12,.42); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.dlg-box { position: relative; width: min(420px, 100%); background: var(--bg); border: 1px solid var(--ink); border-radius: calc(var(--radius) + 4px);
  padding: 20px 22px; box-shadow: 0 24px 60px rgba(10,11,12,.28); display: grid; gap: 14px; opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .2s, transform .25s var(--ease); }
.dlg.open .dlg-bg, .dlg.open .dlg-box { opacity: 1; }
.dlg.open .dlg-box { transform: none; }
.dlg-t { font-size: 17px; font-weight: 650; }
.dlg-x { color: var(--muted); margin-top: -8px; white-space: pre-line; }
.dlg-f { display: grid; gap: 5px; }
.dlg-f > span { font-size: 14px; color: var(--muted); }
.dlg-f input { width: 100%; box-sizing: border-box; }
.dlg-show { display: flex; gap: 8px; }
.dlg-show input { flex: 1; font-family: var(--mono); font-size: 14px; }
.dlg-a { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .dlg-box, .dlg-bg, .sure { transition: none; animation: none; } }

/* ---------- our own dropdowns instead of the browser's <select> / <datalist> lists ---------- */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip-path: inset(50%); }
.dd { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; max-width: 100%; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 7px 12px 7px 14px; font-size: 15px; line-height: 1.35;
  transition: border-color .15s, background-color .15s; }
.dd:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.dd:focus-visible, .dd.dd-on { outline: none; border-color: var(--ink); }
.dd:disabled { opacity: .45; cursor: default; }
.dd-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-ch { width: 12px; height: 12px; flex: none; color: var(--muted); transition: transform .18s var(--ease); }
.dd.dd-on .dd-ch { transform: rotate(180deg); }
.devsw .dd { max-width: 260px; background: var(--panel); box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 5px 10px 5px 12px; }
.dd-menu { position: fixed; z-index: 60; width: max-content; overflow: auto; overscroll-behavior: contain; padding: 5px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 14px; box-shadow: 0 18px 48px rgba(10,11,12,.28); scrollbar-width: none;
  opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .18s var(--ease); }
.dd-menu::-webkit-scrollbar { display: none; }
.dd-menu.up { transform: translateY(4px); }
.dd-menu.open { opacity: 1; transform: none; }
.dd-o { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: transparent; color: inherit;
  text-align: left; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 15px; line-height: 1.3; }
.dd-o .dd-t { display: flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-o:hover, .dd-o.act { background: var(--soft); }
.dd-o.on { font-weight: 600; }
.dd-ok { width: 14px; height: 14px; flex: none; color: var(--ink); }
.dd-o .bk { margin-left: 0; }
input.has-bk { background-repeat: no-repeat !important; background-size: 22px 22px !important; background-position: 4px 50% !important; padding-left: 34px !important; }
/* bank icons */
.bk.bki { display: inline-block; object-fit: cover; border-radius: 28%; background: #fff; vertical-align: middle; position: relative; top: -.08em; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
@media (prefers-reduced-motion: reduce) { .dd-menu, .dd-ch { transition: none; } }

/* ---------- motion presets (owner 11-30): «Строго» = base above; «Мягко», «Пружина», «Кино» below ----------
   Only opacity / transform / filter / clip-path move, so nothing in the layout jumps. */
:root { --m-step: 0ms; }
:root[data-motion="soft"]   { --ease: cubic-bezier(.16,1,.3,1); --m-ease: cubic-bezier(.16,1,.3,1); --m-in: .55s; --m-step: 32ms; }
:root[data-motion="spring"] { --ease: cubic-bezier(.22,1.2,.36,1); --m-ease: cubic-bezier(.34,1.45,.64,1); --m-in: .5s; --m-step: 38ms; }
:root[data-motion="film"]   { --ease: cubic-bezier(.19,1,.22,1); --m-ease: cubic-bezier(.19,1,.22,1); --m-in: .7s; --m-step: 55ms; }

/* lists coming in one by one */
.stg { animation: var(--m-in, .4s) var(--m-ease, ease) both; animation-delay: calc(var(--i, 0) * var(--m-step)); }
:root[data-motion="soft"] .stg   { animation-name: stg-soft; }
:root[data-motion="spring"] .stg { animation-name: stg-spring; }
:root[data-motion="film"] .stg   { animation-name: stg-film; }
@keyframes stg-soft   { from { opacity: 0; transform: translateY(10px); } }
@keyframes stg-spring { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes stg-film   { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }

/* page change */
:root[data-motion="soft"]::view-transition-old(page)   { animation: m-fade-out .2s ease-in both; }
:root[data-motion="soft"]::view-transition-new(page)   { animation: m-soft-in .55s var(--m-ease) both; }
:root[data-motion="spring"]::view-transition-old(page) { animation: m-spring-out .18s ease-in both; }
:root[data-motion="spring"]::view-transition-new(page) { animation: m-spring-in .55s var(--m-ease) both; }
:root[data-motion="film"]::view-transition-old(page)   { animation: m-film-out-f .3s cubic-bezier(.4,0,1,1) both; }
:root[data-motion="film"]::view-transition-new(page)   { animation: m-film-in-f .75s var(--m-ease) both; }
:root[data-motion="film"][data-dir="back"]::view-transition-old(page) { animation-name: m-film-out-b; }
:root[data-motion="film"][data-dir="back"]::view-transition-new(page) { animation-name: m-film-in-b; }
@keyframes m-fade-out   { to { opacity: 0; } }
@keyframes m-soft-in    { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@keyframes m-spring-out { to { opacity: 0; transform: scale(.985); } }
@keyframes m-spring-in  { from { opacity: 0; transform: translateY(18px) scale(.975); } }
@keyframes m-film-out-f { to { opacity: 0; transform: translateX(-36px); filter: blur(6px); } }
@keyframes m-film-in-f  { from { opacity: 0; transform: translateX(56px); filter: blur(10px); } }
@keyframes m-film-out-b { to { opacity: 0; transform: translateX(36px); filter: blur(6px); } }
@keyframes m-film-in-b  { from { opacity: 0; transform: translateX(-56px); filter: blur(10px); } }

/* blocks redrawn by tabs / filters */
:root[data-motion="soft"] .enter   { animation: stg-soft .5s var(--m-ease) both; }
:root[data-motion="spring"] .enter { animation: stg-spring .5s var(--m-ease) both; }
:root[data-motion="film"] .enter   { animation: stg-film .65s var(--m-ease) both; }

/* the sliding tab highlight */
:root[data-motion="soft"] .ind   { transition: transform .5s var(--ease), width .5s var(--ease), height .5s var(--ease), opacity .3s; }
:root[data-motion="spring"] .ind { transition: transform .55s cubic-bezier(.34,1.4,.64,1), width .55s cubic-bezier(.34,1.4,.64,1), height .4s var(--ease), opacity .25s; }
:root[data-motion="film"] .ind   { transition: transform .7s var(--ease), width .7s var(--ease), height .7s var(--ease), opacity .4s; }

/* buttons, tiles, rows: hover and press */
:root:not([data-motion="base"]) .btn { transition: background-color .25s, border-color .25s, color .25s, transform .25s var(--ease), box-shadow .3s; }
:root[data-motion="spring"] .btn:active:not(:disabled) { transform: scale(.96); }
:root[data-motion="soft"] .btn:active:not(:disabled)   { transform: scale(.98); }
:root:not([data-motion="base"]) .pt { transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
:root[data-motion="spring"] .pt:hover { transform: translateY(-4px) scale(1.012); }
:root[data-motion="film"] .pt:hover   { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(10,11,12,.14); }
:root[data-motion="spring"] .pt:active { transform: scale(.98); }
:root:not([data-motion="base"]) .table tr { transition: background-color .25s; }

/* the payout card over the page */
:root[data-motion="soft"] .sheet-bg   { transition: opacity .4s; }
:root[data-motion="soft"] .sheet-box  { transform: translateY(26px) scale(.97); transition: opacity .35s, transform .55s var(--m-ease); }
:root[data-motion="spring"] .sheet-bg { transition: opacity .3s; }
:root[data-motion="spring"] .sheet-box { transform: translateY(30px) scale(.9); transition: opacity .25s, transform .55s var(--m-ease); }
:root[data-motion="film"] .sheet-bg   { transition: opacity .6s, backdrop-filter .6s; backdrop-filter: blur(0); }
:root[data-motion="film"] .sheet.open .sheet-bg { backdrop-filter: blur(8px); }
:root[data-motion="film"] .sheet-box  { transform: translateY(70px); filter: blur(6px); transition: opacity .45s, transform .75s var(--m-ease), filter .6s; }
:root[data-motion="film"] .sheet.open .sheet-box { filter: none; }
:root:not([data-motion="base"]) .sheet.open .sheet-box { transform: none; }

/* dialogs, dropdowns, toast, in-place confirm */
:root[data-motion="soft"] .dlg-box   { transition: opacity .3s, transform .5s var(--m-ease); }
:root[data-motion="spring"] .dlg-box { transform: scale(.88); transition: opacity .2s, transform .5s var(--m-ease); }
:root[data-motion="film"] .dlg-box   { transform: translateY(40px); filter: blur(6px); transition: opacity .4s, transform .7s var(--m-ease), filter .5s; }
:root:not([data-motion="base"]) .dlg.open .dlg-box { transform: none; filter: none; }
:root[data-motion="soft"] .dd-menu   { transition: opacity .22s, transform .35s var(--m-ease); }
:root[data-motion="spring"] .dd-menu { transform-origin: top center; transform: scale(.92) translateY(-6px); transition: opacity .16s, transform .4s var(--m-ease); }
:root[data-motion="spring"] .dd-menu.up { transform-origin: bottom center; transform: scale(.92) translateY(6px); }
:root[data-motion="film"] .dd-menu   { clip-path: inset(0 0 100% 0 round 14px); transform: none; transition: opacity .3s, clip-path .45s var(--m-ease); }
:root[data-motion="film"] .dd-menu.up { clip-path: inset(100% 0 0 0 round 14px); }
:root:not([data-motion="base"]) .dd-menu.open { transform: none; clip-path: inset(0 0 0 0 round 14px); }
:root[data-motion="soft"] #toast   { transition: opacity .3s, transform .5s var(--m-ease); }
:root[data-motion="spring"] #toast { transform: translate(-50%, 24px) scale(.9); transition: opacity .2s, transform .5s var(--m-ease); }
:root[data-motion="film"] #toast   { transform: translate(-50%, 30px); filter: blur(4px); transition: opacity .4s, transform .6s var(--m-ease), filter .4s; }
:root:not([data-motion="base"]) #toast.show { transform: translate(-50%, 0); filter: none; }
:root[data-motion="spring"] .sure { animation: stg-spring .4s var(--m-ease); }
:root[data-motion="film"] .sure   { animation: stg-film .5s var(--m-ease); }
.devsw { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .stg { animation: none !important; } }

/* ---------- 11-30 fit pass: things line up at every width ---------- */
/* timeline: time | event; a wrapped line starts under the event text */
.timeline > div { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; align-items: baseline; }
.timeline .t { margin-right: 0; }
.timeline .e { min-width: 0; overflow-wrap: anywhere; }
/* operator «Вернуть»: the note gets the whole line, the button goes under it */
.retf { flex-wrap: wrap; }
.retf input { flex: 1 1 100%; min-width: 0; }
/* dev menus live in the footer flow, so they never cover the page or «Powered by» */
.pw .devsw { position: static; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; margin: 0 0 14px;
  text-transform: none; letter-spacing: 0; font: 400 15px/1.35 var(--sans); color: var(--ink); }
@media (max-width: 760px) {
  .pw .devsw { flex-direction: column; align-items: center; min-height: 80px; }
  .pcard .req .btn, .btn.sm { min-height: 34px; }
}
@media (max-width: 760px) {
  /* queue stats: 3 + 2 instead of 2 + 2 + 1 */
  .stats.flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats.flow .stat { min-width: 0; }
  .stats.flow .stat:nth-last-child(2) { grid-column: span 2; }
  /* queue filters: separate chips that wrap, not three rows squeezed inside one outline */
  .qbar .seg { border: 0; padding: 0; background: transparent; border-radius: 0; gap: 6px; }
  .qbar .seg button { border: 1px solid var(--line); padding: 7px 12px; min-height: 36px; }
  .qbar .seg button.on { border-color: transparent; }
  .qbar .seg > .ind { border-radius: 999px; }
}
.stat[class*="st-"] .k::before { flex: none; }      /* the colour dot never gets squeezed */
@media (max-width: 760px) {
  .stats.flow .stat { padding: 10px 8px; }
  .stats.flow .stat .k { white-space: nowrap; font-size: 12px; letter-spacing: .02em; gap: 5px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  /* tablet: stats 3 + 2, the queue table fits without sideways scrolling */
  .stats.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .stats.flow .arr, .stats.flow .stat::before { display: none; }
  .stats.flow .stat { min-width: 0; margin-left: 0; }
  .stats.flow .stat:nth-last-child(2) { grid-column: span 2; }
  .table.qt th:nth-child(1), .table.qt td:nth-child(1) { display: none; }
  .table.qt td:nth-child(2) { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc) 70%, transparent); }
  .table.qt th, .table.qt td { padding-left: 10px; padding-right: 10px; }
}
/* balance card and the rows next to it: same top and bottom edge */
.sum0:not(.bal) { align-items: stretch; }
.sum0:not(.bal) > div:first-child { display: flex; flex-direction: column; }
.sum0:not(.bal) > div:first-child .sw { margin-top: auto; padding-top: 22px; }
/* queue table: tighter cells so all columns fit next to the card panel */
.table.qt th, .table.qt td { padding-left: 10px; padding-right: 10px; }
.table.qt th:first-child, .table.qt td:first-child { padding-left: 14px; }
/* tables answer to the room they actually get (next to a card panel, tablet, phone), not to the screen width:
   less important columns step out — they are all in the card / panel anyway */
.wrap-x { container-type: inline-size; }
@container (max-width: 760px) {
  .table.qt th:nth-child(1), .table.qt td:nth-child(1) { display: none; }
  .table.qt td:nth-child(2) { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc) 70%, transparent); }
}
@container (max-width: 650px) { .table.qt th:nth-child(5), .table.qt td:nth-child(5) { display: none; } }
@container (max-width: 520px) { .table.qt th:nth-child(3), .table.qt td:nth-child(3), .table.qt th:nth-child(7), .table.qt td:nth-child(7) { display: none; } }
@container (max-width: 840px) { .table.tt th:nth-child(4), .table.tt td:nth-child(4), .table.tt th:nth-child(5), .table.tt td:nth-child(5), .table.tt th:nth-child(6), .table.tt td:nth-child(6) { display: none; } }
@container (max-width: 520px) { .table.tt th:nth-child(8), .table.tt td:nth-child(8) { display: none; } }
.bkn { white-space: nowrap; }                       /* bank icon + name never split across lines */
/* card header: «#id · method · bank» stays on one line; when there is no room the status pill moves under it */
.pcard .head { flex-wrap: wrap; row-gap: 8px; }
.pcard .head > .muted { flex: 1 1 auto; }
.dd-menu.still { transition: none !important; }   /* a menu that opens upwards unrolls from the bottom, not from the top */

/* ---------- 11-30: phone motion — one calm move per tab change, no waves, no jumps (owner) ---------- */
@media (max-width: 760px) {
  /* the old page is not animated: when it was scrolled, its snapshot would snap to its top for a moment */
  :root[data-motion]::view-transition-old(page),
  :root[data-motion][data-dir="back"]::view-transition-old(page) { animation: none; opacity: 0; }
  /* the new page: a short slide in the tab's direction, no blur (a full-screen blur stutters on phones) */
  :root[data-motion]::view-transition-new(page)                  { animation: m-ph-in-f .32s var(--m-ease, var(--ease)) both; }
  :root[data-motion][data-dir="back"]::view-transition-new(page) { animation-name: m-ph-in-b; }
  :root[data-motion="base"]::view-transition-new(page)           { animation: vt-in .22s var(--ease) both; }
  /* no row-by-row wave on the phone, and redrawn blocks just fade */
  .stg { animation: none !important; }
  :root[data-motion] .enter { animation: m-ph-fade .22s ease-out both; }
  /* sheets, dialogs, toast: transform and opacity only */
  :root[data-motion] .sheet-box, :root[data-motion] .dlg-box, :root[data-motion] #toast { filter: none !important; }
  :root[data-motion] .sheet-bg { backdrop-filter: none !important; }
  :root[data-motion="film"] .sheet-box { transform: translateY(40px); transition: opacity .3s, transform .42s var(--m-ease); }
  :root[data-motion] .sheet.open .sheet-box { transform: none; }
}
@keyframes m-ph-in-f { from { opacity: 0; transform: translateX(18px); } }
@keyframes m-ph-in-b { from { opacity: 0; transform: translateX(-18px); } }
@keyframes m-ph-fade { from { opacity: 0; } }

/* ---------- 11-30: phone pass — card as a bottom sheet, queue rows as compact cards (owner) ---------- */
.pclose, .pbg { display: none; }
@media (max-width: 760px) {
  /* the payout / trader card: a sheet from the bottom over the list; the list stays where it was */
  .split > .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; max-height: 88vh; overflow: auto; overscroll-behavior: contain;
    margin: 0; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); background: var(--bg); border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .35); transform: translateY(104%); visibility: hidden;
    transition: transform .42s var(--m-ease, var(--ease)), visibility 0s linear .42s; }
  .split > .panel.open { transform: none; visibility: visible; transition: transform .42s var(--m-ease, var(--ease)), visibility 0s; }
  .pclose { display: block; position: sticky; top: 0; z-index: 3; width: calc(100% + 24px); height: 30px; margin: 0 -12px 4px; padding: 0;
    border: 0; background: var(--bg); cursor: pointer; }
  .pclose span { display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 99px; background: var(--muted); opacity: .45; }
  .pbg { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .pbg.open { opacity: 1; pointer-events: auto; }
  body.psheet { overflow: hidden; }
  body.psheet main { position: relative; z-index: 30; }          /* the sheet covers the header and the bottom tab bar */
  .table.qt tr.click.sel { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
  .table.qt tr.click.sel > td { background: transparent !important; }

  /* queue rows: stage + amount, requisite, trader · receipts · time — nothing hidden, no sideways scroll */
  .table.qt, .table.qt > tbody { display: block; }
  .table.qt tr:first-child { display: none; }
  .table.qt tr.click { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "st st amt" "req req req" "who rc tm";
    gap: 6px 10px; align-items: center; padding: 12px 12px 12px 15px; border-bottom: 1px solid var(--line);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc) 70%, transparent); }
  .table.qt tr.click > td { display: block !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; min-width: 0; }
  .table.qt tr.click > td:nth-child(1) { display: none !important; }
  .table.qt tr.click > td:nth-child(2) { grid-area: st; display: flex !important; align-items: center; gap: 10px; }
  .table.qt tr.click > td:nth-child(3) { grid-area: req; }
  .table.qt tr.click > td:nth-child(4) { grid-area: amt; font-size: 17px; }
  .table.qt tr.click > td:nth-child(5) { grid-area: who; color: var(--muted); font-size: 14px; }
  .table.qt tr.click > td:nth-child(6) { grid-area: tm; text-align: right; font-size: 14px; }
  .table.qt tr.click > td:nth-child(7) { grid-area: rc; font-size: 14px; }

  /* filters: one row of chips that scrolls sideways */
  .qbar .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; padding-bottom: 2px; }
  .qbar .seg::-webkit-scrollbar { display: none; }
  .qbar .seg button { flex: none; }

  /* «Кто что держит»: name + load, status under it */
  .table.ht, .table.ht > tbody { display: block; }
  .table.ht tr:first-child { display: none; }
  .table.ht tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm hl" "st rv"; gap: 4px 12px;
    padding: 11px 2px; border-bottom: 1px solid var(--line); }
  .table.ht td { display: block; padding: 0 !important; border: 0 !important; }
  .table.ht td:nth-child(1) { grid-area: nm; font-weight: 600; }
  .table.ht td:nth-child(2) { grid-area: st; font-size: 14px; color: var(--muted); }
  .table.ht td:nth-child(3) { grid-area: hl; text-align: right; }
  .table.ht td:nth-child(3)::before { content: 'в работе '; font: 14px var(--sans); color: var(--muted); }
  .table.ht td:nth-child(4) { grid-area: rv; text-align: right; font-size: 14px; }
  .table.ht td:nth-child(4):not(:empty)::before { content: 'на проверке '; color: var(--muted); }
  .table.ht td:nth-child(5) { display: none; }

  /* card stepper: the five labels fit side by side */
  .steps .l { font-size: 11.5px; letter-spacing: 0; white-space: nowrap; line-height: 1.2; }
}

@media (max-width: 760px) {
  /* admin «Трейдеры»: name + balance, status + load; limits and access live in the card */
  .table.tt, .table.tt > tbody { display: block; }
  .table.tt tr:first-child { display: none; }
  .table.tt tr.click { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm bal" "st hl"; gap: 5px 12px;
    align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table.tt tr.click > td { display: none !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
  .table.tt tr.click > td:nth-child(1) { display: block !important; grid-area: nm; font-weight: 600; white-space: normal; }
  .table.tt tr.click > td:nth-child(2) { display: block !important; grid-area: st; font-size: 14px; color: var(--muted); }
  .table.tt tr.click > td:nth-child(3) { display: block !important; grid-area: hl; text-align: right; }
  .table.tt tr.click > td:nth-child(3)::before { content: 'в работе '; font: 14px var(--sans); color: var(--muted); }
  .table.tt tr.click > td:nth-child(7) { display: block !important; grid-area: bal; }
  .table.tt tr.click.sel { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
}
@media (max-width: 760px) {
  /* big segmented tabs (settings: 4 tabs) never squeeze words into each other: they scroll sideways if needed */
  .seg.big:has(> button:nth-of-type(4)) { overflow-x: auto; scrollbar-width: none; }
  .seg.big:has(> button:nth-of-type(4))::-webkit-scrollbar { display: none; }
  .seg.big:has(> button:nth-of-type(4)) button { flex: 1 0 auto; padding-left: 12px; padding-right: 12px; }
}

/* ---------- 12-02 (owner): side card without a scrollbar and without the slide, traders strip, trader page, «Финансы» like Tonka ---------- */
/* the side card scrolls with the wheel / touch, no visible scrollbar (one card had it, another did not) */
.panel { scrollbar-width: none; }
.panel::-webkit-scrollbar { display: none; }
/* another payout in the card: a short fade in place — no translate, no blur, nothing jumps */
.swap { animation: swap-in .18s ease-out both !important; }
@keyframes swap-in { from { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .swap { animation: none !important; } }

/* own dropdown with a search line (traders) */
.dd-menu.dd-search { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.dd-s { flex: none; padding: 6px; border-bottom: 1px solid var(--line); }
.dd-s input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--panel); color: var(--ink); font: 15px var(--sans); }
.dd-s input:focus { outline: none; border-color: var(--ink); }
.dd-l { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 5px; scrollbar-width: none; }
.dd-l::-webkit-scrollbar { display: none; }
.dd-none { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* «Кто что держит»: one line of chips over the queue */
.whostrip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -8px 0 18px; }
.who-k { font: 600 12px var(--label, var(--sans)); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.wchip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel);
  color: var(--ink); font: 500 14px var(--sans); cursor: pointer; transition: border-color .15s, background-color .15s; }
.wchip:hover { border-color: var(--ink); }
.wchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wchip .dot { margin: 0; }
.wchip .wc-l { font: 600 13px var(--mono); opacity: .8; }
.wchip .wc-r { font-size: 12.5px; color: var(--st-review); }
.wchip .wc-h { font-size: 12.5px; color: var(--st-overdue); }
.wchip.on .wc-r, .wchip.on .wc-h { color: inherit; opacity: .8; }

/* trader page (staff) */
.tcard .thd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tcard .tnm { font-size: 19px; }
.tcard .tbal { text-align: right; }
.tcard .tbal .v { font: 650 18px var(--mono); white-space: nowrap; }
.tcard #trf .section:first-of-type { margin-top: 8px; }
.tstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tst { background: var(--panel); padding: 10px 12px; min-width: 0; }
.tst .v { font: 650 20px/1.2 var(--mono); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tst .k { color: var(--muted); font-size: 14px; }
.tst .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tst.bad .v { color: var(--bad); }
.tbars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: end; gap: 2px; height: 70px; margin: 16px 0 4px; }
.tb { display: flex; align-items: flex-end; height: 100%; }
.tb i { display: block; width: 100%; height: var(--h); border-radius: 3px 3px 1px 1px; background: var(--st-closed); }
.tb.none i { background: var(--line); }
.tbars-l { display: flex; justify-content: space-between; gap: 8px; }
.thist { display: grid; gap: 6px; }
.thr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a p" "m u" "t t"; gap: 3px 10px; align-items: center; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sc, var(--line)) 70%, transparent); }
.thr:hover { background: var(--hover); }
.thr .a { grid-area: a; font: 650 16px var(--mono); }
.thr .pill { grid-area: p; justify-self: end; }
.thr .m { grid-area: m; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thr .u { grid-area: u; justify-self: end; font-family: var(--mono); color: var(--st-closed); }
.thr .t { grid-area: t; }

/* ---------- «Финансы» ---------- */
.neg { color: var(--bad) !important; }
.pos { color: var(--st-closed); }
.stats.fin { width: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.stats.fin .stat { min-width: 0; }
.stats.fin .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fnote { margin: 0 0 14px; line-height: 1.45; }
.fbox-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 0 0 10px; }
.fbox-h h2 { margin: 0; }
.fstat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 26px; }
.ftiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.ft1 { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.ft1 span { color: var(--muted); font-size: 14px; }
.ft1 b { font: 650 21px/1.25 var(--mono); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft1 small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.ft1.res { border-color: var(--ink); }
.fchart { position: relative; display: flex; gap: 3px; height: 190px; padding-bottom: 34px; margin-bottom: 6px; }
.fz { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); pointer-events: none; }
.fcol { position: relative; flex: 1 1 0; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.fcol::after { content: ''; position: absolute; inset: 0 0 34px; border-radius: 6px; transition: background-color .15s; }
.fcol:hover::after { background: var(--hover); }
.fcol.sel::after { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line); }
.fcol .fp { position: absolute; inset: 0 0 34px; z-index: 1; pointer-events: none; }
.fcol i { position: absolute; left: 18%; right: 18%; border-radius: 4px; }
.fcol i.p { background: var(--st-closed); }
.fcol i.n { background: var(--bad); }
.fcol .fl { position: absolute; left: -10px; right: -10px; bottom: 0; height: 30px; font: 11.5px/1.25 var(--mono); color: var(--muted); text-align: center; white-space: nowrap; }
.fcol.sel .fl { color: var(--ink); font-weight: 600; }
.fst { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.fst-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 8px; }
.fst-h h3 { margin: 0; font-size: 16px; }
.fsr { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; }
.fsr > span { min-width: 0; }
.fsr small { display: block; color: var(--muted); font-size: 12.5px; }
.fsr b { font: 600 15px var(--mono); white-space: nowrap; }
.fsr.total { border-top: 1px solid var(--line); font-weight: 600; margin-top: 4px; }
.fsr.sub { padding-left: 16px; color: var(--muted); font-size: 14px; }
.fsr.sub b { font-weight: 500; color: var(--ink); }
.fsr.result { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 9px; font-weight: 650; font-size: 16px; }
.fsr.result b { font-size: 17px; }
.fcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 8px; }
.fbox { min-width: 0; }
.pctb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink);
  font: 600 14px var(--mono); cursor: pointer; white-space: nowrap; }
.pctb:hover { border-color: var(--ink); }
.pctb svg { width: 12px; height: 12px; opacity: .6; }
.table.fd tr.none td { color: var(--muted); }
.table.fd tr.sel td, .table.fl tr.click:hover td { background: var(--hover); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
@media (max-width: 1100px) { .stats.fin, .ftiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fcols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .whostrip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -8px -16px 16px; padding: 0 16px 2px; overscroll-behavior-x: contain; }
  .whostrip::-webkit-scrollbar { display: none; }
  .wchip { flex: none; }
  .seg[data-key=fper], .seg[data-key=trper] { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .seg[data-key=fper]::-webkit-scrollbar, .seg[data-key=trper]::-webkit-scrollbar { display: none; }
  .seg[data-key=fper] button, .seg[data-key=trper] button { flex: none; }
  .stats.fin { grid-template-columns: 1fr 1fr; }
  .stats.fin .v { font-size: 19px; white-space: normal; overflow-wrap: anywhere; }
  .fstat { padding: 14px 12px; }
  .ft1 b { font-size: 18px; }
  .fchart { height: 160px; gap: 2px; }
  /* finance tables: name + amounts on two lines */
  .table.ft, .table.ft > tbody, .table.fd, .table.fd > tbody, .table.fl, .table.fl > tbody { display: block; }
  .table.ft tr:first-child, .table.fd tr:first-child, .table.fl tr:first-child { display: none; }
  .table.ft tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm pr" "n rub"; gap: 3px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .table.ft td, .table.fd td, .table.fl td { display: block; padding: 0 !important; border: 0 !important; text-align: left; min-width: 0; }
  .table.ft td:nth-child(1) { grid-area: nm; font-weight: 600; }
  .table.ft td:nth-child(2) { grid-area: n; color: var(--muted); font-size: 14px; }
  .table.ft td:nth-child(2)::after { content: ' выпл.'; }
  .table.ft td:nth-child(3) { grid-area: rub; text-align: right; font-size: 14px; color: var(--muted); }
  .table.ft td:nth-child(4) { display: none; }
  .table.ft td:nth-child(5) { grid-area: pr; text-align: right; }
  .table.fm tr { grid-template-areas: "nm pr" "pc rub"; }
  .table.fm td:nth-child(2) { grid-area: pc; color: var(--ink); text-align: left; }
  .table.fm td:nth-child(2)::after { content: none; }
  .table.fm td:nth-child(3) { display: none; }
  .table.fm td:nth-child(4) { display: block; grid-area: rub; text-align: right; font-size: 14px; color: var(--muted); }
  .table.fd tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d pr" "n rub"; gap: 2px 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
  .table.fd td:nth-child(1) { grid-area: d; font-weight: 600; }
  .table.fd td:nth-child(2) { grid-area: n; color: var(--muted); font-size: 14px; }
  .table.fd td:nth-child(2)::after { content: ' выпл.'; }
  .table.fd td:nth-child(3) { grid-area: rub; text-align: right; color: var(--muted); font-size: 14px; }
  .table.fd td:nth-child(4), .table.fd td:nth-child(5), .table.fd td:nth-child(6) { display: none; }
  .table.fd td:nth-child(7) { grid-area: pr; text-align: right; }
  .table.fl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id pr" "who sum" "who mi" ". tr"; gap: 2px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .table.fl td:nth-child(1) { grid-area: id; }
  .table.fl td:nth-child(2) { grid-area: who; font-size: 14px; }
  .table.fl td:nth-child(3) { grid-area: sum; text-align: right; font-size: 14px; }
  .table.fl td:nth-child(3) .small { display: none; }
  .table.fl td:nth-child(4) { display: none; }
  .table.fl td:nth-child(5) { grid-area: mi; text-align: right; font-size: 13px; color: var(--muted); }
  .table.fl td:nth-child(5) .small, .table.fl td:nth-child(6) .small { display: none; }
  .table.fl td:nth-child(6) { grid-area: tr; text-align: right; font-size: 13px; color: var(--muted); }
  .table.fl td:nth-child(7) { grid-area: pr; text-align: right; }
  .table.bt td:last-child { white-space: nowrap; }
  .tstats .tst .v { font-size: 18px; }
}

/* ---------- 12-02 (owner): trader's own page, merchants section, Bitrix-like finance filters ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--muted); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--ink); }
.tphd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 18px; }
.tphd h1 { margin: 0 0 4px; }
.tphr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tphr .tbal { text-align: right; }
.tphr .tbal .v { font: 650 22px var(--mono); white-space: nowrap; }
.tps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tps-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 14px; }
.tpstats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: end; }
.tpstats .tstats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tpbars .tbars { height: 120px; margin-top: 0; }
.thbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.thq input { width: 190px; }
.table.th td { vertical-align: middle; }
.phd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.phd h1 { margin-bottom: 14px; }
.table.mt tr.off td { opacity: .55; }
details.apidoc { margin-top: 26px; }
details.apidoc summary { cursor: pointer; font: 600 14px var(--label, var(--sans)); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
details.apidoc pre { margin-top: 10px; }
a.tlink { margin-left: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
a.tlink:hover { color: var(--ink); text-decoration: underline; }

/* finance filter bar: active filters as chips, a panel with ready periods and fields */
.ffbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.ffbox { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ffbox.open { border-color: var(--ink); }
.ffopen { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--soft); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.ffopen svg { width: 16px; height: 16px; }
.ffchips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 11px; border-radius: 99px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; white-space: nowrap; }
.fchip b { font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fchip .fx { width: 22px; height: 22px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.fchip .fx:hover { background: var(--soft); color: var(--ink); }
.fchip:not(:has(.fx)) { padding-right: 11px; }
.fpanel { display: grid; grid-template-columns: 190px minmax(0, 1fr); margin: 0 0 18px; border: 1px solid var(--ink); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; animation: swap-in .16s ease-out both; }
.fpp { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); background: var(--soft); }
.fpp button { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: 15px var(--sans); cursor: pointer; }
.fpp button:hover { background: var(--hover); }
.fpp button.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.fpm { display: grid; gap: 14px; padding: 14px 16px; min-width: 0; }
.fpl { font: 600 12px var(--label, var(--sans)); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fpd { display: flex; align-items: center; gap: 8px; }
.fpd input { width: 150px; }
.fpicks { display: flex; flex-wrap: wrap; gap: 6px; }
.fpick { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink); font: 500 14px var(--sans); cursor: pointer; }
.fpick:hover { border-color: var(--ink); }
.fpick.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fpa { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
#fferr { color: var(--bad); }
.fpiv { margin-bottom: 8px; }
.fpiv .fbox-h .seg { flex-wrap: wrap; }
.table.pv tr.tot td { font-weight: 650; border-top: 2px solid var(--ink); }
@media (max-width: 1100px) { .tpstats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .tpstats .tstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tphr { width: 100%; justify-content: space-between; }
  .thbar .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .thbar .seg::-webkit-scrollbar { display: none; }
  .thbar .seg button { flex: none; }
  .thq, .thq input { width: 100%; }
  .ffbar { flex-wrap: wrap; }
  .ffbox { flex-wrap: wrap; }
  .fpanel { grid-template-columns: minmax(0, 1fr); }
  .fpp { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .fpp::-webkit-scrollbar { display: none; }
  .fpp button { flex: none; }
  .fpd input { width: 100%; min-width: 0; }
  .fpiv .fbox-h .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .fpiv .fbox-h .seg::-webkit-scrollbar { display: none; }
  .fpiv .fbox-h .seg button { flex: none; }
  .table.pv td:nth-child(8) { display: none; }
  .table.pv tr.tot { border-top: 2px solid var(--ink); }
  .table.mt, .table.mt > tbody { display: block; }
  .table.mt tr:first-child { display: none; }
  .table.mt tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm pc" "d30 pr" "act act"; gap: 6px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .table.mt td { display: block; padding: 0 !important; border: 0 !important; text-align: left; min-width: 0; }
  .table.mt td:nth-child(1) { grid-area: nm; }
  .table.mt td:nth-child(2) { grid-area: pc; }
  .table.mt td:nth-child(3), .table.mt td:nth-child(6) { display: none; }
  .table.mt td:nth-child(4) { grid-area: d30; color: var(--muted); font-size: 14px; }
  .table.mt td:nth-child(5) { grid-area: pr; text-align: right; }
  .table.mt td:nth-child(7) { grid-area: act; text-align: left; }
}
@media (max-width: 760px) {
  /* owner menu has 7 items on the phone: each item as wide as its word, a touch smaller, nothing overlaps */
  nav.tabs:has(> a:nth-of-type(7)) a { flex: 1 1 auto; padding: 7px 2px; font-size: 10.5px; }
}

/* ---------- 12-02 (owner): Rapira rate in the header, top right ---------- */
/* owner 12-03 «сумбурно, не ровно»: same height as the theme button, text centred, one font family, calm label */
.ratechip { box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); white-space: nowrap; line-height: 1; }
.ratechip:empty { display: none; }
.ratechip .rc-k { font: 500 13px var(--sans); color: var(--muted); line-height: 1; }
.ratechip .rc-v { font: 600 15px var(--sans); font-variant-numeric: tabular-nums; line-height: 1; }
.ratechip.stale .rc-k { color: var(--warn); }
@media (max-width: 760px) {
  .ratechip { padding: 0 11px; gap: 6px; }
}
@media (max-width: 480px) {
  .ratechip .rc-k { display: none; }
  .ratechip .rc-k { font-size: 12px; }
  .ratechip .rc-v { font-size: 14px; }
}

/* settings page (12-04): every line explains itself */
.setform { max-width: 720px; }
.setform .section { margin-bottom: 6px; }
.setv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.sethint { color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 4px; max-width: 52ch; }
.setform .row { align-items: start; }
.setform .row > label:first-child { padding-top: 8px; }
