/* FinBot — оформление в духе приложений iPhone: системные цвета, большие заголовки,
   сгруппированные списки, «стеклянные» панели. Цвета и размеры — из Human Interface Guidelines. */
:root {
  color-scheme: light;
  --bg: #f2f2f7; --card: #ffffff; --card-2: #f2f2f7; --elev: #ffffff;
  --label: #000000; --label-2: rgba(60, 60, 67, .6); --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .2); --fill: rgba(120, 120, 128, .12); --fill-2: rgba(120, 120, 128, .2);
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00; --indigo: #5856d6;
  --purple: #af52de; --pink: #ff2d55; --teal: #30b0c7; --gray: #8e8e93;
  --blue-tint: rgba(0, 122, 255, .12);
  --glass: rgba(255, 255, 255, .74); --glass-line: rgba(255, 255, 255, .7); --glass-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --nav-h: 52px; --tab-h: 62px; --r-group: 20px; --r-card: 22px;
}
html[data-scheme="dark"] {
  color-scheme: dark;
  --bg: #000000; --card: #1c1c1e; --card-2: #2c2c2e; --elev: #3a3a3c;
  --label: #ffffff; --label-2: rgba(235, 235, 245, .6); --label-3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .6); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .36);
  --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a; --indigo: #5e5ce6;
  --purple: #bf5af2; --pink: #ff375f; --teal: #40c8e0; --gray: #8e8e93;
  --blue-tint: rgba(10, 132, 255, .2);
  --glass: rgba(37, 37, 39, .72); --glass-line: rgba(255, 255, 255, .1); --glass-shadow: 0 8px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); font: 17px/1.29 var(--font); letter-spacing: -.25px;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }
svg.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-gray { color: var(--gray); }
.muted { color: var(--label-2); }

/* --- верхняя панель и большой заголовок --- */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--nav-h); display: flex; align-items: center;
  justify-content: flex-end; gap: 10px; padding: 0 16px; transition: background .25s, box-shadow .25s; }
.navbar .title { position: absolute; left: 100px; right: 100px; text-align: center; font-size: 17px; font-weight: 600;
  opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.navbar.scrolled { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 .5px 0 var(--sep); }
.navbar.scrolled .title { opacity: 1; }
.nav-btn { width: 40px; height: 40px; display: grid; place-items: center; border: .5px solid var(--glass-line); border-radius: 50%;
  background: var(--glass); color: var(--label); box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn:active, .tabbar button:active { transform: scale(.94); }
.large { padding: calc(var(--nav-h) + 2px) 20px 12px; }
.large .eyebrow { font-size: 13px; font-weight: 600; color: var(--label-2); letter-spacing: -.05px; margin-bottom: 1px; }
.large h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .25px; }
.demo-flag { margin: 60px 16px -48px; padding: 9px 14px; border-radius: 14px; background: var(--fill); font-size: 13px; color: var(--label-2); }

main { padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 34px); }
.ptr { position: fixed; top: calc(var(--nav-h) - 6px); left: 50%; z-index: 19; width: 30px; height: 30px; margin-left: -15px;
  border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--label-2); opacity: 0;
  transform: translateY(calc(var(--pull, 0px) * .5)) rotate(calc(var(--pull, 0px) * 4)); transition: opacity .2s; pointer-events: none; }
.ptr.ready, .ptr.on { opacity: 1; }
.ptr.on { animation: spin .8s linear infinite; transform: translateY(14px); }
@keyframes spin { to { transform: translateY(14px) rotate(360deg); } }

/* --- нижняя панель вкладок: «стеклянная» капсула --- */
.tabbar { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 10px); z-index: 30; transform: translateX(-50%);
  width: min(calc(100% - 24px), 460px); height: var(--tab-h); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 5px;
  border-radius: 34px; border: .5px solid var(--glass-line); background: var(--glass); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 0;
  border: 0; border-radius: 28px; background: none; color: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: 0;
  transition: background .2s, color .2s, transform .15s; }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar svg .f { fill: none; }
