/* Раздел «Автоматизация». Не меняет :root.
   Цвета, радиусы и тени — только токены style.css.
   Бесконечные анимации: луч сканера (.beam) и точка пути (.path__dot).
   Пауза: body.auto-paused (вне экрана и document.hidden) и prefers-reduced-motion. */

.auto-section { overflow-x: clip; overflow-wrap: anywhere; color: var(--text); font-family: var(--font-sans); }
.auto-section .container { max-width: 1120px; }
.auto-hero { padding: var(--space-5) 0 var(--space-2); min-width: 0; }
.auto-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; min-width: 0; }
.auto-section .btn { white-space: normal; max-width: 100%; min-width: 0; }
.auto-actions, .stage { min-width: 0; max-width: 100%; }
.auto-eyebrow { letter-spacing: .06em; text-transform: uppercase; font-size: var(--fs-xs); margin: 0 0 var(--space-2); color: var(--text-secondary); }
.auto-lead { font-size: var(--fs-md); max-width: 42rem; }
.auto-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0; }
.auto-facts { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.auto-facts li { display: grid; gap: 2px; }
.auto-note, .auto-updated, .auto-reply { font-size: var(--fs-sm); color: var(--text-secondary); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.auto-switch, .auto-toc__row, .auto-chiplinks { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-4); }
.auto-switch { padding: var(--space-2) 0; }
.auto-switch__a, .auto-toc a, .auto-chiplinks a {
  display: inline-flex; align-items: center; min-height: var(--touch-min);
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3);
  text-decoration: none; color: var(--text); background: var(--btn-ghost-bg);
  font-size: var(--fs-sm);
}
.auto-switch__a:hover, .auto-toc a:hover, .auto-chiplinks a:hover {
  background: var(--btn-ghost-hover-bg); border-color: var(--btn-ghost-hover-border);
}
.auto-switch__a.is-on {
  background: var(--eng-blue-dim); color: var(--text); border-color: var(--eng-blue);
}
.auto-toc { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.auto-block { padding: var(--space-6) 0; }
.auto-cards, .auto-sols, [data-auto-hits] { display: grid; gap: var(--space-3); min-width: 0; }
.auto-card, .auto-sol, .auto-list, .auto-ol { min-width: 0; max-width: 100%; }
.auto-card, .auto-sol {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.auto-card h3, .auto-sol h3 { margin: 0 0 var(--space-2); font-size: var(--fs-md); }
.auto-list, .auto-ol { padding-left: 1.2rem; }
.auto-banner {
  background: var(--bg-2); color: var(--text); padding: var(--space-3) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.auto-banner a { color: inherit; }
.auto-final__grid, .auto-airat { display: grid; gap: var(--space-5); }
.auto-badge { display: flex; gap: var(--space-3); align-items: center; margin: 0; }
.auto-badge img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-lg); }
.auto-badge figcaption { display: grid; }

.auto-field { display: grid; gap: var(--space-1); margin: var(--space-2) 0; font-size: var(--fs-sm); color: var(--muted); }
.auto-field input, .auto-field textarea, .auto-field select, .auto-search input {
  width: 100%; max-width: 100%; box-sizing: border-box; min-height: var(--touch-min);
  padding: var(--space-2) var(--space-3); font-family: var(--font-sans); font-size: var(--fs-base);
  color: var(--text); background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: var(--radius);
}
.auto-urgency { border: 0; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.auto-quiz fieldset {
  border: 1px solid var(--line); border-radius: var(--radius-lg); margin: 0 0 var(--space-3);
  padding: var(--space-3); display: grid; gap: var(--space-2);
}
.auto-quiz label { display: flex; gap: var(--space-2); align-items: flex-start; }
.auto-now { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.auto-error { color: var(--error); }
.auto-table-wrap { overflow-x: auto; max-width: 100%; }
.auto-table { width: 100%; border-collapse: collapse; }
.auto-table th, .auto-table td { border-bottom: 1px solid var(--line); text-align: left; padding: var(--space-2); vertical-align: top; }
.auto-nodes { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.auto-nodes button {
  min-height: var(--touch-min); border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: var(--space-2) var(--space-3); font-family: var(--font-sans);
}
.auto-node-text { margin-top: var(--space-2); }
.auto-search { display: grid; gap: var(--space-2); }
.auto-miss { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: var(--space-3); background: var(--surface); }
.auto-sol mark { background: var(--eng-blue-dim); color: inherit; }
.auto-copy { font-size: var(--fs-sm); }
.auto-sol .btn { margin-top: var(--space-2); }
.auto-danger { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: var(--space-3) 0; }
.auto-danger__badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--loss); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--space-1) var(--space-2);
}
.auto-result--risk strong { color: var(--loss); }

.stage {
  --auto-iiko: var(--steel-strong);
  --auto-frontol: var(--eng-blue);
  --auto-aitida: var(--text-secondary);
  --auto-paper: var(--surface-2);
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: var(--space-4); position: relative; overflow: hidden; min-height: 260px;
}
.stage * { box-sizing: border-box; }
.ticket {
  background: var(--auto-paper); color: var(--text); width: min(240px, 100%); margin: var(--space-2) auto;
  padding: var(--space-3) var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: var(--fs-xs);
}
.ticket h4, .ticket .r, .ticket .tot { display: flex; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-2); }
.ticket h4 { color: var(--text); font-size: var(--fs-xs); }
.ticket .ok { color: var(--call); }
.ticket--print { animation: auto-print 1.1s var(--ease-out) both; }
.stage__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage__lines path { fill: none; stroke: var(--auto-frontol); stroke-width: 1.5; stroke-dasharray: 8 6; animation: auto-dash 2.4s linear both; }
.stage__nodes { display: grid; gap: var(--space-2); justify-items: end; font-size: var(--fs-xs); color: var(--text-secondary); }
.stage--hub { display: grid; grid-template-columns: minmax(88px, 1fr) 200px; gap: var(--space-3); align-items: center; }
.stage--hub .ticket { width: 200px; margin: 0; }
.stage__nodes span { white-space: nowrap; }
.dmw { position: relative; width: min(180px, 46%); margin: 0 auto; }
.dm { width: 100%; height: auto; display: block; }
.beam {
  position: absolute; left: 6%; right: 6%; height: 3px; top: 12%;
  background: var(--auto-frontol); box-shadow: none;
  animation: auto-beam 2.8s ease-in-out infinite;
}
.dm__lbl, .prog-badge { font-size: var(--fs-xs); letter-spacing: .04em; }
.prog-badge { position: absolute; right: var(--space-3); bottom: var(--space-3); border: 1px solid currentColor; border-radius: var(--radius); padding: 2px var(--space-2); }
.prog-badge--frontol { color: var(--auto-frontol); }
.prog-badge--iiko { color: var(--auto-iiko); }
.prog-badge--aitida { color: var(--auto-aitida); }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.path li { display: grid; }
.path b { color: var(--auto-frontol); }
.path__dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--auto-frontol); display: block; margin: var(--space-2) 0;
  animation: auto-hop 3.2s ease-in-out infinite;
}
.punch {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: var(--touch-min); padding: var(--space-2) var(--space-3); font-weight: 700; font-family: var(--font-sans);
}
.stations { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.st { border: 1px solid var(--auto-iiko); border-radius: var(--radius-lg); padding: var(--space-2); display: grid; }
.open-tl { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-3) 0 0; font-size: var(--fs-xs); }
.open-tl li { border-bottom: 2px solid var(--auto-iiko); padding-bottom: 2px; }
.layers { display: grid; gap: var(--space-2); }
.lay { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); display: grid; }
.lay i { font-style: normal; color: var(--auto-aitida); }
.cnt u { text-decoration: none; color: var(--auto-aitida); animation: auto-swap 2.4s var(--ease-out) both; }
body.auto-paused .beam,
body.auto-paused .path__dot,
body.auto-paused .ticket--print,
body.auto-paused .stage__lines path,
body.auto-paused .cnt u { animation-play-state: paused; }

