/* GiftTradeBot — the owner's interface (docs/UX_REDESIGN.md). An iOS grouped-inset app in the Telegram +
   MRKT spirit, from the approved prototype: under 1024px one column (max 640px) with a bottom tab bar and
   bottom sheets; from 1024px a glass sidebar, a two-column dashboard and centred sheets. */
/* Layout: iOS grouped-inset app in the Telegram + MRKT spirit. Under 1024px: one column (max 640px) with a
   bottom tab bar and bottom sheets; from 1024px: a glass sidebar and a two-column dashboard with centred sheets.
   The one loud element is the balance, set in SF Rounded; everything else is quiet system type. */
:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --sheet-bg: #F2F2F7;
  --sheet-cell: #FFFFFF;
  --fill: rgba(120,120,128,.12);
  --fill-2: rgba(120,120,128,.07);
  --seg-on: #FFFFFF;
  --sep: rgba(60,60,67,.22);
  --fg: #0B0B0E;
  --fg-2: rgba(60,60,67,.76);
  --fg-3: rgba(60,60,67,.5);
  --accent: #0F7BD8;
  --accent-fill: #127FDC;
  --accent-soft: rgba(18,127,220,.11);
  --on-accent: #FFFFFF;
  --line: #127FDC;
  --bench: #8E8E93;
  --pos: #18924B;
  --pos-soft: rgba(52,199,89,.15);
  --neg: #D93229;
  --neg-soft: rgba(255,59,48,.12);
  --warn: #B26A00;
  --warn-strong: #FF9500;
  --warn-soft: rgba(255,149,0,.15);
  --purple: #8E44D9;
  --purple-soft: rgba(175,82,222,.14);
  --bar-bg: rgba(249,249,251,.84);
  --scrim: rgba(0,0,0,.3);
  --toast-bg: rgba(28,28,30,.94);
  --toast-fg: #FFFFFF;
  --skel: rgba(120,120,128,.14);
  --shadow: 0 10px 40px rgba(0,0,0,.14);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1C1C1E; --sheet-bg: #1C1C1E; --sheet-cell: #2C2C2E;
    --fill: rgba(120,120,128,.26); --fill-2: rgba(120,120,128,.16); --seg-on: #636366;
    --sep: rgba(84,84,88,.6); --fg: #FFFFFF; --fg-2: rgba(235,235,245,.66); --fg-3: rgba(235,235,245,.4);
    --accent: #3EA6F2; --accent-fill: #0B7FE0; --accent-soft: rgba(62,166,242,.18); --on-accent: #FFFFFF;
    --line: #2F9BE8; --bench: #8E8E93;
    --pos: #30D158; --pos-soft: rgba(48,209,88,.17); --neg: #FF453A; --neg-soft: rgba(255,69,58,.17);
    --warn: #FFB340; --warn-strong: #FF9F0A; --warn-soft: rgba(255,159,10,.18);
    --purple: #BF5AF2; --purple-soft: rgba(191,90,242,.2);
    --bar-bg: rgba(22,22,24,.82); --scrim: rgba(0,0,0,.56); --toast-bg: rgba(58,58,60,.96); --toast-fg: #FFFFFF;
    --skel: rgba(120,120,128,.22); --shadow: 0 12px 48px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1C1C1E; --sheet-bg: #1C1C1E; --sheet-cell: #2C2C2E;
  --fill: rgba(120,120,128,.26); --fill-2: rgba(120,120,128,.16); --seg-on: #636366;
  --sep: rgba(84,84,88,.6); --fg: #FFFFFF; --fg-2: rgba(235,235,245,.66); --fg-3: rgba(235,235,245,.4);
  --accent: #3EA6F2; --accent-fill: #0B7FE0; --accent-soft: rgba(62,166,242,.18); --on-accent: #FFFFFF;
  --line: #2F9BE8; --bench: #8E8E93;
  --pos: #30D158; --pos-soft: rgba(48,209,88,.17); --neg: #FF453A; --neg-soft: rgba(255,69,58,.17);
  --warn: #FFB340; --warn-strong: #FF9F0A; --warn-soft: rgba(255,159,10,.18);
  --purple: #BF5AF2; --purple-soft: rgba(191,90,242,.2);
  --bar-bg: rgba(22,22,24,.82); --scrim: rgba(0,0,0,.56); --toast-bg: rgba(58,58,60,.96); --toast-fg: #FFFFFF;
  --skel: rgba(120,120,128,.22); --shadow: 0 12px 48px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.35 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.xs { width: 13px; height: 13px; stroke-width: 2.2; }
