/* «Warm Glass»: стеклянные панели над размытым фоном. Светлая тема — светло-серая комната, тёмная — тёплая комната ночью.
   Вторичный текст плотнее, чем в исходном промте (66/44%): при 44% подписи 12 px давали контраст ~2.7:1. */

:root {
  --ink: #2A2019;
  --ink-2: rgba(42, 32, 25, 0.76);   /* ≈ 6:1 на стекле */
  --ink-3: rgba(42, 32, 25, 0.66);   /* ≥ 4.5:1 — минимум WCAG AA для мелкого текста (проверено расчётом по слоям стекла) */
  --line: rgba(30, 30, 40, 0.09);
  /* нейтральное белое стекло под светло-серый фон (кремовое давало бежевый оттенок, особенно в мини-окне) */
  --glass: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-hl: rgba(255, 255, 255, 0.80);
  --card: rgba(255, 255, 255, 0.50);
  --card-hover: rgba(255, 255, 255, 0.68);
  --card-border: rgba(255, 255, 255, 0.50);
  --sheen: rgba(255, 255, 255, 0.38);
  --cursor-light: rgba(255, 255, 255, 0.30);
  --shadow: 0 30px 70px -30px rgba(50, 42, 36, 0.42);
  --shadow-lift: 0 42px 80px -28px rgba(50, 42, 36, 0.55);
  /* фирменный акцент — синие тона кита из логотипа */
  --accent-a: #1F6BC0;
  --accent-b: #2789E5;
  --accent: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(39, 137, 229, 0.16);
  --accent-text: #154F9E;
  /* сигнальные цвета мер — красно-оранжевые независимо от акцента */
  --danger: linear-gradient(135deg, #FF5A36, #FF9A45);
  --danger-ink: #2A1208;
  --danger-soft: rgba(255, 90, 54, 0.15);
  --danger-text: #B3361B;
  --warn-soft: rgba(255, 154, 69, 0.22);
  --warn-text: #94500C;
  --pos: #066C4A;                    /* темнее #07845A: на светлой пилюле 12.5 px давал ~3.7:1 */
  --pos-soft: rgba(7, 132, 90, 0.15);
  --cta: #1F1711;
  --cta-ink: #FBF4EC;
  --nav-active: #FFFFFF;
  --nav-active-ink: #2A2019;
  --link: #1A5FB4;

  /* светло-серая «комната»: те же формы, нейтральные тона, белый свет вместо лампы */
  --scene-wall-a: #F1F1F3;
  --scene-wall-b: #E6E6E9;
  --scene-wall-c: #D6D6DA;
  --scene-window-a: #FFFFFF;
  --scene-window-b: #F4F4F6;
  --scene-window-glow: rgba(255, 255, 255, 0.9);
  --scene-beam-a: #CFCFD4;
  --scene-beam-b: #DCDCE0;
  --scene-table-a: #D2D2D7;
  --scene-table-b: #C3C3C9;
  --scene-lamp: rgba(255, 255, 255, 0.85);
  --scene-lamp-2: rgba(255, 255, 255, 0.35);
  --scene-plant: rgba(196, 196, 202, 0.5);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #FBF4EC;
    --ink-2: rgba(251, 244, 236, 0.74);
    --ink-3: rgba(251, 244, 236, 0.58);
    --line: rgba(251, 244, 236, 0.10);
    --glass: rgba(34, 25, 19, 0.50);
    --glass-border: rgba(255, 236, 214, 0.12);
    --glass-hl: rgba(255, 236, 214, 0.16);
    --card: rgba(58, 44, 34, 0.46);
    --card-hover: rgba(72, 55, 42, 0.58);
    --card-border: rgba(255, 236, 214, 0.08);
    --sheen: rgba(255, 220, 180, 0.10);
    --cursor-light: rgba(255, 210, 160, 0.10);
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.75);
    --shadow-lift: 0 42px 80px -28px rgba(0, 0, 0, 0.85);
    --accent-soft: rgba(80, 160, 255, 0.22);
    --accent-text: #A9D2FA;
    --danger-soft: rgba(255, 110, 70, 0.18);
    --danger-text: #FFA588;
    --warn-soft: rgba(255, 154, 69, 0.18);
    --warn-text: #FFC08A;
    --pos: #34D399;
    --pos-soft: rgba(52, 211, 153, 0.15);
    --cta: #FBF4EC;
    --cta-ink: #1F1711;
    --nav-active: #FBF0E2;
    --nav-active-ink: #2A2019;
    --link: #8FC0FF;

    --scene-wall-a: #2B1F17;
    --scene-wall-b: #22170F;
    --scene-wall-c: #170F0A;
    --scene-window-a: #2E3448;
    --scene-window-b: #1E2233;
    --scene-window-glow: rgba(70, 82, 120, 0.25);
    --scene-beam-a: #2E1E12;
    --scene-beam-b: #43301F;
    --scene-table-a: #4B2F1B;
    --scene-table-b: #2A190D;
    --scene-lamp: rgba(255, 168, 82, 1);
    --scene-lamp-2: rgba(255, 120, 40, 0.42);
    --scene-plant: rgba(60, 72, 40, 0.5);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #FBF4EC;
  --ink-2: rgba(251, 244, 236, 0.74);
  --ink-3: rgba(251, 244, 236, 0.58);
  --line: rgba(251, 244, 236, 0.10);
  --glass: rgba(34, 25, 19, 0.50);
  --glass-border: rgba(255, 236, 214, 0.12);
  --glass-hl: rgba(255, 236, 214, 0.16);
  --card: rgba(58, 44, 34, 0.46);
  --card-hover: rgba(72, 55, 42, 0.58);
  --card-border: rgba(255, 236, 214, 0.08);
  --sheen: rgba(255, 220, 180, 0.10);
  --cursor-light: rgba(255, 210, 160, 0.10);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.75);
  --shadow-lift: 0 42px 80px -28px rgba(0, 0, 0, 0.85);
  --accent-soft: rgba(80, 160, 255, 0.22);
  --accent-text: #A9D2FA;
  --danger-soft: rgba(255, 110, 70, 0.18);
  --danger-text: #FFA588;
  --warn-soft: rgba(255, 154, 69, 0.18);
  --warn-text: #FFC08A;
  --pos: #34D399;
  --pos-soft: rgba(52, 211, 153, 0.15);
  --cta: #FBF4EC;
  --cta-ink: #1F1711;
  --nav-active: #FBF0E2;
  --nav-active-ink: #2A2019;
  --link: #8FC0FF;

  --scene-wall-a: #2B1F17;
  --scene-wall-b: #22170F;
  --scene-wall-c: #170F0A;
  --scene-window-a: #2E3448;
  --scene-window-b: #1E2233;
  --scene-window-glow: rgba(70, 82, 120, 0.25);
  --scene-beam-a: #2E1E12;
  --scene-beam-b: #43301F;
  --scene-table-a: #4B2F1B;
  --scene-table-b: #2A190D;
  --scene-lamp: rgba(255, 168, 82, 1);
  --scene-lamp-2: rgba(255, 120, 40, 0.42);
  --scene-plant: rgba(60, 72, 40, 0.5);

  color-scheme: dark;
}

