/* ============================================================================
   Компоненты оболочки — собственная реализация по замерам CIRREL_CORE_STYLES.css.
   Геометрия, радиусы, отступы, тени, стекло, зерно и адаптив — итоговые значения
   исходного каскада (с учётом всех слоёв переопределения в конце файла).
   ========================================================================== */
*, :before, :after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 var(--fs-base)/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; margin: 0; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: 0 0; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { flex: none; }
h1, h2, h3, h4, p { margin: 0; }
small { font-size: var(--fs-xs); }
[hidden] { display: none !important; }
::selection { background: var(--sig-soft); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip { z-index: 100; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 14px; font-weight: 600; position: fixed; top: -60px; left: 12px; }
.skip:focus { top: 12px; }
.sr { clip: rect(0 0 0 0); white-space: nowrap; width: 1px; height: 1px; position: absolute; overflow: hidden; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7px; stroke-linecap: round; stroke-linejoin: round; width: 20px; height: 20px; }
.ico--sm { width: 16px; height: 16px; } .ico--lg { width: 24px; height: 24px; }
.word { vertical-align: top; margin-bottom: -.08em; padding-bottom: .08em; display: inline-block; overflow: hidden; }
.ch { display: inline-block; }
.muted { color: var(--muted); } .good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }

/* фон: стена + 5 сфер */
.bg { z-index: 0; pointer-events: none; background: var(--wall); position: fixed; inset: 0; overflow: hidden; }
.bg i { box-shadow: var(--orb-shadow); border-radius: 50%; position: absolute; }
.bg i:nth-child(1) { background: var(--orb-1); width: 540px; height: 540px; inset: 36% auto auto -150px; }
.bg i:nth-child(2) { background: var(--orb-2); width: 300px; height: 300px; inset: -70px 7% auto auto; }
.bg i:nth-child(3) { background: var(--orb-3); width: 460px; height: 460px; inset: auto -120px -140px auto; }
.bg i:nth-child(4) { background: var(--orb-4); width: 200px; height: 200px; inset: auto auto 7% 46%; }
.bg i:nth-child(5) { background: var(--orb-5); width: 150px; height: 150px; top: 54%; left: 60%; }
[data-theme=dark] .bg i:nth-child(2) { opacity: .8; }

