/* iCase CRM — мини-приложение Telegram.
   Совместимость: без color-mix(), :has(), aspect-ratio и т.п. — работает в старых WebView (Android 7+, iOS 13+).
   Производные цвета (заливки, разделители, подсветки) считает app.js из темы Telegram и кладёт в --переменные.

   КАК МЕНЯТЬ
   • Основные цвета берутся из темы Telegram (--tg-theme-…), их менять не нужно.
   • Зелёный/жёлтый/красный (прибыль, «залежался», убыток) — --good, --warn, --bad ниже
     И те же числа в applyTheme() в app.js (good/warn/bad) — для полупрозрачных заливок.
   • Скругления — --r; высота нижнего меню — --tab-h.
   • Блоки по экранам подписаны комментариями «---------- … ----------». */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #111114);
  --hint: var(--tg-theme-hint-color, #8a8a8e);
  --sub: var(--tg-theme-subtitle-text-color, var(--tg-theme-hint-color, #6d6d72));
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --head: var(--tg-theme-section-header-text-color, var(--tg-theme-hint-color, #6d6d72));
  --good: #2fb36b;
  --warn: #e8930c;
  --bad: #e5484d;
  /* значения по умолчанию (светлая тема); app.js пересчитает под тему Telegram */
  --sep: rgba(138, 138, 142, .22);
  --fill: rgba(138, 138, 142, .12);
  --fill-2: rgba(138, 138, 142, .22);
  --good-bg: rgba(47, 179, 107, .14);
  --warn-bg: rgba(232, 147, 12, .15);
  --bad-bg: rgba(229, 72, 77, .13);
  --info-bg: rgba(36, 129, 204, .12);
  --hero-2: #5a5fd6;
  --bar-bg: rgba(255, 255, 255, .9);
  --c-best: rgba(47, 179, 107, .22);
  --c-1: rgba(47, 179, 107, .09);
  --c-2: rgba(232, 147, 12, .11);
  --c-3: rgba(229, 72, 77, .14);
  --shadow: rgba(0, 0, 0, .12);
  --r: 14px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.38 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--hint); }
.sub { color: var(--sub); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
/* прокручивается само окно (а не вложенный блок) — так надёжнее всего во всех WebView */
#app { width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 0 calc(var(--tab-h) + var(--safe-b) + 18px); }
.screen { padding: 0 14px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 12px; }
.top > div:first-child { min-width: 0; margin-right: 10px; }
.top h1 { font-size: 26px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.3px; }
.top .date { color: var(--hint); font-size: 13px; margin-top: 2px; }
.icon-btn { border: 0; background: var(--card); width: 38px; height: 38px; border-radius: 19px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex: none; cursor: pointer; padding: 0; }
.icon-btn:active { opacity: .6; }
.icon-btn svg { width: 20px; height: 20px; }
.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--head); margin: 20px 4px 8px;
  display: flex; justify-content: space-between; align-items: baseline; }
.section-title > span:first-child { min-width: 0; margin-right: 8px; }
.section-title > span + span { white-space: nowrap; flex: none; }
.section-title a { text-transform: none; letter-spacing: 0; color: var(--link); font-size: 14px; text-decoration: none; cursor: pointer; flex: none; }

.card { background: var(--card); border-radius: var(--r); padding: 14px; }
.card + .card { margin-top: 10px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }

/* ---------- главный блок ---------- */
.hero { background: var(--accent); background: linear-gradient(135deg, var(--accent), var(--hero-2));
  color: #fff; border-radius: 18px; padding: 16px 16px 14px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero .label { opacity: .85; font-size: 13px; }
.hero .big { font-size: 32px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0 10px; }
.hero .row { display: flex; }
.hero .pill { flex: 1; background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.hero .pill + .pill { margin-left: 8px; }
.hero .pill b { display: block; font-size: 15px; }
.hero .pill span { font-size: 12px; opacity: .85; }

/* ---------- плитки ---------- */
.tiles { display: flex; flex-wrap: wrap; margin: -5px; }
.tile { background: var(--card); border-radius: var(--r); padding: 12px 13px; min-width: 0; width: calc(50% - 10px); margin: 5px; }
.tile.click { cursor: pointer; }
.tile.click:active { opacity: .7; }
.tile .t { color: var(--hint); font-size: 12.5px; }
.tile .v { font-size: 20px; font-weight: 650; margin-top: 3px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.delta { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 8px; margin-left: 4px; white-space: nowrap; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }

/* ---------- быстрые действия ---------- */
.quick { display: flex; margin: 12px -4px 0; }
.quick button { flex: 1; margin: 0 4px; border: 0; background: var(--card); border-radius: var(--r); padding: 11px 2px 9px; display: flex; flex-direction: column;
  align-items: center; font-size: 12px; cursor: pointer; color: var(--text); min-width: 0; }
.quick button:active { opacity: .7; }
.quick .ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--info-bg);
  color: var(--accent); margin-bottom: 5px; font-size: 18px; }
.quick .ic svg { width: 20px; height: 20px; }

/* ---------- списки ---------- */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; padding: 11px 14px; position: relative; cursor: pointer; min-height: 52px; }
.item:active { background: var(--fill); }
.item + .item::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--sep); }
.item.noicon + .item.noicon::before { left: 14px; }
.item .av { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  background: var(--fill); color: var(--sub); margin-right: 12px; }
.item .av svg { width: 20px; height: 20px; }
.item .main { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t2 { font-size: 13px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.item .end { text-align: right; flex: none; margin-left: 10px; max-width: 48%; }
.item .end .e1 { font-weight: 600; white-space: nowrap; }
.item .end .e2 { font-size: 12.5px; color: var(--hint); margin-top: 1px; white-space: nowrap; }
.item .end .good { color: var(--good); }
.item .end .bad { color: var(--bad); }
.item .chev { color: var(--hint); opacity: .6; flex: none; margin-left: 8px; }
.empty { text-align: center; color: var(--hint); padding: 34px 20px; }
.empty .big { font-size: 40px; margin-bottom: 6px; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 7px; background: var(--fill); color: var(--sub); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- поиск, чипы ---------- */
.field-search { display: flex; align-items: center; background: var(--card); border-radius: 12px; padding: 0 12px; height: 42px; min-width: 0; }
.field-search svg { width: 18px; height: 18px; color: var(--hint); flex: none; margin-right: 8px; }
.field-search input { flex: 1; border: 0; outline: 0; background: transparent; height: 100%; font-size: 16px; min-width: 0; padding: 0; -webkit-appearance: none; appearance: none; border-radius: 0; }
.field-search .clear { border: 0; background: var(--fill-2); color: var(--card); width: 20px; height: 20px; border-radius: 10px; font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; flex: none; }
.chips { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 9px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips > * { margin-right: 7px; }
.chips > *:last-child { margin-right: 0; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
.chips.wrap > * { margin-bottom: 7px; }
.chip { border: 0; background: var(--card); color: var(--text); border-radius: 18px; padding: 7px 13px; font-size: 14px; white-space: nowrap; cursor: pointer; flex: none; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.chip .n { font-size: 12px; opacity: .7; margin-left: 3px; }
.chip.small { padding: 6px 11px; font-size: 13px; background: var(--fill); }
.chip.small.on { background: var(--accent); color: var(--accent-text); }
.summary-line { display: flex; flex-wrap: wrap; color: var(--sub); font-size: 13px; padding: 4px 4px 8px; min-width: 0; }
.summary-line > * { margin-right: 12px; }
.summary-line b { color: var(--text); }
.sortbar { display: flex; justify-content: space-between; align-items: center; }
.sel { position: relative; flex: none; display: inline-flex; align-items: center; color: var(--link); font-size: 14px; padding: 4px 0 4px 8px; white-space: nowrap; cursor: pointer; }
.sel::after { content: "▾"; font-size: 12px; margin-left: 3px; }
.sel select { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; -webkit-appearance: none; appearance: none; cursor: pointer; }

/* ---------- формы ---------- */
.form .group { background: var(--card); border-radius: var(--r); padding: 4px 14px; margin-bottom: 12px; }
.form .row { padding: 10px 0; position: relative; }
.form .row + .row { border-top: 1px solid var(--sep); }
.form label { display: block; font-size: 12.5px; color: var(--hint); margin-bottom: 4px; }
.form input[type=text], .form input[type=tel], .form input[type=date], .form input[type=month], .form input[type=search], .form textarea, .form select, .inp {
  width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 2px 0; color: var(--text); border-radius: 0; -webkit-appearance: none; appearance: none; }
.form textarea { resize: none; min-height: 44px; }
.form input::placeholder, .form textarea::placeholder, .inp::placeholder { color: var(--hint); opacity: .75; }
.money-input { display: flex; align-items: baseline; }
.money-input input { font-size: 30px !important; font-weight: 650; letter-spacing: -.4px; min-width: 0; }
.money-input .cur { font-size: 24px; color: var(--hint); font-weight: 600; margin-left: 6px; }
.help { font-size: 12.5px; color: var(--hint); margin-top: 6px; }
.help.ok { color: var(--good); }
.help.err { color: var(--bad); }
.help.wrn { color: var(--warn); }
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.seg button { flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 8px; padding: 7px 2px; font-size: 14px; cursor: pointer; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px var(--shadow); }
.suggest { position: absolute; left: -14px; right: -14px; top: 100%; z-index: 20; background: var(--card); border-radius: 0 0 var(--r) var(--r);
  box-shadow: 0 10px 24px var(--shadow); max-height: 260px; overflow: auto; }
.suggest div { padding: 11px 14px; border-top: 1px solid var(--sep); cursor: pointer; }
.suggest div:active { background: var(--fill); }
.suggest mark { background: transparent; color: var(--accent); font-weight: 600; }

.btn { white-space: nowrap; border: 0; width: 100%; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer; display: flex;
  align-items: center; justify-content: center; background: var(--accent); color: var(--accent-text); }
.btn svg { width: 19px; height: 19px; margin-right: 8px; }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .45; }
.btn.sec { background: var(--info-bg); color: var(--accent); }
.btn.ghost { background: var(--card); color: var(--accent); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn-row { display: flex; }
.btn-row .btn { flex: 1; }
.btn-row .btn + .btn { margin-left: 8px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; margin-left: 8px; }

/* ---------- нижнее меню ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--sep);
  padding-bottom: var(--safe-b); }
.tabbar .in { display: flex; max-width: 720px; margin: 0 auto; height: var(--tab-h); }
.tabbar button { flex: 1; min-width: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--hint); cursor: pointer; padding: 0; }
.tabbar button svg { width: 25px; height: 25px; margin-bottom: 3px; }
.tabbar button.on { color: var(--accent); }
.tabbar .plus { flex: 0 0 64px; }
.tabbar .plus span { width: 46px; height: 46px; border-radius: 16px; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px var(--shadow); }
.tabbar .plus span svg { width: 26px; height: 26px; margin: 0; }

/* ---------- шторка ---------- */
.backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); z-index: 50; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg); border-radius: 18px 18px 0 0; max-height: 92%;
  overflow-y: auto; -webkit-overflow-scrolling: touch; transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  padding: 0 14px calc(var(--safe-b) + 16px); max-width: 720px; margin: 0 auto; overscroll-behavior: contain; }
.sheet.show { transform: none; }
.sheet .grab { position: -webkit-sticky; position: sticky; top: 0; background: var(--bg); padding: 8px 0 4px; z-index: 2; }
.sheet .grab::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto; }
.sheet .sh-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 6px 2px 12px; }
.sheet .sh-head > div { min-width: 0; margin-right: 10px; }
.sheet .sh-head h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.sheet .sh-head .x { border: 0; background: var(--fill); width: 30px; height: 30px; border-radius: 15px; color: var(--hint); font-size: 15px; cursor: pointer; flex: none; padding: 0; }
body.locked { overflow: hidden; }

/* ---------- карточка устройства ---------- */
.kv { display: flex; justify-content: space-between; padding: 9px 0; }
.kv + .kv { border-top: 1px solid var(--sep); }
.kv .k { color: var(--sub); margin-right: 10px; }
.kv .v { text-align: right; font-weight: 500; min-width: 0; }
.kv.total .k, .kv.total .v { font-weight: 700; color: var(--text); }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill); margin: 10px 0 4px; }
.stack i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.legend span { display: inline-flex; align-items: center; margin-right: 12px; }
.legend .dot { margin-right: 5px; }
.imei { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .3px; }
.copy { border: 0; background: var(--info-bg); color: var(--accent); border-radius: 8px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; margin-left: 4px; }
.timeline { font-size: 13px; color: var(--sub); margin: 2px 0 12px; line-height: 1.7; }
.market { border-radius: var(--r); padding: 12px 14px; background: var(--info-bg); }
.market .mt { font-size: 12.5px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.market .mrow { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding: 2px 0; }
.market .mrow span:first-child { color: var(--sub); min-width: 0; margin-right: 8px; }
.market .mrow b { text-align: right; white-space: nowrap; }
.big-profit { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }

/* ---------- цены: поиск по модели ---------- */
.pgroup .ph { display: flex; justify-content: space-between; align-items: flex-start; }
.pgroup .ph h3 { margin: 0 8px 0 0; font-size: 17px; }
.pstats { display: flex; margin: 10px -3px 4px; }
.pstat { flex: 1; background: var(--fill); border-radius: 10px; padding: 7px 9px; min-width: 0; margin: 0 3px; }
.pstat .l { font-size: 11.5px; color: var(--hint); }
.pstat .v { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--head); margin: 14px 0 4px; }
.prow { display: flex; justify-content: space-between; padding: 7px 0; align-items: baseline; }
.prow + .prow { border-top: 1px solid var(--sep); }
.prow .pl { min-width: 0; margin-right: 10px; }
.prow .pl .a { font-weight: 600; }
.prow .pl .b { font-size: 12.5px; color: var(--hint); }
.prow .pr { text-align: right; flex: none; }
.offers { display: flex; flex-wrap: wrap; margin-top: 5px; }
.offers span { font-size: 12px; background: var(--fill); border-radius: 7px; padding: 2px 7px; color: var(--sub); margin: 0 5px 5px 0; white-space: nowrap; }
.offers span.best { background: var(--good-bg); color: var(--good); font-weight: 600; }
.range { position: relative; height: 6px; border-radius: 3px; background: var(--fill); margin: 12px 7px 8px; }
.range i { position: absolute; top: -4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.range i.o { top: -1px; width: 8px; height: 8px; margin-left: -4px; background: var(--hint); border: 0; opacity: .7; }
.range b { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--info-bg); border-radius: 3px; }

