/* Панель ботов — тот же язык, что у MarketPrint: «жидкое стекло» поверх мягкого цветного фона,
   системные цвета Apple только для смысла (зелёный — прибыль/работает, красный — убыток/ошибка,
   оранжевый — не настоящие деньги, синий — линия капитала и действия). */
:root {
  --bg: #e8ecf5; --solid: #f6f7fb;
  --blob-a: rgba(64, 120, 255, .28); --blob-b: rgba(255, 92, 150, .16); --blob-c: rgba(40, 205, 170, .20); --blob-d: rgba(255, 176, 64, .18);
  --glass: rgba(255, 255, 255, .62); --glass-hi: rgba(255, 255, 255, .95); --menu-bg: rgba(250, 251, 254, .92);
  --rim: rgba(255, 255, 255, .95); --rim-2: rgba(255, 255, 255, .30); --shade: rgba(34, 46, 88, .09);
  --well: rgba(112, 124, 160, .11); --line: rgba(60, 72, 110, .11); --grid: rgba(60, 72, 110, .10);
  --ink: #0e1117; --ink-2: #3a404c; --muted: #6e7686; --faint: #aab0bd; --knob: #fff; --on-color: #fff;
  --blue: #007aff; --blue-ink: #0062d6; --blue-soft: rgba(0, 122, 255, .12); --blue-wash: rgba(0, 122, 255, .10);
  --green: #34c759; --green-ink: #1c8a3a; --green-soft: rgba(52, 199, 89, .15);
  --red: #ff3b30; --red-ink: #d3241a; --red-soft: rgba(255, 59, 48, .12);
  --orange: #ff9500; --orange-ink: #b65d00; --orange-soft: rgba(255, 149, 0, .15);
  --teal: #30b0c7; --teal-ink: #117d92; --teal-soft: rgba(48, 176, 199, .15);
  --f-ui: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --r-card: 24px; --r-ctl: 14px; --gap: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #060912; --solid: #141824;
  --blob-a: rgba(38, 98, 255, .32); --blob-b: rgba(148, 70, 255, .20); --blob-c: rgba(0, 196, 176, .14); --blob-d: rgba(255, 45, 117, .10);
  --glass: rgba(26, 31, 46, .60); --glass-hi: rgba(255, 255, 255, .14); --menu-bg: rgba(30, 35, 50, .94);
  --rim: rgba(255, 255, 255, .28); --rim-2: rgba(255, 255, 255, .05); --shade: rgba(0, 0, 0, .40);
  --well: rgba(255, 255, 255, .065); --line: rgba(255, 255, 255, .08); --grid: rgba(255, 255, 255, .07);
  --ink: #f3f5f9; --ink-2: #c8cdd9; --muted: #8c94a6; --faint: #4c5466;
  --blue: #0a84ff; --blue-ink: #4ca2ff; --blue-soft: rgba(10, 132, 255, .20); --blue-wash: rgba(10, 132, 255, .12);
  --green: #30d158; --green-ink: #4fdc78; --green-soft: rgba(48, 209, 88, .17);
  --red: #ff453a; --red-ink: #ff6b62; --red-soft: rgba(255, 69, 58, .18);
  --orange: #ff9f0a; --orange-ink: #ffb340; --orange-soft: rgba(255, 159, 10, .18);
  --teal: #40c8e0; --teal-ink: #70d8ea; --teal-soft: rgba(64, 200, 224, .18);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #060912; --solid: #141824;
  --blob-a: rgba(38, 98, 255, .32); --blob-b: rgba(148, 70, 255, .20); --blob-c: rgba(0, 196, 176, .14); --blob-d: rgba(255, 45, 117, .10);
  --glass: rgba(26, 31, 46, .60); --glass-hi: rgba(255, 255, 255, .14); --menu-bg: rgba(30, 35, 50, .94);
  --rim: rgba(255, 255, 255, .28); --rim-2: rgba(255, 255, 255, .05); --shade: rgba(0, 0, 0, .40);
  --well: rgba(255, 255, 255, .065); --line: rgba(255, 255, 255, .08); --grid: rgba(255, 255, 255, .07);
  --ink: #f3f5f9; --ink-2: #c8cdd9; --muted: #8c94a6; --faint: #4c5466;
  --blue: #0a84ff; --blue-ink: #4ca2ff; --blue-soft: rgba(10, 132, 255, .20); --blue-wash: rgba(10, 132, 255, .12);
  --green: #30d158; --green-ink: #4fdc78; --green-soft: rgba(48, 209, 88, .17);
  --red: #ff453a; --red-ink: #ff6b62; --red-soft: rgba(255, 69, 58, .18);
  --orange: #ff9f0a; --orange-ink: #ffb340; --orange-soft: rgba(255, 159, 10, .18);
  --teal: #40c8e0; --teal-ink: #70d8ea; --teal-soft: rgba(64, 200, 224, .18);
  color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased; }
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(44vmax 44vmax at 4% 2%, var(--blob-a), transparent 62%),
              radial-gradient(38vmax 38vmax at 98% 8%, var(--blob-b), transparent 60%),
              radial-gradient(42vmax 42vmax at 80% 98%, var(--blob-c), transparent 62%),
              radial-gradient(34vmax 34vmax at 14% 92%, var(--blob-d), transparent 60%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
:is(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.num, .tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--green-ink); }
.neg { color: var(--red-ink); }

/* стекло */
.glass { position: relative; background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(185%); backdrop-filter: blur(26px) saturate(185%);
  box-shadow: 0 1px 1px var(--shade), 0 14px 34px var(--shade); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, var(--rim), var(--rim-2) 34%, transparent 52%, var(--rim-2) 78%, var(--rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ───────── каркас: боковая панель на компьютере, нижняя на телефоне ───────── */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.rail .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 600; font-size: 15px; }
.rail .brand img { width: 30px; height: 30px; border-radius: 8px; }
.rail .brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.navlink { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 12px; color: var(--ink-2);
  font-weight: 500; text-decoration: none; }
.navlink:hover { background: var(--well); text-decoration: none; }
.navlink[aria-current="page"] { background: var(--glass-hi); color: var(--ink); box-shadow: 0 1px 2px var(--shade); }
.navlink svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.navlink[aria-current="page"] svg { color: var(--blue); }
.navlink .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.rail .spacer { flex: 1; }
.rail .ver { padding: 8px 12px; font-size: 11.5px; color: var(--faint); }
.main { padding: 22px 26px 60px; min-width: 0; max-width: 1360px; width: 100%; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 14px 16px 104px; }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 40; border-radius: 22px; padding: 6px; background: var(--menu-bg); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 16px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--blue-ink); background: var(--blue-soft); }
}

/* ───────── заголовки страниц ───────── */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.pagehead h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.back svg { width: 16px; height: 16px; }

/* ───────── кнопки и поля ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 0;
  background: var(--glass-hi); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px var(--shade), inset 0 0 0 1px var(--line); }
.btn:hover { filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--blue); color: var(--on-color); box-shadow: 0 6px 18px var(--blue-soft); }
.btn.danger { background: var(--red-soft); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red-soft); }
.btn.danger.solid { background: var(--red); color: var(--on-color); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--blue-ink); padding: 0 8px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; }
.field { display: grid; gap: 6px; align-content: start; }
.rows .wide { grid-column: span 2; }
.field > .seg { justify-self: start; }
@media (max-width: 560px) { .rows .wide { grid-column: auto; } }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.input, .select { height: 42px; width: 100%; padding: 0 12px; border-radius: 12px; border: 0; background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.input.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: .01em; }
.unit { position: relative; }
.unit .input { padding-right: 42px; }
.unit b { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-weight: 500; color: var(--muted); font-size: 13px; pointer-events: none; }
.select option { background: var(--solid); color: var(--ink); }
.seg { display: inline-flex; background: var(--well); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--glass-hi); color: var(--ink); box-shadow: 0 1px 2px var(--shade), 0 4px 12px var(--shade); }
.seg.scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }

/* переключатель как в iOS */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 51px; height: 31px; border-radius: 16px; background: var(--well); position: relative; flex: none;
  box-shadow: inset 0 0 0 1px var(--line); transition: background .2s ease; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--knob); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.32, .72, 0, 1); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
.switch.sm .track { width: 40px; height: 24px; }
.switch.sm .track::after { width: 20px; height: 20px; }
.switch.sm input:checked + .track::after { transform: translateX(16px); }

/* чипы */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--well);
  color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.paper { background: var(--teal-soft); color: var(--teal-ink); }
