/* =============================================================================
   Оболочка платформы. Стили демонстраций изолированы в static/navigator/demos/
   ============================================================================= */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --surface-3: #e7e4dc;
  --text: #19191d;
  --muted: #55555e;
  --border: #dedad1;
  --border-strong: #c9c4b8;
  --accent: #3138b0;
  --accent-hover: #262c94;
  --accent-soft: #e8e9fa;
  --accent-ink: #ffffff;
  --success: #1d6b43;
  --danger: #b3261e;
  --focus: #3138b0;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 20px;
  --shadow: 0 1px 2px rgba(25, 25, 29, .06), 0 4px 16px rgba(25, 25, 29, .06);
  --shadow-l: 0 2px 4px rgba(25, 25, 29, .05), 0 16px 40px rgba(25, 25, 29, .10);

  --gutter: 16px;
  --container: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img, svg { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-s);
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 241, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--text); }

.brand__mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, transparent 50%),
    linear-gradient(135deg, transparent 0 50%, #e2a03f 50%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  flex: none;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
}

.main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"],
.main-nav a.is-section { color: var(--text); background: var(--surface-3); }

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

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { --btn-bg: var(--surface-2); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  --btn-border: var(--accent);
}
.btn--primary:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); }

.btn--ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn--ghost:hover { --btn-bg: var(--surface-2); }

.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 16px; }