.ton { width: .78em; height: .78em; fill: var(--accent); flex: none; vertical-align: -.06em; margin-right: .18em; }
.num, .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .zero { color: var(--fg-2); }
.muted { color: var(--fg-2); } .faint { color: var(--fg-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.wrap {
  max-width: 640px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 52px calc(108px + env(safe-area-inset-bottom, 0px));
}
.sidebar { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--sep);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; color: var(--fg-3); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tab .i { width: 26px; height: 26px; stroke-width: 1.7; }
.tab.on { color: var(--accent); }
.tab.on .i { stroke-width: 2.1; }
.tab .dotb { position: absolute; }
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 26; height: calc(44px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 64px 0; display: flex; align-items: center; justify-content: center;
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--sep); font-weight: 600; font-size: 17px; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.topbar.show { opacity: 1; }

@media (min-width: 1024px) {
  .tabbar, .topbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30;
    padding: 22px 12px 18px; background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0.5px 0 0 var(--sep);
  }
  .main { margin-left: var(--side); }
  .wrap { max-width: 1120px; padding-left: 40px; padding-right: 40px; padding-block: 40px 64px; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font: 700 19px/1 var(--font-display); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; }
.brand-mark .i { width: 20px; height: 20px; }
.side-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 16px; font-weight: 500; color: var(--fg); }
.side-item .i { color: var(--accent); }
.side-item:hover { background: var(--fill-2); }
.side-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--fill-2); font-size: 14px; line-height: 1.3; text-align: left; }
.side-foot b { display: block; font-size: 15px; }

/* ---------- type & sections ---------- */
.lt { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.lt h1 { font: 700 34px/41px var(--font-display); letter-spacing: .2px; margin: 0; text-wrap: balance; }
.lt p { margin: 4px 0 0; color: var(--fg-2); font-size: 15px; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 2px 8px; }
.sec h2 { font: 700 22px/28px var(--font-display); margin: 0; text-wrap: balance; }
.sec .link { color: var(--accent); font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 2px; }
.cap { font-size: 13px; line-height: 18px; color: var(--fg-2); }
.group-label { font-size: 13px; line-height: 18px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; margin: 26px 16px 7px; }
.foot-note { font-size: 13px; line-height: 18px; color: var(--fg-2); margin: 8px 16px 0; }
p { margin: 0; }

/* ---------- cards & lists ---------- */
.card { background: var(--surface); border-radius: 20px; padding: 18px; }
.list { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 11px 16px; position: relative; text-align: left; color: var(--fg); }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--sep-l, 16px); height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.list.img44 { --sep-l: 72px; } .list.img52 { --sep-l: 80px; } .list.tile { --sep-l: 60px; }
button.row:active, a.row:active, .tap:active { background: var(--fill-2); }
@media (hover: hover) { button.row:hover, a.row:hover { background: var(--fill-2); } }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 16px; line-height: 21px; font-weight: 600; overflow-wrap: anywhere; }
.row-title.reg { font-weight: 400; font-size: 17px; }
.row-sub { font-size: 14px; line-height: 19px; color: var(--fg-2); overflow-wrap: anywhere; }
.row-trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; font-size: 16px; font-variant-numeric: tabular-nums; }
.row-trail .row-sub { font-size: 13px; }
.chev { width: 14px; height: 14px; color: var(--fg-3); stroke-width: 2.4; flex: none; }
.tile-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--on-accent); }
.tile-ic .i { width: 19px; height: 19px; stroke-width: 2; }
.tile-ic.green { background: #2FB457; } .tile-ic.orange { background: var(--warn-strong); } .tile-ic.red { background: #E5483F; }
.tile-ic.blue { background: var(--accent-fill); } .tile-ic.gray { background: #8E8E93; } .tile-ic.purple { background: #A55BE0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.pos { background: var(--pos-soft); } .pill.neg { background: var(--neg-soft); } .pill.zero { background: var(--fill); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--fill); color: var(--fg-2); white-space: nowrap; }
.badge.green { background: var(--pos-soft); color: var(--pos); } .badge.orange { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--neg-soft); color: var(--neg); } .badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

/* gift thumbnails: real image over a coloured placeholder */
.gimg { --s: 44px; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .24); position: relative; overflow: hidden; flex: none; display: inline-grid; place-items: center;
  background: linear-gradient(140deg, hsl(var(--h) 46% 62%), hsl(calc(var(--h) + 28) 42% 44%)); max-width: 100%; }