/* стекло + зерно + блик-кромка */
.glass, .card, .kpi, .side, .tabbar { background-image: var(--grain); background-blend-mode: soft-light; background-size: 128px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glow), var(--shadow); position: relative; }
.card { background-color: var(--glass); border-radius: var(--r-lg); min-width: 0; padding: 18px 20px 20px; }
.card--flush { padding: 0; }
.card--well { background-image: none; background-color: var(--card-2); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 0 0 1px var(--line); }
.card:before, .kpi:before { content: ""; border-radius: inherit; pointer-events: none; background: linear-gradient(#ffffff6b, #ffffff14 22%, #0000 45%); position: absolute; inset: 0; }
[data-theme=dark] .card:before, [data-theme=dark] .kpi:before { background: linear-gradient(#ffffff12, #0000 40%); }
.card--well:before { display: none; }
.card > *, .kpi > * { position: relative; }
.glass:after, .card:after, .kpi:after, .drawer:after, .modal:after, .pop:after, .finder:after {
  content: ""; border-radius: inherit; pointer-events: none; z-index: 2;
  background: linear-gradient(140deg, var(--edge) 0%, var(--edge-2) 32%, transparent 52%, var(--edge-2) 74%, color-mix(in oklab, var(--edge) 70%, transparent) 100%);
  padding: 1px; position: absolute; inset: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card--well:after { display: none; }

/* каркас */
.app { min-height: 100dvh; position: relative; }
.main { z-index: 1; margin-left: calc(var(--side-w) + 32px); flex-direction: column; min-width: 0; min-height: 100vh; display: flex; position: relative; transition: margin-left .55s var(--ease); }
html.is-rail .main { margin-left: calc(var(--side-rail) + 32px); }
.content { width: 100%; max-width: var(--max); flex: 1; min-width: 0; margin: 0 auto; padding: 4px 28px 48px 0; }
.view { min-width: 0; }

/* сайдбар */
.side { z-index: 30; width: var(--side-w); background-color: var(--glass-hi); border-radius: 30px; flex-direction: column; gap: 10px; padding: 14px 14px 12px; display: flex; position: fixed; top: 16px; bottom: 16px; left: 16px; transition: width .55s var(--ease), padding .55s var(--ease); }
html.is-rail .side { width: var(--side-rail); padding: 16px 12px 14px; }
.side__head { align-items: center; gap: 8px; padding: 0 2px 0 4px; display: flex; }
.brand { border-radius: 12px; flex: 1; align-items: center; gap: 11px; min-width: 0; display: flex; }
.mark { color: #fff; width: 38px; height: 38px; box-shadow: inset 0 1px 0 #ffffff80, 0 10px 18px -10px var(--accent); background: linear-gradient(145deg, #64d2ff, #0a84ff 55%, #0050c8); border-radius: 13px; flex: none; place-items: center; display: grid; }
.mark svg { stroke-width: 1.9px; width: 22px; height: 22px; }
.brand__text { min-width: 0; }
.brand__text b { letter-spacing: -.02em; font-size: 21px; font-weight: 700; line-height: 1; display: block; white-space: nowrap; }
.brand__text small { font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; margin-top: 4px; font-weight: 600; display: block; }
.side .collapse { width: 32px; height: 32px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rim); background: #3c28220d; border-radius: 50%; flex: none; place-items: center; display: grid; }
[data-theme=dark] .side .collapse { background: #ffffff0d; }
.side .collapse:hover { background: var(--glass-hi); }
.side .collapse svg { width: 18px; height: 18px; transition: transform .45s var(--ease); }
html.is-rail .side .collapse svg { transform: scaleX(-1); }
html.is-rail .side__head { flex-direction: column; gap: 10px; padding: 0; }
html.is-rail .brand { flex: none; }
html.is-rail .brand__text { display: none; }
.side__search { background: var(--card-2); height: 40px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: var(--fs-md); border-radius: 99px; align-items: center; gap: 9px; padding: 0 7px 0 12px; display: flex; }
.side__search:hover { color: var(--ink); background: var(--card); }
.side__search > span:not(.kbd) { text-align: left; flex: 1; }
html.is-rail .side__search { justify-content: center; padding: 0; }
html.is-rail .side__search > span { display: none; }
.snav { scrollbar-width: none; flex-direction: column; flex: 1; gap: 4px; min-height: 0; margin: 0 -4px; padding: 0 4px; display: flex; position: relative; overflow: hidden auto; }
.snav::-webkit-scrollbar { display: none; }
.snav__pill { pointer-events: none; opacity: 0; background: var(--accent-grad); filter: drop-shadow(0 8px 14px var(--accent-glow)); position: absolute; inset: 0; }
.snav__group { flex-direction: column; gap: 2px; display: flex; }
.snav__group--end { margin-top: auto; padding-top: 8px; }
.side__group { font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 3px; font-weight: 700; white-space: nowrap; }
html.is-rail .side__group { background: var(--line-2); height: 1px; margin: 6px 14px; padding: 0; font-size: 0; }
.snav__item { z-index: 1; height: 37px; font-size: var(--fs-md); color: var(--ink-2); white-space: nowrap; border-radius: 99px; align-items: center; gap: 12px; padding: 0 12px; font-weight: 600; display: flex; position: relative; }
.snav__item > .ico { width: 20px; height: 20px; color: var(--muted); }
.snav__item:hover { background: var(--card-2); color: var(--ink); }
.snav__item[aria-current=page] { color: #fff; background: 0 0; }
.snav__item[aria-current=page] > .ico { color: #fff; }
.snav__label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.snav__count { min-width: 22px; height: 20px; font-size: var(--fs-2xs); background: var(--accent-soft); color: var(--accent-text); border-radius: 99px; place-items: center; padding: 0 7px; font-weight: 700; display: inline-grid; }
.snav__item[aria-current=page] .snav__count { color: #fff; background: #00143c47; }
html.is-rail .snav__item { justify-content: center; padding: 0; }
html.is-rail .snav__label { display: none; }
html.is-rail .snav__count { background: var(--accent); width: 8px; min-width: 0; height: 8px; box-shadow: 0 0 0 2px var(--glass-hi); padding: 0; font-size: 0; position: absolute; top: 8px; right: 12px; }
.side__foot { border-top: 1px solid var(--line); flex-direction: column; gap: 8px; padding-top: 10px; display: flex; }
.side__theme { height: 40px; font-size: var(--fs-md); color: var(--ink-2); align-items: center; gap: 12px; padding: 0 6px 0 12px; font-weight: 600; display: flex; }
.side__theme > .ico { width: 20px; height: 20px; color: var(--muted); }
.side__theme > span { flex: 1; white-space: nowrap; }
html.is-rail .side__theme { flex-direction: column; justify-content: center; gap: 6px; height: auto; padding: 0; }
html.is-rail .side__theme > span, html.is-rail .side__theme > .ico { display: none; }
.side__me { text-align: left; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 99px; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; display: flex; }
.side__me:hover { background: var(--card); }
.side__me .cell__text { flex: 1; min-width: 0; }
.side__me .cell__text b { font-size: var(--fs-md); }
.side__me > .ico { color: var(--muted); }
html.is-rail .side__me { justify-content: center; padding: 6px; }
html.is-rail .side__me .cell__text, html.is-rail .side__me > .ico { display: none; }

/* верхняя полоса */
.top { z-index: 20; padding: 16px 28px 0 0; position: sticky; top: 0; }
.top__in { max-width: var(--max); align-items: center; gap: 12px; min-height: 64px; margin: 0 auto; display: flex; }
.top__hello { flex: 1; min-width: 0; }
.top__hello b { font-size: var(--fs-2xl); letter-spacing: -.015em; font-weight: 600; line-height: 1.2; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__hello small { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; text-overflow: ellipsis; align-items: center; margin-top: 2px; font-weight: 500; display: flex; overflow: hidden; gap: 4px; }
.top__title, .top .top__menu, .top__brand { display: none; }
.tools { flex: none; align-items: center; gap: 8px; display: flex; }
.tip { z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); white-space: pre; box-shadow: var(--shadow); border-radius: 9px; padding: 6px 10px; font-weight: 600; position: fixed; }

/* мелкие элементы */
.tone--accent, .tone--sig { background: var(--sig-soft); color: var(--sig-text); }
.tone--good { background: var(--good-soft); color: var(--good); }
.tone--warn { background: var(--warn-soft); color: var(--warn); }
.tone--bad { background: var(--bad-soft); color: var(--bad); }
.tone--info { background: var(--info-soft); color: var(--info); }
.tone--plain { background: var(--card-2); color: var(--ink); }
.kbd { background: var(--card-2); min-width: 26px; height: 24px; box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-2xs); color: var(--muted); border-radius: 7px; place-items: center; padding: 0 6px; font-weight: 700; display: inline-grid; }
.ibtn { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); width: 42px; height: 42px; color: var(--ink); box-shadow: var(--glow), 0 8px 18px -12px #0f1e3c59; border-radius: 50%; flex: none; place-items: center; display: grid; position: relative; }
.ibtn:hover { background: var(--glass-hi); }
.ibtn--flat { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; background: 0 0; }
.ibtn--flat:hover { background: var(--card-2); }
.ibtn--sm { width: 34px; height: 34px; }
.ibtn:disabled { opacity: .45; cursor: not-allowed; }
.drawer .ibtn, .modal .ibtn, .pop .ibtn { -webkit-backdrop-filter: none; backdrop-filter: none; }
.ibtn__badge { background: var(--sig); color: #fff; min-width: 17px; height: 17px; font-size: var(--fs-2xs); box-shadow: 0 0 0 2px var(--card); border-radius: 99px; place-items: center; padding: 0 4px; font-weight: 700; display: grid; position: absolute; top: 6px; right: 6px; }
.btn { height: 40px; font-size: var(--fs-md); white-space: nowrap; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 color-mix(in oklab, var(--edge) 50%, transparent); border-radius: 99px; justify-content: center; align-items: center; gap: 8px; padding: 0 18px; font-weight: 600; display: inline-flex; }
.btn:hover { background: var(--glass-hi); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 #ffffff59, 0 10px 22px -10px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-hi); }
.btn--dark { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn--dark:hover { background: var(--ink-2); }
.btn--ghost { box-shadow: none; background: 0 0; }
.btn--ghost:hover { background: var(--card-2); }
.btn--danger { color: var(--bad); }
.btn--sm { height: 32px; font-size: var(--fs-sm); border-radius: 99px; padding: 0 14px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { height: 52px; font-size: var(--fs-lg); border-radius: 99px; padding: 0 22px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { color: var(--accent-text); font-weight: 600; font-size: var(--fs-sm); }
.linkbtn:hover { text-underline-offset: 3px; text-decoration: underline; }

.phead { flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 10px 0 20px; display: flex; }
.phead__text { flex: 260px; min-width: 0; }
.phead h1 { letter-spacing: -.025em; font-size: clamp(28px, 2.6vw, 38px); font-weight: 600; line-height: 1.04; }
.phead h1.is-long { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.12; max-width: 32ch; }
.phead p { color: var(--muted); font-size: var(--fs-base); max-width: 70ch; margin-top: 8px; }
.phead__actions { flex-wrap: wrap; align-items: center; gap: 8px; display: flex; }
.eyebrow { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; display: block; }

.chead { align-items: center; gap: 10px; min-height: 32px; margin-bottom: 14px; display: flex; }
.chead__text { flex: 1; min-width: 0; }
.chead h2, .chead h3 { font-size: var(--fs-lg); letter-spacing: -.005em; font-weight: 600; line-height: 1.25; }
.chead p { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.card--flush .chead { padding: 16px 20px 0; }
.grid { gap: var(--gap); display: grid; }
.grid2 { gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
.grid3 { gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); display: grid; }
.stack { gap: var(--gap); flex-direction: column; min-width: 0; display: flex; }

.kpis { gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); display: grid; }
.kpi { border-radius: var(--r-lg); color: var(--tile-ink); background-color: var(--tile-1); flex-direction: column; min-height: 128px; padding: 16px 18px 14px; display: flex; overflow: hidden; }
.kpi--1 { background-color: var(--tile-1); } .kpi--2 { background-color: var(--tile-2); } .kpi--3 { background-color: var(--tile-3); } .kpi--4 { background-color: var(--tile-4); }
.kpi--glass { background-color: var(--glass); }
.kpi__label { font-size: var(--fs-sm); color: var(--tile-muted); align-items: center; gap: 8px; font-weight: 600; display: flex; }
.kpi__label svg { width: 17px; height: 17px; }
.kpi__value { font-size: var(--fs-3xl); letter-spacing: -.01em; margin-top: 10px; font-weight: 600; line-height: 1.1; }
.kpi__foot { font-size: var(--fs-xs); color: var(--tile-muted); align-items: flex-end; gap: 8px; margin-top: auto; padding-top: 8px; font-weight: 600; display: flex; }
.delta { white-space: nowrap; font-size: var(--fs-2xs); border-radius: 99px; align-items: center; gap: 2px; padding: 2px 7px; font-weight: 700; display: inline-flex; }
.delta--up { color: var(--good); background: var(--good-soft); }
.delta--down { color: var(--bad); background: var(--bad-soft); }
.delta--flat { color: var(--muted); background: var(--card-3); }
.kpi .delta--up { color: #145c33; background: #fff9; } .kpi .delta--down { color: #9a2a14; background: #fff9; } .kpi .delta--flat { color: var(--tile-muted); background: #fff9; }
[data-theme=dark] .kpi .delta--up { color: #8fdcb1; background: #00000040; }
[data-theme=dark] .kpi .delta--down { color: #f7a7b6; background: #00000040; }
[data-theme=dark] .kpi .delta--flat { background: #00000040; }
.spark { display: block; overflow: visible; }
.spark path { fill: none; stroke: currentColor; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; }
.spark .spark__area { stroke: none; fill: currentColor; opacity: .14; }

.pill { height: 24px; font-size: var(--fs-xs); white-space: nowrap; background: var(--card-3); color: var(--ink-2); border-radius: 99px; align-items: center; gap: 6px; padding: 0 9px; font-weight: 600; display: inline-flex; }
.pill:before { content: ""; background: currentColor; border-radius: 50%; width: 6px; height: 6px; }
.pill--plain:before { display: none; }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--bad { background: var(--bad-soft); color: var(--bad); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--accent { background: var(--sig-soft); color: var(--sig-text); }
.pill--good { background: var(--good-soft); color: var(--good); }
.badge { min-width: 20px; height: 20px; font-size: var(--fs-2xs); background: var(--card-3); color: var(--ink-2); border-radius: 99px; place-items: center; padding: 0 6px; font-weight: 700; display: inline-grid; }
.chips { flex-wrap: wrap; gap: 6px; display: flex; }
.chip { height: 32px; font-size: var(--fs-sm); color: var(--muted); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; border-radius: 99px; align-items: center; gap: 6px; padding: 0 14px; font-weight: 600; display: inline-flex; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed=true] { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.chip .badge { min-width: 18px; height: 18px; color: inherit; background: #0000000f; }
.chip[aria-pressed=true] .badge { background: #ffffff38; }
.av { width: 34px; height: 34px; font-size: var(--fs-xs); color: var(--mono-ink); background: var(--h, #e6d6c4); border-radius: 50%; flex: none; place-items: center; font-weight: 700; display: grid; position: relative; overflow: hidden; }
.av--sm { width: 26px; height: 26px; font-size: var(--fs-2xs); } .av--lg { width: 48px; height: 48px; font-size: var(--fs-lg); }
.av__dot { background: var(--good); width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--card); border-radius: 50%; position: absolute; bottom: 0; right: 0; }
.avstack { display: flex; }
.avstack > * + * { box-shadow: 0 0 0 2px var(--card); margin-left: -8px; }

.seg { box-shadow: inset 0 0 0 1px var(--line); background: #78829624; border-radius: 99px; padding: 3px; display: inline-flex; position: relative; }
[data-theme=dark] .seg { background: #ffffff14; }
.seg__thumb { background: #fff; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 6px #0f1e3c24); position: absolute; inset: 0; }
[data-theme=dark] .seg__thumb { filter: none; background: #fff3; }
.seg--accent .seg__thumb { background: var(--accent); filter: none; }
.seg--accent button[aria-pressed=true] { color: var(--accent-ink); }
.seg button { z-index: 1; height: 30px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; border-radius: 99px; align-items: center; gap: 6px; padding: 0 14px; font-weight: 600; display: inline-flex; position: relative; }
.seg button[aria-pressed=true] { color: var(--ink); }
.seg button svg { width: 16px; height: 16px; }
.tabs { border-bottom: 1px solid var(--line); scrollbar-width: none; gap: 4px; margin-bottom: 20px; display: flex; position: relative; overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { height: 42px; font-size: var(--fs-md); color: var(--muted); white-space: nowrap; align-items: center; gap: 8px; padding: 0 12px; font-weight: 600; display: inline-flex; position: relative; }
.tabs a:hover, .tabs button:hover, .tabs [aria-current=page], .tabs [aria-selected=true] { color: var(--ink); }
.tabs__line { background: var(--accent); pointer-events: none; opacity: 0; height: 2px; position: absolute; bottom: 0; left: 0; right: 0; }

.table-wrap { position: relative; overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; font-size: var(--fs-md); }
.table th { text-align: left; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); padding: 10px 14px; font-weight: 600; }
.table th button { color: inherit; align-items: center; gap: 4px; font-weight: 600; display: inline-flex; }
.table th button:hover { color: var(--ink); }
.table th .ico { width: 14px; height: 14px; }
.table td { border-bottom: 1px solid var(--line); vertical-align: middle; padding: 11px 14px; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-click { cursor: pointer; }
.table tbody tr.is-click:hover td { background: var(--card-2); }
.table tbody tr.is-click:hover td:first-child { border-radius: 12px 0 0 12px; }
.table tbody tr.is-click:hover td:last-child { border-radius: 0 12px 12px 0; }
.table .r { text-align: right; }
.table td.muted { font-weight: 500; }
.cell { align-items: center; gap: 10px; min-width: 0; display: flex; }
.cell__text { min-width: 0; }
.cell__text b { white-space: nowrap; text-overflow: ellipsis; font-weight: 600; display: block; overflow: hidden; }
.cell__text small { color: var(--muted); white-space: nowrap; text-overflow: ellipsis; font-weight: 500; display: block; overflow: hidden; }
.level, .meter { background: var(--card-3); border-radius: 8px; height: 8px; display: block; position: relative; overflow: hidden; }
.level i, .meter i { border-radius: inherit; background: var(--accent); transform-origin: 0; position: absolute; inset: 0; }
.meter.is-warn i { background: var(--warn); } .meter.is-bad i { background: var(--bad); } .meter.is-good i { background: var(--good); }

.field { flex-direction: column; gap: 6px; min-width: 0; display: flex; }
.field > span { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.field small { color: var(--muted); }
.field small.bad { color: var(--bad); }
.input, .select, .textarea { background: var(--card); width: 100%; height: 42px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-base); border: 0; border-radius: 14px; padding: 0 13px; font-weight: 500; }
[data-theme=dark] .input, [data-theme=dark] .select, [data-theme=dark] .textarea { background: #00000038; }
.textarea { resize: vertical; height: auto; min-height: 96px; padding: 11px 13px; line-height: 1.5; border-radius: 16px; }
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.input.is-bad { box-shadow: inset 0 0 0 1.5px var(--bad); }
.input:disabled, .input[readonly] { color: var(--ink-2); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 17px center, right 12px center; background-repeat: no-repeat; background-size: 5px 5px; padding-right: 34px; }
.select--sm { width: auto; height: 40px; }
.inwrap { align-items: center; display: flex; position: relative; }
.inwrap > .ico { width: 18px; height: 18px; color: var(--muted); pointer-events: none; position: absolute; left: 12px; }
.inwrap .input { padding-left: 38px; border-radius: 99px; }
.formgrid { grid-template-columns: 1fr 1fr; gap: 14px; display: grid; }
.formgrid .span2 { grid-column: 1 / -1; }
.switch { width: 46px; height: 28px; box-shadow: none; background: #78829647; border-radius: 99px; flex: none; position: relative; transition: background .3s var(--ease); }
.switch i { background: #fff; border-radius: 50%; width: 24px; height: 24px; position: absolute; top: 2px; left: 2px; box-shadow: 0 2px 6px #00000038, 0 0 0 .5px #0000000a; transition: transform .45s cubic-bezier(.34, 1.8, .64, 1); }
.switch[aria-checked=true] { background: var(--on); }
.switch[aria-checked=true] i { transform: translateX(18px); }
.check { width: 20px; height: 20px; box-shadow: inset 0 0 0 1.5px var(--line-2); background: var(--card); border-radius: 50%; flex: none; place-items: center; display: grid; }
.check svg { stroke-width: 2.4px; opacity: 0; width: 14px; height: 14px; }
.check[aria-checked=true] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.check[aria-checked=true] svg { opacity: 1; }
.row-set { border-bottom: 1px solid var(--line); align-items: center; gap: 14px; padding: 14px 0; display: flex; }
.row-set:last-child { border-bottom: 0; }
.row-set__text { flex: 1; min-width: 0; }
.row-set__text b { font-weight: 600; display: block; }
.row-set__text small { color: var(--muted); font-size: var(--fs-sm); }
.empty { text-align: center; color: var(--muted); flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; display: flex; }
.empty__icon { background: var(--card-2); width: 52px; height: 52px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 16px; place-items: center; margin-bottom: 4px; display: grid; }
.empty b { color: var(--ink); font-size: var(--fs-lg); font-weight: 600; }
.empty p { max-width: 42ch; font-size: var(--fs-sm); }
.dl { grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; display: grid; }
.dl dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.dl dd { text-align: right; margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.section-label { font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.section-label:first-child { margin-top: 0; }
.toolbar { flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; display: flex; }
.toolbar .inwrap { flex: 240px; max-width: 360px; }
.toolbar__spacer { flex: 1; }
.live { background: var(--good); vertical-align: middle; border-radius: 50%; flex: none; width: 8px; height: 8px; margin-right: 6px; display: inline-block; position: relative; }
.live:after { content: ""; background: var(--good); opacity: .25; border-radius: 50%; animation: 2s ease-in-out infinite breathe; position: absolute; inset: -4px; }
@keyframes breathe { 0%, to { opacity: .1; } 50% { opacity: .45; } }
.is-flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { color: var(--accent); } to { color: inherit; } }
.timeline { flex-direction: column; margin: 0; padding: 0; list-style: none; display: flex; }
.timeline li { gap: 12px; padding: 0 0 16px; display: flex; position: relative; }
.timeline li:before { content: ""; background: var(--line-2); width: 2px; position: absolute; top: 16px; bottom: 0; left: 6px; }
.timeline li:last-child:before { display: none; }
.timeline li > i { z-index: 1; background: var(--card); width: 14px; height: 14px; box-shadow: inset 0 0 0 2px var(--line-2); border-radius: 50%; flex: none; margin-top: 3px; position: relative; }
.timeline li.is-done > i { background: var(--accent); box-shadow: none; }
.timeline li.is-now > i { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
.timeline b { font-weight: 600; display: block; }
.timeline small { color: var(--muted); }
.feed { flex-direction: column; display: flex; }
.feed__row { border-bottom: 1px solid var(--line); gap: 12px; padding: 10px 0; display: flex; }
.feed__row:last-child { border-bottom: 0; }
.feed__ico { background: var(--card-2); width: 32px; height: 32px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; flex: none; place-items: center; display: grid; }
.feed__ico svg { width: 16px; height: 16px; }
.feed__text { flex: 1; min-width: 0; }
.feed__text b { font-weight: 600; font-size: var(--fs-md); display: block; }
.feed__text small { color: var(--muted); }
.legend { font-size: var(--fs-sm); color: var(--muted); flex-wrap: wrap; gap: 6px 14px; font-weight: 600; display: flex; }
.legend span { align-items: center; gap: 6px; display: inline-flex; }
.legend i { background: var(--accent); border-radius: 3px; width: 10px; height: 10px; }

/* оверлеи */
.scrim { z-index: 60; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); background: #0a142833; position: fixed; inset: 0; }
[data-theme=dark] .scrim { background: #00000080; }
.drawer { z-index: 61; background: var(--glass-solid); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); box-shadow: var(--glow), var(--shadow-lg); border-radius: var(--r-xl); width: min(480px, 100vw - 20px); flex-direction: column; display: flex; position: fixed; top: 10px; bottom: 10px; right: 10px; overflow: hidden; }
.drawer--wide { width: min(640px, 100vw - 20px); }
.drawer__head { border-bottom: 1px solid var(--line); align-items: flex-start; gap: 12px; padding: 20px 20px 14px 24px; display: flex; }
.drawer__head h2 { font-size: var(--fs-3xl); letter-spacing: -.02em; font-weight: 700; line-height: 1.15; }
.drawer__head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.drawer__body { flex: 1; padding: 20px 24px 28px; overflow-y: auto; }
.drawer__foot { border-top: 1px solid var(--line); background: 0 0; justify-content: flex-end; gap: 8px; padding: 14px 20px; display: flex; flex-wrap: wrap; }
.modal-wrap { z-index: 62; pointer-events: none; place-items: center; padding: 20px; display: grid; position: fixed; inset: 0; }
.modal { pointer-events: auto; background: var(--glass-solid); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); border-radius: var(--r-xl); width: min(520px, 100%); max-height: calc(100dvh - 40px); box-shadow: var(--glow), var(--shadow-lg); flex-direction: column; display: flex; overflow: hidden; position: relative; }
.modal--wide { width: min(760px, 100%); }
.modal__head { align-items: flex-start; gap: 12px; padding: 22px 22px 6px 24px; display: flex; }
.modal__head h2 { font-size: var(--fs-2xl); letter-spacing: -.015em; font-weight: 700; }
.modal__head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.modal__body { padding: 14px 24px 22px; overflow-y: auto; }
.modal__foot { justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; display: flex; flex-wrap: wrap; }
.pop { z-index: 70; background: var(--glass-solid); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); min-width: 220px; max-width: calc(100vw - 20px); box-shadow: var(--glow), var(--shadow-lg); border-radius: 20px; padding: 6px; position: fixed; }
.menu__item { width: 100%; height: 38px; font-size: var(--fs-md); text-align: left; white-space: nowrap; border-radius: 10px; align-items: center; gap: 10px; padding: 0 10px; font-weight: 600; display: flex; }
.menu__item:hover, .menu__item:focus-visible { background: var(--card-2); outline: none; }
.menu__item svg { width: 18px; height: 18px; color: var(--muted); }
.menu__item .kbd { margin-left: auto; }
.menu__item--danger, .menu__item--danger svg { color: var(--bad); }
.menu__item[aria-checked=true] { color: var(--accent-text); }
.menu__sep { background: var(--line); height: 1px; margin: 6px 4px; }
.menu__label { font-size: var(--fs-2xs); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.toasts { z-index: 80; pointer-events: none; flex-direction: column; gap: 8px; width: min(440px, 100vw - 24px); margin-left: max(-220px, 12px - 50vw); display: flex; position: fixed; bottom: 22px; left: 50%; }
.toast { pointer-events: auto; color: #f6efec; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: #1e1a19eb; box-shadow: var(--shadow-lg); font-size: var(--fs-md); border-radius: 99px; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; font-weight: 600; display: flex; }
[data-theme=dark] .toast { color: #1e1a19; background: #f4eeebf0; }
.toast > svg { color: #8fdcb1; width: 18px; height: 18px; }
[data-theme=dark] .toast > svg { color: #18753a; }
.toast.is-warn > svg { color: #f0b860; }
[data-theme=dark] .toast.is-warn > svg { color: #975400; }
.toast span { flex: 1; }
.toast button { height: 30px; font-weight: 700; font-size: var(--fs-sm); background: #ffffff24; border-radius: 99px; padding: 0 12px; }
[data-theme=dark] .toast button { background: #00000014; }
.finder { z-index: 75; background: var(--glass-solid); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); width: min(620px, 100vw - 24px); box-shadow: var(--glow), var(--shadow-lg); border-radius: 24px; margin-left: max(-310px, 12px - 50vw); position: fixed; top: 12vh; left: 50%; overflow: hidden; }
.finder__in { border-bottom: 1px solid var(--line); align-items: center; gap: 10px; height: 60px; padding: 0 16px; display: flex; }
.finder__in input { font-size: var(--fs-xl); background: 0 0; border: 0; flex: 1; min-width: 0; height: 100%; font-weight: 500; }
.finder__in input:focus-visible { outline: none; }
.finder__list { max-height: min(56vh, 460px); padding: 8px; overflow-y: auto; }
.finder__group { font-size: var(--fs-2xs); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; font-weight: 700; }
.finder__item { text-align: left; border-radius: 12px; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; display: flex; }
.finder__item[aria-selected=true], .finder__item:hover { background: var(--card-2); }
.finder__item .cell__text { flex: 1; }
.finder__ico { background: var(--card-2); width: 36px; height: 36px; color: var(--ink-2); border-radius: 10px; flex: none; place-items: center; display: grid; }
.finder__foot { border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); gap: 14px; padding: 10px 16px; display: flex; }
.signin { z-index: 95; background: var(--wall); place-items: center; padding: 20px; display: grid; position: fixed; inset: 0; }
.signin__card { border-radius: 28px; padding: 34px 30px 26px; position: relative; width: min(420px, 100%); }
.signin__card h1 { letter-spacing: -.025em; font-size: 30px; font-weight: 600; }
.signin__card > p { color: var(--muted); margin: 6px 0 26px; }
.signin__fields { flex-direction: column; gap: 14px; margin-bottom: 20px; display: flex; }
.mark--lg { border-radius: 17px; width: 54px; height: 54px; margin-bottom: 22px; }
.mark--lg svg { width: 30px; height: 30px; }
.tabbar { display: none; }
.sheet__grip { display: none; }
.m-only { display: none; }

/* бумага (ТКП) */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 18px; padding: 22px; position: relative; overflow: hidden; box-shadow: 0 1px 2px #0000000f, 0 14px 30px -20px #00000059; }
.paper .muted { color: #6a615d; }
.stamp { border: 3px solid var(--stamp); color: var(--stamp); letter-spacing: .12em; text-transform: uppercase; opacity: .82; border-radius: 10px; padding: 6px 16px; font-size: 26px; font-weight: 700; animation: .5s cubic-bezier(.3, 1.6, .5, 1) both stamp-in; position: absolute; transform: rotate(-12deg); }
@keyframes stamp-in { 0% { opacity: 0; transform: rotate(-12deg) scale(2.2); } to { opacity: .82; transform: rotate(-12deg) scale(1); } }

/* адаптив — точки исходного CSS: 1399 / 1279 / 1179 / 999 / 760 */
@media (width <= 1279px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .side .collapse { display: none; } .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wide-only { display: none !important; } }
@media (width <= 999px) { .content { padding: 4px 18px 40px 0; } .top { padding-right: 18px; } .formgrid, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } .top__hello b { font-size: var(--fs-xl); } .top__new span { display: none; } .top__new { width: 42px; padding: 0; } }
@media (height <= 860px) and (width >= 761px) { .snav__item { height: 35px; } .side__group { padding-top: 4px; } .side__foot { gap: 6px; padding-top: 6px; } }
@media (height <= 640px) and (width >= 761px) { .snav__item { height: 34px; } .side { gap: 8px; padding-top: 12px; } .top { position: relative; } }
@media (width <= 760px) {
  .side { display: none; }
  .main, html.is-rail .main { margin-left: 0; }
  .content { padding: 0 14px calc(100px + env(safe-area-inset-bottom)); }
  .top { padding: calc(10px + env(safe-area-inset-top)) 14px 6px; }
  .top.is-stuck { background: var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 1px 0 var(--line); }
  .top__in { gap: 8px; min-height: 48px; }
  .top .top__menu { display: grid; }
  .top__brand { flex: none; display: flex; }
  .top__brand .mark { border-radius: 11px; width: 34px; height: 34px; }
  .top__hello { display: none; }
  .top__title { font-size: var(--fs-xl); letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; flex: 1; min-width: 0; font-weight: 600; display: block; overflow: hidden; }
  .top__new { display: none; }
  .top__mode { display: none; } /* на телефоне режим переключается нижней панелью (Расчёт / Таблица) */
  .ibtn { width: 40px; height: 40px; }
  .tabbar { z-index: 40; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background-color: var(--glass-hi); border-radius: 99px; grid-template-columns: repeat(5, 1fr); padding: 6px; display: grid; position: fixed; }
  .tabbar a, .tabbar button { z-index: 1; height: 54px; font-size: var(--fs-2xs); color: var(--muted); border-radius: 99px; flex-direction: column; justify-content: center; align-items: center; gap: 3px; font-weight: 600; display: flex; position: relative; }
  .tabbar [aria-current=page] { color: #fff; }
  .tabbar__pill { background: var(--accent-grad); pointer-events: none; opacity: 0; position: absolute; inset: 0; border-radius: 99px; }
  .phead { margin: 6px 0 16px; } .phead__actions { width: 100%; } .phead__actions > .btn { flex: auto; }
  .card { border-radius: 24px; padding: 16px; } .card--flush { padding: 0; } .card--flush .chead { padding: 14px 16px 0; }
  .chead { flex-wrap: wrap; } .chead > .seg { order: 3; width: 100%; } .chead > .seg button { flex: 1; justify-content: center; }
  .kpi__value { font-size: 18px; } .kpi { min-height: 112px; padding: 14px 14px 12px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
  .drawer { border-radius: 26px 26px 0 0; width: 100%; max-height: 92dvh; inset: auto 0 0; }
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal { border-radius: 26px 26px 0 0; width: 100%; max-height: 92dvh; } .modal--wide { width: 100%; }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .sheet__grip { touch-action: none; cursor: grab; place-items: center; height: 22px; margin-bottom: -6px; display: grid; }
  .sheet__grip i { background: var(--line-2); border-radius: 5px; width: 40px; height: 5px; }
  .drawer__head { padding-top: 10px; }
  .toolbar { gap: 8px; } .toolbar .inwrap { flex: 100%; max-width: none; }
  .toolbar > .chips { flex-wrap: nowrap; margin: 0 -14px; padding: 2px 14px; overflow-x: auto; scrollbar-width: none; }
  .chips > .chip { flex: none; } .chip { min-height: 40px; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), #0000); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), #0000); }
  .tabs a, .tabs button { height: 44px; }
  .m-only { display: inline; } .d-only { display: none !important; }
  .finder { top: calc(10px + env(safe-area-inset-top)); }
  .bg i:nth-child(1) { width: 320px; height: 320px; top: 40%; left: -120px; }
  .bg i:nth-child(2) { width: 180px; height: 180px; top: auto; bottom: 34%; right: -70px; }
  .bg i:nth-child(3) { width: 280px; height: 280px; bottom: -60px; right: -110px; }
  .bg i:nth-child(4) { width: 120px; height: 120px; bottom: 14%; left: 20%; }
  .bg i:nth-child(5) { width: 90px; height: 90px; top: 72%; left: 64%; }
}
@media (hover: none), (pointer: coarse) { .seg button { min-height: 40px; } .ibtn--sm { width: 40px; height: 40px; } .btn--sm, .chip { min-height: 40px; } .menu__item { height: 44px; } .snav__item { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { *, :before, :after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }
