@font-face { font-family: "Vazirmatn"; src: url("/static/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; }

/* ============================================================ tokens (dark is the default) */
:root {
  color-scheme: dark;
  --bg: #0a0e13; --panel: #11171f; --panel2: #18202a; --panel3: #1f2834; --hover: #232e3c;
  --line: #222c39; --line2: #313e50; --text: #e8edf3; --dim: #8796a8; --faint: #5d6b7c;
  --buy: #19c785; --buy-bg: rgba(25,199,133,.13); --sell: #f2555a; --sell-bg: rgba(242,85,90,.13);
  --warn: #f2a93b; --warn-bg: rgba(242,169,59,.12); --accent: #4d8dff; --accent-bg: rgba(77,141,255,.14);
  --on-accent: #fff; --on-buy: #03140d;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 24px rgba(0,0,0,.28);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
  --radius: 12px; --radius-sm: 8px; --head: rgba(10,14,19,.86);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8; --panel: #ffffff; --panel2: #f6f8fb; --panel3: #edf1f6; --hover: #e7ecf3;
  --line: #e2e7ee; --line2: #cdd5e0; --text: #111827; --dim: #5f6b7d; --faint: #94a0b0;
  --buy: #05966a; --buy-bg: rgba(5,150,106,.10); --sell: #dc2a35; --sell-bg: rgba(220,42,53,.08);
  --warn: #b26a00; --warn-bg: rgba(242,169,59,.14); --accent: #2463eb; --accent-bg: rgba(36,99,235,.10);
  --on-accent: #fff; --on-buy: #fff;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.16);
  --head: rgba(255,255,255,.88);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.65 "Vazirmatn", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, input.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; }
.dim { color: var(--dim); }
.buy { color: var(--buy); } .sell { color: var(--sell); } .warn { color: var(--warn); }
.boot { padding: 40px; text-align: center; color: var(--dim); }
.hidden { display: none !important; }
a { color: var(--accent); }
::selection { background: var(--accent-bg); }
summary { cursor: pointer; }

/* ============================================================ controls */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line2);
  background: var(--panel2); cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background .12s, transform .06s, border-color .12s, box-shadow .12s; }
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--faint); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-bg); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.buy { background: var(--buy); border-color: var(--buy); color: var(--on-buy); font-weight: 700; }
.btn.danger { background: var(--sell-bg); border-color: color-mix(in srgb, var(--sell) 55%, transparent); color: var(--sell); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--sell) 22%, transparent); border-color: var(--sell); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; display: inline-grid; place-items: center; }
.btn.sm.icon { width: 30px; }
input, select { height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line2);
  background: var(--bg); outline: none; min-width: 0; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { border-radius: var(--radius-sm); border: 1px solid var(--line2); background: var(--bg); padding: 6px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input:disabled { opacity: .5; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
input.bad { border-color: var(--sell); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.grow { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .tr { width: 40px; height: 23px; border-radius: 12px; background: var(--line2); position: relative; transition: background .15s; flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: right .15s; }
.switch input:checked + .tr { background: var(--buy); }
.switch input:checked + .tr::after { right: 20px; }
.switch.danger input:checked + .tr { background: var(--sell); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line2); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--panel2); max-width: 100%; }
.seg button { min-height: 32px; border: 0; background: transparent; cursor: pointer; color: var(--dim); padding: 0 10px; transition: background .12s, color .12s; }
.seg button:hover { color: var(--text); }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.seg button.on.b { background: var(--buy-bg); color: var(--buy); }
.seg button.on.s { background: var(--sell-bg); color: var(--sell); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.ok { background: var(--buy); box-shadow: 0 0 0 3px var(--buy-bg); }
.dot.bad { background: var(--sell); box-shadow: 0 0 0 3px var(--sell-bg); }
.dot.wait { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* pills and badges */
.armed-pill, .pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--panel2); font-size: 13px; white-space: nowrap; }
.armed-pill.on { border-color: color-mix(in srgb, var(--sell) 60%, transparent); background: var(--sell-bg); color: var(--sell); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 20px; border-radius: 999px; font-size: 11px;
  font-weight: 600; background: var(--panel3); color: var(--dim); white-space: nowrap; vertical-align: middle; }
.badge.buy { background: var(--buy-bg); color: var(--buy); } .badge.sell { background: var(--sell-bg); color: var(--sell); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.acc { background: var(--accent-bg); color: var(--accent); }

/* ============================================================ auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--accent-bg), transparent 70%), var(--bg); }
.auth .card { width: 100%; max-width: 380px; padding: 24px; gap: 14px; box-shadow: var(--shadow-lg); }
.auth h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--buy), #0e8f62); display: inline-grid; place-items: center; flex: none; }
.logo svg { width: 18px; height: 18px; }

/* ============================================================ shell */
header.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 58px; background: var(--head); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.clock { font-size: 13px; color: var(--dim); white-space: nowrap; }
.tabs { display: flex; gap: 2px; min-width: 0; }
.tabs button { height: 38px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--dim);
  cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: color .12s, background .12s; }
.tabs button svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.tabs button:hover { color: var(--text); background: var(--panel2); }
.tabs button.on { color: var(--accent); background: var(--accent-bg); }
.tabs button .cnt, .bnav .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sell); color: #fff;
  font-size: 11px; display: inline-grid; place-items: center; font-weight: 700; }
main { padding: 20px; max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex;
  flex-direction: column; gap: 12px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h2 .ic { width: 18px; height: 18px; color: var(--dim); }
.card .sub { font-size: 12px; color: var(--dim); margin-top: -8px; }
.card.flat { box-shadow: none; background: var(--panel2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: 20px; font-weight: 800; }
.pagehead .sub { color: var(--dim); font-size: 13px; }
.subnav { display: inline-grid; grid-auto-flow: column; grid-auto-columns: auto; width: fit-content; max-width: 100%; }

/* bottom navigation (phones) */
.bnav { display: none; }
@media (max-width: 900px) {
  header.top .tabs { display: none; }
  .bnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    background: var(--head); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bnav button { border: 0; background: transparent; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 1px;
    font-size: 10.5px; font-weight: 600; padding: 6px 0 4px; border-radius: var(--radius-sm); cursor: pointer; position: relative; min-width: 0; }
  .bnav button svg { width: 22px; height: 22px; }
  .bnav button.on { color: var(--accent); }
  .bnav button.on::before { content: ""; position: absolute; top: -4px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .bnav .cnt { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); gap: 12px; }
  header.top { padding: 0 12px; height: 52px; gap: 8px; }
  .clock { display: none; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 520px) {
  .card { padding: 12px; border-radius: 10px; }
  .pagehead h1 { font-size: 18px; }
  header.top .brand .bt { display: none; }
}

/* ============================================================ today dashboard */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.phase { display: flex; flex-direction: column; gap: 4px; }
.phase .big { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.phase .next { font-size: 13px; color: var(--dim); }
.timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.timeline div { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--faint); min-width: 0; }
.timeline div::before { content: ""; height: 4px; border-radius: 2px; background: var(--line2); }
.timeline div.done { color: var(--dim); } .timeline div.done::before { background: var(--accent); opacity: .55; }
.timeline div.now { color: var(--accent); font-weight: 700; } .timeline div.now::before { background: var(--accent); }
.timeline span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex;
  flex-direction: column; gap: 2px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, transform .08s; min-width: 0; }
.tile:hover { border-color: var(--line2); }
.tile:active { transform: translateY(1px); }
.tile .k { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 22px; font-weight: 800; line-height: 1.3; }
.tile .s { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.armcard { display: flex; flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.armcard.on { border-color: color-mix(in srgb, var(--sell) 50%, transparent); background: linear-gradient(0deg, var(--sell-bg), var(--sell-bg)), var(--panel); }
.armcard .t { font-weight: 800; font-size: 16px; }
.list { display: flex; flex-direction: column; }
.list > .it { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list > .it:last-child { border-bottom: 0; }
.list .it .m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list .it .m b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .it .m small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--dim); font-size: 13px; padding: 10px 0; text-align: center; }
.ev { font-size: 13px; display: flex; gap: 8px; padding: 4px 0; min-width: 0; }
.ev .num { color: var(--faint); flex: none; }

/* queue score */
.score { --c: var(--dim); --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel); }
.score b { position: relative; font-size: 14px; color: var(--c); font-variant-numeric: tabular-nums; }
.score.green { --c: var(--buy); } .score.amber { --c: var(--warn); } .score.red { --c: var(--sell); }
.score.sm { width: 36px; height: 36px; } .score.sm b { font-size: 12px; } .score.sm::before { inset: 3px; }
.qcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qcard:last-child { border-bottom: 0; }
.qcard .m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qcard .why { font-size: 12px; color: var(--dim); }
.qcard .nums { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.qcard .nums b { color: var(--text); font-weight: 600; }
.auto { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); flex-wrap: wrap; justify-content: flex-end; }
.auto input.num { width: 52px; height: 30px; text-align: center; }
@media (max-width: 600px) {
  .qcard { grid-template-columns: auto minmax(0, 1fr); }
  .qcard .auto { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ============================================================ accounts */
.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel2); }
.acc .nm { font-weight: 700; }
.captcha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.captcha img { height: 40px; border-radius: 6px; background: #fff; cursor: pointer; }
.captcha input { width: 110px; }
.qr { background: #fff; padding: 8px; border-radius: 8px; width: fit-content; }
.qr svg { display: block; width: 180px; height: 180px; }
code.sec { direction: ltr; font-size: 12px; background: var(--bg); padding: 4px 6px; border-radius: 6px; word-break: break-all; }

/* ============================================================ sar-khati */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1250px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px)  { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .cols { grid-template-columns: minmax(0, 1fr); } .col.addcol { min-height: 64px; } }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column;
  gap: 8px; position: relative; box-shadow: var(--shadow); min-width: 0; }
.col.b { border-top: 3px solid var(--buy); } .col.s { border-top: 3px solid var(--sell); }
.col .hd { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.col .x { border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 16px; width: 28px; height: 28px; border-radius: 6px; }
.col .x:hover { background: var(--sell-bg); color: var(--sell); }
.col.addcol { border: 1.5px dashed var(--line2); background: transparent; align-items: center; justify-content: center; min-height: 200px;
  cursor: pointer; color: var(--dim); font-size: 15px; box-shadow: none; }
.col.addcol:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.symwrap { position: relative; min-width: 0; }
.dd { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 25; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.symwrap label + .dd { top: 100%; }
.dd div { padding: 7px 10px; cursor: pointer; display: flex; gap: 8px; font-size: 13px; }
.dd div:hover, .dd div.act { background: var(--accent-bg); }
.dd .nm { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info { font-size: 12px; background: var(--panel2); border-radius: var(--radius-sm); padding: 6px 8px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; min-height: 52px; }
.info .v { text-align: left; }
.band { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--sell), var(--line2), var(--buy)); margin-top: 2px; position: relative; }
.band i { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--text); }
.err { font-size: 12px; color: var(--sell); min-height: 18px; }
.cap { font-size: 11px; color: var(--dim); }
.val { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }

.review { border: 1px solid color-mix(in srgb, var(--warn) 60%, transparent); background: linear-gradient(0deg, var(--warn-bg), var(--warn-bg)), var(--panel); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { text-align: right; color: var(--dim); font-weight: 500; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--panel2); position: sticky; top: 0; }
table.t th:first-child { border-start-start-radius: var(--radius-sm); } table.t th:last-child { border-start-end-radius: var(--radius-sm); }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover { background: var(--panel2); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.msg { white-space: normal; max-width: 340px; min-width: 160px; font-size: 12px; color: var(--dim); }
tr.warnrow td { background: var(--warn-bg); }
.tw { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
/* portfolio: big numbers, two small charts, cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat .k { color: var(--dim); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 520px) { .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stat .v { font-size: 17px; } }
.stat .s { font-size: 12px; min-height: 18px; }
.pfcharts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .pfcharts { grid-template-columns: minmax(0, 1fr); } }
.donut { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.donut svg { flex: none; }
.legend { flex: 1; min-width: 150px; display: grid; gap: 4px; font-size: 13px; }
.legend .lg { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
svg.line { width: 100%; height: 110px; display: block; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pcard { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel2); padding: 10px 12px; display: grid; gap: 6px; }
.pcard .ph { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcard .pv { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.pcard .pg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; font-size: 13px; }
.pcard .pg > div { display: flex; justify-content: space-between; gap: 8px; }
.pcard .btn.block { height: 42px; }
.trow { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }

/* the phone: every table row is a card (column name : value), buttons full width — nothing to scroll sideways */
@media (max-width: 640px) {
  .tw { overflow: visible; border: 0; border-radius: 0; }
  .tw table.t, .tw table.t tbody { display: block; width: 100%; }
  .tw table.t thead { display: none; }
  .tw table.t tbody tr { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); margin-bottom: 8px; padding: 6px 12px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; }
  .tw table.t td:has(.btn), .tw table.t td.msg, .tw table.t td:has(input[type="checkbox"]) { grid-column: 1 / -1; }
  .tw table.t tbody tr:hover { background: var(--panel); }
  .tw table.t td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0;
    border: 0; white-space: normal; text-align: left; min-height: 30px; }
  .tw table.t td::before { content: attr(data-l); color: var(--dim); font-size: 12px; text-align: right; flex: none; }
  .tw table.t td[data-l=""]::before { content: none; }
  .tw table.t td:empty { display: none; }
  .tw table.t td.msg { max-width: none; min-width: 0; }
  .tw table.t td .btn { flex: 1; height: 42px; font-size: 14px; }
}
.hold { position: relative; overflow: hidden; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--sell); background: var(--sell-bg);
  color: var(--sell); font-weight: 800; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; display: grid; place-items: center; padding: 0 12px; text-align: center; }
.hold .fill { position: absolute; inset-block: 0; right: 0; width: 0; background: color-mix(in srgb, var(--sell) 40%, transparent); }
.hold span { position: relative; }
.sess { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sess.run { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: ""; width: 7px; height: 7px; border-inline-start: 2px solid var(--dim); border-bottom: 2px solid var(--dim);
  transform: rotate(45deg); transition: transform .15s; margin-inline-end: 2px; flex: none; }
details.card[open] > summary::before { transform: rotate(-45deg); }
.mv { display: flex; gap: 6px; flex-wrap: wrap; }
.mv span { background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 4px 2px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mv button { border: 0; background: transparent; color: var(--dim); cursor: pointer; }

/* ============================================================ plan + manual list */
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .mgrid { grid-template-columns: minmax(0, 1fr); } }
.mcode { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel2); min-width: 0; }
.mcode .hd { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mcode .hd .n { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--accent-bg); color: var(--accent); font-size: 13px; }
.mline { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.mline .o { color: var(--faint); font-size: 12px; text-align: center; }
.mline .chip, .chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line2); background: var(--panel); font-weight: 700; min-width: 0; }
.chip .nm { font-weight: 400; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .mres { grid-template-columns: minmax(0, 1fr); } }
.msell { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 520px) { .msell { grid-template-columns: minmax(0, 1fr) auto; } .msell > :first-child { grid-column: 1 / -1; } }
.steps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.steps span { display: inline-flex; align-items: center; gap: 6px; }
.steps i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--panel3); font-size: 11px; font-weight: 700; }
.steps .on i { background: var(--accent); color: var(--on-accent); }
.steps .on { color: var(--text); }

#toasts { position: fixed; bottom: 16px; left: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--panel); border: 1px solid var(--line2); border-inline-start: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px;
  box-shadow: var(--shadow-lg); animation: tin .15s ease-out; }
.toast.ok { border-inline-start-color: var(--buy); } .toast.err { border-inline-start-color: var(--sell); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* owner 2026-10-06: less on screen — card and page descriptions hidden (the sign-in keeps its own) */
.card > .sub, .pagehead .sub { display: none; }
.auth .card > .sub { display: block; }
.pkset { border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 12px; }
.pkset > summary { cursor: pointer; font-size: 13px; }
.pkset[open] > summary { margin-bottom: 8px; }
.pkset > .row { margin-top: 6px; }
.pkt tr[data-pkx] { cursor: pointer; }
.pkcodes > summary, .advbox > summary { cursor: pointer; }
.advbox > section { margin-top: 16px; }
.advbox > summary { font-size: 13px; color: var(--dim); padding: 4px 2px; }
.advbox[open] > summary { margin-bottom: 8px; }

.card.radar { border-color: var(--buy); box-shadow: 0 0 0 1px var(--buy) inset; }
