/* Цвета — роли темы программы (ui/theme.py, LIGHT и DARK). Скругления и тени
   оставлены окну-макету и форме: в самой программе панели — прямоугольники
   с рамкой в 1 px, и сайт держит ту же графику. */
:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #fff;
  --field: #fff;
  --text: #20252b;
  --muted: #5f6b7a;
  --disabled: #9aa4b1;
  --accent: #1a73e8;
  --accent-hover: #1765c8;
  --accent-pressed: #1457ad;
  --accent-text: #fff;
  --accent-fg: #1a73e8;
  --border: #d0d5db;
  --border-soft: #e2e6eb;
  --hover: #e8f0fe;
  --selected: #d2e3fc;
  --heading: #f3f5f7;
  --row-alt: #f5f7fa;
  --menu-bg: #fff;
  --ok: #1d713c;
  --ok-bg: #e6f4ea;
  --warn: #875400;
  --warn-bg: #fff4da;
  --crit: #ad293b;
  --crit-bg: #fce9ec;
  --canvas-bg: #fff;
  --sh-ink: #000000;
  --sh-paper: #ffffff;
  --sh-blue: #0000ff;
  --sh-green: #008000;
  --sh-darkgreen: #006400;
  --sh-purple: #800080;
  --sh-gray: #808080;
  --sh-lightblue: #add8e6;
  --sh-lightgray: #d3d3d3;
  --sh-overload: #e74c3c;
  --grid-dot: #d3d9e0;
  --line-crit: #d6334a;
  --series-1: #1a73e8;
  --phase-a: #d9a400;
  --phase-b: #1f9d55;
  --phase-c: #d93a3a;
  --band: #181c22;
  --band-surface: #222831;
  --band-text: #e5eaf1;
  --band-muted: #aab4c3;
  --band-border: #39424e;
  --band-accent: #80b4ff;
  --glow: rgb(26 115 232 / .16);
  --shadow: 0 48px 90px -42px rgb(15 40 80 / .42), 0 14px 28px -14px rgb(15 40 80 / .14);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #181c22;
    --surface: #222831;
    --field: #1c222a;
    --text: #e5eaf1;
    --muted: #aab4c3;
    --disabled: #6b7684;
    --accent: #246ad0;
    --accent-hover: #1d5bb5;
    --accent-pressed: #184c99;
    --accent-fg: #80b4ff;
    --border: #39424e;
    --border-soft: #2c343f;
    --hover: #2b3440;
    --selected: #293f60;
    --heading: #303946;
    --row-alt: #252d37;
    --menu-bg: #181c22;
    --ok: #8bd2a8;
    --ok-bg: #1f3328;
    --warn: #f2c279;
    --warn-bg: #382e21;
    --crit: #ff9eaa;
    --crit-bg: #3c252d;
    --canvas-bg: #1c222a;
    --sh-ink: #d5dbe3;
    --sh-paper: #1c222a;
    --sh-blue: #b8b8ff;
    --sh-green: #00aa00;
    --sh-darkgreen: #00ce00;
    --sh-purple: #ffa9ff;
    --sh-gray: #797f87;
    --sh-lightblue: #194553;
    --sh-lightgray: #393f47;
    --sh-overload: #e53c2a;
    --grid-dot: #2f3743;
    --line-crit: #ff7a8c;
    --series-1: #4a8ef0;
    --phase-a: #f2c14e;
    --phase-b: #5cc489;
    --phase-c: #ff7a7a;
    --band: #11151a;
    --band-surface: #1a1f26;
    --band-border: #2e3640;
    --glow: rgb(74 142 240 / .16);
    --shadow: 0 48px 90px -42px rgb(0 0 0 / .8), 0 14px 28px -14px rgb(0 0 0 / .45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181c22;
  --surface: #222831;
  --field: #1c222a;
  --text: #e5eaf1;
  --muted: #aab4c3;
  --disabled: #6b7684;
  --accent: #246ad0;
  --accent-hover: #1d5bb5;
  --accent-pressed: #184c99;
  --accent-fg: #80b4ff;
  --border: #39424e;
  --border-soft: #2c343f;
  --hover: #2b3440;
  --selected: #293f60;
  --heading: #303946;
  --row-alt: #252d37;
  --menu-bg: #181c22;
  --ok: #8bd2a8;
  --ok-bg: #1f3328;
  --warn: #f2c279;
  --warn-bg: #382e21;
  --crit: #ff9eaa;
  --crit-bg: #3c252d;
  --canvas-bg: #1c222a;
  --sh-ink: #d5dbe3;
  --sh-paper: #1c222a;
  --sh-blue: #b8b8ff;
  --sh-green: #00aa00;
  --sh-darkgreen: #00ce00;
  --sh-purple: #ffa9ff;
  --sh-gray: #797f87;
  --sh-lightblue: #194553;
  --sh-lightgray: #393f47;
  --sh-overload: #e53c2a;
  --grid-dot: #2f3743;
  --line-crit: #ff7a8c;
  --series-1: #4a8ef0;
  --phase-a: #f2c14e;
  --phase-b: #5cc489;
  --phase-c: #ff7a7a;
  --band: #11151a;
  --band-surface: #1a1f26;
  --band-border: #2e3640;
  --glow: rgb(74 142 240 / .16);
  --shadow: 0 48px 90px -42px rgb(0 0 0 / .8), 0 14px 28px -14px rgb(0 0 0 / .45);
}