.gimg b { color: #FFFFFF; font: 700 calc(var(--s) * .42)/1 var(--font-round); }
.gimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gimg.fluid { width: 100%; height: auto; aspect-ratio: 1; }

/* buttons, segmented, switches, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 13px; font-size: 16px; font-weight: 600; background: var(--fill); color: var(--accent); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.danger { background: var(--neg-soft); color: var(--neg); }
.btn.good { background: var(--pos-soft); color: var(--pos); }
.btn.block { width: 100%; }
.btn-row > .btn { white-space: nowrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 160px; }
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; padding: 0 6px; }
.seg button.on { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button .faint { font-weight: 500; }
.switch { position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill); flex: none; transition: background .2s; }
.switch::before { content: ""; position: absolute; inset: -7px -2px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch[aria-checked="true"] { background: #34C759; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--fg); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; box-shadow: inset 0 0 0 1px var(--sep); white-space: nowrap; }
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip.on { background: var(--fg); color: var(--bg); box-shadow: none; }

/* ---------- home ---------- */
.home-grid { display: grid; gap: 16px; }
.home-grid > .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1024px) {
  .home-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
}
@media (min-width: 1280px) {
  .home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}
.hero { padding: 20px 20px 16px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--fg-2); }
.mode-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--accent-soft); color: var(--accent); position: relative; }
.mode-pill::after { content: ""; position: absolute; inset: -6px -2px; }
.mode-pill.live { background: var(--pos-soft); color: var(--pos); }
.mode-pill.stop { background: var(--neg-soft); color: var(--neg); }
.hero-num { font: 700 clamp(46px, 13vw, 60px)/1.05 var(--font-round); letter-spacing: -.02em; margin-top: 8px; display: flex; align-items: center; }
.hero-num .ton { width: .62em; height: .62em; margin-right: .12em; }
.hero-usd { color: var(--fg-2); font-size: 15px; margin-top: 2px; }
.hero-delta { font-size: 17px; font-weight: 600; margin-top: 10px; font-variant-numeric: tabular-nums; }
.hero-delta span { color: var(--fg-2); font-weight: 400; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.split > div { background: var(--fill-2); border-radius: 13px; padding: 10px 12px; min-width: 0; }
.split > div > span { display: block; font-size: 13px; color: var(--fg-2); }
.split b { font-size: 19px; font-weight: 600; }
.chart-wrap { position: relative; margin: 14px -4px 0; height: 150px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-wrap svg { display: block; overflow: visible; }
.chart-wrap .ax { fill: var(--fg-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-wrap .grid { stroke: var(--sep); stroke-width: 1; }
.chart-empty { height: 150px; margin-top: 14px; border-radius: 14px; background: var(--fill-2); display: grid; place-items: center; text-align: center; padding: 16px; color: var(--fg-2); font-size: 15px; }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; white-space: nowrap; transform: translateX(-50%); z-index: 2; }
.chart-tip b { display: block; font-size: 12px; color: var(--fg-2); font-weight: 600; }
.k-line, .k-dash { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--line); vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.k-dash { border-top: 2px dashed var(--bench); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--fg-2); margin-top: 8px; }
.hero .seg { margin-top: 10px; }
.bench-line { margin-top: 12px; font-size: 15px; line-height: 1.4; color: var(--fg); text-wrap: pretty; }
.status h2, .card-h { font: 700 17px/22px var(--font-display); margin: 0 0 12px; }
.status-answer { display: flex; gap: 12px; align-items: flex-start; }
.status-answer b { display: block; font-size: 17px; }
.status-answer span { display: block; color: var(--fg-2); font-size: 15px; line-height: 1.38; margin-top: 2px; }
.status .list { margin: 12px -18px -18px; border-radius: 0 0 20px 20px; background: transparent; box-shadow: 0 -0.5px 0 var(--sep); }
.status .row { padding-inline: 18px; }
.pcards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.pcards::-webkit-scrollbar { display: none; }
.pcard { flex: 0 0 148px; scroll-snap-align: start; background: var(--surface); border-radius: 18px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.pcard .gimg { margin-bottom: 7px; }
.pcard .nm { font-size: 15px; font-weight: 600; line-height: 19px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sub { font-size: 13px; color: var(--fg-2); padding: 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard .pill { align-self: flex-start; margin: 5px 4px 0; }
@media (min-width: 1024px) {
  .pcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; overflow: visible; }
  .pcard { flex: none; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 14px; row-gap: 1px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 16px; }
  .pcard .gimg.fluid { grid-row: 1 / 5; width: 72px; margin: 0; }
  .pcard .nm, .pcard .sub { grid-column: 2; padding: 0; overflow: hidden; text-overflow: ellipsis; }
  .pcard .pill { grid-column: 2; justify-self: start; margin: 3px 0 0; }
}
.realrow { border-radius: 16px; }
@media (min-width: 1024px) { .chart-wrap, .chart-empty { height: 200px; } }
.urgent { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--neg-soft); border-radius: 16px; padding: 11px 14px; margin-bottom: 12px; min-height: 56px; }
.urgent b { display: block; color: var(--neg); font-size: 15px; }
.urgent .row-body span { font-size: 16px; font-weight: 600; }

/* ---------- trades ---------- */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border-radius: var(--r); overflow: hidden; }
.summary > div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.summary > div > span { display: block; font-size: 13px; color: var(--fg-2); }
.summary b { display: block; font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.summary small { display: block; font-size: 13px; color: var(--fg-2); margin-top: 1px; }
.day-h { font-size: 13px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; margin: 20px 16px 7px; }

/* ---------- sheet ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; }
.sheet {
  --surface: var(--sheet-cell);
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - 44px - env(safe-area-inset-top, 0px));
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform .32s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow);
}
.sheet-root:not(.open) .sheet { visibility: hidden; transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility 0s .32s; }
.sheet-root.open { pointer-events: auto; }
.sheet-root.open .scrim { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fg-3); opacity: .5; margin: 6px auto 0; flex: none; }
.sheet-h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px; padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); flex: none; }
.sheet-h .t { font-weight: 600; font-size: 17px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
.sheet-h .done { justify-self: end; min-height: 44px; padding: 0 10px; color: var(--accent); font-weight: 600; }
.sheet-b { overflow-y: auto; overscroll-behavior: contain; padding: 4px max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sheet-b > * { flex-shrink: 0; }
@media (min-width: 1024px) {
  .sheet { left: 50%; top: 50%; bottom: auto; width: min(580px, calc(100% - 48px)); max-height: 86vh; border-radius: 18px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .22s, opacity .18s; }
  .sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .grabber { display: none; }
}
.s-head { display: flex; gap: 14px; align-items: center; }
.s-head h3 { font: 700 22px/27px var(--font-display); margin: 0; text-wrap: balance; }
.s-head .row-sub { margin-top: 3px; }
.big-res { font: 700 34px/1.1 var(--font-round); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--r); overflow: hidden; }
.strip > div { padding: 11px 12px; min-width: 0; }
.strip > div + div { box-shadow: inset 1px 0 0 var(--sep); }
.strip span { display: block; font-size: 12.5px; color: var(--fg-2); }
.strip b { display: block; font-size: 17px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.block { background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.block h4 { margin: 0 0 6px; font-size: 13px; line-height: 18px; color: var(--fg-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.block p, .block li { font-size: 16px; line-height: 1.45; text-wrap: pretty; }
.block ul, .block ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.block .btn-row { margin-top: 12px; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; position: relative; padding-bottom: 14px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fg-3); margin-top: 6px; }
.tl li.pos::before { background: var(--pos); } .tl li.neg::before { background: var(--neg); } .tl li.acc::before { background: var(--accent); } .tl li.warn::before { background: var(--warn-strong); }
.tl li::after { content: ""; position: absolute; left: 4.5px; top: 20px; bottom: 2px; width: 1px; background: var(--sep); }
.tl li:last-child::after { display: none; }
.tl .t1 { font-size: 15.5px; line-height: 1.38; }
.tl .t2 { font-size: 13px; color: var(--fg-2); }
.tl .pr { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.42; color: var(--fg-2); padding: 0 4px; }
.note .i { color: var(--fg-3); margin-top: 1px; }
.warn-hero { display: flex; gap: 14px; align-items: flex-start; }
.warn-hero .tile-ic { width: 44px; height: 44px; border-radius: 12px; }
.warn-hero .tile-ic .i { width: 24px; height: 24px; }

/* sell options */
.sopts { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.sopt { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; position: relative; text-align: left; width: 100%; }
.sopt + .sopt::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); }
.sopt .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px var(--fg-3); flex: none; margin-top: 1px; display: grid; place-items: center; }
.sopt[aria-checked="true"] .radio { background: var(--accent-fill); box-shadow: none; color: var(--on-accent); }
.sopt .radio .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.sopt[aria-checked="true"] .radio .i { opacity: 1; }
.sopt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sopt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
.sopt-sub { font-size: 14px; color: var(--fg-2); line-height: 1.35; }
.sopt-trail { text-align: right; flex: none; }
.sopt-trail b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.sopt-trail span { font-size: 12px; color: var(--fg-2); }
.meter { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 4px 0 1px; max-width: 220px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--pos); }
.meter.mid i { background: var(--accent-fill); } .meter.low i { background: var(--warn-strong); }

/* ---------- consultant ---------- */
.chat-col { max-width: 760px; margin: 0 auto; }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 72px; }
.day-sep { align-self: center; font-size: 13px; font-weight: 600; color: var(--fg-2); background: var(--fill-2); padding: 3px 10px; border-radius: 999px; margin: 6px 0; }
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.msg.me { align-items: flex-end; }
.bubble { max-width: min(84%, 540px); padding: 9px 13px 8px; border-radius: 19px; font-size: 16px; line-height: 1.42; background: var(--surface); border-bottom-left-radius: 6px; overflow-wrap: anywhere; text-wrap: pretty; }
.me .bubble { background: var(--accent-fill); color: var(--on-accent); border-radius: 19px; border-bottom-right-radius: 6px; }
.bubble .tm { float: right; font-size: 11.5px; margin: 6px 0 -2px 10px; opacity: .6; }
.typing { display: inline-flex; gap: 4px; padding: 14px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.gcard { width: min(100%, 540px); background: var(--surface); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.gcard-top { display: flex; gap: 12px; align-items: center; }
.gcard-top .nm { font: 700 19px/24px var(--font-display); }
.attrs { display: flex; flex-wrap: wrap; gap: 6px; }
.attr { background: var(--fill-2); border-radius: 10px; padding: 6px 10px; font-size: 13px; line-height: 1.3; min-width: 0; }
.attr span { display: block; color: var(--fg-2); font-size: 12px; }
.attr b { font-weight: 600; }
.verdict { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.verdict b { display: block; font-size: 16px; }
.verdict.good { background: var(--pos-soft); } .verdict.good b, .verdict.good .i { color: var(--pos); }
.verdict.fair { background: var(--accent-soft); } .verdict.fair b, .verdict.fair .i { color: var(--accent); }
.verdict.bad { background: var(--warn-soft); } .verdict.bad b, .verdict.bad .i { color: var(--warn); }
.verdict.mine { background: var(--purple-soft); } .verdict.mine b, .verdict.mine .i { color: var(--purple); }
.kv3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv3 > div { background: var(--fill-2); border-radius: 12px; padding: 9px 10px; min-width: 0; }
.kv3 span { display: block; font-size: 12px; color: var(--fg-2); }
.kv3 b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; margin-top: 1px; white-space: nowrap; }
.kv3 small { display: block; font-size: 12px; color: var(--fg-2); }
details.more { border-radius: 14px; background: var(--fill-2); }
details.more > summary { list-style: none; min-height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .chev { transform: rotate(90deg); transition: transform .2s; }
details.more[open] > summary .chev { transform: rotate(-90deg); }
details.more .in { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.42; }
details.more ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
details.more .sopts { background: var(--surface); }
.watch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; min-height: 44px; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); z-index: 29;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  display: flex; flex-direction: column; gap: 8px;
}
.composer .chips { padding-inline: 4px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; resize: none; min-height: 40px; max-height: 120px; padding: 9px 14px; border-radius: 20px; border: 0; background: var(--surface); color: var(--fg); font: 16px/22px var(--font); box-shadow: inset 0 0 0 1px var(--sep); }
.composer textarea::placeholder { color: var(--fg-3); }
.send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; flex: none; position: relative; }
.send::after { content: ""; position: absolute; inset: -4px; }
.send .i { width: 20px; height: 20px; stroke-width: 2.4; }
@media (min-width: 1024px) {
  .composer { left: var(--side); bottom: 0; padding: 12px 40px 16px; }
  .composer > * { width: 100%; max-width: 760px; margin: 0 auto; }
}

