/* Страница решения «Экскаваторы: моточасы, простой и техсостояние» (solution-excavators.html).
   Подключается только на ней, общий styles.css не меняет. Цвета ленты смены — переменные темы,
   поэтому схема переключается вместе с сайтом. Интерактив — solution-excavators.js. Без скрипта
   (нет класса .exc-js на <html>) всё содержимое видно сразу. Общие блоки собраны из шаблона exc_build.py. */

:root,
[data-theme="light"] {
  --exc-ok: #15803d;
  --exc-work: #22a06b;
  --exc-idle: #f2b705;
  --exc-ham: #7c3aed;
  --exc-off: #e3e9ee;
  --exc-warn-bg: #fff6d6;
}

[data-theme="dark"] {
  --exc-ok: #4ade80;
  --exc-work: #34d399;
  --exc-idle: #fbbf24;
  --exc-ham: #a78bfa;
  --exc-off: #263445;
  --exc-warn-bg: rgba(251, 191, 36, 0.12);
}

/* ---------- Первый экран ---------- */
.exc-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2.2rem; align-items: center; }
.exc-hero h1 { font-size: clamp(1.75rem, 3.3vw, 2.55rem); line-height: 1.15; margin: 0 0 1rem; }
.exc-hero__lead { color: var(--muted); font-size: 1.08rem; line-height: 1.6; max-width: 60ch; margin: 0 0 1.4rem; }
.exc-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.exc-badges { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.exc-badges li { font-size: 0.82rem; font-weight: 600; color: var(--accent-strong); background: var(--accent-light); border-radius: 999px; padding: 0.35rem 0.8rem; }

.exc-live { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg); overflow: hidden; }
.exc-live__bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.exc-live__time { margin-left: auto; font-variant-numeric: tabular-nums; }
.exc-live__dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #22c55e; animation: exc-live 1.8s ease-out infinite; }
.exc-live figcaption { font-size: 0.78rem; color: var(--muted); padding: 0.5rem 0.9rem; border-top: 1px solid var(--line); }

@keyframes exc-live {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
}

@media (max-width: 900px) {
  .exc-hero { grid-template-columns: 1fr; }
  .exc-live { max-width: 640px; width: 100%; margin: 0 auto; }
}

/* ---------- Переключатели и вкладки ---------- */
.exc-seg,
.exc-tabs { display: inline-flex; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem; gap: 0.25rem; box-shadow: var(--shadow-sm); }
.exc-tabs { margin-top: 1.2rem; border-radius: 1.2rem; }
.exc-seg__btn,
.exc-tab { border: 0; background: transparent; padding: 0.55rem 1.1rem; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; transition: background var(--transition), color var(--transition), box-shadow var(--transition); }
.exc-seg__btn:hover,
.exc-tab:hover { color: var(--text); }
.exc-seg__btn[aria-pressed="true"],
.exc-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--on-accent); box-shadow: var(--shadow-md); }
html:not(.exc-js) .exc-seg,
html:not(.exc-js) .exc-tabs { display: none; }

@media (max-width: 560px) {
  .exc-seg,
  .exc-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border-radius: 1rem; }
  .exc-seg__btn,
  .exc-tab { border-radius: 0.75rem; padding: 0.5rem 0.35rem; font-size: 0.8rem; line-height: 1.2; }
}

.exc-panel { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem 1.3rem; }
.exc-js .exc-panel:not(.is-active) { display: none; }
html:not(.exc-js) .exc-panel + .exc-panel { margin-top: 1rem; }
.exc-panel.is-active { animation: exc-panel 0.35s ease-out; }