/* База */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: 2px; }
h1, h2, h3 { font-weight: 650; }
sub { font-size: .7em; line-height: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 50; padding: 12px 16px; background: var(--accent); color: var(--accent-text); }
.skip-link:focus { top: 12px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font: 500 12px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pulse { position: relative; width: 8px; height: 8px; background: var(--accent-fg); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--accent-fg); animation: ping 2.4s ease-out infinite; }
@keyframes ping { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn svg { width: 16px; height: 16px; transition: transform .2s; }
.btn:hover svg { transform: translateX(3px); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:active { background: var(--accent-pressed); }
.btn-accent:disabled { background: var(--disabled); cursor: default; }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-fg); color: var(--accent-fg); }
.btn-small { padding: 8px 14px; font-size: 14px; }

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.header-row { height: 64px; display: flex; align-items: center; gap: 32px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 24px; height: 27px; }
.desktop-nav { display: flex; gap: 28px; margin-left: 8px; font-size: 14.5px; color: var(--muted); }
.desktop-nav a { transition: color .15s; }
.desktop-nav a:hover { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent-fg); color: var(--accent-fg); }
.theme-toggle svg { width: 16px; height: 16px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
.menu-button { display: none; }
.mobile-nav[hidden] { display: none; }

/* Первый экран */
.hero { position: relative; isolation: isolate; padding-bottom: 24px; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(#000 0, #000 30%, transparent 75%);
  mask-image: linear-gradient(#000 0, #000 30%, transparent 75%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: -64px 0 auto;
  height: 720px;
  z-index: -1;
  background: radial-gradient(60% 60% at 72% 30%, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: end;
  gap: 48px;
  padding: 72px 0 48px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.calc-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .2em;
  padding: .12em .42em .14em .34em;
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .64em;
  letter-spacing: -.02em;
  vertical-align: .16em;
  white-space: nowrap;
  animation: chip-ring 2.8s ease-out 1s infinite;
}
.calc-chip svg { width: .62em; height: .62em; }
@keyframes chip-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 .32em transparent; }
}
.hero-lead p { margin: 0 0 24px; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Окно программы */
.app-window {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
}
.win-title { height: 34px; display: flex; align-items: center; gap: 8px; padding-left: 12px; font-size: 12px; }
.win-icon { width: 15px; height: 17px; flex: none; }
.win-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-controls { margin-left: auto; display: flex; height: 100%; flex: none; }
.win-controls i { position: relative; width: 46px; display: grid; place-items: center; }
.win-controls i::before, .win-controls i::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--text); }
.win-controls i:nth-child(1)::before { width: 10px; height: 1px; transform: translate(-50%, -50%); }
.win-controls i:nth-child(1)::after { display: none; }
.win-controls i:nth-child(2)::before { width: 10px; height: 10px; background: none; border: 1px solid var(--text); transform: translate(-50%, -50%); }
.win-controls i:nth-child(2)::after { display: none; }
.win-controls i:nth-child(3)::before, .win-controls i:nth-child(3)::after { width: 13px; height: 1px; transform: translate(-50%, -50%) rotate(45deg); }
.win-controls i:nth-child(3)::after { transform: translate(-50%, -50%) rotate(-45deg); }

.win-menu {
  display: flex;
  padding: 0 4px;
  background: var(--menu-bg);
  border-top: 1px solid var(--border-soft);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.win-menu::-webkit-scrollbar { display: none; }
.win-menu a { padding: 4px 9px; }
.win-menu a:hover { background: var(--hover); }
.win-menu a:focus-visible { outline-offset: -2px; }

.win-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  padding: 4px 6px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
  flex: none;
}
.tb svg { width: 16px; height: 16px; flex: none; }
button.tb:hover { background: var(--hover); }
.tb[aria-pressed="true"] { background: var(--selected); color: var(--accent-fg); }
.tb-inert { cursor: default; }
button.tb:disabled { color: var(--muted); cursor: default; }
button.tb:disabled:hover { background: none; }
.tb-compact { display: none; }
.tb-sep { align-self: stretch; width: 1px; margin: 4px; background: var(--border); flex: none; }
.tb-accent { padding: 0 12px; background: var(--accent); color: var(--accent-text); }
button.tb-accent:hover { background: var(--accent-hover); }
.tb-accent[aria-expanded="true"] { background: var(--accent-pressed); }
.calc-wrap { position: relative; flex: none; }
.calc-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 6;
  min-width: 220px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgb(0 0 0 / .16);
}
.calc-menu[hidden] { display: none; }
.calc-menu button { display: block; width: 100%; padding: 7px 28px; border: 0; background: none; text-align: left; font-size: 13px; }
.calc-menu button:hover, .calc-menu button:focus-visible { background: var(--selected); outline: none; }
.coach {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 5;
  padding: 5px 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: bob 1.8s ease-in-out infinite;
}
.coach::before { content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.app-window.is-touched .coach, .tb-accent[aria-expanded="true"] ~ .coach { display: none; }
@keyframes bob { 50% { transform: translate(-50%, 4px); } }
@keyframes bob-right { 50% { transform: translateY(4px); } }

.win-body {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  height: clamp(400px, 44vw, 540px);
}
.app-window.no-side .win-body { grid-template-columns: minmax(0, 1fr); }
.app-window.no-side .win-side, .app-window.no-palette .palette, .app-window.no-props .props { display: none; }
.win-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 8px 8px 10px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
}
.win-side h3 { margin: 0; font-size: 13px; font-weight: 700; }
.win-side .muted { margin: 0; font-size: 12px; color: var(--muted); }
.palette-list { margin: 6px 0 8px; padding: 2px 0; list-style: none; background: var(--surface); border: 1px solid var(--border); }
.palette-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-size: 13px;
  text-align: left;
}
.palette-list button:hover, .palette-list button:focus-visible { background: var(--hover); outline: none; }
.palette-list svg { width: 16px; height: 16px; flex: none; }
.palette-list i { margin-left: auto; font-style: normal; font-size: 11px; letter-spacing: -2px; color: var(--muted); }
.pin { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pin i { position: relative; width: 13px; height: 13px; background: var(--accent); }
.pin i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.props { position: relative; margin-top: 4px; padding: 10px 8px 8px; border: 1px solid var(--border); }
.props h3 { position: absolute; top: -9px; left: 6px; padding: 0 4px; background: var(--bg); font-size: 12px; }
.props-name { margin: 0 0 6px; font-size: 12px; font-weight: 700; }
.props dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; margin: 0; font-size: 12px; align-items: center; }
.props dt { color: var(--muted); }
.props dd { margin: 0; padding: 2px 6px; background: var(--field); border: 1px solid var(--border); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.props dd.is-field { padding: 0; overflow: visible; }
.props select, .props input { display: block; width: 100%; min-width: 0; height: 22px; margin: 0; padding: 0 4px; background: var(--field); color: var(--text); border: 0; font: inherit; font-size: 12px; }
.props select:focus-visible, .props input:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: -1px; }
.props .panel-button { margin-top: 8px; }