.tabbar button[aria-selected="true"] { color: var(--blue); background: var(--fill); }
.tabbar button[aria-selected="true"] svg .f { fill: currentColor; fill-opacity: .2; }

/* --- заголовки разделов, группы, ячейки --- */
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 20px 10px; }
.section-h h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: .1px; }
.section-h.small { margin: 22px 20px 8px; }
.section-h.small h2 { font-size: 20px; line-height: 25px; }
.link { padding: 0; border: 0; background: none; color: var(--blue); font-size: 17px; }
.group { margin: 0 16px 8px; overflow: hidden; border-radius: var(--r-group); background: var(--card); }
.footnote { margin: 7px 32px 16px; font-size: 13px; line-height: 18px; color: var(--label-2); letter-spacing: -.05px; }
.footnote.top { margin-top: 0; }
.footnote.center { text-align: center; }
.cell { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 11px 16px;
  border: 0; background: none; color: inherit; text-align: left; }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep); }
.cell:has(.ico) + .cell::before, .cell.news + .cell::before { left: 64px; }
button.cell:active, label.cell:active { background: var(--fill); }
.cell .ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; }
.cell .ico svg { width: 19px; height: 19px; stroke-width: 2; }
.cell .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell .t { font-size: 17px; line-height: 22px; }
.cell .s { margin-top: 1px; font-size: 15px; line-height: 20px; color: var(--label-2); }
.cell .v { flex: none; max-width: 55%; color: var(--label-2); font-size: 17px; text-align: right; }
.cell svg.chev { flex: none; width: 14px; height: 14px; margin-right: -4px; color: var(--label-3); stroke-width: 2.4; }
.cell.kv .t { flex: 1; }
.cell.kv .v { color: var(--label-2); }
.cell.disabled { opacity: .4; pointer-events: none; }
.cell.add { color: var(--blue); }
.cell.add svg { width: 22px; height: 22px; }
.cell .check svg { width: 20px; height: 20px; color: var(--blue); stroke-width: 2.4; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.dot.wait { background: var(--orange); } .dot.off { background: var(--red); }

/* новости и сигналы */
.cell.news { align-items: flex-start; padding-top: 13px; padding-bottom: 13px; }
.headline { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.35px; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--label-2); }
.dir.up { color: var(--green); } .dir.down { color: var(--red); }
.tag { padding: 2px 7px; border-radius: 6px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--label); letter-spacing: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag.long b { color: var(--green); } .tag.short b { color: var(--red); }
.ring { flex: none; width: 36px; height: 36px; }
.ring .track { fill: none; stroke: var(--fill-2); stroke-width: 3.6; }
.ring .arc { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.ring text { fill: var(--label); font: 700 14px var(--rounded); text-anchor: middle; dominant-baseline: central; }
.rank { flex: none; width: 36px; padding-top: 1px; text-align: center; font: 700 20px/22px var(--rounded); color: var(--label-2); }
.rank.big { width: 52px; font-size: 30px; line-height: 36px; }
.prob { flex: none; width: 52px; padding-top: 1px; font: 700 17px/22px var(--rounded); color: var(--blue); }

/* лонг/шорт */
.cell.pos { gap: 14px; }
.cell.pos .tk { flex: none; width: 52px; font-size: 17px; font-weight: 600; }
.lsbar { display: flex; height: 7px; overflow: hidden; border-radius: 4px; background: var(--fill); }
.lsbar .l { background: var(--green); } .lsbar .s { background: var(--red); }
.cell.pos .cap { margin-top: 6px; font-size: 12px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.pos .share { flex: none; min-width: 52px; text-align: right; font: 700 20px/1 var(--rounded); }
.cell.pos .share small { display: block; margin-top: 3px; font: 400 11px/1 var(--font); color: var(--label-2); }

/* как в «Акциях» */
.cell.stock { gap: 12px; min-height: 64px; }
.cell.stock .tk { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.cell.stock .nm { margin-top: 2px; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.px b { font-size: 17px; font-weight: 600; }
.pill { min-width: 78px; padding: 3px 7px; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 600; line-height: 20px;
  text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.1px; }
.pill.up { background: var(--green); } .pill.down { background: var(--red); } .pill.flat { background: var(--gray); }
.spark { flex: none; display: block; }
.spark polyline { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--fill); object-fit: cover; }

/* плитки рынка на «Сегодня» */
.tiles { display: flex; gap: 10px; margin-bottom: 14px; padding: 2px 16px 4px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding: 0 16px; scrollbar-width: none; }
.tiles::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.tile { flex: none; width: 148px; display: flex; flex-direction: column; align-items: flex-start; padding: 13px 12px 10px 14px;
  border: 0; border-radius: 20px; background: var(--card); color: inherit; text-align: left; scroll-snap-align: start; }
.tile .tk { font-size: 15px; font-weight: 700; }
.tile .nm { font-size: 12px; color: var(--label-2); }
.tile .px { display: block; margin-top: 8px; font: 700 22px/26px var(--rounded); letter-spacing: -.2px; }
.tile .ch { margin-top: 1px; font-size: 13px; font-weight: 600; }
.tile .spark { margin-top: 8px; }
.tile:active, .card-h:active { opacity: .7; }

/* карточки в стиле «Здоровья» */
.card { margin: 0 16px 12px; padding: 14px 16px 16px; border-radius: var(--r-card); background: var(--card); }
.card.plain { margin-top: 4px; }
.card-h { display: flex; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: none;
  color: var(--accent, var(--blue)); font-size: 15px; font-weight: 600; text-align: left; }
.card-h svg { width: 19px; height: 19px; stroke-width: 2; }
.card-h .when { margin-left: auto; color: var(--label-2); font-size: 13px; font-weight: 400; }
.card-h svg.chev { width: 13px; height: 13px; color: var(--label-3); stroke-width: 2.4; }
.card-h svg.push { margin-left: auto; }
.card-value { margin-top: 6px; font: 600 17px/22px var(--rounded); letter-spacing: -.2px; }
.brief-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
  margin: 10px 0 0; font-size: 15px; line-height: 21px; letter-spacing: -.2px; }

/* сейсмограмма */
.seismo { display: block; width: 100%; height: 112px; margin-top: 12px; overflow: visible; }
.seismo line { vector-effect: non-scaling-stroke; stroke-linecap: round; }
.seismo .axis { stroke: var(--sep); stroke-width: 1; }
.seismo .grid { stroke: var(--sep); stroke-width: 1; stroke-dasharray: 2 4; }
.seismo .tick { stroke-width: 2.4; transform-box: fill-box; }
.seismo .tick.strong { stroke-width: 3.8; }
.seismo .tick.up { transform-origin: 50% 100%; } .seismo .tick.down { transform-origin: 50% 0; } .seismo .tick.flat { transform-origin: 50% 50%; }
.seismo .c-up { stroke: var(--green); } .seismo .c-down { stroke: var(--red); } .seismo .c-flat { stroke: var(--gray); } .seismo .c-money { stroke: var(--orange); }
.seismo.draw .tick { animation: grow .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d); }
@keyframes grow { from { transform: scaleY(0); } }
.axis { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--label-2); }
.axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.axis .first { left: 0; transform: none; } .axis .last { right: 0; left: auto; transform: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--label-2); }
.legend i { display: inline-block; width: 3px; height: 11px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }

/* сегменты и фильтры */
.seg { position: relative; display: flex; margin: 0 16px 12px; padding: 3px; border-radius: 999px; background: var(--fill); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 999px; background: var(--elev);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); transition: transform .3s cubic-bezier(.3, .7, .2, 1); }
.seg button { position: relative; z-index: 1; flex: 1; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 999px; background: none;
  font-size: 14px; font-weight: 500; letter-spacing: -.1px; }
.seg button[aria-pressed="true"] { font-weight: 600; }
.chips { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--card); font-size: 15px; letter-spacing: -.2px; }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 50px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--fill); color: var(--blue); font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.btn svg { width: 19px; height: 19px; stroke-width: 2; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn.tinted { background: var(--blue-tint); color: var(--blue); }
.btn.filled { background: var(--blue); color: #fff; }
.btn.plain { background: none; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.on-up { background: var(--green); color: #fff; }
.btn.on-down { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; }
.btn:active { opacity: .75; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 16px 8px; }
.actions .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.icon-plain { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--label-2); }
.icon-plain svg { width: 20px; height: 20px; }
.icon-plain.danger { color: var(--red); }

/* переключатель и поля */
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 51px; height: 31px; margin: 0;
  border-radius: 999px; background: var(--fill-2); cursor: pointer; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s cubic-bezier(.3, .7, .2, 1); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.time { flex: none; min-width: 92px; padding: 6px 10px; border: 0; border-radius: 9px; background: var(--fill); font-size: 17px;
  font-variant-numeric: tabular-nums; text-align: center; }
.form { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.form .lbl { margin-bottom: -4px; font-size: 13px; color: var(--label-2); }
.field { width: 100%; min-height: 46px; padding: 11px 14px; border: 0; border-radius: 12px; background: var(--fill); font-size: 17px; outline: none; }
.field:focus { box-shadow: 0 0 0 2px var(--blue); }
.field::placeholder { color: var(--label-3); }

/* лист снизу */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; display: flex; flex-direction: column;
  height: min(93vh, calc(var(--tg-viewport-height, 100vh) - 10px)); overflow: hidden; border-radius: 30px 30px 0 0; background: var(--bg);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .18); transform: translateY(105%); transition: transform .4s cubic-bezier(.2, .9, .25, 1); }
.sheet.on { transform: none; }
.sheet .grab { position: absolute; top: 6px; left: 50%; z-index: 3; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill-2); }
.sheet .pages { position: relative; flex: 1; overflow: hidden; }
.sheet .page { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: calc(var(--safe-bottom) + 28px); background: var(--bg); transition: transform .38s cubic-bezier(.2, .9, .25, 1), opacity .38s; }
.sheet .page.ahead { transform: translateX(100%); }
.sheet .page.behind { transform: translateX(-28%); opacity: 0; pointer-events: none; }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px;
  height: 58px; padding: 10px 12px 0; background: var(--bg); }
