/* Dom Control console. A terminal at night: black, letters, hairlines and
   one cold accent for what can be pressed, with the house and the app's
   services written in glyphs behind it (scene/). Few frames and much air:
   numbers stand in rows under a hairline rather than in boxes. Condensed
   type, square corners, small capitals for labels, numbers that line up.
   Dark only. The page is complete without the scene. */

@font-face {
  font-family: "Roboto Condensed";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/loginadmin/fonts/roboto-condensed-latin.woff2") format("woff2");
  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: "Roboto Condensed";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/loginadmin/fonts/roboto-condensed-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Kazakh letters (Ә, Ғ, Қ, Ң, Ө, Ү, Һ) are in the extended set. */
@font-face {
  font-family: "Roboto Condensed";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/loginadmin/fonts/roboto-condensed-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  color-scheme: dark;

  --sky-top: #000;
  --sky-mid: #020304;
  --sky-low: #05070a;
  --horizon: rgba(65, 232, 255, 0.05);
  --bg: #000;
  --surface: rgba(4, 5, 7, 0.94);
  --surface-solid: #050608;
  --surface-raised: #0c0e12;
  --field: rgba(0, 0, 0, 0.55);
  --hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f2f2ef;
  --text-2: #a5a6a3;
  --text-3: #707270;
  --accent: #41e8ff;
  --accent-hover: #7cf0ff;
  --accent-press: #1fc8e0;
  --accent-text: #6eeeff;
  --accent-soft: rgba(65, 232, 255, 0.1);
  --accent-ring: rgba(65, 232, 255, 0.32);
  --on-accent: #00141a;
  --violet: #8c6aff;
  --blue: #4478ff;
  --lime: #d4ff4a;
  --veil: rgba(0, 0, 0, 0.45);
  --veil-strong: rgba(0, 0, 0, 0.84);
  --brand-graphite-top: #a0a5b0;
  --brand-graphite-bottom: #6b6f79;

  --c-ok: #4ade80;
  --c-warn: #ffb547;
  --c-err: #ff5c6c;

  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 3px;
  --chamfer: 9px;
  --shadow-sm: none;
  --shadow-md: 0 0 0 1px var(--line-strong), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 0 0 1px var(--line-strong), 0 30px 80px -30px rgba(0, 0, 0, 0.95);

  --font-body: "Roboto Condensed", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* The content's column, the masthead's hairline with it. */
  --content-max: 1520px;

  /* The older names the sections' rules use, mapped onto this palette. */
  --color-bg: var(--bg);
  --color-surface: var(--surface-solid);
  --color-text: var(--text);
  --color-accent: var(--accent);
  --color-divider: var(--line);
  --color-neutral-100: #f4f4f2;
  --color-neutral-200: #e2e2df;
  --color-neutral-300: #c4c5c2;
  --color-neutral-400: var(--text-2);
  --color-neutral-500: var(--text-3);
  --color-neutral-600: #5a5c5a;
  --color-neutral-700: #383a3a;
  --color-neutral-800: #1f2122;
  --color-neutral-900: #0e0f10;
  --color-accent-100: #e8fcff;
  --color-accent-200: #bff6ff;
  --color-accent-300: var(--accent-text);
  --color-accent-400: #7cf0ff;
  --color-accent-500: #41e8ff;
  --color-accent-600: #1fc8e0;
  --color-accent-700: #0d8ea1;
  --color-accent-800: #08404a;
  --color-accent-900: #031c21;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.brand-graphite-top { stop-color: var(--brand-graphite-top); }
.brand-graphite-bottom { stop-color: var(--brand-graphite-bottom); }

html { max-width: 100%; min-width: 320px; overflow-x: clip; background: var(--bg); }
body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button, input, textarea, select {
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, opacity 140ms ease, color 140ms ease;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:not(:disabled):active { transform: scale(.985); }
button:disabled { cursor: not-allowed; opacity: .45; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }

/* ——— the house behind the console ——— */
.scene-layer { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.scene-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 72% 50%, var(--horizon), transparent 70%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 50%, var(--sky-low));
}
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease; }
.scene-canvas.is-ready { opacity: 1; }
/* Behind the sections the letters step back under their content, which
   runs the screen's width; the login and «Обзор» keep an empty place for
   the house (.scene-anchor) and need no veil. */
.scene-layer::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  opacity: 0;
  background: radial-gradient(70% 70% at 50% 52%, var(--veil) 0, var(--veil-strong) 100%);
  transition: opacity .9s ease;
}
body[data-view]:not([data-view="login"]):not([data-view="overview"]) .scene-layer::after { opacity: 1; }
.scene-layer.is-off .scene-canvas { opacity: 0; }
.scene-anchor { min-width: 0; min-height: 0; pointer-events: none; }

.shell { position: relative; z-index: 1; width: 100%; min-height: 100vh; }

/* Until app.js knows whether a session is open, neither the login nor the
   dashboard shows, so a signed-in reload never flashes the login. Without
   the script the login appears on its own after a moment. */
.booting .login-view, .booting .dashboard { visibility: hidden; }
.booting .login-view { animation: boot-reveal 0s 2.5s forwards; }

/* ——— typography ——— */
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-body); line-height: 1.08; }
h1 { margin-bottom: 8px; font-size: clamp(2.3rem, 3.6vw, 3.2rem); font-weight: 300; letter-spacing: -0.01em; }
h2 { margin-bottom: 0; font-size: 1.4rem; font-weight: 400; letter-spacing: 0; }
h3 { margin-bottom: 10px; font-size: 1.04rem; font-weight: 500; letter-spacing: .01em; }
/* The title of the open view ends in a blinking cursor. */
.topbar h1::after, .login-card h1::after {
  content: "_";
  margin-left: .04em;
  color: var(--accent);
  animation: cursor-blink 1.1s steps(1) infinite;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 5px; height: 5px; flex: none; background: var(--accent); }
.muted { color: var(--text-3); line-height: 1.5; }
.safe { color: var(--c-ok); }
.error { min-height: 1.3rem; margin: 14px 0 0; color: var(--c-err); font-size: .86rem; }
.label, label > span { color: var(--text-2); font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 7px; }

/* ——— controls ——— */
input, textarea, select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--field);
  color: var(--text);
  caret-color: var(--accent);
  font-size: 14.5px;
}
textarea { min-height: 94px; resize: vertical; line-height: 1.45; }
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--text) 38%, transparent); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text-3) 85%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="file"] { padding: 6px; color: var(--text-2); }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

button {
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
button:not(:disabled):hover { border-color: color-mix(in srgb, var(--text) 45%, transparent); background: var(--hover); }
/* What can be pressed for real: the accent, with two corners cut. */
.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.primary:not(:disabled):hover { border-color: transparent; background: var(--accent-hover); }
.primary:not(:disabled):active { background: var(--accent-press); }
.ghost { border-color: transparent; color: var(--text-2); }
.ghost:not(:disabled):hover { border-color: transparent; color: var(--text); background: var(--hover); }
.danger { border-color: color-mix(in srgb, var(--c-err) 50%, transparent); background: transparent; color: var(--c-err); }
.danger:not(:disabled):hover { border-color: var(--c-err); background: color-mix(in srgb, var(--c-err) 12%, transparent); }

/* ——— brand ——— */
.brand-mark { display: block; flex: none; width: 30px; height: 30px; overflow: visible; }
.brand-mark.mini { width: 20px; height: 20px; }
.brand-word { font-size: 1.05rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }

/* ——— login ——— */
.login-view {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: 48px clamp(20px, 7vw, 120px);
}
.login-view .scene-anchor { height: min(72vh, 680px); }
.login-card {
  position: relative;
  width: 100%;
  padding: 32px 30px 26px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
}
body:not(.booting) .login-card { animation: rise-in .7s cubic-bezier(.2, .75, .2, 1) both; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-brand .brand-mark { width: 34px; height: 34px; }
.login-card h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 3vw, 2.7rem); }
.login-card .muted { margin-bottom: 0; font-size: .9rem; }
.login-card .primary { min-height: 46px; }
.login-foot {
  margin: 16px 0 0 2px;
  color: var(--text-3);
  font: .7rem var(--font-mono);
  letter-spacing: .06em;
}
.login-view > div:first-child { min-width: 0; }

/* ——— dashboard frame ——— */
/* A masthead over the whole width, as on soul.io: a hairline with a coloured
   tick over every group of sections, each group opening its sections under
   the pointer, and a few live numbers on the right. The content stands in
   one centred column under it. */