.win-canvas { position: relative; min-width: 0; background: var(--canvas-bg); }
.canvas-scroll { position: absolute; inset: 0; overflow: auto; scrollbar-width: thin; }
.scheme { display: block; width: 100%; height: 100%; min-width: 600px; user-select: none; -webkit-user-select: none; }
.scheme text { font-family: Arial, "Helvetica Neue", Helvetica, "Liberation Sans", sans-serif; }
.sheet { fill: transparent; }

/* Цвета холста записаны цветами белого листа, как их пишет программа; в тёмной
   теме их заменяют значения canvas/scheme_canvas.sheet_color (переменные --sh-*). */
.scheme [fill="#000000"] { fill: var(--sh-ink); }
.scheme [stroke="#000000"] { stroke: var(--sh-ink); }
.scheme [fill="#ffffff"] { fill: var(--sh-paper); }
.scheme [stroke="#ffffff"] { stroke: var(--sh-paper); }
.scheme [fill="#0000ff"] { fill: var(--sh-blue); }
.scheme [stroke="#0000ff"] { stroke: var(--sh-blue); }
.scheme [fill="#008000"] { fill: var(--sh-green); }
.scheme [stroke="#008000"] { stroke: var(--sh-green); }
.scheme [fill="#006400"] { fill: var(--sh-darkgreen); }
.scheme [stroke="#006400"] { stroke: var(--sh-darkgreen); }
.scheme [fill="#800080"] { fill: var(--sh-purple); }
.scheme [stroke="#800080"] { stroke: var(--sh-purple); }
.scheme [fill="#808080"] { fill: var(--sh-gray); }
.scheme [stroke="#808080"] { stroke: var(--sh-gray); }
.scheme [fill="#add8e6"] { fill: var(--sh-lightblue); }
.scheme [stroke="#add8e6"] { stroke: var(--sh-lightblue); }
.scheme [fill="#d3d3d3"] { fill: var(--sh-lightgray); }
.scheme [stroke="#e74c3c"] { stroke: var(--sh-overload); }

