/* «Бражник» — дизайн-система веб-приложения.
   Темы задаются атрибутом data-theme на <html>, все цвета — переменные.
   Анимации отключаются при prefers-reduced-motion и в режиме «Без анимаций». */

:root {
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Exo 2', 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --gap: 16px;
  --nav-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ── Темы ─────────────────────────────────────────────── */
/* Космос: глубокий тёмно-синий с полярным сиянием (по умолчанию) */
[data-theme="cosmos"] {
  color-scheme: dark;
  --bg: #070b16; --bg-2: #0c1222;
  --surface: rgba(20, 28, 50, .62); --surface-2: rgba(30, 40, 68, .7); --surface-solid: #131b31;
  --line: rgba(148, 170, 220, .14); --line-2: rgba(148, 170, 220, .26);
  --text: #e8edfb; --muted: #8c97b6; --faint: #5d6889;
  --accent: #6ee7ff; --accent-2: #a78bfa; --accent-ink: #04121d;
  --cold: #60a5fa; --ice: #a5f3fc; --ok: #34d399; --warn: #fbbf24; --danger: #fb7185; --heat: #fb923c;
  --glow: 0 0 0 1px var(--line), 0 18px 50px -18px rgba(0, 0, 0, .7);
  --aurora-1: #6ee7ff; --aurora-2: #a78bfa; --aurora-3: #34d399;
}
/* Лёд: светлая морозная */
[data-theme="ice"] {
  color-scheme: light;
  --bg: #eef4fb; --bg-2: #e3ecf7;
  --surface: rgba(255, 255, 255, .72); --surface-2: rgba(255, 255, 255, .9); --surface-solid: #ffffff;
  --line: rgba(30, 64, 120, .1); --line-2: rgba(30, 64, 120, .2);
  --text: #0e1b2e; --muted: #475569; --faint: #64748b;
  --accent: #0284c7; --accent-2: #6366f1; --accent-ink: #ffffff;
  --cold: #2563eb; --ice: #0891b2; --ok: #059669; --warn: #d97706; --danger: #e11d48; --heat: #ea580c;
  --glow: 0 0 0 1px var(--line), 0 18px 40px -22px rgba(30, 64, 120, .35);
  --aurora-1: #7dd3fc; --aurora-2: #c4b5fd; --aurora-3: #99f6e4;
}
/* Пивоварня: тёплая медь и янтарь */
[data-theme="brew"] {
  color-scheme: dark;
  --bg: #140d08; --bg-2: #1c130c;
  --surface: rgba(46, 31, 20, .66); --surface-2: rgba(62, 42, 27, .74); --surface-solid: #2a1c12;
  --line: rgba(240, 190, 130, .14); --line-2: rgba(240, 190, 130, .28);
  --text: #fbefe1; --muted: #c4a689; --faint: #8a705a;
  --accent: #f6b25a; --accent-2: #e8784a; --accent-ink: #1d1006;
  --cold: #7cc4e8; --ice: #b9e6f5; --ok: #9ad37a; --warn: #f6c35a; --danger: #f2786a; --heat: #f39b4b;
  --glow: 0 0 0 1px var(--line), 0 18px 50px -18px rgba(0, 0, 0, .75);
  --aurora-1: #f6b25a; --aurora-2: #e8784a; --aurora-3: #c99d5a;
}
/* Неон: контрастная киберпанк */
[data-theme="neon"] {
  color-scheme: dark;
  --bg: #05010c; --bg-2: #0b0418;
  --surface: rgba(18, 8, 38, .7); --surface-2: rgba(30, 14, 58, .78); --surface-solid: #140a29;
  --line: rgba(255, 70, 220, .18); --line-2: rgba(80, 255, 230, .35);
  --text: #f5f0ff; --muted: #a998cc; --faint: #6c5c8f;
  --accent: #3cffe0; --accent-2: #ff4fd8; --accent-ink: #05010c;
  --cold: #4cc9ff; --ice: #8afcff; --ok: #5dff9c; --warn: #ffe14d; --danger: #ff4f7b; --heat: #ff9f43;
  --glow: 0 0 0 1px var(--line), 0 0 30px -8px rgba(255, 79, 216, .35);
  --aurora-1: #3cffe0; --aurora-2: #ff4fd8; --aurora-3: #7b5cff;
}

/* ── База ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Фон: полярное сияние — три размытых пятна, медленно дрейфуют */
.aurora { position: fixed; inset: -20vmax; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at 50% 120%, var(--bg-2), var(--bg) 60%); }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px);
  opacity: .22; mix-blend-mode: screen; animation: drift 28s var(--ease) infinite alternate; }