@keyframes auto-print { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes auto-dash { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }
@keyframes auto-beam { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(140px); } }
@keyframes auto-hop { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(28px); opacity: 1; } }
@keyframes auto-swap { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 900px) {
  .auto-hero__grid, .auto-final__grid, .auto-airat { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .auto-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .auto-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .auto-table, .auto-table tbody, .auto-table tr, .auto-table td { display: block; width: 100%; }
  .auto-table tr { margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2); }
  .stage--hub { grid-template-columns: 1fr; }
  .stage--hub .ticket { width: min(240px, 100%); margin: var(--space-2) auto; }
  .stage__nodes span { white-space: normal; }
  .stage__nodes { justify-items: start; }
}
.auto-section .content-related__list a { text-decoration: underline; text-underline-offset: 2px; }
.auto-prose { max-width: 44rem; }
.auto-prose h2, .auto-block h2, .auto-card h3 { overflow-wrap: anywhere; }
.auto-prose p, .auto-prose li, .auto-lead, .auto-card p, .auto-sol p, .auto-note { overflow-wrap: anywhere; }
.auto-block { scroll-margin-top: 72px; }
.auto-callout { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 16px 0; }
.auto-sources { font-size: 14px; }
.auto-tracks, .auto-taps { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; margin: 12px 0; max-width: 100%; background: var(--surface); }
.auto-tracks__switch, .auto-taps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.auto-tracks__stage { position: relative; min-height: 72px; margin-top: 10px; overflow: hidden; }
.auto-bottle { display: inline-block; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); transition: transform 2s ease; }
.auto-tracks[data-state="hall"] .auto-bottle { transform: translateX(0.5rem); }
.auto-tracks[data-state="vitrina"] .auto-bottle { transform: translateX(1.25rem); }
.auto-section .project-links a,
.auto-section .content-related__list a,
.auto-sol a { overflow-wrap: anywhere; max-width: 100%; }
.auto-tracks__out { display: none; margin-top: 8px; }
.auto-tracks[data-state="hall"] [data-hall],
.auto-tracks[data-state="vitrina"] [data-vitrina] { display: block; }
.auto-kegpath li, .auto-card--rise { animation: auto-rise .5s ease both; }
.auto-kegpath li:nth-child(2), .auto-card--rise:nth-child(2) { animation-delay: .12s; }
.auto-kegpath li:nth-child(3), .auto-card--rise:nth-child(3) { animation-delay: .24s; }
.auto-kegpath li:nth-child(4), .auto-card--rise:nth-child(4) { animation-delay: .36s; }
@keyframes auto-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .beam, .path__dot, .ticket--print, .stage__lines path, .cnt u,
  .auto-kegpath li, .auto-card--rise { animation: none !important; }
  .auto-bottle { transition: none; }
}