.sheet-bar .title { max-width: 52vw; overflow: hidden; text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.sheet-bar .side { min-width: 0; display: flex; }
.sheet-bar .side.right { justify-content: flex-end; }
.sheet-bar .back { display: flex; align-items: center; gap: 1px; min-width: 0; padding: 6px 2px; border: 0; background: none; color: var(--blue); font-size: 17px; }
.sheet-bar .back span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet-bar .back svg { flex: none; width: 22px; height: 22px; stroke-width: 2.4; }
.sheet-bar .close { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: var(--fill); color: var(--label-2); }
.sheet-bar .close svg { width: 15px; height: 15px; stroke-width: 2.6; }
.sheet-bar .done { padding: 6px 4px; border: 0; background: none; color: var(--blue); font-size: 17px; font-weight: 600; }
.spacer { height: 8px; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin: 4px 20px 14px; }
.detail-head .ring { width: 48px; height: 48px; }
.detail-head .ring text { font-size: 15px; }
.detail-head .eyebrow { font-size: 13px; color: var(--label-2); }
.detail-head h2 { margin: 3px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: .1px; overflow-wrap: anywhere; }
.ico.big { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; }
.ico.big svg { width: 26px; height: 26px; }
.quote-head { margin: 0 20px 6px; }
.quote-head .nm { font-size: 15px; color: var(--label-2); }
.quote-head .big { margin-top: 2px; font: 700 40px/46px var(--rounded); letter-spacing: -.5px; }
.quote-head .chg { font-size: 17px; font-weight: 600; }
.chart { margin: 8px 0 14px; padding: 0 12px; }
.chart .area { display: block; width: 100%; height: 150px; }
.chart .area .line { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.prose { padding: 0 20px 8px; font-size: 17px; line-height: 25px; }
.prose h4 { margin: 18px 0 6px; font-size: 20px; line-height: 25px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose .eyebrow { color: var(--label-2); font-size: 13px; }

/* ассистент */
.chat-page { min-height: calc(100% - 58px); display: flex; flex-direction: column; }
.chat-page .chat { flex: 1; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 14px 12px; }
.chat-intro { margin: 8px 6px 10px; text-align: center; color: var(--label-2); font-size: 15px; line-height: 21px; }
.chat-intro svg { width: 34px; height: 34px; color: var(--purple); }
.msg { max-width: 86%; padding: 9px 14px; border-radius: 20px; font-size: 17px; line-height: 23px; overflow-wrap: anywhere; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg h4 { margin: 6px 0 4px; font-size: 17px; }
.msg.me { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--blue); color: #fff; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--card); }
.msg.err { color: var(--red); }
.msg .by { display: block; margin-top: 6px; font-size: 12px; color: var(--label-2); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--label-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; } }
.about { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; padding: 8px 6px 8px 12px; border-radius: 14px;
  background: var(--card); font-size: 13px; color: var(--label-2); }
.about > svg { flex: none; width: 16px; height: 16px; color: var(--purple); }
.about span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(8px + var(--safe-bottom));
  background: var(--bg); }
.composer textarea { flex: 1; min-height: 42px; max-height: 120px; padding: 10px 16px; border: .5px solid var(--sep); border-radius: 21px;
  background: var(--card); font-size: 17px; line-height: 22px; resize: none; outline: none; }
.composer .send { flex: none; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: var(--blue); color: #fff; }
.composer .send svg { width: 22px; height: 22px; stroke-width: 2.4; }
.composer .send:disabled { opacity: .4; }

/* лента карточек «Для вас»: листается по одной, как короткие видео */
body.lock { overflow: hidden; }
.cards { height: calc(var(--tg-viewport-stable-height, 100vh) - var(--nav-h) - 150px - var(--tab-h) - var(--safe-bottom));
  min-height: 380px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none;
  padding: 0 16px; -webkit-overflow-scrolling: touch; }
.cards::-webkit-scrollbar { display: none; }
.fcard { position: relative; height: calc(100% - 12px); margin-bottom: 12px; display: flex; flex-direction: column; overflow: hidden;
  padding: 18px 18px 10px; border-radius: 28px; background: var(--card); scroll-snap-align: start; scroll-snap-stop: always;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.fcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 55%; pointer-events: none; opacity: .14;
  background: linear-gradient(180deg, var(--tint, var(--gray)), transparent); }
.tint-up { --tint: var(--green); } .tint-down { --tint: var(--red); } .tint-flat { --tint: var(--blue); }
.tint-money { --tint: var(--orange); } .tint-learn { --tint: var(--purple); }
.fc-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px;
  font-weight: 600; color: var(--label-2); }
.fc-top > span { display: inline-flex; align-items: center; gap: 6px; }
.fc-top svg.i { width: 17px; height: 17px; }
.fc-top .ring { width: 40px; height: 40px; }
.fc-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 14px 0 8px; scrollbar-width: none; }
.fc-body::-webkit-scrollbar { display: none; }
.fc-body h2 { margin: 0 0 14px; font-size: 26px; line-height: 31px; font-weight: 700; letter-spacing: .2px; overflow-wrap: anywhere; }
.fc-body p { margin: 0 0 12px; font-size: 17px; line-height: 24px; }
.fc-body p.muted { color: var(--label-2); font-size: 15px; line-height: 20px; }
.fc-label { margin: 6px 0 4px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.fc-body .tags { margin-top: 4px; }
.tag.mine { background: var(--blue-tint); color: var(--blue); }
.tag.dir.up { color: var(--green); } .tag.dir.down { color: var(--red); }
.fc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.fc-fact { padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.fc-fact span { display: block; font-size: 12px; color: var(--label-2); }
.fc-fact b { display: block; margin-top: 2px; font: 600 17px/22px var(--rounded); overflow-wrap: anywhere; }
.fc-actions { position: relative; display: flex; justify-content: space-around; gap: 4px; padding-top: 8px; border-top: .5px solid var(--sep); }
.fa { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 2px; border: 0; border-radius: 14px;
  background: none; color: var(--label-2); font-size: 11px; font-weight: 600; }
.fa svg { width: 25px; height: 25px; }
.fa span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fa.on { color: var(--blue); }
.fa.on svg { fill: currentColor; fill-opacity: .2; }
.fa:active { background: var(--fill); }
.fcard.end { align-items: center; justify-content: center; }
.fc-body.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.fc-body.center > svg { width: 44px; height: 44px; color: var(--green); }
.fc-body.center h2 { margin: 0; }

/* состояния */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 22px; text-align: center; color: var(--label-2);
  font-size: 15px; line-height: 20px; }
.empty > svg { width: 30px; height: 30px; margin-bottom: 4px; color: var(--label-3); }
.empty b { color: var(--label); font-size: 17px; }
.empty .btn { margin-top: 10px; }
.skel { padding: 14px 16px; }
.skel i { display: block; height: 12px; margin: 8px 0; border-radius: 6px; background: var(--fill); }
.gate { max-width: 420px; margin: 22vh auto 0; padding: 0 30px; text-align: center; }
.gate svg { width: 48px; height: 48px; color: var(--blue); }
.gate h2 { margin: 14px 0 8px; font-size: 22px; }
.gate p { margin: 0; color: var(--label-2); line-height: 1.45; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-bottom) + 22px); z-index: 60; max-width: calc(100% - 40px);
  padding: 11px 18px; border-radius: 999px; border: .5px solid var(--glass-line); background: var(--glass); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  font-size: 15px; font-weight: 500; line-height: 20px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px);
  transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { color: var(--red); }