[data-theme="ice"] .aurora i { mix-blend-mode: multiply; opacity: .35; }
.aurora i:nth-child(1) { background: var(--aurora-1); left: 10%; top: 0; }
.aurora i:nth-child(2) { background: var(--aurora-2); right: 0; top: 20%; animation-duration: 34s; animation-delay: -8s; }
.aurora i:nth-child(3) { background: var(--aurora-3); left: 30%; bottom: 0; animation-duration: 40s; animation-delay: -16s; }
@keyframes drift { to { transform: translate3d(8vmax, -6vmax, 0) scale(1.15); } }

/* ── Каркас: меню слева на ПК, нижняя навигация на телефоне ── */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100dvh; }
.nav { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 24px -6px var(--accent); }
.brand b { font: 700 19px/1.1 var(--font-display); letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-weight: 600; position: relative;
  transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); }
.nav .sec { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.nav .grow { flex: 1; min-height: 12px; }
.nav a[aria-current="page"] .icon { color: var(--accent); }
.nav-state { margin: 0 4px 10px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 8px; font-size: 12px; color: var(--muted); }
.nav-state .chip { justify-self: start; }
.nav-tanks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nav-tanks i { height: 6px; border-radius: 99px; background: var(--line-2); }
.nav-tanks i[data-kind="cool"] { background: var(--cold); }
.nav-tanks i[data-kind="hold"] { background: var(--ok); }
.nav-tanks i[data-kind="wait"] { background: var(--warn); }
.nav-tanks i[data-kind="pause"] { background: var(--accent-2); }
.nav-tanks i[data-alarm="1"] { background: var(--danger); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.main { min-width: 0; padding: 22px clamp(14px, 2.4vw, 34px) 40px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font: 700 clamp(22px, 2.4vw, 30px)/1.15 var(--font-display); }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }

.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; }
  .main { padding: calc(14px + var(--safe-t)) 14px calc(96px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30;
    left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 82%, transparent); backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: var(--glow); }
  .tabbar a, .tabbar button { display: grid; place-items: center; gap: 2px; padding: 8px 2px; border-radius: 16px; border: 0;
    background: transparent; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; cursor: pointer;
    position: relative; min-width: 0; -webkit-tap-highlight-color: transparent; transition: color .2s, transform .15s var(--spring); }
  .tabbar a:active, .tabbar button:active { transform: scale(.92); }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .bell.has-unread::after { top: 2px; right: calc(50% - 22px); }
  .tabbar a[aria-current="page"] .icon { animation: tab-pop .35s var(--spring); }
  @keyframes tab-pop { from { transform: translateY(3px) scale(.8); } }
  .tabbar a[aria-current="page"] { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
  .topbar h1 { font-size: 22px; }
}

/* ── Поверхности ── */
.card { position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--glow); backdrop-filter: blur(16px) saturate(1.2); }
.card h2, .card h3 { margin: 0 0 12px; font: 700 16px/1.3 var(--font-display); letter-spacing: .01em; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* ── Кнопки и поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2);
  font-weight: 700; cursor: pointer; transition: transform .15s var(--spring), border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { border: 0; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px -10px var(--accent); }
