/* ============ шрифты (локально, работают без интернета) ============ */
@font-face { font-family: 'Roboto Flex'; font-style: normal; font-display: swap; font-weight: 100 1000; font-stretch: 25% 151%;
  src: url(/static/vendor/roboto-flex-cyrillic-full-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Flex'; font-style: normal; font-display: swap; font-weight: 100 1000; font-stretch: 25% 151%;
  src: url(/static/vendor/roboto-flex-latin-full-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 100 700; font-display: block;
  src: url(/static/vendor/material-symbols-rounded.woff2) format('woff2'); }

/* ============ анимируемые токены формы (Expressive: кнопки морфятся при нажатии) ============ */
@property --md-filled-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-filled-tonal-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-outlined-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-text-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-icon-button-state-layer-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-filled-tonal-icon-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-filled-icon-button-container-shape { syntax: '<length>'; inherits: true; initial-value: 20px; }
@property --md-fab-container-shape { syntax: '<length>'; inherits: true; initial-value: 16px; }
@property --wght { syntax: '<number>'; inherits: true; initial-value: 400; }

:root {
  --md-ref-typeface-brand: 'Roboto Flex', 'Segoe UI', system-ui, sans-serif;
  --md-ref-typeface-plain: 'Roboto Flex', 'Segoe UI', system-ui, sans-serif;
  --md-icon-font: 'Material Symbols Rounded';
  --md-sys-typescale-body-medium-size: 14px;

  /* Motion: пружины M3 Expressive, приближённые через linear() */
  --spring-fast: linear(0, 0.083 2.9%, 0.312 7.4%, 0.614 13.2%, 0.828 18.4%, 0.981 24%, 1.065 29.5%, 1.098 34.6%, 1.099 39.3%, 1.068 48.1%, 1.02 60%, 0.998 72%, 1);
  --spring-default: linear(0, 0.048 2.4%, 0.203 5.7%, 0.451 10.2%, 0.693 15.3%, 0.866 20.4%, 0.975 25.8%, 1.033 31.3%, 1.052 36.4%, 1.044 44.5%, 1.013 57.6%, 0.998 73%, 1);
  --effects: cubic-bezier(0.31, 0.94, 0.34, 1);
  --d-fast: 280ms; --d-default: 480ms; --d-slow: 700ms;

  /* Формы: Expressive — крупные скругления */
  --r-xs: 8px; --r-s: 12px; --r-m: 16px; --r-l: 20px; --r-xl: 28px; --r-xxl: 36px; --r-full: 999px;

  --rail-w: 96px; --rail-w-open: 264px;
  --gap: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
html.light { color-scheme: light; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--md-sys-color-surface, #131218); color: var(--md-sys-color-on-surface, #e6e1e9);
  font: 400 14px/1.45 var(--md-ref-typeface-plain);
  font-variation-settings: 'opsz' 14;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
md-icon { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; transition: font-variation-settings var(--d-fast) var(--effects); }
a { color: var(--md-sys-color-primary); }
button { font: inherit; color: inherit; }
::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============ кнопки M3: морфинг формы при нажатии ============ */
md-filled-button, md-filled-tonal-button, md-outlined-button, md-text-button {
  --md-filled-button-container-shape: 20px; --md-filled-tonal-button-container-shape: 20px;
  --md-outlined-button-container-shape: 20px; --md-text-button-container-shape: 20px;
  transition: --md-filled-button-container-shape var(--d-fast) var(--spring-fast),
              --md-filled-tonal-button-container-shape var(--d-fast) var(--spring-fast),
              --md-outlined-button-container-shape var(--d-fast) var(--spring-fast),
              --md-text-button-container-shape var(--d-fast) var(--spring-fast);
  --md-filled-button-label-text-font: var(--md-ref-typeface-plain); --md-filled-button-label-text-weight: 600;
  --md-filled-tonal-button-label-text-weight: 600; --md-outlined-button-label-text-weight: 600; --md-text-button-label-text-weight: 600;
}
md-filled-button:active { --md-filled-button-container-shape: 8px; }
md-filled-tonal-button:active { --md-filled-tonal-button-container-shape: 8px; }
md-outlined-button:active { --md-outlined-button-container-shape: 8px; }
md-text-button:active { --md-text-button-container-shape: 8px; }
md-filled-tonal-icon-button, md-filled-icon-button, md-icon-button {
  --md-filled-tonal-icon-button-container-shape: 20px; --md-filled-icon-button-container-shape: 20px;
  transition: --md-filled-tonal-icon-button-container-shape var(--d-fast) var(--spring-fast), --md-filled-icon-button-container-shape var(--d-fast) var(--spring-fast);
}
md-filled-tonal-icon-button:active { --md-filled-tonal-icon-button-container-shape: 10px; }
md-filled-icon-button:active { --md-filled-icon-button-container-shape: 10px; }
.btn-lg { --md-filled-button-container-height: 56px; --md-filled-tonal-button-container-height: 56px; --md-filled-button-label-text-size: 16px; --md-filled-tonal-button-label-text-size: 16px;
  --md-filled-button-container-shape: 28px; --md-filled-tonal-button-container-shape: 28px; --md-filled-button-leading-space: 24px; --md-filled-button-trailing-space: 24px; }
.btn-lg:active { --md-filled-button-container-shape: 14px; --md-filled-tonal-button-container-shape: 14px; }
.danger { --md-filled-button-container-color: var(--md-sys-color-error); --md-filled-button-label-text-color: var(--md-sys-color-on-error);
  --md-filled-tonal-button-container-color: var(--md-sys-color-error-container); --md-filled-tonal-button-label-text-color: var(--md-sys-color-on-error-container);
  --md-filled-tonal-button-icon-color: var(--md-sys-color-on-error-container); }
md-fab { --md-fab-container-shape: 16px; transition: --md-fab-container-shape var(--d-fast) var(--spring-fast); }
md-fab:hover { --md-fab-container-shape: 22px; }
md-fab:active { --md-fab-container-shape: 12px; }

/* ============ каркас ============ */
#app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100dvh; transition: grid-template-columns var(--d-default) var(--spring-default); }
#app.rail-open { grid-template-columns: var(--rail-w-open) 1fr; }
#body { min-width: 0; display: flex; flex-direction: column; grid-column: 2; grid-row: 1; }
#rail { grid-column: 1; grid-row: 1; }
#scrim { position: fixed; inset: 0; display: none; z-index: 15; background: rgba(0,0,0,.32); animation: fade var(--d-fast); }

/* ---- навигационная панель (rail) ---- */
#rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 12px 12px; background: var(--md-sys-color-surface); overflow: hidden auto; z-index: 20;
}
.rail-top { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 0 8px 18px; }
.rail-top md-icon-button { margin-left: 4px; }
#railFab { transition: --md-fab-container-shape var(--d-fast) var(--spring-fast), width var(--d-default) var(--spring-default); }
.rail-items { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  all: unset; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 0 8px; border-radius: var(--r-l); color: var(--md-sys-color-on-surface-variant);
  font: 600 12px/16px var(--md-ref-typeface-plain); letter-spacing: .3px; text-align: center; -webkit-tap-highlight-color: transparent;
}
.nav-item .pill {
  position: relative; display: grid; place-items: center; width: 56px; height: 32px; border-radius: var(--r-full);
  transition: background-color var(--d-fast) var(--effects), width var(--d-default) var(--spring-default);
}
.nav-item .pill md-ripple { border-radius: inherit; }
.nav-item[aria-current="page"] { color: var(--md-sys-color-on-surface); }
.nav-item[aria-current="page"] .pill { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.nav-item[aria-current="page"] md-icon { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.nav-item .badge { position: absolute; top: -2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); font: 700 11px/16px var(--md-ref-typeface-plain); }
.nav-item .badge:empty { display: none; }
/* развёрнутая панель: подпись справа от иконки, активный индикатор — во всю ширину */
#app.rail-open .nav-item { flex-direction: row; gap: 0; padding: 0; }
#app.rail-open .nav-item .pill { width: 100%; height: 56px; justify-content: start; padding-left: 16px; grid-template-columns: 24px 1fr; column-gap: 12px; }
#app.rail-open .nav-item .lbl { position: absolute; left: 56px; font-size: 14px; letter-spacing: .1px; pointer-events: none; }
#app.rail-open .nav-item .badge { top: 20px; right: 16px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; }
.rail-foot .idx { font-size: 11px; color: var(--md-sys-color-on-surface-variant); text-align: center; line-height: 1.35; }
#app:not(.rail-open) .rail-foot .lbl { display: none; }
#app:not(.rail-open) .rail-foot md-text-button { --md-text-button-leading-space: 12px; --md-text-button-trailing-space: 12px; }

/* ---- верхняя панель ---- */
#appbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 3vw, 32px); min-height: 72px;
  background: color-mix(in srgb, var(--md-sys-color-surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4);
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.brand-star { width: 26px; height: 26px; align-self: center; transition: transform var(--d-slow) var(--spring-default); }
.brand:hover .brand-star { transform: rotate(90deg) scale(1.1); }
.brand-word { font: 700 26px/1 var(--md-ref-typeface-brand); letter-spacing: -.5px; font-stretch: 112%;
  background: linear-gradient(100deg, var(--md-sys-color-on-surface) 30%, var(--md-sys-color-primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font: 500 14px/1 var(--md-ref-typeface-plain); color: var(--md-sys-color-on-surface-variant); }
#pageTitle { margin: 0 0 0 12px; font: 500 22px/28px var(--md-ref-typeface-brand); color: var(--md-sys-color-on-surface-variant);
  padding-left: 14px; border-left: 1px solid var(--md-sys-color-outline-variant); }
.appbar-actions { margin-left: auto; display: flex; gap: 4px; }
.compact-only { display: none; }

#page { padding: 4px clamp(16px, 3vw, 32px) 48px; outline: none; max-width: 1680px; width: 100%; }
#page.enter > * { animation: rise var(--d-default) var(--spring-default) both; }
#page.enter > *:nth-child(2) { animation-delay: 40ms; } #page.enter > *:nth-child(3) { animation-delay: 80ms; }
#page.enter > *:nth-child(4) { animation-delay: 120ms; } #page.enter > *:nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }

/* ---- нижняя навигация (компактные экраны) ---- */
#navbar { display: none; }

/* ============ поверхности ============ */
.card {
  position: relative; background: var(--md-sys-color-surface-container-low); border-radius: var(--r-xl); padding: 20px;
  transition: background-color var(--d-fast) var(--effects), transform var(--d-default) var(--spring-default), border-radius var(--d-default) var(--spring-default);
  min-width: 0;
}
.card.hi { background: var(--md-sys-color-surface-container); }
.card.click { cursor: pointer; }
.card.click:hover { background: var(--md-sys-color-surface-container); border-radius: var(--r-xxl); }
.card.click:active { transform: scale(.985); border-radius: var(--r-l); }
.card h2, .sec-title { margin: 0 0 14px; font: 600 16px/24px var(--md-ref-typeface-brand); letter-spacing: .1px; display: flex; align-items: center; gap: 10px; }
.card h2 .aside, .sec-title .aside { margin-left: auto; font: 500 13px/20px var(--md-ref-typeface-plain); color: var(--md-sys-color-on-surface-variant); }
.sec-title { margin: 28px 4px 14px; font-size: 20px; line-height: 28px; font-weight: 600; }
.muted { color: var(--md-sys-color-on-surface-variant); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: var(--gap); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { display: grid; place-items: center; gap: 12px; padding: 64px 16px; color: var(--md-sys-color-on-surface-variant); text-align: center; }
.empty x-shape { width: 88px; height: 88px; --shape-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.empty x-shape md-icon { --md-icon-size: 40px; }
.loading { display: grid; place-items: center; padding: 80px 0; }

/* ============ Expressive-компоненты ============ */
x-shape { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0;
  color: var(--md-sys-color-on-primary-container); --shape-color: var(--md-sys-color-primary-container); }
x-shape > .x-shape-bg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--shape-color); transition: transform var(--d-slow) var(--spring-default); }
x-shape > :not(.x-shape-bg) { position: relative; }
.card.click:hover x-shape > .x-shape-bg, .spin-hover:hover x-shape > .x-shape-bg { transform: rotate(40deg); }
x-shape.sec { --shape-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
x-shape.ter { --shape-color: var(--x-tertiary-container); color: var(--x-on-tertiary-container); }
x-shape.err { --shape-color: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

x-wavy { display: block; height: 14px; width: 100%; color: var(--md-sys-color-primary); }
x-wavy svg { display: block; width: 100%; height: 100%; overflow: visible; }
x-wavy .active { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
x-wavy .track { fill: none; stroke: var(--md-sys-color-secondary-container); stroke-width: 4; stroke-linecap: round; }
x-wavy .stop { fill: currentColor; }
x-wavy.warn { color: var(--md-sys-color-tertiary); }
x-wavy.bad { color: var(--md-sys-color-error); }

x-ring { position: relative; display: grid; place-items: center; width: 128px; aspect-ratio: 1; color: var(--md-sys-color-primary); flex-shrink: 0; }
x-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
x-ring .active { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
x-ring .track { fill: none; stroke: var(--md-sys-color-secondary-container); stroke-width: 7; stroke-linecap: round; }
x-ring .center { position: relative; text-align: center; line-height: 1.1; }
x-ring.warn { color: var(--md-sys-color-tertiary); } x-ring.bad { color: var(--md-sys-color-error); }

x-loader { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--md-sys-color-primary-container); }
x-loader svg { width: 76%; height: 76%; }
x-loader path { fill: var(--md-sys-color-on-primary-container); }
x-loader.bare { background: none; } x-loader.bare path { fill: var(--md-sys-color-primary); }
x-loader.sm { width: 36px; height: 36px; }

x-spark { display: block; height: 44px; width: 100%; color: var(--md-sys-color-primary); }
x-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
x-spark .line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
x-spark .area { fill: currentColor; opacity: .14; }
x-spark.alt { color: var(--md-sys-color-tertiary); }

/* connected button group */
x-group { display: inline-flex; gap: 2px; flex-wrap: wrap; }
x-group button {
  all: unset; position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant);
  font: 600 14px/20px var(--md-ref-typeface-plain); border-radius: 8px;
  transition: border-radius var(--d-default) var(--spring-fast), background-color var(--d-fast) var(--effects), color var(--d-fast) var(--effects);
  -webkit-tap-highlight-color: transparent;
}
x-group button:first-child { border-radius: 20px 8px 8px 20px; }
x-group button:last-child { border-radius: 8px 20px 20px 8px; }
x-group button.selected { background: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary); border-radius: 20px; }
x-group button:active { border-radius: 6px; }
x-group button md-icon { --md-icon-size: 20px; }
x-group button.selected md-icon { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
x-group button:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }

/* ============ главная ============ */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: clamp(20px, 3.5vw, 40px); border-radius: var(--r-xxl); margin-bottom: var(--gap);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--md-sys-color-primary) 26%, transparent), transparent 60%),
              radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--md-sys-color-tertiary) 22%, transparent), transparent 55%),
              var(--md-sys-color-surface-container);
}
.hero h2 { margin: 0; font: 700 clamp(30px, 4.6vw, 52px)/1.05 var(--md-ref-typeface-brand); letter-spacing: -1px; font-stretch: 108%; }
.hero .sub { margin: 10px 0 22px; font-size: 16px; color: var(--md-sys-color-on-surface-variant); }
.hero .deco { position: relative; width: clamp(120px, 16vw, 200px); aspect-ratio: 1; }
.hero .deco x-shape { position: absolute; inset: 0; width: 100%; height: 100%; --shape-color: color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent); animation: slowspin 40s linear infinite; }
.hero .deco img { position: absolute; inset: 18%; width: 64%; height: 64%; filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent)); animation: float 6s ease-in-out infinite; }
@keyframes slowspin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(8deg); } }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.searchbar {
  position: relative; display: flex; align-items: center; gap: 4px; height: 56px; max-width: 720px; padding: 0 8px 0 18px;
  background: var(--md-sys-color-surface-container-highest); border-radius: var(--r-full);
  transition: border-radius var(--d-default) var(--spring-default), box-shadow var(--d-fast) var(--effects);
}
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--md-sys-color-primary); border-radius: var(--r-l); }
.searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: inherit; font: 400 16px var(--md-ref-typeface-plain); padding: 0 8px; }
.searchbar input::placeholder { color: var(--md-sys-color-on-surface-variant); }
.searchbar > md-icon { color: var(--md-sys-color-on-surface-variant); }
.kbd { font: 600 11px/1 var(--md-ref-typeface-plain); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant); }

#stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 212px), 1fr)); }
.stat { display: flex; flex-direction: column; gap: 10px; min-height: 184px; container-type: inline-size; }
.stat .kv { min-width: 0; }
.stat .kv dd { white-space: nowrap; }
/* узкая карточка: кольцо компактнее, подпись над значением — ничего не переносится и не обрезается */
@container (max-width: 360px) {
  .stat .body { gap: 14px; }
  .stat x-ring { width: 100px; }
  .stat x-ring .big { font-size: 22px; }
  .stat .kv { grid-template-columns: 1fr; gap: 0; }
  .stat .kv dt { font-size: 11px; line-height: 14px; }
  .stat .kv dd { text-align: left; font-size: 14px; line-height: 18px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
}
@container (max-width: 250px) {
  .stat x-ring { width: 84px; }
  .stat x-ring .big { font-size: 19px; }
}
.stat .head { display: flex; align-items: center; gap: 12px; }
.stat .head .t { font: 600 15px/20px var(--md-ref-typeface-brand); }
.stat .head .s { font-size: 12px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .body { display: flex; align-items: center; gap: 16px; flex: 1; }
.big { font: 700 34px/1 var(--md-ref-typeface-brand); letter-spacing: -.5px; font-variant-numeric: tabular-nums; font-stretch: 110%; }
.big small { font-size: 15px; font-weight: 600; margin-left: 2px; color: var(--md-sys-color-on-surface-variant); letter-spacing: 0; }
x-ring .big { font-size: 26px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--md-sys-color-on-surface-variant); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rate { display: flex; gap: 18px; font-size: 13px; }
.rate b { font: 700 18px/1.2 var(--md-ref-typeface-brand); display: block; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; margin-right: 6px; vertical-align: middle; }

.disk-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 14px; align-items: center; padding: 10px 0; }
.disk-row + .disk-row { border-top: 1px solid var(--md-sys-color-outline-variant); }
.disk-row .letter { grid-row: span 2; font: 700 18px/1 var(--md-ref-typeface-brand); }
.disk-row .name { font-weight: 600; }
.disk-row x-wavy { grid-column: 2 / 4; }

.list { display: flex; flex-direction: column; }
.li { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-m); min-height: 56px;
  transition: background-color var(--d-fast) var(--effects), border-radius var(--d-default) var(--spring-default); }
.li:hover { background: var(--md-sys-color-surface-container-high); }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 12px; color: var(--md-sys-color-on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.li .s bdi { direction: ltr; }
.li .meta { font-size: 12px; color: var(--md-sys-color-on-surface-variant); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.li .acts { display: flex; gap: 2px; opacity: .55; transition: opacity var(--d-fast); }
.li:hover .acts, .li:focus-within .acts { opacity: 1; }
.li x-shape { width: 40px; height: 40px; }
.li x-shape md-icon { --md-icon-size: 20px; }
.li img.appicon { width: 40px; height: 40px; }
mark { background: color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; }

.notice { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-xl);
  background: var(--x-tertiary-container); color: var(--x-on-tertiary-container); margin-bottom: var(--gap); flex-wrap: wrap; }
.notice .t { font: 600 16px/22px var(--md-ref-typeface-brand); }
.notice x-shape { --shape-color: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary); }
.notice md-filled-button { margin-left: auto; --md-filled-button-container-color: var(--md-sys-color-tertiary); --md-filled-button-label-text-color: var(--md-sys-color-on-tertiary); }

/* ============ система ============ */
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 6px; align-items: end; height: 120px; }
.core { position: relative; height: 100%; background: var(--md-sys-color-surface-container-highest); border-radius: 10px; overflow: hidden; }
.core i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--md-sys-color-primary); border-radius: 10px;
  transition: height var(--d-default) var(--spring-default), background-color var(--d-fast); min-height: 6px; }