/* ---------- база ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--scene-wall-b);
  color: var(--ink);
  font-family: "Geist", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* длинные слова («сельскохозяйственных») на узких экранах переносятся, а не обрезаются */
  overflow-wrap: break-word;
  hyphens: auto;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 2px; }

/* ---------- сцена: размытая тёплая комната ---------- */

.scene {
  position: fixed;
  inset: -80px;
  z-index: -1;
  overflow: hidden;
  filter: blur(36px);
  background: linear-gradient(180deg, var(--scene-wall-a) 0%, var(--scene-wall-b) 58%, var(--scene-wall-c) 100%);
  pointer-events: none;
}
.scene > div { position: absolute; }
.s-window {
  left: 9%; top: 14%; width: 28%; height: 52%;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--scene-window-a), var(--scene-window-b));
  box-shadow: 0 0 140px 50px var(--scene-window-glow);
}
.s-window::after { /* переплёт окна */
  content: ""; position: absolute; left: 48%; top: 0; bottom: 0; width: 4%;
  background: var(--scene-beam-b); opacity: .55;
}
.s-beam {
  left: -5%; right: -5%; top: 3%; height: 8%;
  background: linear-gradient(90deg, var(--scene-beam-a), var(--scene-beam-b) 45%, var(--scene-beam-a));
}
.s-table {
  left: 18%; bottom: -8%; width: 72%; height: 27%;
  border-radius: 48% 48% 0 0 / 22% 22% 0 0;
  background: linear-gradient(180deg, var(--scene-table-a), var(--scene-table-b));
}
.s-lamp {
  right: 9%; top: 18%; width: 34vmax; height: 34vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--scene-lamp) 0%, var(--scene-lamp-2) 38%, transparent 68%);
}
.s-plant {
  left: 54%; bottom: 16%; width: 13%; height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, var(--scene-plant), transparent 70%);
}