/* ---------- my gifts ---------- */
.ggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gtile { background: var(--surface); border-radius: 18px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 0; }
.gtile .gimg { margin-bottom: 7px; }
.gtile .nm { font-size: 15px; font-weight: 600; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtile .v { font-size: 17px; font-weight: 600; padding: 0 4px; }
.gtile .s { font-size: 13px; color: var(--fg-2); padding: 0 4px; line-height: 1.35; }
.gtile .s.warn { color: var(--warn); }
.wealth-num { font: 700 40px/1.1 var(--font-round); letter-spacing: -.02em; margin-top: 4px; display: flex; align-items: center; }
.wealth-num .ton { width: .62em; height: .62em; }

/* ---------- bot ---------- */
.bot-grid { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); }
.bot-grid > div { min-width: 0; }
@media (min-width: 1024px) { .bot-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.state-line { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #34C759; flex: none; box-shadow: 0 0 0 4px var(--pos-soft); }
.dot.red { background: #FF3B30; box-shadow: 0 0 0 4px var(--neg-soft); }
.dot.orange { background: var(--warn-strong); box-shadow: 0 0 0 4px var(--warn-soft); }
.now-text { font-size: 16px; line-height: 1.5; margin-top: 10px; text-wrap: pretty; }
.now-text a, .linkbtn { color: var(--accent); font-weight: 500; }
.linkbtn { display: inline; padding: 10px 0; margin: -10px 0; text-align: left; }
.stopbtn { width: 100%; margin-top: 14px; }
.mtabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 10px; }
.mtabs::-webkit-scrollbar { display: none; }
.mtabs .chip b { font-variant-numeric: tabular-nums; }
.proposal { border-radius: 20px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.proposal .k { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.proposal h3 { margin: 0; font: 700 18px/23px var(--font-display); }
.proposal p { font-size: 15.5px; line-height: 1.45; color: var(--fg); }
.proposal .ev { color: var(--fg-2); font-size: 14px; }
.bot-grid > div > .group-label:first-child { margin-top: 0; }
@media (max-width: 1023px) { .bot-grid > div > .group-label:first-child { margin-top: 30px; } }
.version { text-align: center; font-size: 13px; color: var(--fg-3); padding: 22px 0 6px; width: 100%; min-height: 44px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 10px 0; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; background: var(--fill); color: var(--accent); font-size: 28px; font-weight: 500; display: grid; place-items: center; }
.stepper .val { font: 700 40px/1 var(--font-round); min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; line-height: 1.42; }
.check-row .i { margin-top: 1px; }
.qr { width: 168px; height: 168px; border-radius: 14px; background: #FFFFFF; padding: 10px; align-self: center; }

/* ---------- states ---------- */
.sk { background: var(--skel); border-radius: 10px; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.offline { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; font-size: 14.5px; line-height: 1.42; }
.offline b { display: block; font-size: 16px; }
.offline .btn { min-height: 36px; padding: 0 12px; font-size: 14px; margin-top: 8px; background: var(--surface); }
.empty { text-align: center; padding: 26px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .tile-ic { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 6px; }
.empty .tile-ic .i { width: 26px; height: 26px; }
.empty b { font-size: 17px; }
.empty span { color: var(--fg-2); font-size: 15px; line-height: 1.42; max-width: 380px; text-wrap: pretty; }
.stale { opacity: .55; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; z-index: 80;
  background: var(--toast-bg); color: var(--toast-fg); border-radius: 14px; padding: 10px 10px 10px 16px; font-size: 15px; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 32px); box-shadow: var(--shadow); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: #6CC4FF; font-weight: 600; min-height: 36px; padding: 0 8px; }
@media (min-width: 1024px) { .toast { bottom: 24px; left: calc(50% + var(--side) / 2); } }
  min-height: 32px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2);
  background: var(--bar-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px dashed var(--fg-3); }
  width: min(300px, calc(100% - 20px)); max-height: calc(100% - 70px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; border: 1px dashed var(--fg-3); }
.dev { font-family: var(--font-mono); font-size: 12.5px; }
.dev .row-sub { font-family: var(--font-mono); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- server-rendered additions ---------- */
a.row, a.pcard, a.gtile, a.side-item, a.tab, a.side-foot, a.chip, a.btn { color: inherit; text-decoration: none; }
a.btn.primary { color: var(--on-accent); }
a.btn { color: var(--accent); }
a.btn.danger { color: var(--neg); } a.btn.good { color: var(--pos); }
a.chip.on { color: var(--bg); }
.gimg { background: linear-gradient(140deg, var(--c1, hsl(var(--h, 210) 46% 62%)), var(--c2, hsl(calc(var(--h, 210) + 28) 42% 44%))); }
.seg a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; padding: 0 6px; }
.seg a.on { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.side-sep { height: 1px; background: var(--sep); margin: 8px 10px; transform: scaleY(.5); }
.side-item.sm { min-height: 38px; font-size: 15px; }
.side-item .i { color: var(--accent); }
.side-item.tech .i { color: var(--fg-2); }
/* phones: «Бот» and «Тех» in the top corner of every screen */
.quick { position: fixed; z-index: 27; top: calc(env(safe-area-inset-top, 0px) + 6px); right: max(10px, calc(env(safe-area-inset-right, 0px) + 8px)); display: flex; gap: 6px; }
.quick a { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg);
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); box-shadow: 0 0 0 .5px var(--sep); }
.quick a::after { content: ""; position: absolute; inset: -6px -2px; }
.quick a.on { color: var(--accent); }
.quick .dot { width: 8px; height: 8px; box-shadow: none; }
.quick .i { width: 16px; height: 16px; }
@media (min-width: 1024px) { .quick { display: none; } }
.topbar { padding-right: 150px; padding-left: 150px; }
.lt-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -8px 0 4px -6px; font-size: 17px; }
.lt-back .i { width: 20px; height: 20px; }
.sheet-b .sk { min-height: 18px; }
.sheet-loading { display: flex; flex-direction: column; gap: 14px; }
.htmx-request .on-busy { opacity: .6; }
.stale-note { font-size: 13px; color: var(--fg-3); text-align: center; margin-top: 14px; }
.inline-form { display: contents; }
.page-sheet { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.legend .faint { margin-left: 4px; }
.field { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 0; background: var(--fill-2); color: var(--fg); font: 16px/22px var(--font); box-shadow: inset 0 0 0 1px var(--sep); }
.qr { display: grid; place-items: center; margin: 14px auto 0; }
.qr svg { width: 100%; height: 100%; display: block; }
/* consultant */
.chat .md p { margin: 0; } .chat .md p + p, .chat .md ul, .chat .md ol { margin-top: 8px; }
.chat .md ul, .chat .md ol { padding-left: 20px; }
.chat .md a { color: var(--accent); }
.me .bubble .md a { color: inherit; text-decoration: underline; }
.msg.err .bubble { background: var(--warn-soft); }
.msg.err .btn { min-height: 36px; margin-top: 8px; font-size: 14px; }
.typing-status { margin-left: 4px; }
.composer form.busy textarea { opacity: .7; }
.send:disabled { opacity: .45; }
.chip:disabled { opacity: .5; }
.gcard .nm { color: var(--fg); font: 700 19px/24px var(--font-display); }
.gcard-top a:first-child { flex: none; }
.card-when { text-align: right; }
.stale-card .btn.primary { background: var(--fill); color: var(--accent); }
.verdict.none { background: var(--fill-2); } .verdict.none b, .verdict.none .i { color: var(--fg-2); }
.watch .switch { cursor: pointer; }
/* analytics */
.facts { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.42; color: var(--fg-2); }
.stack-gap { display: flex; flex-direction: column; gap: 12px; }
.spark-box { flex: none; width: 72px; display: flex; align-items: center; }
.spark-box svg { width: 72px; height: 26px; }
.row .meter { margin-top: 6px; }
/* bot */
.step-input { width: 170px; border: 0; background: transparent; color: var(--fg); font: 700 40px/1 var(--font-round); text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.step-input::-webkit-outer-spin-button, .step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.switch[aria-disabled="true"] { opacity: .5; }
a.sopt { color: var(--fg); }
.restart-note { color: var(--accent); }
/* tech */
.tech-links { flex-wrap: wrap; overflow: visible; margin-bottom: 4px; }
.tech-grid { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); }
.tech-grid > section { min-width: 0; }
@media (min-width: 1100px) { .tech-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.list.dev .row { padding-block: 8px; min-height: 36px; }
.list.dev .row-title { font: 500 13px/1.35 var(--font-mono); overflow-wrap: anywhere; }
.list.dev .row-sub { font: 12px/1.4 var(--font-mono); }
.list.dev .row-trail { font: 13px/1.35 var(--font-mono); }
.list.dev .dot { width: 8px; height: 8px; box-shadow: none; }
.tech-epoch { display: block; }
.tech-epoch > summary { list-style: none; cursor: pointer; display: flex; }
.tech-epoch > summary::-webkit-details-marker { display: none; }
.tech-pre { margin: 8px 0 0; padding: 10px; border-radius: 10px; background: var(--fill-2); font: 11.5px/1.4 var(--font-mono); max-height: 320px; overflow: auto; white-space: pre; }

/* Guest login: every control is inert (the server refuses its posts anyway). */
.guest-note { margin-bottom: 16px; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; background: var(--warn-soft); }
body[data-guest] form[method="post"]:not(.logout) :is(button, input, select, textarea),
body[data-guest] [hx-post] { pointer-events: none; opacity: 0.45; }

/* «Выйти» in the quick bar, and the login page. */
.logout { display: contents; }
.quick .logout button { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg);
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); box-shadow: 0 0 0 .5px var(--sep); border: 0; cursor: pointer; }
.login-page { min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.login-card .brand { padding: 2px 0 10px; }
.login-label { font-size: 14px; font-weight: 600; margin-top: 4px; }
.login-check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 6px 0 4px; }
.login-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--neg-soft); color: var(--neg); font-size: 14.5px; }
.login-hint { margin: 4px 0 0; font-size: 13.5px; }