.core i.hot { background: var(--md-sys-color-tertiary); } .core i.max { background: var(--md-sys-color-error); }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.spec div { padding: 14px 16px; border-radius: var(--r-l); background: var(--md-sys-color-surface-container); }
.spec b { display: block; font: 600 14px/20px var(--md-ref-typeface-plain); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.spec span { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.gauges { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-around; }
.gauges .g { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauges x-ring { width: 112px; }
.pbar { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; margin: 10px 0; }
.pbar x-wavy { grid-column: 1 / -1; }
.proc-cpu { width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.proc-mem { width: 82px; text-align: right; font-variant-numeric: tabular-nums; color: var(--md-sys-color-on-surface-variant); font-size: 13px; }
.count { font: 700 11px/18px var(--md-ref-typeface-plain); min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; text-align: center;
  background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar .searchbar { height: 48px; flex: 1; min-width: 200px; }
.scroll { max-height: 560px; overflow: auto; margin: 0 -8px; padding: 0 8px; }

/* ============ твики ============ */
.tweak { display: flex; align-items: center; gap: 16px; padding: 14px 4px; }
.tweak + .tweak { border-top: 1px solid var(--md-sys-color-outline-variant); }
.tweak .main { flex: 1; min-width: 0; }
.tweak .t { font-weight: 600; font-size: 15px; }
.tweak .s { font-size: 13px; color: var(--md-sys-color-on-surface-variant); }
.tweak md-switch { flex-shrink: 0; }
md-switch { --md-switch-selected-handle-color: var(--md-sys-color-on-primary); }
.clean { display: flex; flex-direction: column; gap: 12px; }
.clean .big { font-size: 28px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.tile {
  all: unset; position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 16px;
  border-radius: var(--r-l); background: var(--md-sys-color-surface-container); font-weight: 600; font-size: 13px; line-height: 18px;
  transition: border-radius var(--d-default) var(--spring-fast), background-color var(--d-fast), transform var(--d-default) var(--spring-fast);
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { background: var(--md-sys-color-surface-container-high); border-radius: var(--r-xl); }
.tile:active { border-radius: var(--r-s); transform: scale(.97); }
.tile:focus-visible { outline: 3px solid var(--md-sys-color-secondary); }
.tile md-ripple { border-radius: inherit; }
.tile x-shape { width: 40px; height: 40px; } .tile x-shape md-icon { --md-icon-size: 22px; }
.tile.err x-shape { --shape-color: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* ============ поиск ============ */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 18px; }
md-chip-set { --md-filter-chip-container-shape: 10px; }
md-filter-chip { --md-filter-chip-container-shape: 10px; }
md-outlined-select { --md-outlined-select-text-field-container-shape: 16px; min-width: 180px; }
.results .li .size { width: 84px; text-align: right; }
.results .li .date { width: 128px; text-align: right; }

/* ============ проекты / приложения ============ */
.proj { display: flex; flex-direction: column; gap: 12px; }
.proj .top { display: flex; gap: 14px; align-items: center; }
.proj .t { font: 600 17px/22px var(--md-ref-typeface-brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .s { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.proj .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 600 11px/22px var(--md-ref-typeface-plain); padding: 0 10px; border-radius: 8px; background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); display: inline-flex; align-items: center; gap: 4px; }
.tag md-icon { --md-icon-size: 14px; }
.tag.android { background: #3ddc8433; color: #3ddc84; } .tag.node { background: #7cc36b33; color: #8fd47c; } .tag.python { background: #4b8bbe33; color: #7fb3e0; }
.tag.web { background: #f0652833; color: #ff9a6b; } .tag.docker { background: #2496ed33; color: #6cb8f5; } .tag.go { background: #00add833; color: #54d2ee; }
html.light .tag.android { color: #1c7a47; } html.light .tag.node { color: #3d7a2d; } html.light .tag.python { color: #2b5f8a; } html.light .tag.web { color: #b5431a; } html.light .tag.docker { color: #1566a8; } html.light .tag.go { color: #00798f; }
.proj .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.app {
  all: unset; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px 12px;
  border-radius: var(--r-xl); text-align: center; font-size: 12.5px; font-weight: 600; line-height: 16px;
  transition: background-color var(--d-fast), border-radius var(--d-default) var(--spring-fast), transform var(--d-default) var(--spring-fast);
}
.app:hover { background: var(--md-sys-color-surface-container-high); }
.app:active { transform: scale(.94); border-radius: var(--r-l); }
.app:focus-visible { outline: 3px solid var(--md-sys-color-secondary); }
.app md-ripple { border-radius: inherit; }
.app .ico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: var(--md-sys-color-surface-container-highest);
  transition: border-radius var(--d-default) var(--spring-fast); }
.app:hover .ico { border-radius: 28px; }
.app .ico img { width: 40px; height: 40px; }
.app span.n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============ файлы ============ */
md-tabs { --md-primary-tab-container-color: transparent; margin: 0 -4px 18px; border-radius: var(--r-l); overflow: hidden; }
.stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 3px; margin-bottom: 16px; }
.stack i { display: block; min-width: 4px; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 14px; padding: 8px 10px; border-radius: var(--r-m); cursor: pointer; }
.bar-row:hover { background: var(--md-sys-color-surface-container-high); }
.bar-row .v { font-variant-numeric: tabular-nums; color: var(--md-sys-color-on-surface-variant); font-size: 13px; min-width: 150px; text-align: right; }
.hbar { height: 10px; border-radius: 5px; background: var(--md-sys-color-primary); min-width: 4px; transition: width var(--d-slow) var(--spring-default); }
.dupe { margin-bottom: 10px; }
.dupe .paths .li { min-height: 44px; padding: 6px 10px; }
.target-list { max-height: 50vh; overflow: auto; margin-top: 8px; }
.target { all: unset; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; font-size: 14px; width: 100%; box-sizing: border-box; }
.target:hover, .target:focus-visible { background: var(--md-sys-color-surface-container-highest); }
.target.suggest { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.target .sub { color: var(--md-sys-color-on-surface-variant); }

/* ============ экосистема ============ */
/* у роутера и телефона нет разделов ПК — прячем их из навигации */
#app[data-kind="router"] .nav-item[data-pc], #app[data-kind="phone"] .nav-item[data-pc], #app[data-kind="server"] .nav-item[data-pc],
#app[data-kind="router"] #railFab, #app[data-kind="phone"] #railFab, #app[data-kind="server"] #railFab { display: none; }
/* сайты */
.card.site { display: flex; flex-direction: column; gap: 12px; }
.card.site .t { font: 600 16px/22px var(--md-ref-typeface-brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.site .s { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.card.site .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.site-nums { display: flex; gap: 20px; }
.site-nums b { display: block; font: 700 22px/1.1 var(--md-ref-typeface-brand); font-variant-numeric: tabular-nums; }
.site-nums span { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.live { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 22px; border-radius: 999px;
  background: var(--x-tertiary-container); color: var(--x-on-tertiary-container); font: 700 13px/22px var(--md-ref-typeface-plain); }
.live::before { content: ''; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.big-live { flex-direction: column; padding: 14px 22px; border-radius: var(--r-xl); gap: 0; text-align: center; }
.big-live::before { left: 12px; top: 14px; margin: 0; }
.big-live b { font: 700 34px/1 var(--md-ref-typeface-brand); }
.big-live span { font: 500 12px/16px var(--md-ref-typeface-plain); }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .4; } }
.bars { display: flex; align-items: flex-end; gap: 3px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 6px; background: var(--md-sys-color-surface-container-highest); }
.bar i { display: block; width: 100%; border-radius: 6px; transition: height var(--d-slow) var(--spring-default); min-height: 0; }
.bar:hover i { filter: brightness(1.2); }
.bars-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
pre.logs { margin: 0; max-height: 60vh; overflow: auto; padding: 14px; border-radius: var(--r-m); background: var(--md-sys-color-surface-container-highest);
  font: 12px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
md-dialog.wide { max-width: min(1100px, calc(100vw - 32px)); width: 100%; }

.bell { position: relative; display: inline-flex; }
.bell-badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; pointer-events: none;
  background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); font: 700 10px/16px var(--md-ref-typeface-plain); text-align: center; }
.bell-badge:empty { display: none; }

/* ============ хаб: устройства, вход ============ */
.dev-switch { position: relative; margin-left: 8px; }
.dev-btn { all: unset; position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 14px;
  border-radius: var(--r-full); background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
  font: 600 14px/20px var(--md-ref-typeface-plain); max-width: 260px; transition: border-radius var(--d-default) var(--spring-fast); }
.dev-btn:active { border-radius: var(--r-s); }
.dev-btn span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-btn md-ripple { border-radius: inherit; }
.dev-btn:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.dot.on { color: var(--md-sys-color-primary); } .dot.off { color: var(--md-sys-color-outline); }
.dev-btn .dot { margin: 0; flex-shrink: 0; }
.card.dev { display: flex; flex-direction: column; gap: 14px; }
.card.dev.current { box-shadow: inset 0 0 0 2px var(--md-sys-color-primary); }
.card.dev .t { font: 600 17px/22px var(--md-ref-typeface-brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.dev .s { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.dev-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 12px; }
.dev-meters .m { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.dev-meters b { font: 700 15px/1.2 var(--md-ref-typeface-brand); color: var(--md-sys-color-on-surface); font-variant-numeric: tabular-nums; }
.dev-meters x-wavy { grid-column: 1 / -1; }
.dev-spec { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd { display: flex; align-items: center; gap: 6px; padding: 10px 6px 10px 14px; border-radius: var(--r-m); background: var(--md-sys-color-surface-container-highest); }
.cmd code { flex: 1; font: 500 13px/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; word-break: break-all; user-select: all; }
.danger-text { --md-text-button-label-text-color: var(--md-sys-color-error); --md-text-button-icon-color: var(--md-sys-color-error); }

#gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(90% 70% at 85% 0%, color-mix(in srgb, var(--md-sys-color-primary) 28%, transparent), transparent 60%),
              radial-gradient(80% 60% at 0% 100%, color-mix(in srgb, var(--md-sys-color-tertiary) 22%, transparent), transparent 60%),
              var(--md-sys-color-surface); }
#gate[hidden] { display: none; }
.gate-card { width: min(420px, 100%); padding: clamp(24px, 5vw, 40px); border-radius: var(--r-xxl); background: var(--md-sys-color-surface-container-low);
  display: flex; flex-direction: column; gap: 14px; text-align: center; animation: rise var(--d-default) var(--spring-default) both;
  box-shadow: 0 24px 64px rgba(0,0,0,.25); }
.gate-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.gate-card md-outlined-text-field { width: 100%; --md-outlined-text-field-container-shape: 16px; }
.gate-card h2 { margin: 4px 0 0; font: 700 26px/1.2 var(--md-ref-typeface-brand); }
.gate-card p { margin: 0; }
.gate-star { width: 64px; height: 64px; margin: 0 auto; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent)); }
.gate-brand { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.gate-err { min-height: 20px; color: var(--md-sys-color-error); font-size: 13px; font-weight: 600; }
.qr { width: min(240px, 70vw); margin: 4px auto; padding: 12px; border-radius: var(--r-l); background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { display: block; margin-top: 8px; font: 600 14px/1.6 ui-monospace, Consolas, monospace; letter-spacing: 1px; word-break: break-all; color: var(--md-sys-color-on-surface); }

/* ============ диалог и снекбар ============ */
md-dialog { --md-dialog-container-shape: 28px; max-width: min(560px, calc(100vw - 32px)); }
#dlgBody { font-size: 15px; line-height: 1.5; }
#snackbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 140%); opacity: 0;
  display: flex; align-items: center; gap: 12px; min-height: 48px; max-width: min(640px, calc(100vw - 32px)); padding: 12px 16px;
  border-radius: var(--r-m); background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  box-shadow: 0 6px 24px rgba(0,0,0,.3); transition: transform var(--d-default) var(--spring-fast), opacity var(--d-fast);
  font-weight: 500;
}
#snackbar.show { transform: translate(-50%, 0); opacity: 1; }
#snackbar.err { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* ============ адаптивность (M3 window size classes) ============ */
/* medium: 600–1199 — компактная панель */
@media (max-width: 1199px) { #app.rail-open { grid-template-columns: var(--rail-w) 1fr; }
  #app.rail-open #rail { position: fixed; width: var(--rail-w-open); left: 0; box-shadow: 8px 0 32px rgba(0,0,0,.35); background: var(--md-sys-color-surface-container-low); border-radius: 0 var(--r-xl) var(--r-xl) 0; }
  #app.rail-open #scrim { display: block; } }
@keyframes fade { from { opacity: 0; } }
/* compact: < 600 — нижняя навигация, модальная панель по кнопке меню */
@media (max-width: 599px) {
  :root { --gap: 12px; }
  #app, #app.rail-open { grid-template-columns: 1fr; }
  #body { grid-column: 1; }
  #rail { position: fixed; left: 0; top: 0; width: var(--rail-w-open); transform: translateX(-105%); transition: transform var(--d-default) var(--spring-default);
    background: var(--md-sys-color-surface-container-low); border-radius: 0 var(--r-xl) var(--r-xl) 0; }
  #app.rail-open #rail { transform: none; }
  #railToggle { display: none; }
  .compact-only { display: inline-flex; }
  #pageTitle, #appbar .brand-sub, #appbar .brand-word { display: none; }
  .dev-switch { margin-left: 0; min-width: 0; flex: 1; }
  .dev-btn { max-width: 100%; }
  #appbar { min-height: 64px; padding: 8px 12px; }
  #page { padding: 4px 12px calc(96px + env(safe-area-inset-bottom)); }
  #navbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; height: calc(80px + env(safe-area-inset-bottom));
    padding: 12px 4px env(safe-area-inset-bottom); background: var(--md-sys-color-surface-container); justify-content: space-around; }
  #navbar .nav-item { flex: 1; }
  .hero { grid-template-columns: 1fr; } .hero .deco { display: none; }
  .card { padding: 16px; border-radius: var(--r-l); }
  .stat { min-height: 0; }
  x-ring { width: 104px; }
  .results .li .date, .li .acts md-icon-button.opt { display: none; }
  .results .li .size { width: auto; }
  .bar-row { grid-template-columns: 1fr auto; } .bar-row .hbar-wrap { grid-column: 1 / -1; grid-row: 2; }
  #snackbar { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