.dashboard { display: block; width: 100%; min-height: 100vh; }
body:not(.booting) .dashboard { animation: fade-in .5s ease both; }
.masthead {
  --gutter: clamp(16px, 3vw, 40px);
  position: sticky;
  z-index: 40;
  top: 0;
  padding: 20px var(--gutter) 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
/* The hairline the groups hang from runs over the content column's width. */
.masthead-inner {
  display: flex;
  align-items: stretch;
  gap: clamp(16px, 2.6vw, 40px);
  max-width: calc(var(--content-max) - 2 * var(--gutter));
  min-height: 56px;
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
}
.masthead-brand { display: flex; align-items: center; gap: 10px; padding-right: 8px; }
.masthead-brand .brand-mark { width: 24px; height: 24px; }
.masthead-brand span { font-size: .78rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }
.tabs { display: flex; gap: 0; }
.nav-group { position: relative; display: flex; align-items: stretch; --tick: var(--accent); }
.nav-group:nth-child(2) { --tick: var(--violet); }
.nav-group:nth-child(3) { --tick: var(--blue); }
.nav-group:nth-child(4) { --tick: var(--lime); }
.nav-group:nth-child(5) { --tick: #ff6fa8; }
.nav-group::before { position: absolute; top: -1px; left: 14px; width: 14px; height: 2px; content: ""; background: var(--tick); opacity: .55; transition: opacity .2s ease, width .2s ease; }
.nav-group:hover::before, .nav-group.open::before, .nav-group:has(.tab.active)::before { width: 26px; opacity: 1; }
.nav-group-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-2);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .14em;
  white-space: nowrap;
}
.nav-group-button:not(:disabled):hover, .nav-group.open .nav-group-button { border: 0; background: none; color: var(--text); }
.nav-group-button:not(:disabled):active { transform: none; }
.nav-group:has(.tab.active) .nav-group-button { color: var(--text); }
/* New requests in «Обращения» show on its group while the menu is shut. */
.nav-group:has(.tab-count:not([hidden])) .nav-group-button::after { width: 6px; height: 6px; content: ""; background: var(--accent); }
.nav-menu {
  position: absolute;
  z-index: 60;
  top: 100%;
  left: 0;
  display: grid;
  min-width: 232px;
  padding: 8px 0;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--tick);
  background: rgba(3, 4, 6, 0.97);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
/* A bridge over the gap, so the pointer may travel down into the menu. */
.nav-menu::before { position: absolute; right: 0; bottom: 100%; left: 0; height: 8px; content: ""; }
.nav-group:hover .nav-menu, .nav-group.open .nav-menu, .nav-group:has(:focus-visible) .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.tab {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 18px;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: .95rem;
  font-weight: 400;
  letter-spacing: .02em;
  text-align: left;
  text-transform: none;
}
.tab svg, .catalog-insight-icon svg, .window-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
/* The icons are for the bar of a phone. */
.tab svg { display: none; }
.tab:not(:disabled):hover { border-color: transparent; background: var(--hover); color: var(--text); }
.tab:not(:disabled):active { transform: none; }
.tab.active { background: linear-gradient(90deg, color-mix(in srgb, var(--tick) 14%, transparent), transparent 85%); color: var(--text); font-weight: 500; }
.tab.active::after { position: absolute; top: 7px; bottom: 7px; left: 0; width: 2px; content: ""; background: var(--tick); }
.tab-count {
  position: absolute;
  top: 50%;
  right: 14px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 .66rem/18px var(--font-mono);
  text-align: center;
  transform: translateY(-50%);
}
.masthead-stats { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); margin-left: auto; }
.masthead-stat { display: grid; gap: 3px; }
.masthead-stat small { color: var(--text-3); font-size: .6rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.masthead-stat strong { font: 400 .86rem var(--font-mono); font-variant-numeric: tabular-nums; }

.content-frame { width: 100%; max-width: var(--content-max); min-width: 0; margin: 0 auto; padding: 34px clamp(16px, 3vw, 40px) 28px; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: grid; min-width: 0; }
.topbar h1 { margin: 6px 0 0; }
.topbar .eyebrow { margin-bottom: 0; }
.top-actions { display: flex; align-items: center; gap: 14px; }
/* As soul.io's «Updated»: where the console runs, and when it is now. */
.topbar-meta { display: grid; justify-items: end; gap: 3px; }
.topbar-meta small { color: var(--c-ok); font-size: .62rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.topbar-meta time { font: .8rem var(--font-mono); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.logout-button:not(:disabled):hover { border-color: var(--c-err); color: var(--c-err); background: color-mix(in srgb, var(--c-err) 10%, transparent); }

.console-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font: .7rem var(--font-mono);
  letter-spacing: .04em;
}
.scene-toggle { min-height: 0; padding: 4px 0; border: 0; background: none; color: var(--text-2); font-size: .68rem; }
.scene-toggle b { margin-left: 4px; color: var(--accent); font-weight: 500; }
.scene-toggle[aria-pressed="false"] b { color: var(--text-3); }
.scene-toggle:not(:disabled):hover { border: 0; background: none; color: var(--text); }

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--c-ok) 45%, transparent);
  border-radius: var(--radius-sm);
  color: var(--c-ok);
  background: color-mix(in srgb, var(--c-ok) 8%, transparent);
  font: 500 .66rem var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pill.pill-danger { color: var(--c-err); border-color: color-mix(in srgb, var(--c-err) 45%, transparent); background: color-mix(in srgb, var(--c-err) 8%, transparent); }
.pill.pill-warn { color: var(--c-warn); border-color: color-mix(in srgb, var(--c-warn) 45%, transparent); background: color-mix(in srgb, var(--c-warn) 8%, transparent); }
.pill.pill-muted { color: var(--text-3); border-color: var(--line); background: transparent; }

.panel { display: none; width: 100%; max-width: 100%; min-width: 0; gap: 24px; }
.panel.active { display: grid; animation: fade-up 0.4s cubic-bezier(.2, .75, .2, 1) both; }
.section-heading { display: flex; flex-wrap: wrap; max-width: 100%; min-width: 0; align-items: end; justify-content: space-between; gap: 14px; }
.section-heading > div { min-width: 0; }
/* In the wide column a long note still reads as a line, not a banner. */
.section-heading .muted, .panel > .muted { max-width: 96ch; }
.panel > .muted { max-width: 100%; margin-bottom: 0; overflow-wrap: anywhere; }
.section-heading.compact { align-items: center; }
.section-heading h3 { margin: 0; }