/* ---------- стекло ---------- */

.pane {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hl), var(--shadow);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px 22px;
  overflow: hidden;
  transition: transform .28s cubic-bezier(.2, .7, .2, 1), box-shadow .28s, background-color .28s;
}
.card::after { /* мягкий свет, который следует за курсором */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, -300px) var(--my, -300px), var(--cursor-light), transparent 62%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.card:hover::after { opacity: 1; }
.card.static:hover { transform: none; box-shadow: none; }

/* ---------- раскладка ---------- */

.app {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "dock main";
  gap: 18px;
  max-width: 1320px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 24px 26px;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 10px 9px 12px;
  border-radius: 999px;
  position: sticky; top: 14px; z-index: 5;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand b { display: block; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; line-height: 1.15; }
.brand small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.2; white-space: nowrap; }
.logo { display: block; flex: none; width: 52px; height: 52px; margin: -6px -4px -6px -6px; }
.logo img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(12, 69, 153, .22)); }
.tile {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

.command {
  flex: 1;
  max-width: 660px;
  margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  height: 52px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  transition: box-shadow .2s, background-color .2s;
}
/* нейтральная обводка: в мини-окне поле в фокусе всегда, оранжевое кольцо окрашивало всё окно */
.command:focus-within { background: var(--card-hover); box-shadow: 0 0 0 3px var(--line); }
.command input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 16px; height: 100%;
}
.command input::placeholder { color: var(--ink-3); }
.command input::-webkit-search-cancel-button { display: none; }
kbd {
  font: 500 12px/1 "Geist Mono", ui-monospace, monospace;
  padding: 5px 8px; border-radius: 999px;
  color: var(--ink-2); background: var(--line);
}

.orb {
  position: relative; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: conic-gradient(from 0deg, #0C4599, #2789E5, #A9D2FA, #1F6BC0, #0C4599);
  box-shadow: 0 0 18px rgba(39, 137, 229, .45);
  animation: spin 7s linear infinite;
}
.orb::after { /* блик */
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 55%);
}
.loading .orb { animation-duration: 1.1s; }
@keyframes spin { to { transform: rotate(360deg); } }

.round-btn {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  transition: background-color .2s, transform .2s;
}
.round-btn:hover { background: var(--card-hover); transform: translateY(-2px); }

/* Кнопка мини-окна: синяя пилюля с подписью и клавишей. Градиент темнее фирменного,
   чтобы белый текст держал контраст ≥ 4.5:1. */
.mini-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 8px 0 16px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #154F9E, #1F6BC0);
  color: #FFFFFF;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 24px -12px rgba(21, 79, 158, .75);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.mini-btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 16px 30px -12px rgba(21, 79, 158, .85); }