@keyframes res-in { from { opacity: 0; } }
/* Результаты не перекрывают выбор и перетаскивание элементов под ними. */
.scheme .res { pointer-events: none; }
.app-window.hide-b .res-branch-buses,
.app-window.hide-v .res-voltage-label,
.app-window.hide-p .res-power-label,
.app-window:not(.show-i) .res-current-label { display: none; }

/* Компоненты и надписи перетаскиваются, как на холсте программы. */
.el, .txt { cursor: grab; outline: none; touch-action: none; }
.app-window.is-dragging .scheme, .app-window.is-dragging .el, .app-window.is-dragging .txt { cursor: grabbing; }
.app-window.is-dragging .el:hover { filter: none; }
.wire { cursor: pointer; }
.scheme .hit { fill: none; stroke: transparent; stroke-width: 14px; }
.el:hover { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent-fg) 70%, transparent)); }
.el:focus-visible { filter: drop-shadow(0 0 3px var(--accent-fg)); }
/* Выделение — как ElectricalComponent.highlight(): толщина всех линий элемента 4. */
.el.is-selected [stroke], .el.is-picked [stroke] { stroke-width: 4px; }
.el.is-picked, .el.is-hinted, .txt.is-hinted { filter: drop-shadow(0 0 4px var(--accent-fg)); }
.app-window.is-measuring .scheme { cursor: crosshair; }