@keyframes exc-panel {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.exc-panel h3 { margin: 0 0 0.8rem; font-size: 1.12rem; }
.exc-panel h4 { margin: 0 0 0.5rem; font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.exc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.exc-list li { position: relative; padding-left: 1.5rem; line-height: 1.5; }
.exc-list li::before { content: '\2713'; position: absolute; left: 0; top: 0; width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; color: #fff; background: var(--exc-ok); }
.exc-list.is-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1.4rem; }
.exc-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; padding-left: 0.9rem; border-left: 3px solid var(--accent2); max-width: 80ch; }
.exc-more { margin: 1.2rem 0 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 720px) {
  .exc-list.is-cols { grid-template-columns: 1fr; }
}

/* ---------- Сравнение ---------- */
.exc-cmp-list { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; }
.exc-cmp { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem; transition: border-color 0.35s, box-shadow 0.35s; }
.exc-cmp__ico { display: block; font-size: 1.6rem; line-height: 1; }
.exc-cmp h3 { margin: 0.55rem 0 0.6rem; font-size: 1.02rem; padding-right: 1.8rem; }
.exc-cmp p { margin: 0; line-height: 1.5; font-size: 0.94rem; }
.exc-cmp__tag { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 0.25rem; }
.exc-cmp__before { color: var(--muted); }
.exc-cmp__after .exc-cmp__tag { color: var(--accent); }
.exc-cmp__after b { color: var(--accent-strong); }
html:not(.exc-js) .exc-cmp__after { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px dashed var(--line); }
.exc-cmp::after { content: '?'; position: absolute; top: 0.9rem; right: 0.9rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: var(--muted); background: var(--alt); transition: background 0.35s, color 0.35s, transform 0.35s; }
html:not(.exc-js) .exc-cmp::after { display: none; }
.exc-js .exc-cmp { display: grid; grid-template-rows: auto auto 1fr; }
.exc-js .exc-cmp__before,
.exc-js .exc-cmp__after { grid-row: 3; grid-column: 1; transition: opacity 0.35s, transform 0.35s, visibility 0.35s; }
.exc-js .exc-compare[data-state="before"] .exc-cmp__after { opacity: 0; visibility: hidden; transform: translateY(8px); }
.exc-js .exc-compare[data-state="after"] .exc-cmp__before { opacity: 0; visibility: hidden; transform: translateY(-8px); }
.exc-compare[data-state="after"] .exc-cmp { border-color: var(--accent); box-shadow: var(--shadow-md); }
.exc-compare[data-state="after"] .exc-cmp::after { content: '\2713'; color: #fff; background: var(--exc-ok); transform: rotate(360deg); }
.exc-compare[data-hint] .exc-seg__btn[data-compare-set="after"] { animation: exc-hint 2.2s ease-in-out infinite; }

@keyframes exc-hint {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-light); }
  50% { box-shadow: 0 0 0 6px var(--accent-light); }
}