.mini-btn svg.i { width: 18px; height: 18px; }
.mini-btn kbd { background: rgba(255, 255, 255, .20); color: #FFFFFF; }

.dock {
  grid-area: dock;
  align-self: start;
  position: sticky; top: 100px;
  z-index: 6;  /* выше главной панели, иначе подсказки уходят под неё */
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  border-radius: 999px;
}
.dock-item {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.dock-item:hover { background: var(--card); color: var(--ink); }
.dock-item.active { background: var(--nav-active); color: var(--nav-active-ink); box-shadow: 0 6px 16px -8px rgba(70, 40, 15, .5); }
.dock-item::after { /* подсказка */
  content: attr(data-tip);
  position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translate(-4px, -50%);
  padding: 6px 12px; border-radius: 999px;
  white-space: nowrap; font-size: 12.5px; font-weight: 500;
  background: var(--cta); color: var(--cta-ink);
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.dock-item:hover::after, .dock-item:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.dock-logout { margin-top: 6px; }
.dock-logout::before { /* отделяет выход от разделов */
  content: ""; position: absolute; top: -8px; left: 12px; right: 12px; height: 1px; background: var(--line);
}

.main {
  grid-area: main;
  position: relative;
  min-width: 0;
  border-radius: 34px;
  padding: 26px;
}
.main::before { /* блик в левом верхнем углу */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(110% 55% at 0% 0%, var(--sheen), transparent 46%);
}
.main > * { position: relative; }

/* ---------- типографика ---------- */

.eyebrow {
  margin: 0 0 6px;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3);
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 32px; letter-spacing: -0.025em; line-height: 1.15; }
h2 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.25; }
h2.long { font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; }
h3 { font-size: 16px; letter-spacing: -0.01em; }
.label { font-size: 12.5px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
p { margin: 8px 0 0; }

.big-code {
  font-size: 44px; font-weight: 600;
  letter-spacing: -0.035em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 10px;
}
.big-code .minor { font-size: .5em; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-3); margin-left: .28em; }

.code-chip {
  display: inline-block; flex: none;
  min-width: 112px;
  font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}

/* ---------- пилюли мер ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap;
}
.pill.ban { background: var(--danger); color: var(--danger-ink); }
.pill.restriction { background: var(--danger-soft); color: var(--danger-text); }
.pill.permit { background: var(--warn-soft); color: var(--warn-text); }
.pill.ok { background: var(--pos-soft); color: var(--pos); }
.pill.doc { background: var(--accent-soft); color: var(--accent-text); }
.pill.neutral, .pill.other { background: var(--line); color: var(--ink-2); }
.pill { white-space: normal; }
.pill svg.i { width: 15px; height: 15px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none; color: var(--ink);
  transition: background-color .2s, transform .2s;
}
.btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.btn.primary { background: var(--cta); color: var(--cta-ink); border-color: transparent; }
.btn.active { background: var(--nav-active); color: var(--nav-active-ink); }
.btn svg.i { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- главная ---------- */

.hero { padding: 18px 6px 8px; max-width: 760px; }
.hero h1 { margin-top: 4px; }
.hero p { font-size: 16px; color: var(--ink-2); max-width: 600px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--card-border); background: var(--card);
  font-size: 13.5px;
  transition: transform .2s, background-color .2s;
}
.chip:hover { transform: translateY(-2px); background: var(--card-hover); }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chip span { color: var(--ink-2); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.home-grid { align-items: start; }
.tip { display: flex; gap: 14px; align-items: flex-start; }
.tip .tile { width: 38px; height: 38px; border-radius: 11px; }
.tip p { margin-top: 4px; }

/* карточка «База данных» */
.stat-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.stat-num { font-size: 40px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.stat-grid div { padding: 10px 12px; border-radius: 16px; background: var(--line); }
.stat-grid div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stat-grid dt { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat-grid dd { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.stat-updated { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.stat-updated svg.i { width: 15px; height: 15px; }

/* ---------- результат по коду ---------- */

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: 16px; align-items: start; }
.route-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.route-note { grid-column: 1 / -1; margin: 0; padding: 0 6px; }
.shipping-slot { display: contents; }  /* пустое место (другой маршрут) не добавляет отступ в колонке */
.shipping-slot:not(:empty) + .route-columns { margin-top: 16px; }  /* код не найден: карточка над колонками */
.shipping-card {  /* документы на любую отправку — заметнее остальных карточек */
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%), var(--card);
  border: 1.5px solid rgba(39, 137, 229, .55);
  box-shadow: 0 16px 36px -22px rgba(31, 107, 192, .7);
}
.shipping-card h3 { color: var(--accent-text); }
.shipping-docs li { padding-left: 10px; border-left: 3px solid var(--accent-b); }
.shipping-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 13.5px; }
.shipping-docs b { font-weight: 600; }
.shipping-docs span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }

.docs { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--line); font-size: 13px; }
.docs.always { margin: 0 0 14px; }
.docs-title { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.docs li b { font-weight: 600; }
.docs li span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); }
.docs li .case-when { margin: 0 0 1px; }
.docs-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); }
.docs-basis { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.rows-block > summary { font-size: 12.5px; }
.rows-block > summary::after { content: "Скрыть"; float: right; margin-left: 10px; color: var(--link); }
.rows-block:not([open]) > summary::after { content: "Показать"; }
.more-rows { margin-top: 8px; }
.measure-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.maybe { font-size: 12px; font-weight: 500; color: var(--ink-2); font-style: italic; }
.only-if { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 12px; border-radius: 14px;
  background: var(--warn-soft); color: var(--warn-text); font-size: 13px; line-height: 1.45; }
.only-if svg.i { flex: none; width: 15px; height: 15px; margin-top: 2px; }
/* совпадения «из»: только часть товаров кода */
.partial-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow-empty + .partial-block { border-top: 0; padding-top: 0; }
.partial-item + .partial-item { margin-top: 14px; }
.partial-item .only-if { margin-top: 6px; }
.partial-then { margin: 6px 2px 0; font-size: 13px; color: var(--ink-2); }
.partial-then b { color: var(--ink); font-weight: 600; }
.partial-more { margin-top: 6px; }
.only-if.faint { background: var(--line); color: var(--ink-2); }
.unlikely-note { margin: 0 2px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.unlikely-tag { font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.flow-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.flow-head .eyebrow { margin: 0; }
.flow-tile { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.flow-empty p { margin-top: 10px; }
.flow-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow-more summary { font-size: 13.5px; }
.measure.off { margin-top: 10px; padding: 0; border: 0; opacity: .85; }
.measure.off .measure-meta { margin-top: 0; }
.condition {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 6px; padding: 8px 10px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn-text); font-size: 12.5px;
}
.condition svg.i { width: 15px; height: 15px; margin-top: 2px; }
.general-acts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.general-acts span { display: block; }

/* Тумблер маршрута */
.route {
  flex: none;
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 46px; padding: 0 12px;
  border: 1px solid var(--card-border); border-radius: 999px;
  background: var(--card);
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  transition: background-color .2s, transform .2s, box-shadow .2s;
}
.route:hover { background: var(--card-hover); transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(21, 79, 158, .6); }
.route-side { min-width: 28px; text-align: center; }
.route-arrow {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #154F9E, #1F6BC0); color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 14px -8px rgba(21, 79, 158, .8);
}
.route-arrow svg.i { width: 16px; height: 16px; stroke-width: 2.2; }
.route.swap .route-arrow { animation: route-spin .45s cubic-bezier(.2, .7, .2, 1); }
.route.swap .route-side { animation: route-side .35s ease; }
@keyframes route-spin { from { transform: rotate(-180deg) scale(.85); } to { transform: none; } }
@keyframes route-side { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.route.compact { height: 48px; padding: 0 8px; font-size: 14px; gap: 3px; }
.route.compact .route-side { min-width: 24px; }
.route.compact .route-arrow { width: 26px; height: 26px; }
.col { display: grid; gap: 16px; min-width: 0; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 10px 0 0; padding: 10px 14px;
  border-radius: 16px; background: var(--warn-soft); color: var(--warn-text);
  font-size: 13.5px;
}

.path { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 2px; }
.path li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.path .node-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); justify-self: center; transform: translateY(-1px); }
.path li.current .node-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.path .node-text { font-size: 13.5px; color: var(--ink-2); }
.path li.current .node-text { color: var(--ink); font-weight: 500; }
.path .kind { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }

.linkish {
  border: 0; background: none; padding: 0;
  color: inherit; text-align: left; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px;
}
.linkish:hover { color: var(--link); text-decoration-color: currentColor; }

.tree { list-style: none; margin: 12px 0 0; padding: 0; }
.tree li { border-top: 1px solid var(--line); }
.tree li:first-child { border-top: 0; }
.tree .row {
  display: flex; gap: 12px; align-items: baseline;
  width: 100%; padding: 9px 6px 9px calc(6px + var(--indent, 0) * 18px);
  border: 0; background: none; text-align: left;
  border-radius: 12px;
  font-size: 13.5px;
}
button.row:hover { background: var(--card-hover); }
.tree .row.line { color: var(--ink-2); font-style: italic; }
.tree .row .txt { min-width: 0; overflow-wrap: anywhere; }
.tree .row .txt.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tree .row .code-chip svg.i { width: 16px; height: 16px; color: var(--ink-3); vertical-align: -3px; }
.more { margin-top: 10px; }

.measure + .measure { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.measure-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.measure-meta { margin-top: 8px; font-size: 13.5px; }
.measure-meta div + div { margin-top: 3px; }
.measure-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.measure-rows li { padding: 10px 12px; border-radius: 16px; background: var(--line); font-size: 13.5px; }
.measure-rows .status { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.measure-rows .row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.measure-rows .row-code { font-variant-numeric: tabular-nums; }
.row-chip { min-height: 22px; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.measure-rows .row-text { display: block; margin-top: 4px; line-height: 1.45; }
.measure-rows .row-text.clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.measure-rows .row-toggle { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 12.5px; cursor: pointer; }
.measure-rows .row-toggle:hover { text-decoration: underline; }
.measure-rows .row-source { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
details { margin-top: 10px; font-size: 13.5px; }
summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
details blockquote { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent-b); border-radius: 0 12px 12px 0; background: var(--line); }
.fineprint { margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }

.explain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.explain-body {
  margin-top: 12px;
  max-height: 68vh; overflow: auto;
  padding-right: 6px;
  font-size: 14px; line-height: 1.55;
}
.explain-body p { margin: 0 0 .55em; }
.explain-body .text-bold { font-weight: 600; }
.explain-body .text-italic { font-style: italic; }
.explain-body table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; }
.explain-body td, .explain-body th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.explain-body td p { margin: 0; }
.explain-body .code-link { color: var(--link); font-weight: 500; text-decoration: underline dotted; text-underline-offset: 3px; }
.explain-body .hit { background: var(--warn-soft); border-radius: 6px; box-shadow: 0 0 0 3px var(--warn-soft); }

/* ---------- поиск по названию ---------- */

.results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.result {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 14px;
  width: 100%; padding: 14px 16px; text-align: left;
  border-radius: 20px;
}
.result .code-chip { font-size: 15px; grid-row: span 2; }
.result .name { font-weight: 500; }
.result .ctx { font-size: 12.5px; color: var(--ink-2); }

/* ---------- о данных ---------- */

.sources { list-style: none; margin: 12px 0 0; padding: 0; }
.sources li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.sources li:first-child { border-top: 0; }

/* сверка источников */
.check-card h3 { margin-top: 2px; }
.check-card .notice p { margin: 0; }
.check-card .notice p + p { margin-top: 6px; }
.check-card .notice a { color: inherit; font-weight: 600; }
.check-card code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--line); overflow-wrap: anywhere; }
.notice.danger { background: var(--danger-soft); color: var(--danger-text); }
.notice svg.i { flex: none; margin-top: 2px; }
.changes { list-style: none; margin: 14px 0 0; padding: 0; }
.change { padding: 11px 0; border-top: 1px solid var(--line); }
.change:first-child { border-top: 0; }
.change-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13.5px; }
.change-head a { color: var(--ink); font-weight: 600; }
.change-date { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 82px; }
.change-sum { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); }
.change.held .change-sum { color: var(--danger-text); }
.change details { margin-top: 6px; }
.change-part { margin-top: 10px; }
.change-part > .small { margin: 0; }
.change-group { margin-top: 8px; }
.change-group .eyebrow { margin: 0 0 4px; }
.change-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.change-group li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 13px; color: var(--ink-2); }
.change-group li.removed span { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.change-group .code-chip { min-width: 0; color: var(--ink); }
.dock-item[data-alert]::before { /* что-то в источниках требует внимания */
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--glass-hl);
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.toggle span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line);
  transition: background .25s;
  pointer-events: none;
}
.toggle span::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent-a); outline-offset: 2px; }