.chip.testnet { background: var(--orange-soft); color: var(--orange-ink); }
.chip.live { background: var(--green-soft); color: var(--green-ink); }
.chip.warn { background: var(--orange-soft); color: var(--orange-ink); }
.chip.bad { background: var(--red-soft); color: var(--red-ink); }
.chip.good { background: var(--green-soft); color: var(--green-ink); }
.chip svg { width: 13px; height: 13px; }
.sym { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.coin { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: #fff;
  letter-spacing: -.02em; flex: none; background: linear-gradient(160deg, #5e8bff, #3c4fd6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.coin.gold { background: linear-gradient(160deg, #ffcc4d, #f29a00); }

/* состояние бота: точка-пульс */
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.state.running .dot { background: var(--green); box-shadow: 0 0 0 0 var(--green-soft); animation: pulse 2.4s ease-out infinite; }
.state.paused .dot { background: var(--orange); }
.state.crashed .dot, .state.error .dot { background: var(--red); }
.state.starting .dot, .state.waiting .dot { background: var(--orange); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .45); } 70% { box-shadow: 0 0 0 9px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }
@media (prefers-reduced-motion: reduce) { .state.running .dot { animation: none; } * { transition: none !important; } }

/* ───────── обзор: часы 4-часовой свечи ───────── */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; border-radius: 28px; padding: 20px 24px; margin-bottom: var(--gap); }
.dial { position: relative; width: 132px; height: 132px; }
.dial svg { width: 100%; height: 100%; display: block; }
.dial .seg-bg { stroke: var(--well); }
.dial .seg-done { stroke: var(--blue); opacity: .30; }
.dial .seg-now { stroke: var(--blue); }
.dial .tick { fill: var(--muted); font-size: 9px; font-weight: 600; }
.dial circle.tick { fill: var(--faint); }
.dial .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial .center b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dial .center span { font-size: 11px; color: var(--muted); }
.hero h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.hero .lead { margin: 0 0 14px; color: var(--muted); max-width: 62ch; }
.figs { display: flex; flex-wrap: wrap; gap: 10px 34px; }
.fig .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.fig .l { font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) {
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: 18px; }
  .dial { width: 112px; height: 112px; }
  .fig .v { font-size: 22px; }
}

/* ───────── карточки ботов ───────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--gap); }
@media (max-width: 400px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card { border-radius: var(--r-card); padding: 18px; }
.botcard { display: grid; gap: 14px; cursor: pointer; }
.botcard:hover { box-shadow: 0 1px 1px var(--shade), 0 18px 40px var(--shade); }
.botcard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.botcard h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.botcard .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.botcard .money { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.botcard .eq { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.botcard .sub { font-size: 12.5px; color: var(--muted); }
.spark { width: 132px; height: 40px; flex: none; }
.spark path.l { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.a { fill: var(--blue-wash); stroke: none; }
.botcard .bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.posline { display: flex; flex-wrap: wrap; gap: 6px; }
.addcard { display: grid; place-content: center; justify-items: center; gap: 10px; min-height: 220px; border-radius: var(--r-card); color: var(--muted);
  border: 1.5px dashed var(--line); background: transparent; cursor: pointer; font-weight: 600; }
.addcard:hover { color: var(--blue-ink); border-color: var(--blue-soft); background: var(--blue-wash); }
.addcard svg { width: 28px; height: 28px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; }
.section-h h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }

/* ───────── страница бота ───────── */
.botbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-radius: 20px; margin-bottom: var(--gap); }
.botbar .grow { flex: 1; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 16px; margin-bottom: var(--gap); font-size: 13.5px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--orange-soft); color: var(--ink); }
.notice.warn svg { color: var(--orange-ink); }
.notice.bad { background: var(--red-soft); }
.notice.bad svg { color: var(--red-ink); }
.notice.info { background: var(--blue-soft); }
.notice.info svg { color: var(--blue-ink); }
.notice b { font-weight: 650; }
.notice .act { margin-left: auto; }
.tabs { margin-bottom: var(--gap); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { border-radius: 20px; padding: 14px 16px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.kpi .d { font-size: 12.5px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .two { grid-template-columns: minmax(0, 1fr); } }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.card .cap { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }

/* график капитала */
.chart { position: relative; height: 280px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart path.line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart path.area { fill: var(--blue-wash); }
.chart line.base { stroke: var(--faint); stroke-width: 1; }
.chart line.cross { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.chart circle.mk { fill: var(--blue); stroke: var(--solid); stroke-width: 2; }
.chart .tip { position: absolute; top: 6px; pointer-events: none; padding: 8px 11px; border-radius: 12px; background: var(--menu-bg);
  box-shadow: 0 8px 24px var(--shade), inset 0 0 0 1px var(--line); font-size: 12px; white-space: nowrap; }
.chart .tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart .empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 20px; }
.rangebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* таблицы */
.tablewrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
td .sub { display: block; font-size: 11.5px; color: var(--muted); }
.empty-row { padding: 26px 10px; text-align: center; color: var(--muted); }
.rank { display: inline-grid; grid-template-columns: 70px auto; align-items: center; gap: 8px; }
.rank .bar { position: relative; height: 6px; border-radius: 3px; background: var(--well); overflow: visible; }
.rank .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--blue); }
.rank .bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); border-radius: 1px; text-decoration: none; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.trend svg { width: 14px; height: 14px; }
.trend.up { color: var(--green-ink); }
.trend.down { color: var(--red-ink); }