/* ---------- цены: разделы, таблица ---------- */
.pnav { display: flex; background: var(--fill); border-radius: 11px; padding: 2px; margin: 8px 0 4px; }
.pnav button { flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 9px; padding: 8px 0; font-size: 13.5px; color: var(--sub);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnav button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px var(--shadow); }
.frow { display: flex; align-items: center; margin-top: 6px; }
.frow .field-search { flex: 1; height: 40px; }
.vt { display: flex; background: var(--card); border-radius: 10px; padding: 3px; flex: none; margin-left: 8px; }
.vt button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; color: var(--hint); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.vt button.on { background: var(--info-bg); color: var(--accent); }
.vt svg { width: 18px; height: 18px; }
.tbl-wrap { background: var(--card); border-radius: var(--r); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: separate; border-spacing: 0; font-size: 13px; width: 100%; }
.tbl th { background: var(--card); color: var(--hint); font-weight: 600; font-size: 11.5px; text-align: right; padding: 9px 8px 7px; white-space: nowrap; border-bottom: 1px solid var(--sep); }
.tbl td { padding: 7px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--sep); font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { position: -webkit-sticky; position: sticky; left: 0; z-index: 2; text-align: left; background: var(--card);
  border-right: 1px solid var(--sep); min-width: 96px; max-width: 128px; white-space: normal; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.grp td { border-top: 2px solid var(--fill-2); }
.tbl td .m1 { font-weight: 600; font-size: 13px; line-height: 1.2; }
.tbl td .m2 { color: var(--hint); font-size: 11px; line-height: 1.25; }
.tbl td.min { font-weight: 700; }
.tbl td.c-best { background: var(--c-best); color: var(--good); font-weight: 700; }
.tbl td.c-1 { background: var(--c-1); }
.tbl td.c-2 { background: var(--c-2); }
.tbl td.c-3 { background: var(--c-3); }
.tbl td.empty { color: var(--hint); opacity: .5; padding: 7px 8px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:active td { opacity: .7; }
.tbl-note { font-size: 12px; color: var(--hint); margin: 8px 4px 0; display: flex; flex-wrap: wrap; }
.tbl-note span { margin-right: 12px; white-space: nowrap; }
.tbl-note i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.more-btn { margin-top: 10px; }
.pcard { background: var(--card); border-radius: var(--r); padding: 12px 14px; cursor: pointer; }
.pcard + .pcard { margin-top: 8px; }
.pcard .top1 { display: flex; justify-content: space-between; align-items: baseline; }
.pcard .top1 > div { min-width: 0; margin-right: 8px; }
.pcard .top1 b { font-size: 15px; }
.pcard .bar { position: relative; height: 22px; margin: 8px 7px 2px; }
.pcard .bar::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--fill-2); border-radius: 1px; }
.pcard .bar span { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--card); }
.vbars { display: flex; align-items: flex-end; height: 120px; }
.vbars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; margin: 0 3px; }
.vbars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; min-height: 3px; }
.vbars b { font-size: 13px; margin-bottom: 4px; }
.vlabels { display: flex; margin-top: 6px; }
.vlabels span { flex: 1; text-align: center; font-size: 11px; color: var(--hint); min-width: 0; margin: 0 3px; }
.chg { display: flex; align-items: center; padding: 10px 14px; position: relative; }
.chg + .chg::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; height: 1px; background: var(--sep); }
.chg .arrow { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; margin-right: 10px; }
.chg .arrow.up { background: var(--bad-bg); color: var(--bad); }
.chg .arrow.down { background: var(--good-bg); color: var(--good); }
.chg .main { flex: 1; min-width: 0; }
.chg .main .t1 { font-weight: 600; line-height: 1.25; }
.chg .main .t2 { font-size: 12.5px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg .end { text-align: right; flex: none; font-variant-numeric: tabular-nums; margin-left: 10px; }
.strike { text-decoration: line-through; color: var(--hint); font-size: 12px; }
.err-box { text-align: center; padding: 28px 16px; }
.err-box .btn { margin-top: 14px; }

/* ---------- графики ---------- */
.chart { width: 100%; display: block; }
.chart-wrap { position: relative; }
.chart-tip { position: absolute; top: 0; background: var(--text); color: var(--card); font-size: 12px; padding: 4px 8px; border-radius: 8px;
  pointer-events: none; white-space: nowrap; z-index: 2; transform: translateX(-50%); }
.hbar { display: flex; align-items: center; padding: 6px 0; }
.hbar .hl { width: 36%; font-size: 13.5px; min-width: 0; overflow: hidden; }
.hbar .hl .muted { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .ht { flex: 1; height: 8px; background: var(--fill); border-radius: 4px; overflow: hidden; margin: 0 10px; }
.hbar .ht i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.hbar .hv { width: 84px; text-align: right; font-size: 13px; font-weight: 600; flex: none; }
.months { display: flex; margin-top: 2px; }
.months span { flex: 1; text-align: center; font-size: 10px; color: var(--hint); }

/* ---------- уведомления ---------- */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 80; text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(20px); transition: opacity .22s, transform .22s; }
.toast span { display: inline-block; background: var(--text); color: var(--card); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 100%; }
.toast.err span { background: var(--bad); color: #fff; }
.toast.show { opacity: 1; transform: none; }
.alert { display: flex; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--card); cursor: pointer; }
.alert + .alert { margin-top: 8px; }
.alert .ai { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; font-size: 16px; margin-right: 11px; }
.alert > div:last-child { min-width: 0; }
.alert .at { font-weight: 600; }
.alert .as { font-size: 13px; color: var(--sub); margin-top: 1px; }

.skeleton { background: var(--fill); border-radius: var(--r); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.success { text-align: center; padding: 26px 10px 12px; }
.success .ok { width: 68px; height: 68px; border-radius: 34px; background: var(--good-bg); color: var(--good); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.success .ok svg { width: 36px; height: 36px; }
.gate { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.gate .big { font-size: 46px; }
.menu-grid .item .av { color: #fff; }
.pad { height: 10px; }
@media (max-width: 345px) {
  .pnav button { font-size: 12.5px; }
  .top h1 { font-size: 24px; }
  .tile .v { font-size: 18px; }
  .hero .big { font-size: 28px; }
  .quick button { font-size: 11px; }
}

/* ---------- фото устройства ---------- */
.photo-row { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.photo-row::-webkit-scrollbar { display: none; }
.photo-row img, .photo-add { flex: none; width: 84px; height: 84px; border-radius: 12px; object-fit: cover; margin-right: 8px; background: var(--fill); cursor: pointer; }
.photo-add { display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--accent); background: var(--info-bg); }
input[type=month] { width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 2px 0; color: var(--text); -webkit-appearance: none; appearance: none; }