/* ---------- Калькулятор потерь ---------- */
.exc-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 1.3rem; margin-top: 1.3rem; align-items: stretch; }
.exc-calc__in { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: 0.9rem; }
.exc-field { display: grid; gap: 0.3rem; }
.exc-field label { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; font-size: 0.94rem; }
.exc-field output { font-variant-numeric: tabular-nums; color: var(--accent-strong); font-weight: 800; white-space: nowrap; }
.exc-field input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.exc-calc__out { background: #0b1220; color: #cbd5e1; border-radius: var(--radius); padding: 1.3rem 1.3rem 1.2rem; display: grid; gap: 0.9rem; align-content: start; }
.exc-calc__row { display: grid; gap: 0.15rem; padding-bottom: 0.8rem; border-bottom: 1px solid #1e293b; }
.exc-calc__row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.exc-calc__row span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
.exc-calc__row b { font: 700 1.35rem ui-monospace, Consolas, 'Courier New', monospace; color: #fbbf24; font-variant-numeric: tabular-nums; }
.exc-calc__row.is-big b { font-size: 2rem; color: #f87171; }
.exc-calc__src { margin: 0; font-size: 0.8rem; color: #94a3b8; line-height: 1.5; }
html:not(.exc-js) .exc-calc__in input { display: none; }

@media (max-width: 860px) {
  .exc-calc { grid-template-columns: 1fr; }
}

/* ---------- Вопросы ---------- */
.exc-faq { display: grid; gap: 0.6rem; margin-top: 1.2rem; max-width: 860px; }
.exc-faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; transition: border-color var(--transition); }
.exc-faq details[open] { border-color: var(--accent); }
.exc-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.exc-faq summary::-webkit-details-marker { display: none; }
.exc-faq summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.exc-faq details[open] summary::after { content: '\2212'; }
.exc-faq details p { color: var(--muted); line-height: 1.6; margin: 0.6rem 0 0; }

/* ---------- Оборудование ---------- */
.exc-equip { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.2rem; }
.exc-photo { display: block; width: 100%; height: auto; aspect-ratio: 500 / 340; object-fit: contain; background: #fff; }
.exc-photo.is-cover { object-fit: cover; }
.exc-card-link { display: inline-block; margin-top: 0.7rem; font-weight: 600; text-decoration: none; }

/* ---------- Заявка ---------- */
.exc-final { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 2rem; align-items: center; }
.exc-final p { color: rgba(255, 255, 255, 0.86); line-height: 1.6; max-width: 60ch; }
.exc-final__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }
.section--cta .exc-btn-max { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; }
.section--cta .exc-btn-max:hover { background: rgba(255, 255, 255, 0.16); color: #fff; transform: translateY(-1px); }
.exc-final__mail { font-size: 0.9rem; }
.exc-contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.exc-contacts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "role role" "phone name"; gap: 0.15rem 0.8rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0.9rem; padding: 0.75rem 1rem; }
.exc-contacts span { grid-area: role; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.section--cta .exc-contacts a { grid-area: phone; font-size: 1.15rem; font-weight: 700; text-decoration: none; color: #fff; white-space: nowrap; }
.section--cta .exc-contacts a:hover { color: var(--accent2); }
.exc-contacts small { grid-area: name; align-self: center; font-size: 0.9rem; color: rgba(255, 255, 255, 0.72); }

@media (max-width: 820px) {
  .exc-final { grid-template-columns: 1fr; }
}


/* ---------- Лента смены ---------- */
.exc-ribbon { display: block; width: 100%; height: auto; padding: 0.6rem 0.6rem 0.2rem; }
.exc-ribbon__h, .exc-ribbon__legend { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.exc-ribbon__note { font-size: 10px; font-weight: 600; fill: var(--muted); }
.exc-ribbon__off { fill: var(--exc-off); }
.exc-ribbon__work { fill: var(--exc-work); }
.exc-ribbon__idle { fill: var(--exc-idle); }
.exc-ribbon__ham { fill: var(--exc-ham); }
.exc-ribbon__now { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0; }
.exc-js .exc-ribbon__now.is-on { opacity: 0.8; }

.exc-legend { list-style: none; margin: 0; padding: 0 0.8rem 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.78rem; color: var(--muted); }
.exc-legend li { display: flex; align-items: center; gap: 0.35rem; }
.exc-legend i { width: 0.75rem; height: 0.75rem; border-radius: 0.2rem; }
.exc-legend .is-work { background: var(--exc-work); }
.exc-legend .is-idle { background: var(--exc-idle); }
.exc-legend .is-off { background: var(--exc-off); border: 1px solid var(--line); }
.exc-legend .is-ham { background: var(--exc-ham); }
.exc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0; padding: 0.4rem 0.8rem 0.6rem; }
.exc-kpis div { background: var(--alt); border-radius: 0.7rem; padding: 0.5rem 0.6rem; min-width: 0; }
.exc-kpis div.is-warn { background: var(--exc-warn-bg); }
.exc-kpis dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.exc-kpis dd { margin: 0.15rem 0 0; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exc-health { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.8rem 0.7rem; }
.exc-health span { font-size: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.exc-health b { color: var(--text); font-weight: 700; margin-right: 0.2rem; }
.exc-health .is-ok { border-color: var(--exc-ok); }
.exc-health .is-ok b { color: var(--exc-ok); }

@media (max-width: 560px) {
  .exc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exc-ribbon__h { font-size: 15px; }
  .exc-ribbon__note { display: none; }
}

/* ---------- Источники данных ---------- */
.exc-src { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; }
.exc-src li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.05rem 1.1rem; display: grid; gap: 0.35rem; align-content: start; }
.exc-src__ico { font-size: 1.5rem; line-height: 1; }
.exc-src b { font-size: 1rem; }
.exc-src span:last-child { color: var(--muted); line-height: 1.5; font-size: 0.92rem; }

.exc-sub { margin: 2.2rem 0 0.3rem; font-size: 1.15rem; }
.exc-sub__lead { margin: 0; color: var(--muted); line-height: 1.55; }
.exc-cov { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; display: grid; gap: 1rem; }
.exc-cov .exc-seg { justify-self: start; }
.exc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.exc-bars li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 3rem; gap: 0.8rem; align-items: center; }
.exc-bars__name { font-size: 0.92rem; }
.exc-bars__track { height: 0.75rem; border-radius: 999px; background: var(--alt); overflow: hidden; }
.exc-bars__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width 0.5s ease; }
.exc-bars__val { text-align: right; font-variant-numeric: tabular-nums; }
.exc-cov__note { margin: 0; font-size: 0.86rem; color: var(--muted); }

@media (max-width: 640px) {
  .exc-bars li { grid-template-columns: minmax(0, 1fr) 3rem; grid-template-areas: "name val" "track track"; gap: 0.25rem 0.6rem; }
  .exc-bars__name { grid-area: name; }
  .exc-bars__track { grid-area: track; }
  .exc-bars__val { grid-area: val; }
}

/* ---------- Как подключаем ---------- */
.exc-how { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; counter-reset: how; }
.exc-how li { counter-increment: how; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.6rem 0.95rem 1rem; display: grid; gap: 0.3rem; align-content: start; }
.exc-how li::before { content: counter(how); position: absolute; top: 0.8rem; left: 0.95rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.82rem; background: var(--accent2); color: var(--on-accent2); }
.exc-how b { font-size: 0.98rem; }
.exc-how span { color: var(--muted); line-height: 1.5; font-size: 0.9rem; }

@media (max-width: 1000px) {
  .exc-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .exc-how { grid-template-columns: 1fr; }
}

/* ---------- Смотрите также ---------- */
.exc-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; margin-top: 1.6rem; }
.exc-next__card { display: grid; gap: 0.35rem; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text); transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.exc-next__card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.exc-next__card b { font-size: 1.02rem; color: var(--accent-strong); }
.exc-next__card span { color: var(--muted); line-height: 1.5; }

@media (max-width: 860px) {
  .exc-next { grid-template-columns: 1fr; }
}

/* ---------- Без анимаций по просьбе системы ---------- */
@media (prefers-reduced-motion: reduce) {
  .exc-live__dot,
  .exc-bars__fill,
  .exc-compare[data-hint] .exc-seg__btn[data-compare-set="after"] {
    animation: none !important;
    transition: none !important;
  }
}