.btn--danger { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); background: transparent; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn--icon { width: 40px; padding: 0; flex: none; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field > input, .field > select, .field > textarea, .input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent); color: var(--text); font-weight: 500;
  font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field > input:focus, .field > select:focus, .input:focus { border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .25s var(--spring); }
.switch input:checked + i { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + i::after { transform: translateX(20px); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-danger { color: var(--danger); }
.tone-info { color: var(--accent); } .tone-cool { color: var(--cold); } .tone-muted { color: var(--muted); }
.pulse .dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: 13px;
  color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ── Шапка дашборда: сводка ── */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } }
.hero-main { display: flex; gap: 20px; align-items: center; overflow: hidden; }
.hero-main .orb { width: 92px; height: 92px; flex: none; }
.mobile-state { display: none; }

.hero-main h2 { font-size: 22px; margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--glow); }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { display: block; font: 700 22px/1.2 var(--font-display); margin-top: 4px; }

/* ── Карточка ЦКТ ── */
.tanks { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
/* После перехода на swipe-track сам deck не должен наследовать grid-колонки:
   иначе его track сжимается в первую колонку и на широком экране карточки
   становятся узкими, а справа появляется пустой экран. */
.tanks.swipe-deck { display: block; }
/* Режим списка удалён: холодильники всегда плитками (сетка выше). */
.tank { overflow: hidden; display: grid; gap: 14px; animation: rise .5s var(--ease) both; }
.tank::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--tone) 70%, transparent), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.tank[data-kind="cool"] { --tone: var(--cold); }
.tank[data-kind="hold"] { --tone: var(--ok); }
.tank[data-kind="wait"] { --tone: var(--warn); }
.tank[data-kind="pause"] { --tone: var(--accent-2); }
.tank[data-kind="stop"] { --tone: var(--faint); }
.tank[data-alarm="1"] { --tone: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.tank-top { display: flex; align-items: flex-start; gap: 10px; }
.tank-top h3 { margin: 0; font-size: 18px; line-height: 1.25; word-break: break-word; }
.tank-top .grow { flex: 1; min-width: 0; }
.tank-body { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
.tank-temp { font: 700 44px/1 var(--font-display); letter-spacing: -.02em; }
.tank-temp small { font-size: 18px; color: var(--muted); font-weight: 600; }
.tank-target { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tank-target b { color: var(--text); }
.state-line { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.state-line .st { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--tone);
  text-transform: capitalize; }
.state-line .when { font-size: 13px; color: var(--muted); }
.state-line .when b { color: var(--text); font-weight: 700; }
.tank-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tank-actions .btn { flex: 1 1 auto; }
/* Правила для [data-view="list"] удалены вместе с режимом списка. */

/* Прогресс профиля */
.prog { display: grid; gap: 8px; }
.prog-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.prog-head b { color: var(--text); }
.prog-bar { position: relative; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; gap: 2px; }
.prog-bar i { position: relative; height: 100%; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.prog-bar i > em { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit; transition: width .8s var(--ease); }
.prog-bar i > em::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 2.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── SVG: ферментер (ЦКТ) ── */
.fv-wrap { position: relative; display: grid; place-items: center; }
.fv-wrap::before { content: ''; position: absolute; inset: 14% 8% 10%; border-radius: 50%; filter: blur(22px); opacity: .28;
  background: var(--tone); transition: background .6s; }
.tank[data-kind="stop"] .fv-wrap::before { opacity: .08; }
.fv { position: relative; width: 120px; height: 170px; overflow: visible; }
.fv .tank-bg { fill: color-mix(in srgb, var(--surface-solid) 85%, var(--bg)); }
.fv .shell-o { fill: none; stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 2.4; stroke-linejoin: round; }
.fv .leg { fill: none; stroke: var(--line-2); stroke-width: 3; stroke-linecap: round; }
.fv .valve, .fv .manway { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.fv .wave { animation: wave 5s linear infinite; }
.fv .wave-back { opacity: .55; animation-duration: 8s; animation-direction: reverse; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
.fv .foam circle { fill: color-mix(in srgb, #fff 82%, var(--warn)); opacity: .8; transform-box: fill-box; transform-origin: center;
  animation: foam 3s ease-in-out infinite; }
@keyframes foam { 50% { transform: scale(.82) translateY(1px); } }
.fv .bubble { fill: rgba(255, 255, 255, .6); animation: bubble 3s ease-in infinite; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-80px); opacity: 0; } }
.fv .jacket rect { fill: none; stroke: var(--cold); stroke-width: 2; stroke-dasharray: 6 5; opacity: .22; }
.fv[data-kind="cool"] .jacket rect { opacity: 1; animation: flow 1.1s linear infinite;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--cold) 70%, transparent)); }
.fv[data-kind="cool"] .jacket rect:nth-child(2) { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.fv .probe { stroke: var(--line-2); stroke-width: 2.5; stroke-linecap: round; }
.fv .probe-dot { animation: probe 2.4s ease-in-out infinite; }
@keyframes probe { 50% { opacity: .4; } }
.fv .frost { fill: none; stroke: var(--ice); stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
.fv[data-kind="cool"] .frost { animation: frost 2.8s ease-in-out infinite; }
@keyframes frost { 0%, 100% { opacity: 0; transform: translateY(-4px) scale(.6); } 50% { opacity: .95; transform: translateY(8px) scale(1); } }
.tank[data-alarm="1"] .fv .shell-o { stroke: var(--danger); animation: alarm-glow 1.4s ease-in-out infinite; }
@keyframes alarm-glow { 50% { filter: drop-shadow(0 0 6px var(--danger)); } }

/* ── Шкала зон: гистерезис и граница аварии ── */
.zone { margin-top: 12px; display: grid; gap: 5px; }
.zone-bar { position: relative; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--warn) 22%, var(--line)); }
.zone-bar i { position: absolute; top: 0; bottom: 0; }
.zone-a { left: 0; border-radius: 99px 0 0 99px; background: color-mix(in srgb, var(--danger) 55%, transparent); }
.zone-a--r { right: 0; border-radius: 0 99px 99px 0; }
.zone-h { background: color-mix(in srgb, var(--ok) 70%, transparent); border-radius: 3px; }
.zone[data-alarm-off="1"] .zone-a { background: repeating-linear-gradient(135deg, var(--line-2) 0 4px, transparent 4px 8px); }
.zone-pin { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line-2), 0 0 12px -2px var(--tone);
  transition: left .8s var(--ease); }
.zone-pin.is-out { animation: pin-out 1s ease-in-out infinite; }
@keyframes pin-out { 50% { transform: scale(1.25); } }
.zone[data-over="1"] .zone-pin { background: var(--danger); }
.zone-legend { display: flex; justify-content: space-between; gap: 6px; font: 11px/1.2 var(--font-mono); color: var(--faint); }
.zone-legend span:nth-child(2) { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-weight: 700; color: var(--muted); }
.zone-legend .icon { width: 13px; height: 13px; }

/* ── Схема пивоварни: чиллер, гликолевая линия, пять ЦКТ ── */
.hero-main { flex-direction: column; align-items: stretch; gap: 14px; }
.hero-sum { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.hero-sum .grow { flex: 1; min-width: 200px; }
.hero-recv { font-size: 12px; max-width: 280px; text-align: right; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.plant { display: grid; grid-template-columns: 76px 22px 1fr; align-items: center; }
.plant-chiller { display: grid; justify-items: center; gap: 4px; font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; }
.chill { width: 66px; height: 66px; }
.chill-box { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 2; }
.chill-ring { fill: none; stroke: var(--line-2); stroke-width: 2; }
.chill .fan { fill: var(--cold); opacity: .55; transform-box: fill-box; transform-origin: center; }
.plant[data-cooling="1"] .chill .fan { opacity: 1; animation: spin 1.1s linear infinite; }
.chill-hub { fill: var(--surface-solid); stroke: var(--line-2); stroke-width: 2; }
.plant-line svg { width: 100%; height: 10px; display: block; }
.plant-line .pipe, .plant-slots::before { stroke: var(--line-2); }
.pipe { fill: none; stroke-width: 4; stroke-linecap: round; }
.pipe-flow { fill: none; stroke: var(--cold); stroke-width: 2; stroke-dasharray: 4 6; opacity: 0; }
.plant[data-cooling="1"] .pipe-flow { opacity: 1; animation: flow 0.9s linear infinite; }
.plant-slots { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.plant-slots::before { content: ''; position: absolute; left: 0; right: 10%; top: 32px; height: 4px; border-radius: 4px;
  background: var(--line-2); z-index: 0; }
.plant[data-cooling="1"] .plant-slots::before { background: linear-gradient(90deg, var(--cold), color-mix(in srgb, var(--cold) 30%, var(--line-2)));
  background-size: 200% 100%; animation: glycol 2.4s linear infinite; }
@keyframes glycol { to { background-position: -200% 0; } }
.slot { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; min-width: 0;
  border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--text); text-decoration: none;
  cursor: pointer; font: inherit; transition: background .2s, border-color .2s, transform .15s var(--spring); }
.slot:hover { background: var(--surface-2); border-color: var(--line); }
.slot:active { transform: scale(.95); }
.slot b { font-size: 15px; line-height: 1.1; }
.slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.slot.is-free b { font-size: 12px; color: var(--faint); font-family: var(--font-ui); }
.slot.is-free small { color: var(--faint); }
.mini { width: 46px; height: 54px; overflow: visible; }
.mini .tank-bg { fill: var(--surface-solid); }
.mini .shell-o { fill: none; stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 2; }
.mini .leg { stroke: var(--line-2); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.mini .wave { animation: wave 5s linear infinite; opacity: .9; }
.mini-jacket { fill: none; stroke: var(--cold); stroke-width: 1.6; opacity: .25; stroke-dasharray: 4 3; }
.slot[data-kind="cool"] .mini-jacket { opacity: 1; animation: flow 1s linear infinite; }
.slot[data-kind="stop"] .mini { opacity: .55; }
.slot[data-alarm="1"] .mini .shell-o { stroke: var(--danger); animation: alarm-glow 1.4s ease-in-out infinite; }
.slot[data-alarm="1"] b { color: var(--danger); }
.mini-free { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 4 4; }
.mini-plus { stroke: var(--faint); stroke-width: 2.4; stroke-linecap: round; }
.tank.is-flash { animation: flash 1.1s var(--ease); }
@keyframes flash { 30% { box-shadow: 0 0 0 2px var(--accent), 0 0 40px -6px var(--accent); } }
.tank-no { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); }
.tank-read { min-width: 0; }

/* ── Настройки: блок аварии холодильника ── */
.alarm-box { margin-top: 14px; padding: 14px; border-radius: var(--r); background: color-mix(in srgb, var(--danger) 7%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent); transition: background .25s, border-color .25s; }
.alarm-box[data-off="1"] { background: var(--surface-2); border-color: var(--line); }
.alarm-box[data-off="1"] .tone-danger { color: var(--faint); }
.alarm-delta { display: grid; gap: 10px; grid-template-columns: minmax(0, 200px) 1fr; align-items: end; margin-top: 6px; }
.alarm-delta .hint { grid-column: 1 / -1; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 600px) { .alarm-delta { grid-template-columns: 1fr; } }

/* ── Свайп-подборки холодильников и профилей ── */
.swipe-deck { position: relative; min-width: 0; }
.swipe-track { display: grid; gap: var(--gap); min-width: 0; }
.tanks.swipe-deck .swipe-track { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.settings-equipment-deck .swipe-track { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.swipe-dots { display: none; }
@media (max-width: 900px) {
  .swipe-deck .swipe-track { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none; padding: 1px 1px 10px; cursor: grab; }
  .swipe-deck .swipe-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
  .swipe-deck .swipe-track::-webkit-scrollbar { display: none; }
  .swipe-deck .swipe-track > * { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
  .swipe-dots { display: flex; justify-content: center; gap: 7px; padding: 2px 0 0; }
  .swipe-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line-2); cursor: pointer; }
  .swipe-dots button[aria-current="true"] { width: 22px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
  .swipe-deck.tanks { display: block; }
  .settings-equipment-deck .swipe-track > .card { min-height: 100%; }
}

/* Иконки состояния */
.spin { animation: spin 6s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes spin { to { transform: rotate(360deg); } }
.breathe { animation: breathe 2.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .8; } }

/* ── График ── */
/* Пропорции viewBox (1000×300) сохраняются: высота контейнера задаётся
   aspect-ratio, а не фиксированными 300 px при любой ширине. Вместе с
   preserveAspectRatio="xMidYMid meet" в SVG это убирает растяжение
   линий и подписей и на ПК, и на телефоне. */
.chart { position: relative; width: 100%; height: auto; aspect-ratio: 1000 / 300; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Панель графиков: оверлей по образцу панели уведомлений (.npanel).
   На десктопе всплывает сверху справа, на мобильном (до 600 px) —
   шторкой снизу. Сама панель и есть подложка: клик мимо карточки
   закрывает её, как у уведомлений. */
.chart-panel { position: fixed; inset: 0; z-index: 55; display: flex;
  justify-content: flex-end; align-items: flex-start;
  padding: calc(70px + var(--safe-t)) clamp(12px, 2.4vw, 34px) 16px 16px;
  background: rgba(3, 6, 14, .35); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.chart-panel.open { opacity: 1; pointer-events: auto; }
.chart-panel > * { width: min(760px, calc(100vw - 24px));
  max-height: min(80dvh, 820px); overflow: auto; animation: pop .3s var(--spring); }
@media (max-width: 600px) {
  .chart-panel { justify-content: stretch; align-items: flex-end; padding: 0; }
  .chart-panel > * { width: 100%; max-height: 85dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(18px + var(--safe-b));
    animation: sheet .34s var(--ease); }
}
/* Навигация по скользящим окнам графиков: стрелки и выпадающий список
   окон (месяцев/лет). Показывается только для периодов «Месяц» и «Год». */
.chart-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.chart-nav select { flex: 1; min-width: 0; min-height: 32px; padding: 4px 10px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-weight: 700; font-size: 13px; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font: 11px var(--font-mono); }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .area { opacity: 0; animation: fade .8s .6s forwards; }
@keyframes fade { to { opacity: 1; } }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 12px; font-size: 12px;
  background: var(--surface-solid); box-shadow: var(--glow); min-width: 150px; transform: translate(-50%, -110%); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.legend button[aria-pressed="false"] { opacity: .4; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ── Лента событий ── */
.feed { display: grid; gap: 2px; max-height: 460px; overflow: auto; }
.ev { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 10px 6px; border-radius: 12px; }
.ev:hover { background: var(--surface-2); }
.ev .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, currentColor 14%, transparent); }
.ev .t { font-size: 14px; }
.ev .m { font-size: 12px; color: var(--muted); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.empty svg { width: 64px; height: 64px; opacity: .6; }

/* ── Модальное окно (на телефоне — шторка снизу) ── */
.modal-host { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 6, 14, .55); backdrop-filter: blur(6px); animation: fade .2s forwards; opacity: 0; }
.modal { width: min(560px, 100%); max-height: min(86dvh, 820px); overflow: auto; background: var(--surface-solid);
  border-radius: var(--r-xl); padding: 22px; box-shadow: var(--glow); animation: pop .32s var(--spring); }
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font: 700 20px/1.25 var(--font-display); }
.modal .btn-row { justify-content: flex-end; margin-top: 18px; }
@media (max-width: 600px) {
  .modal-host { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(22px + var(--safe-b));
    animation: sheet .34s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } }
  .modal .btn-row .btn { flex: 1; }
}

/* ── Тосты и индикатор загрузки ── */
.toasts { position: fixed; z-index: 70; right: 16px; top: calc(16px + var(--safe-t)); display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-solid); box-shadow: var(--glow); animation: slide .35s var(--spring); font-size: 14px; }
.toast { grid-template-columns: 26px 1fr 28px; align-items: start; }
.toast b { display: block; }
.toast .muted { display: block; font-size: 13px; margin-top: 2px; }
.toast-x { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; }
.toast-x:hover { background: var(--surface-2); color: var(--text); }
.toast-x .icon { width: 16px; height: 16px; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; width: auto; } }
/* Индикатор обмена: строка-«пилюля» сверху. Текст не переносится, ширина по
   содержимому; display:flex вешается только на видимый элемент, иначе [hidden]
   не скрывал бы его. */
.busy { position: fixed; z-index: 65; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 99px; width: max-content;
  max-width: calc(100vw - 32px); white-space: nowrap; background: var(--surface-solid); box-shadow: var(--glow);
  font-weight: 700; font-size: 13px; animation: busy-in .25s var(--ease); }
.busy[hidden] { display: none; }
.busy .busy-text { overflow: hidden; text-overflow: ellipsis; }
.busy .loader { flex: none; }
@keyframes busy-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.loader { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ── Вход ── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(460px, 100%); padding: 30px; text-align: center; }
.login .logo-ring { width: 120px; height: 120px; margin: 0 auto 10px; }
.login h1 { font: 800 30px/1.1 var(--font-display); margin: 6px 0; }
.login form { display: grid; gap: 12px; margin-top: 18px; text-align: left; }

/* ── Настройки ── */
.settings-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; background: var(--surface); border: 1px solid var(--line); }
.settings-tabs a[aria-current="page"] { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.list-item + .list-item { margin-top: 8px; }
.list-item .grow { flex: 1; min-width: 0; }
.steps { display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 30px repeat(4, minmax(0, 1fr)) 40px; gap: 8px; align-items: end; }
.step .n { width: 30px; height: 42px; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
@media (max-width: 600px) { .step { grid-template-columns: 1fr 1fr; } .step .n { grid-column: 1 / -1; height: auto; justify-content: start; } }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.theme-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.swatch { position: relative; padding: 12px; border-radius: var(--r); border: 2px solid var(--line); cursor: pointer;
  text-align: left; background: var(--sw-bg); color: var(--sw-text); font-weight: 700; }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.swatch span { display: flex; gap: 4px; margin-top: 8px; }
.swatch span i { width: 18px; height: 18px; border-radius: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ── Баннеры ── */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); margin-bottom: var(--gap);
  font-weight: 600; background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); }
.banner .grow { flex: 1; }
.banner[data-tone="danger"] { --tone: var(--danger); }
.banner[data-tone="warn"] { --tone: var(--warn); }
.banner[data-tone="info"] { --tone: var(--accent); }

/* Скелетон при первой загрузке */
.skel { border-radius: var(--r-lg); height: 260px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { to { background-position: -150% 0; } }

/* Переходы между страницами */
.page { animation: page .4s var(--ease); }
@keyframes page { from { opacity: 0; transform: translateY(8px); } }

/* Без анимаций: системная настройка или переключатель в «Оформлении» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* ── Колокольчик и панель уведомлений ── */
.bell { position: relative; }
.bell.has-unread::after { content: attr(data-count); position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 2px var(--bg); animation: pop .35s var(--spring); }
.bell.has-alarm::after { background: var(--danger); color: #fff; }
.bell.has-alarm .icon { color: var(--danger); animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); }
  30% { transform: rotate(8deg); } 40% { transform: rotate(-5deg); } }
.npanel-host { position: fixed; inset: 0; z-index: 55; background: rgba(3, 6, 14, .35); backdrop-filter: blur(3px);
  animation: fade .2s forwards; opacity: 0; }
.npanel { position: absolute; top: calc(70px + var(--safe-t)); right: clamp(12px, 2.4vw, 34px); width: min(440px, calc(100vw - 24px));
  max-height: min(70dvh, 640px); display: flex; flex-direction: column; background: var(--surface-solid);
  border-radius: var(--r-lg); box-shadow: var(--glow); animation: pop .3s var(--spring); overflow: hidden; }
.npanel header { display: flex; align-items: center; gap: 6px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.npanel header h2 { margin: 0; font: 700 17px/1.2 var(--font-display); }
.npanel header .spacer { flex: 1; }
.npanel .feed { max-height: none; flex: 1; padding: 6px; }
.npanel .ev[data-href] { cursor: pointer; }
.ev.is-new { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ev.is-new .t::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: var(--accent); vertical-align: middle; }
@media (max-width: 600px) {
  .npanel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 80dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: var(--safe-b); animation: sheet .34s var(--ease); }
}
/* При изменении только данных карточка не пересоздаётся; при смене режима
   тоже не нужно повторять подъём — это убирает мерцание при опросе. */
.tank.is-update { animation: none; }
/* Телефон: верхняя сводка — компактный ряд рядом с выбором контроллера;
   подробности остаются в KPI, а не занимают половину первого экрана. */
@media (max-width: 600px) {
  .main { padding-top: calc(8px + var(--safe-t)); }
  .topbar { margin-bottom: 10px; gap: 7px; }
  .topbar h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
  .topbar .sub { font-size: 11px; white-space: nowrap; }
  .hero { gap: 8px; margin-bottom: 10px; }
  .hero-main { min-height: 76px; padding: 11px 12px; gap: 10px; border-radius: 18px; }
  .hero-main .orb { width: 58px; height: 58px; }
  .hero-main h2 { font-size: 17px; line-height: 1.15; white-space: nowrap; margin-bottom: 2px; }
  .hero-main .muted { font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-main .muted:last-of-type { display: none; }
  .hero-main > .btn { width: 34px; height: 34px; min-height: 34px; }
  .kpis { gap: 8px; }
  .kpi { padding: 10px 11px; border-radius: 14px; }
  .kpi small { font-size: 10px; }
  .kpi b { font-size: 18px; margin-top: 2px; }
  .card-head { margin-bottom: 9px; }
  .card-head h2 { font-size: 18px; }
}

/* Мобильная шапка: подробный hero скрыт, краткий статус рядом с контроллером. */
@media (max-width: 600px) {
  .mobile-state { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
  .hero { display: block; }
  /* Сводка — в шапке; схема пивоварни остаётся компактной полосой. */
  .hero-main { display: block; min-height: 0; padding: 8px 8px 4px; margin-bottom: 8px; }
  .hero-sum { display: none; }
  .plant { grid-template-columns: 44px 6px 1fr; }
  .plant-chiller small { display: none; }
  .chill { width: 42px; height: 42px; }
  .plant-slots { gap: 2px; }
  .plant-slots::before { top: 22px; }
  .mini { width: 34px; height: 40px; }
  .slot { padding: 4px 0 6px; }
  .slot b { font-size: 13px; }
  .slot small { font-size: 10px; }
  .tank-body { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; }
  .fv { width: 100px; height: 142px; }
  .tank-temp { font-size: 38px; }
  .topbar .bell { display: none; }
}


/* ── Заблокированные параметры работающего холодильника ── */
/* Отключённый элемент не получает клик — пропускаем его к подписи, чтобы
   показать ошибку с причиной (settings.js, data-lock-msg). */
[data-lock-msg] { cursor: not-allowed; }
[data-lock-msg] > :is(input, select):disabled { pointer-events: none; opacity: .55; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[aria-disabled="true"]:active { transform: none; }
.hint .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.tank-rename { flex: none; opacity: .6; transition: opacity .2s; }
.tank:hover .tank-rename, .tank-rename:focus-visible { opacity: 1; }
@media (hover: none) { .tank-rename { opacity: 1; } }