/* события и лог */
.events { display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; }
.ev:hover { background: var(--well); }
.ev .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--well); color: var(--muted); }
.ev .ic svg { width: 15px; height: 15px; }
.ev.entry .ic { background: var(--blue-soft); color: var(--blue-ink); }
.ev.exit.win .ic { background: var(--green-soft); color: var(--green-ink); }
.ev.exit.loss .ic { background: var(--red-soft); color: var(--red-ink); }
.ev .t { font-weight: 600; font-size: 13px; }
.ev .s { font-size: 12px; color: var(--muted); }
.ev .v { font-size: 13px; font-weight: 600; text-align: right; }
.log { font: 12px/1.6 ui-monospace, "SF Mono", Menlo, monospace; max-height: 560px; overflow: auto; padding: 4px 2px; }
.log div { display: grid; grid-template-columns: 136px 58px minmax(0, 1fr); gap: 8px; padding: 1px 6px; border-radius: 6px; }
.log div:hover { background: var(--well); }
.log .lv { font-weight: 700; }
.log .WARNING .lv { color: var(--orange-ink); }
.log .ERROR .lv { color: var(--red-ink); }
.log .ERROR { background: var(--red-soft); }
.log span:last-child { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 600px) { .log div { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 6px; } .log .lv { display: none; } }

/* настройки */
.form { display: grid; gap: var(--gap); }
.fs { border-radius: var(--r-card); padding: 18px 20px 20px; }
.fs > h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.fs > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; max-width: 70ch; }
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 18px; }
.chipsedit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border-radius: 14px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.chipsedit .chip { height: 30px; padding: 0 6px 0 10px; font-size: 13px; background: var(--glass-hi); box-shadow: 0 1px 2px var(--shade); }
.chipsedit .chip button { width: 20px; height: 20px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.chipsedit .chip button:hover { background: var(--red-soft); color: var(--red-ink); }
.chipsedit .chip button svg { width: 12px; height: 12px; }
.chipsedit input { border: 0; background: transparent; height: 30px; min-width: 120px; flex: 1; outline: none; font-size: 14px; text-transform: uppercase; }
.chipsedit input::placeholder { text-transform: none; color: var(--faint); }
details.rules > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; }
details.rules > summary::-webkit-details-marker { display: none; }
details.rules > summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform .2s ease; }
details.rules[open] > summary svg { transform: rotate(90deg); }
.savebar { position: sticky; bottom: 14px; z-index: 30; display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: 18px; margin-top: var(--gap); background: var(--menu-bg); }
@media (max-width: 860px) { .savebar { bottom: calc(92px + env(safe-area-inset-bottom)); } }
.changed { color: var(--orange-ink); font-weight: 600; }

/* счета */
.acc { display: grid; gap: 14px; }
.acc .top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.acc h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; }
.checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; }
.checks svg { width: 16px; height: 16px; margin-top: 2px; }
.checks .ok svg { color: var(--green-ink); }
.checks .no svg { color: var(--red-ink); }
.keybox { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--well); flex-wrap: wrap; }
.keybox b { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.acc .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* окна */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(6, 9, 18, .45); display: grid; place-items: center; padding: 16px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 26px; padding: 22px; background: var(--menu-bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.modal p { margin: 0 0 14px; color: var(--ink-2); }
.modal .body { display: grid; gap: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; font-size: 13.5px; }
.err { color: var(--red-ink); font-weight: 600; font-size: 13px; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; font-size: 13.5px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); }

/* уведомления */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
@media (max-width: 860px) { .toasts { left: 14px; right: 14px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: none; } }
.toast { padding: 12px 16px; border-radius: 16px; background: var(--menu-bg); box-shadow: 0 12px 34px var(--shade), inset 0 0 0 1px var(--line);
  font-size: 13.5px; font-weight: 500; animation: toast-in .28s cubic-bezier(.32, .72, 0, 1); }
.toast.bad { box-shadow: 0 12px 34px var(--shade), inset 0 0 0 1.5px var(--red); }
.toast.good { box-shadow: 0 12px 34px var(--shade), inset 0 0 0 1.5px var(--green); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; grid-column: 1 / -1; }
.login .box { width: min(400px, 100%); border-radius: 30px; padding: 30px 28px; display: grid; gap: 16px; }
.login .logo { display: flex; align-items: center; gap: 12px; }
.login .logo img { width: 46px; height: 46px; border-radius: 12px; }
.login h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login p { margin: 0; color: var(--muted); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.stack { display: grid; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--muted); }