@media (min-width: 700px) { main, .large { max-width: 680px; margin-left: auto; margin-right: auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* портфель: сума як у «Гаманці», розподіл як у «Екранному часі» */
.pf-hero { margin: 0 16px 14px; padding: 14px 16px 16px; border-radius: var(--r-card); background: var(--card); }
.pf-top { display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--label-2); }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--label-2); }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 2.2; }
.pf-total { margin-top: 2px; font: 700 38px/44px var(--rounded); letter-spacing: -.6px; overflow-wrap: anywhere; }
.pf-day { margin-top: 2px; font-size: 15px; font-weight: 600; }
.pf-hero .chart { margin: 12px -4px 4px; padding: 0; }
.pf-hero .chart .area { height: 130px; }
.pf-range-change { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.pf-hero .seg { margin: 0 0 14px; }
.pf-hero .hint { margin: 12px 0 14px; font-size: 13px; line-height: 18px; color: var(--label-2); }
.alloc { display: flex; gap: 2px; height: 12px; overflow: hidden; border-radius: 6px; background: var(--fill); }
.alloc i { min-width: 3px; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--label-2); }
.alloc-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.alloc-legend b { color: var(--label); font-weight: 600; }
.cell.holding { gap: 12px; min-height: 60px; }
.cell.holding .tk { font-size: 17px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.holding .nm { margin-top: 2px; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.holding .px { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 48%; }
.cell.holding .px b { font: 600 17px/22px var(--rounded); white-space: nowrap; }
.cell.holding .px .pill { min-width: 0; padding: 1px 6px; font-size: 13px; line-height: 18px; border-radius: 6px; }
.cell.holding .px small { font-size: 13px; font-weight: 600; }
.cell.holding:has(.coin) + .cell::before { left: 60px; }
.coin { position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%;
  background: var(--c, var(--fill-2)); color: #fff; font: 700 15px/1 var(--rounded); }
.coin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }
.pf-empty .btn { margin-top: 14px; }
.pf-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pf-kinds span { padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--c); }
.acc-head { flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.acc-head .ico.big { margin-bottom: 6px; }
.acc-head .big { margin-top: 4px; font: 700 34px/40px var(--rounded); letter-spacing: -.5px; }
.cell .v small { font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
textarea.field { resize: none; line-height: 22px; font-size: 15px; }
select.field { appearance: none; -webkit-appearance: none; }
.steps { margin: 0 16px 12px; padding: 12px 14px; border-radius: 14px; background: var(--blue-tint); color: var(--label); font-size: 15px; line-height: 21px; }
.warn { display: flex; gap: 10px; margin: 4px 16px 16px; padding: 12px 14px; border-radius: 14px; background: var(--fill);
  font-size: 13px; line-height: 18px; color: var(--label-2); }
.warn svg { flex: none; width: 20px; height: 20px; color: var(--green); stroke-width: 2; }
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cell .s.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* аналітик */
.regime { margin-top: 10px; }
.regime-bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--red), var(--orange) 35%, var(--gray) 50%, var(--teal) 65%, var(--green)); opacity: .85; }
.regime-bar i { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); border: 3px solid var(--label); }
.regime-lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--label-2); }
.regime-lbl b { font-size: 13px; }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 0; border-radius: 999px; background: var(--fill); color: var(--label); font-size: 14px; }
.stance { padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.stance.up { background: var(--green); } .stance.down { background: var(--red); } .stance.flat { background: var(--gray); }
.an-head { margin: 0 20px 6px; }
.an-head .eyebrow { font-size: 13px; color: var(--label-2); }
.an-head h2 { margin: 4px 0 4px; font: 700 24px/29px var(--rounded); letter-spacing: -.3px; }
.an-sum p { margin-top: 10px; }
.cell.bullet { align-items: flex-start; gap: 12px; }
.cell.bullet svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--indigo); stroke-width: 2; }
.cell.bullet .t { font-size: 15px; line-height: 21px; }
.scen, .idea { margin: 0 16px 10px; padding: 14px 16px; border-radius: var(--r-card); background: var(--card); }
.scen-h { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--c); }
.scen-h b { font: 700 17px/1 var(--rounded); }
.scen-bar { height: 6px; margin: 8px 0 10px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.scen-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.scen h3, .idea p, .scen p { margin: 0; }
.scen h3 { font-size: 17px; line-height: 22px; }
.scen p, .idea p { margin-top: 6px; font-size: 15px; line-height: 21px; }
.scen p.sub, .idea p.sub { font-size: 13px; line-height: 18px; color: var(--label-2); }
.idea { border-left: 4px solid var(--c); }
.idea-h { display: flex; align-items: center; gap: 8px; }
.idea-h b { font: 700 19px/1 var(--rounded); }
.idea-h .act { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--label-2); }
.idea-m { margin-top: 6px; font-size: 13px; color: var(--label-2); }
.conf { display: inline-flex; gap: 3px; vertical-align: 1px; }
.conf i { width: 6px; height: 6px; border-radius: 50%; background: var(--fill-2); }
.conf i.on { background: var(--c, var(--blue)); }
.idea-res { display: flex; gap: 12px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.plan { padding-top: 16px; }
.plan-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 4px 10px; align-items: center; margin-top: 12px; font-size: 15px; }
.plan-row > i { width: 10px; height: 10px; border-radius: 50%; }
.plan-row p { grid-column: 2 / 4; margin: 0; font-size: 13px; line-height: 18px; color: var(--label-2); }
.acc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px; }
.acc { padding: 12px; border-radius: 16px; background: var(--card); text-align: center; }
.acc span, .acc small { display: block; font-size: 12px; color: var(--label-2); }
.acc b { display: block; margin: 4px 0 2px; font: 700 24px/28px var(--rounded); }
.dotr { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dotr.up { background: var(--green); } .dotr.down { background: var(--red); } .dotr.flat { background: var(--gray); }
.btn[disabled] { opacity: .55; }

/* фонди */
.cell.hold .bar { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.cell.hold .bar i { display: block; height: 100%; border-radius: 3px; background: var(--indigo); }
.chg-tag { font-size: 12px; font-weight: 700; margin-right: 4px; }