/* ---------- состояния ---------- */

.empty { padding: 24px 6px; color: var(--ink-2); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--cta); color: var(--cta-ink);
  font-size: 13.5px;
  box-shadow: var(--shadow);
}

/* ---------- появление ---------- */

.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: .45; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .chip:hover, .btn:hover, .round-btn:hover, .mini-btn:hover { transform: none; }
}

/* ---------- мини-окно (Document Picture-in-Picture или всплывающее окно) ---------- */

body.mini { min-height: 100vh; }
.mini-shell {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 100vh;
  padding: 12px;
}
.mini-top { display: flex; gap: 8px; align-items: center; flex: none; }
.mini-shell .command { max-width: none; margin: 0; height: 48px; flex: 1; min-width: 0; order: 0; flex-basis: auto; }
.mini-flow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-flow .eyebrow { margin-bottom: 8px; }
.mini-flow .mini-measures { margin-top: 0; }
.mini-shell .orb { width: 24px; height: 24px; }
.mini-body { flex: 1; overflow: auto; border-radius: 24px; padding: 16px; }
.mini-body .big-code { font-size: 32px; margin-bottom: 4px; }
.mini-name { font-weight: 500; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini-measures { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.mini-measures li { display: grid; gap: 4px; justify-items: start; }
.mini-measures .label { padding-left: 4px; }
.mini-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-results button { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 14px; background: none; text-align: left; font-size: 13px; }
.mini-results button:hover { background: var(--card-hover); }
.mini-hint { font-size: 12.5px; color: var(--ink-2); padding: 6px 4px; }

/* ---------- адаптив ---------- */

/* Большие мониторы: шире, а на 2K/4K без системного масштабирования — пропорционально крупнее,
   иначе интерфейс остаётся мелким островком посередине экрана. */
@media (min-width: 1680px) {
  .app { max-width: 1480px; }
}
@media (min-width: 2200px) {
  .app { zoom: 1.2; }
}
@media (min-width: 3000px) {
  .app { zoom: 1.5; }
}

@media (max-width: 1240px) {
  .result-grid { grid-template-columns: minmax(0, 1fr); }  /* код сверху, две колонки под ним */
  .brand small { display: none; }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "dock" "main";
    gap: 12px;
    padding: 12px 16px 20px;
  }
  .topbar { flex-wrap: wrap; border-radius: 28px; gap: 10px; padding: 10px; top: 8px; }
  .brand { order: 1; flex: 1; }
  .mini-btn, .desktop-only { display: none; }  /* мобильные браузеры не держат окно поверх программ */
  #route-slot, .topbar .route { order: 2; }
  .route-columns { grid-template-columns: minmax(0, 1fr); }
  .command { order: 3; flex-basis: 100%; height: 48px; }
  .brand small { display: none; }
  kbd { display: none; }
  .dock { position: static; flex-direction: row; justify-content: center; justify-self: center; padding: 6px; }
  .dock-item::after { display: none; }
  .dock-logout { margin: 0 0 0 6px; }
  .dock-logout::before { top: 12px; bottom: 12px; left: -7px; right: auto; width: 1px; height: auto; }
  .main { padding: 18px 16px; border-radius: 28px; }
  .card { padding: 16px; }
  h1 { font-size: 28px; }
  .big-code { font-size: 40px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .result { grid-template-columns: minmax(0, 1fr); }
  .result .code-chip { grid-row: auto; }
  .code-chip { min-width: 96px; }
}