/* ——— cards ——— */
/* A card is a plain hairline frame on the near-black surface. */
.card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
/* Numbers stand in one row under a hairline, each with a short tick of the
   accent over its label, as many to a row as the width allows. */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.metric {
  position: relative;
  display: block;
  min-height: 0;
  padding: 20px 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
}
.metric::before { position: absolute; top: -1px; left: 0; width: 14px; height: 2px; content: ""; background: var(--accent); }
.metric-copy { display: grid; min-width: 0; gap: 10px; }
.metric .label { color: var(--text-3); font-size: .66rem; }
.metric strong { font-size: 2.7rem; font-weight: 300; letter-spacing: -0.01em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric small { color: var(--text-3); line-height: 1.4; font-size: .8rem; }
.metric-icon { display: none; }
.split-card { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split-card > div { display: grid; gap: 8px; }
.state-list { display: grid; gap: 12px; }
.state-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.state-row strong { font-weight: 400; font-variant-numeric: tabular-nums; }
.state-track { height: 2px; margin-top: 8px; overflow: hidden; background: color-mix(in srgb, var(--text) 10%, transparent); }
.state-fill { height: 100%; background: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.span-two { grid-column: 1 / -1; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ——— overview ——— */
/* A stage over the column's whole width: the house and the app's services
   round it (.scene-anchor); the gateway's state in one line; the numbers;
   then push delivery and the latest events, open under a hairline instead
   of boxed. */
.overview-stage { display: grid; }
.overview-stage .scene-anchor { height: clamp(300px, 50vh, 560px); }
.infra-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 12px 0; border-top: 1px solid var(--line); }
.infra-bar .ghost { min-height: 30px; padding: 4px 10px; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 56px; align-items: start; margin-top: 16px; }
.overview-columns > .card { display: grid; gap: 16px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.delivery-transport { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.delivery-transport > div { display: grid; gap: 4px; }
.delivery-transport strong { font-weight: 500; }
.infra-list { display: flex; flex-wrap: wrap; gap: 8px 32px; min-width: 0; }
.infra-row { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.infra-dot { width: 6px; height: 6px; flex: none; background: var(--text-3); }
.infra-dot.tone-ok { background: var(--c-ok); box-shadow: 0 0 8px color-mix(in srgb, var(--c-ok) 70%, transparent); }
.infra-dot.tone-warn { background: var(--c-warn); }
.infra-value { margin-left: 2px; color: var(--text-2); font: .74rem var(--font-mono); font-variant-numeric: tabular-nums; }
.infra-value.tone-ok { color: var(--c-ok); }
.infra-value.tone-warn { color: var(--c-warn); }

/* ——— send ——— */
.simple-send-form { display: grid; gap: 17px; padding: 24px; }
.simple-send-form textarea { min-height: 190px; }
.simple-send-form .primary { min-height: 44px; }
.send-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .75fr); gap: 14px; align-items: start; }
.notification-preview { position: sticky; top: 18px; display: grid; gap: 16px; }
.preview-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-3);
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.windows-toast {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.toast-app { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; color: var(--text-2); font-size: .78rem; }
.toast-app time { color: var(--text-3); font-size: .72rem; }
.windows-toast > strong { overflow-wrap: anywhere; font-weight: 600; font-size: .86rem; }
.windows-toast > p { margin: 0; color: var(--text-2); overflow-wrap: anywhere; line-height: 1.45; font-size: .8rem; }
.preview-help { margin: 0; font-size: .78rem; }

/* ——— devices ——— */
.device-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.device-toolbar label { flex: 1; }
.device-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-card { display: grid; gap: 14px; transition: border-color 0.2s ease; }
.device-card:hover { border-color: var(--line-strong); }
.device-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.device-heading strong { min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 1rem; }
.state-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: color-mix(in srgb, var(--text-3) 16%, transparent);
  font-size: .72rem;
  font-weight: 600;
}
.state-active { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 14%, transparent); }
.state-provider_invalid, .state-ciphertext_corrupt { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.state-deactivated { color: var(--c-err); background: color-mix(in srgb, var(--c-err) 14%, transparent); }
.device-fields { display: grid; grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr); gap: 7px 13px; margin: 0; }
.device-more > summary { width: fit-content; padding: 4px 0; cursor: pointer; color: var(--accent-text); font-size: .84rem; font-weight: 600; list-style: none; }
.device-more > summary::-webkit-details-marker { display: none; }
.device-more > summary::after { content: ' ▾'; }
.device-more[open] > summary { margin-bottom: 10px; }
.device-more[open] > summary::after { content: ' ▴'; }
.device-fields dt { color: var(--text-3); font-size: .8rem; }
.device-fields dd { margin: 0; overflow-wrap: anywhere; font: .75rem var(--font-mono); line-height: 1.6; }
.pager { display: flex; max-width: 100%; min-width: 0; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ——— catalog ——— */
.catalog-layout { display: grid; width: 100%; max-width: 100%; min-width: 0; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr); gap: 14px; align-items: start; }
.catalog-browser { max-width: 100%; min-width: 0; padding: 10px; }
.catalog-list { display: grid; gap: 5px; margin-bottom: 10px; }
.catalog-item {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 9px;
  overflow: hidden;
  border-color: transparent;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
}
.catalog-item:hover { border-color: transparent; background: var(--hover); transform: none; box-shadow: none; }
.catalog-item-media { display: grid; width: 70px; height: 58px; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--color-neutral-900); }
.catalog-item-media img { width: 100%; height: 100%; object-fit: cover; }
.catalog-thumb-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: var(--text-3); background: var(--surface-raised); }
.catalog-thumb-fallback svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.catalog-item-copy { display: grid; min-width: 0; gap: 4px; }
.catalog-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.catalog-item-copy small { overflow: hidden; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.catalog-insight { display: grid; max-width: 100%; min-width: 0; justify-items: start; min-height: 220px; align-content: start; }
.catalog-insight-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-2);
  background: var(--surface-raised);
}
.catalog-insight h3 { font-size: 1.05rem; }
.catalog-insight .ghost { margin-top: auto; }

/* ——— dialogs ——— */
.window-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}
.window-dialog::backdrop { background: rgba(4, 7, 13, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: backdrop-enter 160ms ease both; }
.window-dialog[open] { animation: rise-in .28s cubic-bezier(.2, .75, .2, 1) both; }
.dialog-window { display: grid; max-height: calc(100dvh - 30px); grid-template-rows: auto minmax(0, 1fr); }
.dialog-titlebar { display: flex; min-height: 52px; align-items: center; justify-content: space-between; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); }
.dialog-titlebar > div { display: flex; align-items: center; gap: 10px; }
.dialog-titlebar strong { font-weight: 650; }
.window-close { display: grid; place-items: center; width: 40px; min-height: 34px; padding: 0; border-color: transparent; background: transparent; color: var(--text-3); }
.window-close:hover { border-color: transparent !important; color: var(--c-err); background: color-mix(in srgb, var(--c-err) 12%, transparent) !important; }
.window-close svg { width: 17px; height: 17px; }
.catalog-form { display: grid; gap: 18px; overflow-y: auto; padding: 20px; }
.catalog-preview-shell { display: grid; min-height: 210px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--color-neutral-900); }
.catalog-preview { width: 100%; height: 250px; object-fit: cover; }
.catalog-preview-empty { color: var(--text-3); font-weight: 500; }