.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Общие элементы ---------- */

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead { font-size: 18px; color: var(--muted); max-width: 64ch; }
@media (min-width: 1024px) { .lead { font-size: 20px; } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--direction { background: #e8e9fa; color: #262c94; }
.badge--technique { background: #fbecd6; color: #7a4508; }
.badge--layout { background: #dcefe4; color: #1d5a39; }

.demo-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-flag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.section { padding: 56px 0; }
@media (min-width: 1024px) { .section { padding: 88px 0; } }

.section--tight { padding-top: 0; }
.services-grid { list-style: none; }

.section__head { margin-bottom: 32px; max-width: 760px; }
.section__head h2 { font-size: clamp(26px, 3.2vw, 36px); margin-top: 8px; }
.section__head p { margin-top: 12px; color: var(--muted); }

.breadcrumbs { padding-top: 24px; font-size: 14px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

.page-head { padding: 24px 0 32px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); margin: 10px 0 14px; }

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

.hero { padding: 40px 0 56px; }
@media (min-width: 1024px) { .hero { padding: 72px 0 96px; } }

.hero__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; }
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 14px 0 20px;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__points {
  display: grid;
  gap: 10px;
  margin-top: 32px;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}
.hero__points li { display: flex; gap: 10px; align-items: flex-start; }
.hero__points li::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233138b0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.mosaic {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.mosaic__item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-l);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform .25s var(--ease);
}
.mosaic__item:hover { transform: translateY(-3px); color: inherit; }
.mosaic__item--a { grid-column: 1 / 5; }
.mosaic__item--b { grid-column: 5 / 7; grid-row: 1 / 3; align-self: stretch; }
.mosaic__item--c { grid-column: 1 / 3; }
.mosaic__item--d { grid-column: 3 / 5; }
.mosaic__item .stage { border-radius: 0; }
.mosaic__label {
  position: absolute;
  left: 8px; bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(25, 25, 29, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}
.mosaic__caption { margin-top: 14px; font-size: 13px; color: var(--muted); }

.services-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.service-card {
  display: grid;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}
@media (min-width: 900px) {
  .service-card--featured { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: center; padding: 40px; gap: 40px; }
}
.service-card h3 { font-size: 26px; margin-top: 8px; }
.service-card p { color: var(--muted); margin-top: 12px; }
.service-card .btn { margin-top: 24px; }

.service-card__preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.service-card__preview .stage { border-radius: var(--radius-s); box-shadow: 0 0 0 1px var(--border); }

.steps {
  display: grid;
  gap: 16px;
  list-style: none;
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.steps li {
  counter-increment: step;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
}
.steps h3 { font-size: 18px; }
.steps p { color: var(--muted); margin-top: 6px; font-size: 15px; }

.note {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Подвал ---------- */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}
.site-footer__inner {
  display: grid;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 40px;
}
@media (min-width: 800px) {
  .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer__about { margin-top: 12px; max-width: 44ch; }
.site-footer h2 { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.site-footer ul { list-style: none; display: grid; gap: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Демонстрации: «холст» и масштабирование ---------- */

.stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius);
  aspect-ratio: var(--stage-w) / var(--stage-h);
  contain: layout paint;
}
.stage--app {
  max-width: calc(var(--stage-w) * 1px);
  margin-inline: auto;
  border-radius: 36px;
  box-shadow: 0 0 0 10px #1c1c20, var(--shadow-l);
}
.stage__canvas {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  transform: scale(var(--stage-scale, .25));
  overflow: hidden;
}
.stage--preview { pointer-events: none; }
.stage--preview.stage--app { box-shadow: 0 0 0 6px #1c1c20; border-radius: 22px; }

/* Базовый сброс внутри демонстрации: оболочка платформы не должна протекать
   в демо. Всё остальное оформление — в static/navigator/demos/<slug>.css */
.dm {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: normal;
  text-align: left;
  color: #111;
  background: #fff;
}
.dm *, .dm *::before, .dm *::after { box-sizing: border-box; }
.dm h1, .dm h2, .dm h3, .dm h4, .dm h5, .dm p, .dm ul, .dm ol, .dm li, .dm figure, .dm blockquote, .dm dl, .dm dd {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}
.dm ul, .dm ol { list-style: none; }
.dm a { color: inherit; text-decoration: none; }
.dm svg { display: block; max-width: none; }
.dm button, .dm input { font: inherit; color: inherit; }

/* ---------- Каталог ---------- */

.catalog-tools {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 900px) {
  .catalog-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}

.search label { display: block; font-weight: 600; margin-bottom: 8px; }
.search__field { position: relative; max-width: 560px; }
.search__field svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px 12px 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  transition: border-color .15s, box-shadow .15s;
}
.search input:hover { border-color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__submit { margin-top: 8px; }
.search__hint { margin-top: 8px; font-size: 14px; color: var(--muted); }

.search-status { font-size: 15px; color: var(--muted); }

.kinds-legend {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
@media (min-width: 900px) { .kinds-legend { grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px; } }
.kinds-legend__item p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.kinds-legend__note { grid-column: 1 / -1; font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }

.style-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  list-style: none;
}

.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
}
.style-card:hover { box-shadow: var(--shadow-l); transform: translateY(-2px); border-color: var(--border-strong); }
.style-card:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.style-card .stage { border-radius: 0; border-bottom: 1px solid var(--border); }
.style-card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 24px; flex: 1; }
.style-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.style-card h2 { font-size: 22px; }
.style-card h2 a { color: var(--text); text-decoration: none; }
.style-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.style-card h2 a:focus-visible { outline: none; }
.style-card__en { font-size: 14px; color: var(--muted); }
.style-card__summary { color: var(--muted); font-size: 15px; }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-l);
  background: var(--surface);
}
.empty-state h2 { font-size: 22px; }
.empty-state p { margin: 8px auto 20px; color: var(--muted); max-width: 52ch; }
[hidden] { display: none !important; }

/* ---------- Страница стиля ---------- */

.style-hero { padding: 16px 0 24px; }
.style-hero__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 12px 0 14px; }
.style-hero h1 { font-size: clamp(34px, 5.5vw, 56px); letter-spacing: -.02em; }
.style-hero__en { font-size: clamp(18px, 2.2vw, 24px); color: var(--muted); font-weight: 500; }
.style-hero__kind { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.style-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.demo-panel {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--surface-3);
}
@media (min-width: 900px) { .demo-panel { padding: 24px; } }

.demo-panel__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tabs a, .tabs button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.tabs a:hover, .tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs [aria-selected="true"], .tabs [aria-current="true"] { background: var(--text); color: #fff; }
.tabs [aria-selected="true"]:hover, .tabs [aria-current="true"]:hover { background: var(--text); color: #fff; }

.demo-panel figure { margin: 0; }
.demo-panel figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); }

.toc {
  position: sticky;
  top: 64px;
  z-index: 10;
  margin: 32px 0 0;
  padding: 10px 0;
  background: rgba(246, 245, 241, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.toc ul {
  display: flex;
  gap: 4px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.toc ul::-webkit-scrollbar { display: none; }
.toc a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
.toc a:hover { background: var(--surface-2); color: var(--text); }

.style-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 130px;
}
.style-section:last-of-type { border-bottom: 0; }
.style-section > h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 20px; }
.style-section__intro { color: var(--muted); max-width: 70ch; margin-bottom: 24px; }

.two-col { display: grid; gap: 24px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 32px; } }

.panel {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.panel h3 { font-size: 18px; margin-bottom: 12px; }
.panel--good h3 { color: var(--success); }
.panel--bad h3 { color: var(--danger); }

.list { list-style: none; display: grid; gap: 10px; }
.list li { position: relative; padding-left: 22px; }
.list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .62em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.list--bad li::before { background: var(--danger); border-radius: 50%; }
.list--good li::before { background: var(--success); border-radius: 50%; }

.features {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  list-style: none;
}
.features li {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 15px;
}

.prose p + p { margin-top: 12px; }
.prose { max-width: 72ch; font-size: 17px; }

.palettes { margin-top: 20px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.palette { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.palette__strip { display: flex; height: 72px; }
.palette__strip span { flex: 1; }
.palette__body { padding: 16px 18px 18px; }
.palette__body h3 { font-size: 17px; }
.palette__body > p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.palette__colors { list-style: none; display: grid; gap: 6px; margin-top: 14px; }

.swatch {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 8px 6px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.swatch:hover { background: var(--surface-2); border-color: var(--border); }
.swatch__chip { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch__role { color: var(--muted); overflow-wrap: anywhere; }
.swatch__hex { font-family: var(--mono); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.swatch__hex svg { width: 14px; height: 14px; color: var(--muted); }

.font-pairs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); list-style: none; margin-top: 24px; }
.font-pair { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.font-pair__sample-h { font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.font-pair__sample-b { font-size: 15px; margin-top: 8px; color: var(--muted); }
.font-pair dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 16px 0 0; font-size: 14px; }
.font-pair dt { color: var(--muted); }
.font-pair dd { margin: 0; font-weight: 600; }
.font-pair__note { font-size: 14px; color: var(--muted); margin-top: 10px; }

.components { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.components .panel p { font-size: 15px; color: var(--muted); }

.combos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); list-style: none; }
.combo { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s; }
.combo:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.combo:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.combo .stage { border-radius: 8px; align-self: start; }
.combo h3 { font-size: 16px; }
.combo h3 a { color: var(--text); text-decoration: none; }
.combo h3 a::after { content: ""; position: absolute; inset: 0; }
.combo h3 a:focus-visible { outline: none; }
.combo p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.combo .badge { margin-top: 8px; }

.use-cta {
  margin: 48px 0 0;
  padding: 32px;
  border-radius: var(--radius-l);
  background: var(--text);
  color: #fff;
  display: grid;
  gap: 20px;
}
@media (min-width: 800px) { .use-cta { grid-template-columns: 1fr auto; align-items: center; padding: 40px; } }
.use-cta h2 { font-size: 28px; }
.use-cta p { color: rgba(255, 255, 255, .78); margin-top: 8px; max-width: 60ch; }
.use-cta .btn--primary { --btn-bg: #fff; --btn-fg: var(--text); --btn-border: #fff; }
.use-cta .btn--primary:hover { --btn-bg: #e9e8f8; --btn-border: #e9e8f8; }
.use-cta :focus-visible { outline-color: #fff; }

/* ---------- Использовать / выбор типа / результат ---------- */

.flow { max-width: 880px; }

.flow-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.flow-summary .stage { width: 120px; flex: none; border-radius: 8px; }
.flow-summary__label { font-size: 13px; color: var(--muted); }
.flow-summary__name { font-weight: 700; font-size: 18px; }
.flow-summary__en { color: var(--muted); font-weight: 500; font-size: 15px; }
.flow-summary a { font-size: 14px; }

.method-list { display: grid; gap: 16px; list-style: none; }
.method {
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
@media (min-width: 760px) { .method { grid-template-columns: 56px 1fr auto; align-items: center; } }
.method__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.method__icon svg { width: 28px; height: 28px; }
.method h2 { font-size: 22px; }
.method p { color: var(--muted); margin-top: 6px; font-size: 15px; }

.choice-group { border: 0; padding: 0; margin: 0; }
.choice-group legend { font-weight: 700; font-size: 20px; margin-bottom: 6px; padding: 0; }
.choice-group__hint { color: var(--muted); margin-bottom: 20px; }
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label {
  display: grid;
  gap: 10px;
  height: 100%;
  padding: 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.choice label:hover { border-color: var(--border-strong); }
.choice input:checked + label { border-color: var(--accent); background: #f7f7fe; box-shadow: 0 0 0 1px var(--accent); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.choice__title { font-weight: 700; font-size: 18px; }
.choice__desc { color: var(--muted); font-size: 14px; }
.choice__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text); }
.choice__icon svg { width: 22px; height: 22px; }
.choice__radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; }
.choice input:checked + label .choice__radio { border-color: var(--accent); }
.choice input:checked + label .choice__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }

.alert {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 500;
}
.alert--error { background: #fdecea; color: #8c1d18; border: 1px solid #f3c2bd; }

.result-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; }
.result-meta div { display: grid; }
.result-meta dt { font-size: 13px; color: var(--muted); }
.result-meta dd { margin: 0; font-weight: 700; font-size: 18px; }

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.result-toolbar__spacer { flex: 1; }

.prompt-box { position: relative; }
.prompt-box label { display: block; font-weight: 600; margin-bottom: 8px; }
.prompt-text {
  display: block;
  width: 100%;
  min-height: 60vh;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
@media (min-width: 900px) { .prompt-text { padding: 28px 32px; font-size: 14.5px; } }

.copy-status { min-height: 24px; font-size: 15px; font-weight: 500; }
.copy-status--ok { color: var(--success); }
.copy-status--fail { color: var(--danger); }

.help-text { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* ---------- Уведомление ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-l);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 404 ---------- */

.not-found { padding: 80px 0; max-width: 640px; }
.not-found__code { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.not-found h1 { font-size: clamp(32px, 5vw, 48px); margin: 12px 0 16px; }
.not-found p { color: var(--muted); font-size: 18px; }
.not-found .hero__actions { margin-top: 28px; }

/* ---------- Уменьшение анимаций ---------- */

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