.display-options {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: none;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
}
.app-window[data-result="flow"] .display-options { display: grid; animation: res-in .3s ease-out; }
.panel-title { margin: 0 0 2px; font-weight: 700; }
.display-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.display-options input { margin: 0; accent-color: var(--accent); }
.panel-button { justify-self: start; margin-top: 4px; padding: 3px 10px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
.panel-button:hover { background: var(--hover); border-color: var(--accent-fg); }

.results-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(460px, 94%);
  max-height: 92%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 22px 48px rgb(0 0 0 / .25);
  transform: translate(-50%, -50%);
  animation: res-in .2s ease-out;
}
.results-dialog[hidden] { display: none; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; padding-left: 10px; font-size: 12px; border-bottom: 1px solid var(--border); }
.dialog-title button { width: 40px; height: 28px; border: 0; background: none; font-size: 18px; line-height: 1; }
.dialog-title button:hover { background: #c42b1c; color: #fff; }
.dialog-body { padding: 8px; overflow: auto; }
.tree { width: 100%; border-collapse: collapse; background: var(--field); border: 1px solid var(--border); font-size: 12px; }
.tree th { padding: 5px 8px; background: var(--heading); border-bottom: 1px solid var(--border); text-align: left; font-weight: 600; white-space: nowrap; }
.tree td { padding: 4px 8px; white-space: nowrap; }
.tree tbody tr:nth-child(even) { background: var(--row-alt); }
.tree tbody { display: none; }
.app-window[data-result="flow"] tbody[data-for="flow"], .app-window[data-result="fault"] tbody[data-for="fault"] { display: table-row-group; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 2px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge::before { font-weight: 800; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.ok::before { content: "✓"; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.warn::before { content: "!"; }
.badge.crit { background: var(--crit-bg); color: var(--crit); }
.badge.crit::before { content: "▲"; font-size: .8em; }

.win-status { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px; font-size: 12px; }
.status-hint { flex: 1; min-width: 0; padding-left: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.zoom { display: flex; align-items: center; }
.zoom output { width: 54px; text-align: center; }
.win-status button { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px; border: 0; background: none; font-size: 12px; }
.win-status button:hover { background: var(--hover); }
.win-status button[hidden] { display: none; }
.win-status svg { width: 14px; height: 14px; }

.app-caption { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.norms { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; padding: 40px 0 0; }
.norms-label { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.norms ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.norms li { padding: 5px 10px; background: var(--surface); border: 1px solid var(--border); font: 12.5px var(--mono); }

/* Секции */
.section { padding: 120px 0; }
.modules { padding-top: 96px; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head h2, .contact h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.section-head h2 span { color: var(--muted); }
.section-head p { margin: 0; font-size: 17px; color: var(--muted); max-width: 580px; }

/* Модули */
.module-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-3 { grid-column: span 3; }
.module {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
  scroll-margin-top: 90px;
}
.module:hover { border-color: color-mix(in srgb, var(--accent-fg) 55%, var(--border)); box-shadow: 0 18px 40px -28px rgb(15 40 80 / .35); }
.module:target { border-color: var(--accent-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-fg) 25%, transparent); }
.module-path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font: 12px var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.module-path svg { width: 14px; height: 14px; flex: none; color: var(--accent-fg); }
.module-path b { font-weight: 400; color: var(--disabled); }
.module-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.module h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.span-3 h3 { font-size: 19px; }
.module-body > p { margin: 0 0 20px; font-size: 15px; color: var(--muted); }

.mini { margin: auto 0 0; background: var(--field); border: 1px solid var(--border); }
.mini figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 7px 12px;
  background: var(--heading);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.mini svg { display: block; width: 100%; height: auto; }
/* Рисунок программы — белый лист, как в записке, в обеих темах. */
.mini-tcc img { display: block; width: 100%; height: auto; padding: 6px 4px 2px; background: #fff; }

.mini-vector { display: flex; flex-direction: column; }
.mini-vector svg { max-height: 260px; padding: 8px 0 0; }
.mini-vector figcaption { order: 2; border-top: 1px solid var(--border); border-bottom: 0; }
.vec-ring { fill: none; stroke: var(--border-soft); stroke-dasharray: 2 4; }
.vec-pre { fill: none; stroke: var(--disabled); stroke-width: 1.4; stroke-dasharray: 4 4; }
.vec { fill: none; stroke-width: 2.6; }
.vec-i { stroke-width: 3.6; }
.ph-a { stroke: var(--phase-a); }
.ph-b { stroke: var(--phase-b); }
.ph-c { stroke: var(--phase-c); }
.ph-a-fill { fill: var(--phase-a); }
.ph-b-fill { fill: var(--phase-b); }
.ph-c-fill { fill: var(--phase-c); }
.vec-label { font: 600 13px var(--sans); fill: var(--text); }
.vec-label .sub, .vec-note .sub { font-size: 9px; }
.vec-note { font: 12px var(--sans); fill: var(--muted); }
.vec-origin { fill: var(--text); }
.phase-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.phase-key i { width: 12px; height: 3px; border-radius: 2px; }
.phase-key i:not(:first-child) { margin-left: 6px; }
.ph-a-bg { background: var(--phase-a); }
.ph-b-bg { background: var(--phase-b); }
.ph-c-bg { background: var(--phase-c); }

.variants { width: 100%; border-collapse: collapse; font-size: 13px; }
.variants th { padding: 7px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
.variants td { padding: 8px 12px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.variants td:first-child .badge { margin-left: 6px; }
.variants tr.is-best td { background: var(--selected); }
.bar-cell { display: flex; align-items: center; gap: 10px; font: 12.5px var(--mono); }
.track { display: block; width: 84px; height: 8px; background: var(--row-alt); flex: none; }
.bar { display: block; height: 100%; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--series-1) 45%, var(--field)); }
.is-best .bar { background: var(--series-1); }
.w-100 { width: 100%; }
.w-94 { width: 94%; }
.w-85 { width: 85%; }
.w-77 { width: 77%; }

.seg { display: inline-flex; border: 1px solid var(--border); background: var(--surface); }
.seg button { padding: 3px 10px; border: 0; background: none; font-size: 12px; color: var(--text); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--selected); color: var(--accent-fg); }
.harm-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  height: 196px;
  margin: 0 18px 30px;
  padding-top: 30px;
  border-bottom: 1px solid var(--muted);
}
.harm-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.harm-bar {
  position: relative;
  width: 56%;
  max-width: 46px;
  border-radius: 4px 4px 0 0;
  background: var(--series-1);
  transition: height .7s cubic-bezier(.2, .8, .2, 1), background-color .3s;
}
.harm-bar b { position: absolute; z-index: 2; bottom: calc(100% + 3px); left: 50%; padding: 0 3px; background: var(--field); transform: translateX(-50%); font: 600 12px var(--mono); color: var(--text); }
.harm-limit { position: absolute; left: 6%; right: 6%; z-index: 1; border-top: 2px dashed var(--text); opacity: .55; }
.harm-n { position: absolute; top: calc(100% + 6px); font: 12px var(--mono); color: var(--muted); }
.harm-flag { position: absolute; top: -24px; padding: 1px 6px; background: var(--crit-bg); color: var(--crit); font-size: 11px; font-weight: 600; white-space: nowrap; transition: opacity .3s; }
.harm-flag::before { content: "▲ "; font-size: .8em; }
.n5 .harm-limit { bottom: 66.7%; }
.n7 .harm-limit { bottom: 50%; }
.n11 .harm-limit, .n13 .harm-limit { bottom: 33.3%; }
.harm[data-state="before"] .n5 .harm-bar { height: 86.7%; background: var(--line-crit); }
.harm[data-state="before"] .n7 .harm-bar { height: 43.3%; }
.harm[data-state="before"] .n11 .harm-bar { height: 28.3%; }
.harm[data-state="before"] .n13 .harm-bar { height: 23.3%; }
.harm[data-state="after"] .n5 .harm-bar { height: 26.7%; }
.harm[data-state="after"] .n7 .harm-bar { height: 35%; }
.harm[data-state="after"] .n11 .harm-bar { height: 25%; }
.harm[data-state="after"] .n13 .harm-bar { height: 20%; }
.harm[data-state="after"] .harm-flag { opacity: 0; }
.harm[data-state="before"] .v-after, .harm[data-state="after"] .v-before { display: none; }
.harm-foot { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.harm-foot b { color: var(--text); font-family: var(--mono); }
.limit-key { display: inline-block; width: 18px; margin-right: 6px; border-top: 2px dashed var(--text); opacity: .55; vertical-align: middle; }

.status-keys { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; list-style: none; }
.omp { display: block; width: 100%; margin-top: auto; overflow: visible; }
.omp-line { stroke: var(--text); stroke-width: 2; }
.omp-ticks { stroke: var(--muted); stroke-width: 1.5; }
.omp-pin { stroke: var(--line-crit); stroke-width: 2; }
.omp-dot { fill: var(--line-crit); stroke: var(--surface); stroke-width: 2; }
.omp text { font: 11px var(--mono); fill: var(--muted); }
.omp text:first-of-type { fill: var(--text); font-weight: 700; }
.formula { margin: auto 0 0; padding: 10px 12px; background: var(--bg); border-left: 3px solid var(--accent-fg); font: 12.5px var(--mono); white-space: nowrap; overflow-x: auto; }
.file-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: auto 0 0; }
.file-flow span { padding: 3px 8px; border: 1px solid var(--border); font: 12px var(--mono); }
.file-flow .is-model { background: var(--selected); border-color: transparent; color: var(--accent-fg); }
.file-flow svg { width: 16px; height: 16px; color: var(--muted); }

/* Как работает — тёмная полоса в графитовой теме программы */
.workflow {
  position: relative;
  padding: 120px 0;
  background: var(--band);
  color: var(--band-text);
  overflow: hidden;
  isolation: isolate;
}
.workflow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--band-border) 1px, transparent 1px), linear-gradient(90deg, var(--band-border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  -webkit-mask-image: radial-gradient(70% 80% at 80% 0, #000, transparent 70%);
  mask-image: radial-gradient(70% 80% at 80% 0, #000, transparent 70%);
}
.workflow .eyebrow, .workflow .section-head h2 span { color: var(--band-muted); }
.steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.steps::before { content: ""; position: absolute; top: 24px; left: 0; right: 0; height: 2px; background: var(--band-border); }
.steps::after {
  content: "";
  position: absolute;
  top: 23px;
  left: -140px;
  width: 140px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--band-accent), transparent);
  animation: travel 4.5s linear infinite;
}
@keyframes travel { to { left: 100%; } }
.step { position: relative; padding-right: 40px; }
.step-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  background: var(--band-surface);
  border: 1px solid var(--band-border);
}
.step-node svg { width: 20px; height: 20px; }
.step-node.is-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.step-num { margin: 28px 0 6px; font: 12px var(--mono); color: var(--band-muted); }
.step h3 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.02em; }
.step p { margin: 0; font-size: 15px; color: var(--band-muted); }
.step .step-meta { margin-top: 14px; font: 12.5px var(--mono); color: var(--band-accent); }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.doc-chips li { padding: 3px 8px; border: 1px solid var(--band-border); font: 12px var(--mono); }
.doc-chips li::after { content: ".docx"; margin-left: 4px; color: var(--band-muted); }

/* Записки: листы — белая бумага в обеих темах, как вышли из Word */
.reports { padding-bottom: 72px; }
.note-sheets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.note-sheet a { display: block; background: #fff; border: 1px solid var(--border); box-shadow: 0 22px 40px -30px rgb(15 40 80 / .45); transition: transform .2s, box-shadow .2s; }
.note-sheet a:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgb(15 40 80 / .55); }
.note-sheet a:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: 3px; }
.note-sheet img { display: block; width: 100%; height: auto; }
.note-sheet p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.note-sheet b { display: block; margin-bottom: 2px; font: 600 12px var(--mono); color: var(--text); }
.note-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 36px; }
.note-downloads p { flex: 1 1 260px; margin: 0; font-size: 14px; color: var(--muted); }

/* Проверка расчёта */
.verify { padding-top: 72px; border-top: 1px solid var(--border); }
.verify-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: start; }
.verify-layout .section-head { margin-bottom: 0; }
.verify-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
.verify-stats div { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); }
.verify-stats dt { font-size: 12.5px; color: var(--muted); }
.verify-stats dd { margin: 6px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.verify-stats dd span { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.verify-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.verify-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.verify-list li::before { content: "✓"; flex: none; font-weight: 700; color: var(--ok); }
.verify-note { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* Детали */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.detail { padding: 28px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background-color .2s; }
.detail:hover { background: var(--surface); }
.detail svg { width: 22px; height: 22px; color: var(--accent-fg); }
.detail h3 { margin: 18px 0 6px; font-size: 17px; letter-spacing: -.01em; }
.detail p { margin: 0; font-size: 14.5px; color: var(--muted); }
.hotkeys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 32px 0 0; }
.hotkeys div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); }
.hotkeys dt { font-size: 12px; color: var(--muted); }
.hotkeys dd { margin: 8px 0 0; font-size: 14px; }
kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  font: 600 12px var(--mono);
  color: var(--text);
  text-align: center;
}