/* ——— banners ——— */
.banner-master-control { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; }
.banner-master-control p { margin: 3px 0 0; }
.banner-master-control strong { font-weight: 600; font-size: .95rem; }
.toggle-control { position: relative; display: inline-flex; flex: none; align-items: center; gap: 9px; cursor: pointer; }
.toggle-control input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.toggle-control > span {
  position: relative;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-neutral-800);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.toggle-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  content: "";
  transition: transform 160ms cubic-bezier(.2, .75, .2, 1), background-color 160ms ease;
}
.toggle-control input:checked + span { background: var(--accent); box-shadow: none; }
.toggle-control input:checked + span::after { background: #fff; transform: translateX(16px); }
.toggle-control input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle-control b { min-width: 78px; font-size: .78rem; font-weight: 550; }
.compact-toggle b { display: none; }
.compact-toggle > span { width: 34px; height: 20px; }
.compact-toggle > span::after { width: 14px; height: 14px; }
.compact-toggle input:checked + span::after { transform: translateX(14px); }

.banner-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr); gap: 14px; align-items: start; }
.banner-browser { padding: 8px 12px; overflow: hidden; }
.banner-table-heading, .banner-row { display: grid; grid-template-columns: minmax(230px, 1.5fr) minmax(120px, .65fr) 74px 66px 96px; gap: 12px; align-items: center; }
.banner-table-heading {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: .67rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.banner-list { display: grid; }
.banner-row { padding: 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.banner-row:last-child { border-bottom: 0; }
.banner-row:hover { background: var(--hover); }
.banner-identity { display: grid; min-width: 0; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 12px; }
.banner-identity img { width: 74px; aspect-ratio: 12 / 5; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--color-neutral-900); }
.banner-identity > div { display: grid; min-width: 0; gap: 2px; }
.banner-identity strong, .banner-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-identity strong { font-weight: 600; }
.banner-identity small { color: var(--text-3); font-size: .78rem; }
.banner-cell { overflow-wrap: anywhere; font-size: .8rem; }
.banner-edit { min-height: 32px; padding: 6px 10px; font-size: .78rem; }
.banner-empty { padding: 24px 12px; text-align: center; }
/* Разделы приложения. Сверху «Где менять» — все ЖК или один; ниже строки
   разделов под тонкой линией: название, что действует, переключатель
   режима, значки ЖК со своим режимом. Полоска слева — раздел закрыт
   (жёлтая — техработы, красная — скрыт) там, где выбрано. Карточки «Ролей»
   остаются карточками (.app-section). */
.app-section-list { display: grid; gap: 14px; }
.app-section { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.app-section-scope { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-top: 2px solid var(--accent); background: var(--surface); }
.app-section-scope-field { max-width: 620px; }
.app-section-scope-field select { min-height: 46px; font-size: 1rem; }
.app-section-scope-hint { max-width: 96ch; margin: 0; color: var(--text-2); font-size: .88rem; line-height: 1.6; }
.app-section-scope-name { color: var(--text); font-weight: 500; }
.app-section-scope-hint .tone-hidden { color: var(--c-err); font-weight: 500; }
.app-section-scope-hint .tone-maintenance { color: var(--c-warn); font-weight: 500; }
.app-section-scope-other > summary { width: fit-content; cursor: pointer; color: var(--text-3); font-size: .8rem; }
.app-section-scope-add { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; max-width: 760px; margin-top: 10px; }
#app-section-scope-uid { font-family: var(--font-mono); }
.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  letter-spacing: 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-text) 45%, transparent);
  text-transform: none;
  text-underline-offset: 3px;
}
.link-button:not(:disabled):hover { border: 0; background: none; color: var(--text); }
#app-section-list { gap: 0; border-top: 1px solid var(--line); }
.mode-row { display: grid; gap: 10px; padding: 14px 0 14px 16px; border-bottom: 1px solid var(--line); box-shadow: inset 2px 0 0 transparent; }
.mode-row[data-mode="maintenance"] { box-shadow: inset 2px 0 0 var(--c-warn); }
.mode-row[data-mode="hidden"] { box-shadow: inset 2px 0 0 var(--c-err); }
.mode-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.mode-row-copy { display: grid; min-width: 0; gap: 3px; }
.mode-row-copy h3 { margin: 0; font-size: 1rem; }
.mode-row-note { margin: 0; color: var(--text-3); font-size: .78rem; }
.mode-row-own .mode-row-note { color: var(--accent-text); }
.mode-switch { display: inline-flex; flex: none; border: 1px solid var(--line-strong); }
.mode-switch button {
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-radius: 0;
  background: none;
  color: var(--text-3);
  font-size: .7rem;
  letter-spacing: .08em;
}
.mode-switch button:first-child { border-left: 0; }
.mode-switch button:not(:disabled):hover { border-color: var(--line-strong); background: var(--hover); color: var(--text); }
.mode-switch button:not(:disabled):active { transform: none; }
/* Только закрытое в цвете: «Работает» и «Как везде» — обычное, тихое. */
.mode-switch button[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 11%, transparent); }
.mode-switch button[data-mode="maintenance"][aria-pressed="true"] { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 15%, transparent); }
.mode-switch button[data-mode="hidden"][aria-pressed="true"] { color: var(--c-err); background: color-mix(in srgb, var(--c-err) 15%, transparent); }
.mode-row-objects { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-chip { display: inline-flex; max-width: 100%; border: 1px solid var(--line-strong); }
.mode-chip[data-mode="maintenance"] { border-color: color-mix(in srgb, var(--c-warn) 45%, transparent); }
.mode-chip[data-mode="hidden"] { border-color: color-mix(in srgb, var(--c-err) 45%, transparent); }
.mode-chip button {
  min-width: 0;
  min-height: 26px;
  padding: 2px 9px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}
.mode-chip button:not(:disabled):hover { border-color: transparent; background: var(--hover); color: var(--text); }
.mode-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-chip-name b { color: var(--text); font-weight: 500; }
.mode-chip .mode-chip-remove { flex: none; border-left: 1px solid var(--line); color: var(--text-3); }
.mode-row-confirm { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--c-err) 40%, transparent); background: color-mix(in srgb, var(--c-err) 8%, transparent); }
.mode-row-confirm p { max-width: 90ch; margin: 0; font-size: .86rem; }
.app-controls { display: grid; margin: 0 0 0 16px; padding: 0 0 0 14px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.app-controls > summary { padding: 10px 0; cursor: pointer; color: var(--text-3); font-size: .8rem; letter-spacing: .02em; }
.app-controls > .mode-row:last-child { border-bottom: 0; }
.app-controls .mode-row h3 { font-size: .92rem; }
.app-section-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.app-section-add input:first-of-type { font-family: var(--font-mono); }
.role-rules { display: grid; gap: 10px; }
.role-rule { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.role-rule-everywhere { background: var(--hover); }
.role-rule-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.role-rule-head small { color: var(--text-3); font: .7rem var(--font-mono); }
.role-rule-head button { margin-left: auto; }
.role-access { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.role-equipment { display: grid; gap: 6px; margin-left: 12px; color: var(--text-3); font-size: .85rem; }
.role-check { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--text); }
.role-check small { color: var(--text-3); font: .7rem var(--font-mono); }
.role-hidden { display: grid; gap: 6px; }
.role-hidden > summary { cursor: pointer; color: var(--text-3); font-size: .85rem; }
.app-page-list { display: grid; gap: 8px; }
.app-page-row { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: none; color: inherit; text-align: left; cursor: pointer; }
.app-page-row small { color: var(--text-3); }
.app-page-editor { margin-top: 16px; }
.app-page-form { display: grid; gap: 14px; }
.page-text-fields { display: grid; gap: 6px; }
.page-text-fields textarea { resize: vertical; }
.page-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.page-published { display: flex; align-items: center; gap: 8px; }
.page-audience-list { display: flex; flex-wrap: wrap; gap: 6px; }
.page-blocks { display: grid; gap: 10px; }
.page-blocks h4 { margin: 0; }
.page-block { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.page-block-head { display: flex; align-items: center; gap: 6px; cursor: grab; }
.page-block-head b { margin-right: auto; }
.page-block-dragging { opacity: .45; }
.page-block-drop { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.page-block-picked { border-color: var(--accent); background: var(--accent-soft); transition: background .3s ease; }
.page-image-preview { max-width: 100%; max-height: 220px; border-radius: var(--radius-md); object-fit: contain; }
.page-on-phone .ghost { border: 1px solid var(--line); }
/* «Новая страница»: шаблоны плиткой, у каждого — его страница в миниатюре,
   как её рисует приложение (светлая тема, src/constants/theme.ts). */
.app-page-templates { display: grid; gap: 12px; }
.app-page-templates > p { margin: 0; }
.page-templates-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-templates-head h3 { margin: 0; }
.page-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.page-template { display: grid; align-content: start; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: none; color: inherit; text-align: left; }
.page-template:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.page-template b { font-weight: 600; }
.page-template small { color: var(--text-3); line-height: 1.35; }
.page-thumb { display: grid; align-content: start; gap: 5px; height: 172px; overflow: hidden; padding: 12px 10px; border-radius: 14px; background: #fff; color: #0b0c0f; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; text-transform: none; letter-spacing: 0; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.page-thumb-title { font-size: 13px; font-weight: 800; line-height: 1.15; }
.page-thumb-heading { font-size: 10px; font-style: normal; font-weight: 750; }
.page-thumb-text { display: -webkit-box; overflow: hidden; color: #4b5059; font-size: 8.5px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.page-thumb-button { padding: 5px 6px; border-radius: 7px; background: #ff5a36; color: #fff; font-size: 8.5px; font-weight: 700; text-align: center; }
.page-thumb-image { height: 46px; border-radius: 7px; background: linear-gradient(135deg, #e8ecf2, #d6dde8); }
.page-thumb hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid #e3e6ea; }
.page-thumb-blank { display: grid; height: 100%; place-items: center; color: #b6bcc6; font-size: 34px; font-weight: 300; }
/* Тексты приложения: фильтры, карточки с превью и правка на трёх языках. */
.app-text-browser { display: grid; align-content: start; gap: 12px; min-width: 0; }
.app-text-browser > p { margin: 0; }
.app-text-filters { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr); align-items: end; gap: 10px; }
.app-text-toggles { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-3); font-size: .84rem; }
.app-text-toggles label { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; }
.app-text-toggles input { width: 18px; min-height: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); }
.app-text-list { display: grid; gap: 10px; }
.app-text-group { margin: 12px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: .92rem; font-weight: 650; }
.app-text-item { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
.app-text-head { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: center; gap: 16px; width: 100%; padding: 10px; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.app-text-head:not(:disabled):hover { background: var(--hover); }
.app-text-mini { min-width: 0; pointer-events: none; }
.app-text-mini .pv { font-size: 12px; }
.app-text-info { display: grid; align-content: center; gap: 7px; min-width: 0; }
.app-text-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.app-text-kind { padding: 3px 9px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-size: .74rem; font-weight: 600; }
.app-text-kind-a11y, .app-text-kind-unused { background: color-mix(in srgb, var(--text-3) 14%, transparent); color: var(--text-3); }
.app-text-kind-error { background: color-mix(in srgb, #FF6178 14%, transparent); color: var(--c-err); }
.app-text-changed { color: var(--c-warn); }
.app-text-where { overflow-wrap: anywhere; font-size: .86rem; line-height: 1.35; }
.app-text-open { color: var(--text-3); font-size: .78rem; }
.app-text-editor { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; gap: 18px; padding: 14px; border-top: 1px solid var(--line); background: var(--hover); }
.app-text-stage { display: grid; gap: 8px; min-width: 0; position: sticky; top: 12px; }
.app-text-stage .eyebrow { margin: 0; }
.app-text-stage .pv { font-size: 15px; }
.app-text-form { display: grid; align-content: start; gap: 10px; min-width: 0; }
.app-text-langs { display: inline-flex; justify-self: start; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.app-text-lang { position: relative; min-height: 32px; padding: 5px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-3); font: inherit; font-size: .84rem; cursor: pointer; }
.app-text-lang.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.app-text-lang.changed::after { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--c-warn); }
.app-text-field { display: grid; gap: 5px; }
.app-text-field > span { color: var(--text-3); font-size: .8rem; }
.app-text-field textarea { min-height: 64px; }
.app-text-hints { display: grid; gap: 4px; }
.app-text-hints .field-hint { margin: 0; overflow-wrap: anywhere; }
.app-text-keep { color: var(--accent-text); }
.app-text-places { color: var(--text-3); font-size: .82rem; }
.app-text-places summary { cursor: pointer; }
.app-text-places ul { margin: 6px 0 0; padding-left: 18px; }
.app-text-key { margin: 0; color: var(--text-3); font: .72rem var(--font-mono); overflow-wrap: anywhere; }
.app-text-help { margin-top: 14px; }
.app-text-help summary { cursor: pointer; font-weight: 600; }
.app-text-help p { max-width: 82ch; line-height: 1.6; }

/* ——— the phone («Тексты») ———
   The app itself (phone/, the app built for the browser with its demo home)
   in a drawn iPhone or Android: the status bar and the home bar are the
   frame's, the app fills the space between them. The device is laid out at
   the phone's own size and scaled to the column (--phone-scale, app.js);
   the editor of a picked text stands over it, next to the text. */
.phone-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); align-items: start; gap: 18px; }
.phone-column { position: sticky; top: 92px; min-width: 0; }
.phone-card { display: grid; gap: 12px; }
.phone-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.segmented button { min-height: 30px; padding: 4px 8px; border: 0; background: none; color: var(--text-3); font-size: .74rem; letter-spacing: .04em; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }
.phone-edit-toggle { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); font-size: .74rem; letter-spacing: .04em; }
.phone-edit-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.phone-stage { position: relative; justify-self: center; }
.phone-device {
  --bezel: 11px;
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--phone-w) + 2 * var(--bezel));
  height: calc(var(--phone-h) + 2 * var(--bezel));
  padding: var(--bezel);
  border-radius: var(--phone-radius);
  background: #17181b;
  box-shadow: inset 0 0 0 2px #3b3c41, 0 0 0 1px rgba(255, 255, 255, 0.07), 0 40px 80px -40px rgba(0, 0, 0, 0.95);
  transform: scale(var(--phone-scale, 1));
  transform-origin: 0 0;
}
.phone-device[data-device="iphone"] { --phone-w: 393px; --phone-h: 852px; --phone-top: 54px; --phone-bottom: 34px; --phone-radius: 64px; }
.phone-device[data-device="android"] { --bezel: 9px; --phone-w: 412px; --phone-h: 915px; --phone-top: 34px; --phone-bottom: 24px; --phone-radius: 42px; }
/* The app's own backgrounds and text (src/constants/theme.ts). */
.phone-device[data-app-theme="light"] { --phone-bg: #ffffff; --phone-ink: #0b0c0f; }
.phone-device[data-app-theme="dark"] { --phone-bg: #0b0c0f; --phone-ink: #f4f6fa; }
.phone-screen { position: relative; width: var(--phone-w); height: var(--phone-h); overflow: hidden; border-radius: calc(var(--phone-radius) - var(--bezel)); background: var(--phone-bg); color: var(--phone-ink); }
.phone-statusbar { position: absolute; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; height: var(--phone-top); padding: 4px 34px 0 46px; font: 600 17px/1 -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; letter-spacing: -0.01em; }
.phone-device[data-device="android"] .phone-statusbar { padding: 0 22px; font: 500 14px/1 Roboto, "Segoe UI", sans-serif; }
.phone-camera { position: absolute; top: 11px; left: 50%; width: 124px; height: 36px; margin-left: -62px; border-radius: 18px; background: #000; }
.phone-device[data-device="android"] .phone-camera { top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; }
.phone-signal { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.phone-signal i { width: 3px; border-radius: 1px; background: currentColor; }
.phone-signal i:nth-child(1) { height: 4px; }
.phone-signal i:nth-child(2) { height: 6px; }
.phone-signal i:nth-child(3) { height: 9px; }
.phone-signal i:nth-child(4) { height: 12px; }
.phone-signal b { position: relative; width: 24px; height: 12px; margin-left: 6px; border: 1.5px solid currentColor; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--phone-bg); background: currentColor; opacity: .9; }
.phone-signal b::after { position: absolute; top: 3px; right: -4px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; content: ""; background: currentColor; }
.phone-frame { position: absolute; top: var(--phone-top); left: 0; display: block; width: 100%; height: calc(var(--phone-h) - var(--phone-top) - var(--phone-bottom)); border: 0; background: var(--phone-bg); }
.phone-homebar { position: absolute; right: 0; bottom: 0; left: 0; height: var(--phone-bottom); }
.phone-homebar::after { position: absolute; bottom: 9px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; content: ""; background: var(--phone-ink); }
.phone-device[data-device="android"] .phone-homebar::after { width: 108px; height: 4px; margin-left: -54px; opacity: .7; }
.phone-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; background: var(--phone-bg); color: #8a8c90; font: 500 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
.phone-loading[hidden] { display: none; }
.phone-foot { display: flex; align-items: center; gap: 8px; }
.phone-foot .ghost { min-height: 34px; border: 1px solid var(--line); }
.phone-where { display: grid; flex: 1; gap: 3px; min-width: 0; }
.phone-where .eyebrow { margin: 0; }
.phone-where b { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.phone-hint { margin: 0; }
.phone-editor { position: absolute; z-index: 5; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: rgba(5, 6, 8, 0.97); box-shadow: var(--shadow-lg); }
.phone-editor[hidden] { display: none; }
.phone-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phone-editor-head .ghost { min-height: 30px; margin-left: auto; padding: 2px 10px; }
.phone-editor textarea { min-height: 76px; }
.phone-editor .field-hint { margin: 0; }
.phone-choices { display: grid; gap: 6px; }
.phone-choices button { display: grid; gap: 2px; padding: 8px 10px; text-align: left; }
.phone-choices button small { color: var(--text-3); font-size: .74rem; }

/* Превью текста в приложении: его тёмная тема (src/constants/theme.ts, Colors.dark),
   цвета и шрифты; размеры в em, чтобы маленькая карточка и большое превью были одним. */
.pv {
  --pv-bg: #0B0C0F; --pv-surface: #15171C; --pv-muted: #1A1D23; --pv-border: #2A2E36;
  --pv-text: #F7F7F3; --pv-secondary: #A6ABB5; --pv-tertiary: #858C98;
  --pv-accent: #FF5A36; --pv-accent-readable: #FF7658; --pv-accent-soft: #2E1915; --pv-on-accent: #111216;
  --pv-danger: #FF6178; --pv-warning: #F5AD48;
  display: grid; align-content: start; gap: .65em; padding: 1.1em; border: 1px solid #1F2229; border-radius: 1.3em;
  background: var(--pv-bg); color: var(--pv-text); font: 600 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  letter-spacing: 0; overflow-wrap: anywhere; text-align: left; color-scheme: dark;
}
.pv-var { border-bottom: 1.5px dashed currentColor; color: var(--pv-accent-readable); }
.pv-button-box .pv-var, .pv-tour-next .pv-var { color: inherit; }
.pv-skeleton { width: 55%; height: .75em; border-radius: 999px; background: var(--pv-muted); }
.pv-skeleton-wide { width: 85%; }
.pv-topbar { display: flex; }
.pv-round { display: inline-grid; place-items: center; width: 2.4em; height: 2.4em; border: 1px solid var(--pv-border); border-radius: 50%; font-size: 1em; line-height: 1; }
.pv-title-text { font-size: 2em; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.pv-heading-text { font-size: 1.25em; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.pv-section-text { font-size: 1.5em; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.pv-button-box { display: grid; place-items: center; min-height: 3.4em; padding: .5em 1.4em; border-radius: .9em; background: var(--pv-accent); color: var(--pv-on-accent); font-size: 1.05em; font-weight: 800; line-height: 1.25; text-align: center; }
.pv-button-muted { background: var(--pv-muted); color: var(--pv-text); }
.pv-link-text { color: var(--pv-accent-readable); font-size: .9em; font-weight: 800; }
.pv-tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3em; padding-top: .7em; border-top: 1px solid var(--pv-border); }
.pv-tab { display: grid; justify-items: center; gap: .35em; color: var(--pv-tertiary); font-size: .72em; font-weight: 700; text-align: center; }
.pv-tab-icon { width: 1.7em; height: 1.7em; border-radius: .5em; background: currentColor; opacity: .75; }
.pv-tab-active { color: var(--pv-accent); }
.pv-tab-skeleton { width: 80%; height: .7em; }
.pv-options { display: flex; flex-wrap: wrap; gap: .5em; }
.pv-chip { padding: .5em 1em; border: 1px solid var(--pv-border); border-radius: 999px; background: var(--pv-surface); font-size: .88em; font-weight: 800; }
.pv-chip-active { border-color: color-mix(in srgb, var(--pv-accent) 60%, transparent); background: var(--pv-accent-soft); color: var(--pv-accent-readable); }
.pv-chip-blank { width: 5em; }
.pv-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85em; padding: .85em 1em; border: 1px solid var(--pv-border); border-radius: 1.2em; background: var(--pv-surface); }
.pv-row-icon { width: 2.4em; height: 2.4em; border-radius: .75em; background: radial-gradient(circle, var(--pv-accent) 0 .42em, var(--pv-accent-soft) .44em); }
.pv-row-copy { display: grid; gap: .3em; min-width: 0; }
.pv-row-title { font-size: 1.06em; font-weight: 700; }
.pv-row-subtitle { color: var(--pv-secondary); font-size: .82em; }
.pv-chevron { color: var(--pv-tertiary); font-size: 1.35em; line-height: 1; }
.pv-label-text { color: var(--pv-secondary); font-size: .88em; font-weight: 800; }
.pv-input { min-height: 3em; padding: .8em 1em; border: 1px solid var(--pv-border); border-radius: .9em; background: var(--pv-muted); }
.pv-input-placeholder { color: var(--pv-tertiary); font-size: 1.06em; }
.pv-caption-text { color: var(--pv-secondary); font-size: .82em; font-weight: 700; }
.pv-text-text { font-size: 1.06em; }
.pv-dim { opacity: .55; }
.pv-notice-box, .pv-error-box { display: flex; align-items: flex-start; gap: .55em; font-size: .85em; font-weight: 700; }
.pv-notice-box { padding: .8em .9em; border: 1px solid var(--pv-border); border-radius: .9em; background: var(--pv-surface); }
.pv-error-box { color: var(--pv-danger); }
.pv-sign { display: inline-grid; flex: none; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--pv-warning); color: var(--pv-bg); font-size: .85em; font-weight: 900; }
.pv-error-box .pv-sign { background: var(--pv-danger); }
.pv-empty-box { display: grid; justify-items: center; gap: .6em; padding: .9em 0; text-align: center; }
.pv-empty-box .pv-skeleton { justify-self: center; }
.pv-empty-icon { width: 3.4em; height: 3.4em; border-radius: 50%; background: var(--pv-muted); }
.pv-empty-title { font-size: 1.25em; font-weight: 800; }
.pv-empty-text { color: var(--pv-secondary); font-size: .92em; }
.pv-alert { display: grid; justify-items: center; gap: .5em; width: min(100%, 17em); margin: .4em auto; padding: 1.1em 1em 0; border-radius: 1em; background: #2C2C2E; text-align: center; }
.pv-alert .pv-skeleton { background: #3A3A3C; }
.pv-alert-title { font-size: 1.02em; font-weight: 700; }
.pv-alert-text { color: #D1D1D6; font-size: .82em; font-weight: 500; }
.pv-alert-button { justify-self: stretch; margin-top: .4em; padding: .7em 0; border-top: 1px solid #3A3A3C; color: #0A84FF; font-weight: 600; }
.pv-tour { display: grid; gap: .55em; padding: 1.05em; border: 1px solid var(--pv-border); border-radius: 1.2em; background: var(--pv-surface); box-shadow: 0 .7em 1.8em rgba(0, 0, 0, .5); }
.pv-tour-title { font-size: 1.12em; font-weight: 800; }
.pv-tour-text { color: var(--pv-secondary); font-size: .92em; }
.pv-tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .3em; }
.pv-dots { color: var(--pv-tertiary); font-size: .7em; letter-spacing: .25em; }
.pv-tour-next { padding: .5em 1.1em; border-radius: 999px; background: var(--pv-accent); color: var(--pv-on-accent); font-size: .85em; font-weight: 800; }
.pv-push { display: grid; gap: .35em; padding: .8em .9em; border-radius: 1.2em; background: rgba(58, 58, 64, .95); }
.pv-push-head { display: flex; align-items: center; gap: .5em; color: #D1D1D6; font-size: .76em; font-weight: 600; }
.pv-push-icon { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: .45em; background: var(--pv-accent); color: var(--pv-on-accent); font-weight: 900; }
.pv-push-time { margin-left: auto; }
.pv-push-text { font-size: .92em; }
.pv-a11y-box { display: grid; gap: .4em; padding: .85em .9em; border: 1px dashed var(--pv-border); border-radius: .9em; }
.pv-note { color: var(--pv-tertiary); font-size: .78em; font-weight: 700; }
.pv-a11y-text { font-style: italic; }
.object-directory { display: grid; align-content: start; gap: 14px; min-width: 0; }
.object-directory-list { display: grid; gap: 10px; }
.object-directory-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.object-directory-row > div { display: grid; gap: 4px; min-width: 0; }
.object-directory-row h3, .object-directory-row p { margin: 0; overflow-wrap: anywhere; }
.object-directory-row code { color: var(--text-3); font: .78rem var(--font-mono); overflow-wrap: anywhere; user-select: all; }
.object-directory-row small { font-size: .74rem; }
.object-directory-empty { margin: 0; }
.object-directory-source { margin: 0; overflow-wrap: anywhere; }
.object-directory-source-error { color: var(--c-err); }
.object-directory-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.feedback-browser { display: grid; gap: 10px; align-content: start; min-width: 0; }
.feedback-browser > p { margin: 0; }
.feedback-list { display: grid; gap: 10px; }
.feedback-card { display: grid; gap: 10px; }
.feedback-author { margin: 0; overflow-wrap: anywhere; }
.feedback-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.feedback-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-photos img { display: block; width: 112px; height: 112px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); }
.feedback-video { display: block; width: 100%; max-width: 420px; max-height: 360px; border-radius: var(--radius-md); border: 1px solid var(--line); background: #000; }
.feedback-answer { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 12px; align-items: start; padding-top: 10px; border-top: 1px solid var(--line); }
.feedback-answer label > span:first-child { display: block; margin-bottom: 5px; color: var(--text-3); font-size: .78rem; }
.feedback-answer .checkbox-field { grid-column: 1 / -1; }
.feedback-status-new { color: var(--c-err); background: color-mix(in srgb, var(--c-err) 14%, transparent); }
.feedback-status-reviewing, .feedback-status-in_progress { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.feedback-status-done { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 14%, transparent); }
.app-haptics { display: grid; gap: 16px; align-content: start; }
.app-haptics-events { display: grid; gap: 8px; }
.app-haptics-event { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, 170px) minmax(112px, 170px); align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.app-haptics-event span { font-weight: 550; }
.app-haptics-head { border-top: 0; padding-bottom: 0; }
.app-haptics-head span { color: var(--text-3); font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.app-haptics-event select:disabled, .app-haptics select:disabled { opacity: .55; }
.banner-insight { display: grid; align-content: start; min-height: 260px; }
.banner-insight h3 { margin-top: 0; font-size: 1.05rem; }
.banner-insight p { line-height: 1.6; }
.banner-form { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; padding: 20px; }
/* Где показывать баннер или контакт поддержки: отмеченные ЖК и строка добавления нового. */
.banner-objects-field { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.banner-object-search { width: 100%; }
.banner-locales { display: grid; gap: 10px; }
.banner-locale { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.banner-locale-preview { width: 96px; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-neutral-900); }
.banner-locale-preview.is-empty { visibility: hidden; }
.banner-object-options { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; }
.banner-object-options:empty { display: none; }
.banner-object-option { max-width: 100%; }
.banner-object-option input { flex: none; width: 18px; min-height: 18px; margin: 0; accent-color: var(--accent); }
.banner-object-option span { display: grid; min-width: 0; gap: 1px; }
.banner-object-option b, .banner-object-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-object-option b { font-weight: 550; }
.banner-object-option small { color: var(--text-3); font: .7rem var(--font-mono); }
.banner-object-option .banner-object-address { font: .72rem var(--font-body); }
.banner-object-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
#banner-object-uid { font-family: var(--font-mono); }
.banner-identity small.banner-audience-targeted { color: var(--accent-text); }
.banner-preview-shell { position: relative; display: grid; width: 100%; min-width: 0; flex: none; aspect-ratio: 12 / 5; max-height: 360px; place-items: center; overflow: hidden; contain: layout paint; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--color-neutral-900); }
.banner-preview { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; }
.banner-preview-empty { color: var(--text-3); font-size: 1.7rem; font-weight: 500; letter-spacing: .05em; }
.field-hint { color: var(--text-3); font-size: .72rem; line-height: 1.4; }
.checkbox-field > span:last-child { display: flex; min-height: 38px; align-items: center; gap: 9px; }
.checkbox-field input { width: 18px; min-height: 18px; accent-color: var(--accent); }

/* ——— logs ——— */
.live-actions { display: flex; align-items: center; gap: 9px; }
.audit-list { display: grid; gap: 0; padding: 8px 20px; overflow: hidden; font-family: var(--font-mono); }
.audit-event {
  display: grid;
  grid-template-columns: minmax(125px, .65fr) minmax(140px, 1fr) minmax(0, 2fr);
  gap: 14px;
  padding: 12px 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.audit-event:last-child { border-bottom: 0; }
.audit-event time, .audit-event small { color: var(--text-3); font-size: .76rem; font-variant-numeric: tabular-nums; }
.audit-details { overflow: hidden; color: var(--text-2); font: .74rem var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.audit-heading { margin-top: 8px; }
.caddy-log-card { display: grid; gap: 14px; padding: 16px 20px; }
.caddy-log-card p { margin: 5px 0 0; }
.caddy-log-list {
  height: min(54vh, 600px);
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  font-family: var(--font-mono);
}
.caddy-log-list:empty { height: 96px; min-height: 96px; }
.caddy-log-row {
  display: grid;
  min-width: 780px;
  grid-template-columns: 82px 58px minmax(180px, 1fr) 50px minmax(230px, auto);
  gap: 10px;
  align-items: baseline;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: .74rem;
  line-height: 1.7;
}
.caddy-log-row time, .caddy-log-row small { color: var(--text-3); font-variant-numeric: tabular-nums; }
.caddy-log-row code { overflow: hidden; color: var(--accent-text); text-overflow: ellipsis; white-space: nowrap; }
.caddy-log-row b { color: var(--c-ok); font-weight: 600; }
.caddy-log-row.status-4xx b { color: var(--c-warn); }
.caddy-log-row.status-5xx b { color: var(--c-err); }
.log-empty { display: block; padding: 18px; }

/* ——— notices / server ——— */
.notice {
  position: sticky;
  z-index: 20;
  top: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-md);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  box-shadow: var(--shadow-md);
  animation: rise-in .25s ease both;
}
.notice.bad {
  border-color: color-mix(in srgb, var(--c-err) 50%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--c-err) 16%, var(--surface-solid));
}
.warning-card { display: grid; max-width: 720px; gap: 15px; border-color: color-mix(in srgb, var(--c-warn) 32%, transparent); }
.maintenance-card { display: grid; max-width: 860px; gap: 18px; }
.maintenance-card .section-heading p { margin: 5px 0 0; }
.maintenance-card .pill.active { color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }

/* ——— log level chips + terminal rows ——— */
.log-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-filter-spacer { flex: 1; }
.log-chip {
  min-height: 0;
  padding: 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 550;
}
.log-chip.active { border-color: transparent; background: var(--accent-soft); color: var(--text); }
.log-line {
  display: grid;
  grid-template-columns: 128px 52px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  line-height: 1.7;
}
.log-line:last-child { border-bottom: 0; }
.log-line time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.log-line small { color: var(--color-neutral-600); font-size: .7rem; }
.log-level { font-weight: 600; }
.level-info { color: var(--c-ok); }
.level-warn { color: var(--c-warn); }
.level-error { color: var(--c-err); }
.log-message { overflow-wrap: anywhere; }

/* ——— app errors (internal/clienterror): red rows that open their details ——— */
.client-error-card { display: grid; gap: 12px; margin-bottom: 18px; padding: 18px 20px; }
.client-error-list { display: grid; font-family: var(--font-mono); }
.client-error-row { border-bottom: 1px solid var(--line); }
.client-error-row:last-child { border-bottom: 0; }
.client-error-row > summary {
  display: grid;
  grid-template-columns: 128px 92px minmax(0, 1fr);
  gap: 2px 16px;
  align-items: baseline;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
  color: var(--c-err);
  font-size: .78rem;
  line-height: 1.6;
}
.client-error-row > summary::-webkit-details-marker { display: none; }
.client-error-row time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.client-error-badge { width: fit-content; font-weight: 600; }
.client-error-fatal .client-error-badge { padding: 0 6px; border-radius: var(--radius-sm); color: #fff; background: var(--c-err); }
.client-error-message { overflow-wrap: anywhere; }
.client-error-meta { grid-column: 3; color: var(--text-3); font-size: .7rem; overflow-wrap: anywhere; }
.client-error-details { display: grid; gap: 10px; padding: 2px 0 14px; font-size: .74rem; }
.client-error-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 14px; margin: 0; }
.client-error-fields dt { color: var(--text-3); }
.client-error-fields dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.client-error-stack {
  max-height: 320px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border-radius: var(--radius-md);
  color: var(--text);
  background: color-mix(in srgb, var(--c-err) 9%, transparent);
  font-size: .72rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.client-error-empty { padding: 10px 0; }
.client-error-steps-title { color: var(--text); font-weight: 600; }
.client-error-steps { display: grid; gap: 2px; margin: 0; padding-left: 22px; }
.client-error-steps li { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 10px; }
.client-error-steps time { color: var(--text-3); }
.client-error-step-kind { color: var(--text-3); }
.client-error-step-text { overflow-wrap: anywhere; }
.client-error-steps li:last-child .client-error-step-text { color: var(--c-err); font-weight: 600; }

/* ——— recent events feed ——— */
.event-feed { display: grid; }
.event-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.event-row:last-child { border-bottom: 0; }
.event-row time { width: 46px; flex: none; color: var(--text-3); font-size: .76rem; font-variant-numeric: tabular-nums; }
.event-icon { display: grid; place-items: center; flex: none; color: var(--text-3); }
.event-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.event-message { min-width: 0; overflow-wrap: anywhere; }
.event-tag { margin-left: auto; flex: none; font-size: .74rem; }
.event-tag.level-info { color: var(--c-ok); }
.event-tag.level-warn { color: var(--c-warn); }
.event-tag.level-error { color: var(--c-err); }

/* ---------- Bitrix-каталог (вкладка «Каталог») ---------- */
.shop-tier-options { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.shop-tier-option, .banner-object-option { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.shop-tier-option:has(input:checked), .banner-object-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.shop-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 15px; align-items: start; }
.shop-category-list { display: grid; gap: 2px; max-height: 520px; overflow-y: auto; }
.shop-category-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 12px; cursor: pointer; text-align: left; color: var(--text); border: 0; border-radius: var(--radius-sm); background: transparent; }
.shop-category-row:not(:disabled):hover { background: var(--hover); }
.shop-category-row.selected { background: var(--accent-soft); }
.shop-category-row small { flex-shrink: 0; color: var(--text-3); }
.shop-category-caret { width: 14px; flex-shrink: 0; color: var(--text-3); }
.shop-category-name { flex: 1; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.shop-product-list { display: grid; gap: 8px; }
.shop-product-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.shop-product-identity { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: center; }
.shop-product-effective { display: grid; gap: 2px; text-align: right; }
.shop-product-override { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shop-product-override input { width: 110px; }
.shop-visibility-toggle { justify-self: center; }
.shop-order-list { display: grid; gap: 10px; }
.shop-order-card { display: grid; gap: 10px; }
.shop-order-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.shop-order-heading time, .shop-order-heading small { margin-left: auto; }
.shop-order-items { display: grid; gap: 4px; }
.shop-order-item { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.shop-order-item:last-child { border-bottom: 0; }
.shop-orders-filter { display: inline-flex; align-items: center; gap: 8px; }

/* «Бэкапы» */
.backup-list { display: grid; gap: 10px; }
.backup-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.backup-row-copy { display: grid; gap: 4px; min-width: 0; }
.backup-row-copy .muted { overflow-wrap: anywhere; }
.backup-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-restore-body { display: grid; gap: 12px; padding: 18px; }
.backup-restore-summary { margin: 0; font-weight: 600; }
.backup-restore-effects { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; color: var(--text-3); }
.backup-error { margin: 0; color: var(--c-err); }

/* «Статистика» */
.stats-series { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; }
.stats-bar { position: relative; flex: 1 1 0; min-width: 2px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 0; background: var(--accent); overflow: hidden; }
.stats-bar-new { width: 100%; background: color-mix(in srgb, var(--accent) 45%, var(--text)); }
.stats-series-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-3); font-size: .78rem; font-variant-numeric: tabular-nums; }
.stats-breakdowns { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stats-breakdown { display: grid; gap: 10px; align-content: start; }
.stats-breakdown h3 { margin: 0; }
.stats-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.stats-row-label { overflow-wrap: anywhere; }
.stats-row-value { color: var(--text-3); font-variant-numeric: tabular-nums; }
.stats-row-track { grid-column: 1 / -1; height: 6px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--text) 9%, transparent); overflow: hidden; }
.stats-row-fill { height: 100%; border-radius: var(--radius-sm); background: var(--accent); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes boot-reveal { to { visibility: visible; } }
@keyframes cursor-blink { 50% { opacity: 0; } }

@media (max-width: 1100px) {
  .overview-columns { grid-template-columns: minmax(0, 1fr); }
  .phone-layout { grid-template-columns: minmax(0, 1fr); }
  .phone-column { position: static; justify-self: center; width: min(420px, 100%); }
}

@media (max-width: 1040px) {
  .device-list { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .banner-layout { grid-template-columns: 1fr; }
  .catalog-insight { min-height: 0; }
  .catalog-insight-icon { margin-bottom: 12px; }
  .catalog-insight .ghost { margin-top: 8px; }
}

@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-product-row { grid-template-columns: 1fr; }
  .shop-product-effective { text-align: left; }
}

@media (max-width: 820px) {
  .app-text-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .app-text-search { grid-column: 1 / -1; }
  .app-text-head { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
  .app-text-editor { grid-template-columns: minmax(0, 1fr); }
  .app-text-stage { position: static; }
  .client-error-row > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .client-error-message, .client-error-meta { grid-column: 1 / -1; }
  .client-error-fields { grid-template-columns: minmax(0, 1fr); }
  .client-error-fields dd { margin-bottom: 6px; }
  .client-error-steps li { grid-template-columns: max-content minmax(0, 1fr); }
  .object-directory-row { grid-template-columns: minmax(0, 1fr); }
  .object-directory-row button { justify-self: start; }
  .app-section-add, .app-section-scope-add { grid-template-columns: minmax(0, 1fr); }
  .client-error-step-text { grid-column: 1 / -1; }

  /* On a phone the house stands above the login sheet and stays behind the
     content as one even shade. */
  .login-view { grid-template-columns: minmax(0, 1fr); align-content: end; justify-items: stretch; padding: 24px 12px max(14px, env(safe-area-inset-bottom)); }
  .login-view .scene-anchor { display: none; }
  .login-card { width: 100%; padding: 24px 20px 20px; }
  .login-foot { margin-left: 8px; }
  .scene-layer::after { background: var(--veil-strong); }

  /* On a phone the masthead keeps the brand; the sections leave their
     groups for one bar at the bottom. */
  .dashboard { min-height: 100dvh; }
  .masthead { position: static; padding-top: 14px; }
  .masthead-inner { min-height: 44px; }
  .masthead-stats, .nav-group-button, .nav-group::before { display: none; }
  .nav-group, .nav-menu { display: contents; }
  .nav-menu { visibility: visible; opacity: 1; }
  .content-frame { min-height: 100dvh; padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed;
    z-index: 50;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    display: flex;
    gap: 2px;
    padding: 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    box-shadow: var(--shadow-lg);
  }
  .tabs::-webkit-scrollbar { display: none; }
  /* Sixteen sections do not fit one row of a phone: the bar scrolls sideways
     and every tab keeps a readable label and a thumb-sized target. */
  .tab { flex: 0 0 auto; width: auto; min-width: 74px; min-height: 56px; grid-template-columns: 1fr; justify-items: center; align-content: center; padding: 5px 6px; gap: 4px; border-radius: 0; text-align: center; scroll-snap-align: center; }
  .tab svg { display: block; width: 20px; height: 20px; }
  .tab.active { background: var(--accent-soft); }
  .tab.active::after { top: auto; right: 18px; bottom: 0; left: 18px; width: auto; height: 2px; }
  .tab span { font-size: 11px; white-space: nowrap; }
  .tab-count { top: 4px; right: 8px; transform: none; }
  input, textarea, select { font-size: 16px; }
  .topbar { align-items: flex-start; margin-bottom: 20px; }
  .top-actions { gap: 6px; }
  .topbar-meta { display: none; }
  .send-workspace { grid-template-columns: 1fr; }
  .notification-preview { position: static; order: -1; }
  .device-toolbar { align-items: stretch; flex-direction: column; }
  .audit-event { grid-template-columns: 1fr; gap: 5px; }
  .audit-details { overflow-wrap: anywhere; white-space: normal; }
  .log-line { grid-template-columns: 96px 52px minmax(0, 1fr); }
  .log-line small { grid-column: 3; }
  .banner-table-heading { display: none; }
  .banner-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .banner-identity { grid-column: 1 / -1; }
  .banner-row .banner-cell:first-of-type { grid-column: 1; }
  .banner-edit { grid-column: 3; grid-row: 2; }
}

@media (max-width: 560px) {
  .feedback-answer { grid-template-columns: minmax(0, 1fr); }
  /* «Разделы»: переключатель режима во всю ширину под названием. */
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1 1 0; padding-inline: 4px; }
  .app-controls { margin-left: 8px; padding-left: 10px; }
  .app-text-filters { grid-template-columns: minmax(0, 1fr); }
  .app-text-head, .app-text-editor { grid-template-columns: minmax(0, 1fr); }
  .app-text-stage { position: static; }
  .feedback-photos img { width: 88px; height: 88px; }
  /* «Вибрация»: the moment on its own line, iPhone and Android under it. */
  .app-haptics-event { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; }
  .app-haptics-event > span:first-child { grid-column: 1 / -1; }
  .app-haptics-head > span:first-child { display: none; }
  .content-frame { padding-inline: 11px; }
  .topbar h1 { font-size: 1.7rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .metric { padding: 16px 0 4px; }
  .metric strong { font-size: 2rem; }
  .card { padding: 16px; }
  .overview-columns > .card { padding: 16px 0 0; }
  .overview-stage .scene-anchor { height: clamp(200px, 32vh, 280px); }
  .form-grid, .split-card, .delivery-transport { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .section-heading { align-items: flex-start; }
  .catalog-item { grid-template-columns: 58px minmax(0, 1fr); }
  .catalog-item-media { width: 58px; height: 52px; }
  .catalog-item > .state-badge { grid-column: 2; justify-self: start; }
  .window-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: var(--radius-xl); }
  .dialog-window { max-height: calc(100dvh - 14px); }
  .catalog-form { padding: 13px; }
  .catalog-preview-shell { min-height: 150px; }
  .catalog-preview { height: 190px; }
  .banner-master-control { align-items: flex-start; flex-direction: column; }
  .banner-row { grid-template-columns: minmax(0, 1fr) auto; }
  .banner-identity { grid-template-columns: 76px minmax(0, 1fr); }
  .banner-identity img { width: 76px; }
  .banner-row .banner-cell:first-of-type { grid-column: 1; }
  .banner-row .banner-cell:nth-of-type(2) { display: none; }
  .banner-edit { grid-column: 1; grid-row: 3; justify-self: start; }
  .compact-toggle { grid-column: 2; grid-row: 3; }
  .banner-form { padding: 13px; }
  .banner-object-add { grid-template-columns: 1fr; }
  .banner-locale { grid-template-columns: 72px minmax(0, 1fr); }
  .banner-locale-preview { width: 72px; }
  .banner-locale button { grid-column: 1 / -1; justify-self: start; }
  .banner-preview-empty { font-size: 1.2rem; }
  .caddy-log-list { min-height: 280px; }
  .log-line { grid-template-columns: auto minmax(0, 1fr); }
  .log-line .log-message, .log-line small { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