/* Вопросы */
.faq { padding-top: 0; }
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; align-items: start; }
.faq-list details { padding: 18px 0; border-top: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: 1px solid var(--border); }
.faq-list summary { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--accent-fg); transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin: 10px 0 0; max-width: 640px; color: var(--muted); }

/* Заявка */
.contact { padding: 120px 0; background: var(--surface); border-top: 1px solid var(--border); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.contact-copy > p:not(.eyebrow) { margin: 0; font-size: 17px; color: var(--muted); max-width: 460px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 36px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.facts li { padding: 16px 12px 0 0; }
.facts b { display: block; font-size: 22px; letter-spacing: -.02em; }
.facts span { font-size: 13.5px; color: var(--muted); }
.telegram-card { min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.telegram-card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.telegram-status { padding: 2px 8px; background: var(--warn-bg); color: var(--warn); font: 600 11px var(--mono); }
.telegram-card-body { padding: clamp(20px, 3vw, 32px); overflow-wrap: anywhere; }
.telegram-card-body h3 { margin: 0 0 10px; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.telegram-card-body > p { margin: 0; font-size: 15px; color: var(--muted); }
.telegram-button { width: 100%; min-width: 0; margin-top: 24px; text-align: center; }
.telegram-button svg { flex: none; }
.telegram-card-body .telegram-note { margin-top: 12px; font-size: 12.5px; }

.site-footer { padding: 32px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-row p { margin: 0; }
.site-footer .wordmark { font-size: 17px; color: var(--text); }
.site-footer .brand-mark { width: 20px; height: 22px; }

/* Появление при прокрутке */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Адаптив */
@media (max-width: 1024px) {
  .hero-head { grid-template-columns: 1fr; gap: 24px; padding-top: 56px; }
  .span-7, .span-5 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hotkeys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout, .faq-layout, .verify-layout { grid-template-columns: 1fr; gap: 40px; }
  .note-sheets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .desktop-nav { display: none; }
  .menu-button {
    display: grid;
    place-content: center;
    gap: 6px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--surface);
  }
  .menu-button span { display: block; width: 16px; height: 1.5px; background: var(--text); transition: transform .2s; }
  .menu-button[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .mobile-nav { display: grid; padding: 4px 0 16px; }
  .mobile-nav a { padding: 12px 0; border-top: 1px solid var(--border); font-size: 17px; }
}

/* Окно в компактном режиме, как у программы: второстепенные команды уходят в «Ещё», колонка — оверлеем. */
@media (max-width: 1180px) {
  .tb-full { display: none; }
  .tb-compact { display: inline-flex; }
}

@media (max-width: 760px) {
  .tb-wide.tb-inert { display: none; }
  .tb-compact .tb-label,
  [data-action="fault-point"] .tb-label,
  [data-action="measure"] .tb-label,
  [data-action="props"] .tb-label { display: none; }
  .win-body, .app-window.no-side .win-body { grid-template-columns: minmax(0, 1fr); height: 380px; }
  .win-side {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 3;
    width: min(236px, 78%);
    background: var(--bg);
    box-shadow: 12px 0 32px rgb(0 0 0 / .18);
  }
  .calc-menu { left: auto; right: 0; }
  .coach { left: auto; right: 0; transform: none; animation-name: bob-right; }
  .coach::before { left: auto; right: 30px; transform: rotate(45deg); }
  .display-options { display: none !important; }
  .status-center span { display: none; }
  .win-controls i { width: 34px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .header-cta { display: none; }
  .hero-head { padding: 40px 0 32px; }
  .hero-lead p { font-size: 16.5px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .section, .workflow, .contact { padding: 80px 0; }
  .faq { padding-top: 0; }
  .section-head { margin-bottom: 36px; }
  .span-3 { grid-column: span 12; }
  .module-body { padding: 20px 18px 20px; }
  .harm-chart { margin-inline: 10px; gap: 10px; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .steps::before { top: 0; bottom: 0; left: 24px; right: auto; width: 2px; height: auto; }
  .steps::after { display: none; }
  .step { padding: 0 0 0 76px; }
  .step-node { position: absolute; left: 0; top: 0; }
  .step-num { margin-top: 0; }
  .detail-grid, .hotkeys, .facts { grid-template-columns: 1fr; }
  .note-sheets { gap: 14px; }
  .verify-stats { grid-template-columns: 1fr; }
  .facts li { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  [data-action="palette"] .tb-label { display: none; }
  [data-action="palette"]::after { content: "▾"; font-size: 11px; }
  .win-name { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
