/* Секундомер ЕГЭ — блок под условием вместо HTML-решения */

.ege-task-stopwatch-wrap {
  display: none !important;
}

/* Список вариантов /ege-{n}/ и /oge-{n}/ — без переключателя и капсулы в шапке. */
body[data-neuroege-hf-variant-list-only="1"] .hf-task-unified__stopwatch-slot {
  display: none !important;
}

/* По центру ширины шапки (десктоп и мобильный slug). */
body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__stopwatch-slot,
body.task-mobile-mode:is(.hf-mobile-list-feed, .neuroege-hf-slug-active)
  .header--task-unified
  .hf-task-unified__stopwatch-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: min(100%, calc(100% - 12rem));
  transform: translateY(-50%);
  pointer-events: none;
}

body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__stopwatch-slot > *,
body.task-mobile-mode:is(.hf-mobile-list-feed, .neuroege-hf-slug-active)
  .header--task-unified
  .hf-task-unified__stopwatch-slot
  > * {
  pointer-events: auto;
}

/* Высота как у кнопки «Вход» в шапке. Бегунок не меняем. Фон спокойный, не мятный. */
.hf-task-unified__stopwatch-cluster {
  --hf-stopwatch-switch-center-x: 0px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transform: translateX(calc(-1 * var(--hf-stopwatch-switch-center-x)));
  box-sizing: border-box;
  min-height: calc(0.32rem * 2 + 1.2 * 0.82rem);
  padding: 0 0.55rem 0 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
}

.ege-task-stopwatch--mini {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ege-task-stopwatch--mini[hidden] {
  display: none !important;
}

.ege-task-stopwatch--mini .ege-task-stopwatch__digital-value {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  min-width: 4.6rem;
  line-height: 1.2;
  color: #f8fafc;
}

.ege-task-stopwatch__mini-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 650;
  cursor: pointer;
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.85);
}

.ege-task-stopwatch__mini-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.ege-task-stopwatch__mini-btn--start {
  color: #052e16;
  background: #34d399;
}

.ege-task-stopwatch--mini[data-state="running"] .ege-task-stopwatch__mini-btn--start {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.95);
}

.ege-task-stopwatch__mini-btn:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.ege-task-stopwatch__norm {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  min-width: 3.1rem;
  padding-left: 0.35rem;
  margin-left: 0.1rem;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(148, 163, 184, 0.95);
}

.ege-task-stopwatch__norm-label {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.ege-task-stopwatch__norm-track {
  position: relative;
  display: block;
  width: 3.1rem;
  height: 0.26rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
  opacity: 0.35;
  direction: ltr;
  transition: opacity 0.15s ease;
}

.ege-task-stopwatch__norm--active .ege-task-stopwatch__norm-track,
.ege-task-stopwatch__norm--running .ege-task-stopwatch__norm-track {
  opacity: 1;
}

.ege-task-stopwatch__norm-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399 0%, #2dd4bf 100%);
  transform-origin: left center;
  transition: width 0.06s linear;
}

.ege-task-stopwatch__norm--over .ege-task-stopwatch__norm-fill {
  background: linear-gradient(90deg, #fb923c 0%, #f87171 100%);
}

.ege-task-stopwatch__norm--over .ege-task-stopwatch__norm-label {
  color: #fca5a5;
}

[data-theme="light"] .ege-task-stopwatch__norm {
  border-left-color: rgba(15, 23, 42, 0.12);
  color: #64748b;
}

[data-theme="light"] .ege-task-stopwatch__norm-track {
  background: rgba(15, 23, 42, 0.1);
}

.ege-task-stopwatch-wrap {
  flex-shrink: 0;
  margin-top: 0.85rem;
}

.ege-task-stopwatch:not(.ege-task-stopwatch--mini) {
  max-width: 22rem;
  margin-inline: auto;
  padding: 1.1rem 1.15rem 0.85rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.ege-task-stopwatch--mini {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.ege-task-stopwatch__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ege-task-stopwatch__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.ege-task-stopwatch__display-toggle {
  display: inline-flex;
  padding: 0.12rem;
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.ege-task-stopwatch__display-btn {
  border: 0;
  border-radius: 0.42rem;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  color: rgba(203, 213, 225, 0.8);
  background: transparent;
  cursor: pointer;
}

.ege-task-stopwatch__display-btn--active {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.95);
}

.ege-task-stopwatch__display-btn:focus-visible,
.ege-task-stopwatch__round:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.ege-task-stopwatch__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 11.5rem;
  padding: 0.35rem 0 0.15rem;
}

.ege-task-stopwatch__face[hidden],
.ege-task-stopwatch__digital[hidden] {
  display: none;
}

.ege-task-stopwatch__dial {
  width: min(11.5rem, 68vw);
  height: auto;
}

.ege-task-stopwatch__dial-ring {
  fill: #020617;
  stroke: rgba(226, 232, 240, 0.16);
  stroke-width: 2;
}

.ege-task-stopwatch__ticks line {
  stroke: rgba(226, 232, 240, 0.55);
  stroke-width: 2;
  stroke-linecap: round;
}

.ege-task-stopwatch__hand {
  stroke-linecap: round;
}

.ege-task-stopwatch__hand--minute {
  stroke: #f8fafc;
  stroke-width: 3.5;
}

.ege-task-stopwatch__hand--second {
  stroke: #34d399;
  stroke-width: 1.75;
}

.ege-task-stopwatch[data-state="running"] .ege-task-stopwatch__hand--second {
  stroke: #4ade80;
}

.ege-task-stopwatch__hub {
  fill: #34d399;
}

.ege-task-stopwatch__digital {
  margin: 0.35rem 0 0;
}

.ege-task-stopwatch__face:not([hidden]) + .ege-task-stopwatch__digital {
  margin-top: 0.15rem;
}

.ege-task-stopwatch__digital-value {
  font-variant-numeric: tabular-nums;
  font-size: 2.35rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: #f8fafc;
}

.ege-task-stopwatch__face[hidden] + .ege-task-stopwatch__digital .ege-task-stopwatch__digital-value,
.ege-task-stopwatch__stage:not(:has(.ege-task-stopwatch__face:not([hidden]))) .ege-task-stopwatch__digital-value {
  font-size: clamp(2.6rem, 9vw, 3.25rem);
}

.ege-task-stopwatch__status {
  margin: 0.35rem 0 0;
  min-height: 1.15rem;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
  text-align: center;
}

.ege-task-stopwatch[data-state="running"] .ege-task-stopwatch__status {
  color: #6ee7b7;
}

.ege-task-stopwatch__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.35rem;
  margin-top: 0.35rem;
}

.ege-task-stopwatch__round {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.ege-task-stopwatch__round--reset {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.85);
}

.ege-task-stopwatch__round--reset:disabled {
  opacity: 0.38;
  cursor: default;
}

.ege-task-stopwatch__round--start {
  color: #052e16;
  background: #34d399;
}

.ege-task-stopwatch[data-state="running"] .ege-task-stopwatch__round--start {
  color: #431407;
  background: #fb923c;
}

.ege-task-stopwatch__round:hover:not(:disabled) {
  filter: brightness(1.06);
}

.ege-task-stopwatch__hint {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgba(100, 116, 139, 0.95);
}

body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__brand-toggles {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  min-width: max-content;
}

body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__brand-toggles > .hf-task-mode-switch {
  flex-shrink: 0;
  margin-left: 0;
}

body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__brand-toggles .hf-task-mode-switch__label {
  max-width: none;
  white-space: nowrap;
}

.hf-task-unified__stopwatch-switch--bank-off .hf-task-mode-switch__label {
  opacity: 0.55;
}

/* Телефон: /ege-{n}/, /ege-{n}/{slug}/, /oge-{n}/, /oge-{n}/{slug}/ — без переключателя «Секундомер» в шапке */
body.task-mobile-mode .header--task-unified .hf-task-unified__stopwatch-slot,
body.task-mobile-mode .header--task-unified .hf-task-unified__stopwatch-switch,
html.task-mobile-lite .header--task-unified .hf-task-unified__stopwatch-slot,
html.task-mobile-lite .header--task-unified .hf-task-unified__stopwatch-switch {
  display: none !important;
}

@media (max-width: 900px), ((max-width: 1100px) and (pointer: coarse)) {
  .header--task-unified .hf-task-unified__stopwatch-slot,
  .header--task-unified .hf-task-unified__stopwatch-switch {
    display: none !important;
  }
}

body:not(.task-mobile-mode) .header--task-unified .hf-task-unified__brand {
  max-width: min(30rem, calc(100% - 18rem));
}

/* Заголовок задания не перекрывается капсулой секундомера */
body.neuroege-stopwatch-mode:not(.task-mobile-mode) .header--task-unified .hf-task-unified__center {
  visibility: hidden;
  pointer-events: none;
}

[data-theme="light"] .hf-task-unified__stopwatch-cluster {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

[data-theme="light"] .ege-task-stopwatch--mini .ege-task-stopwatch__digital-value {
  color: #0f172a;
}

[data-theme="light"] .ege-task-stopwatch:not(.ege-task-stopwatch--mini) {
  border-color: rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .ege-task-stopwatch__kicker,
[data-theme="light"] .ege-task-stopwatch__status,
[data-theme="light"] .ege-task-stopwatch__hint {
  color: #64748b;
}

[data-theme="light"] .ege-task-stopwatch__display-toggle {
  background: #e2e8f0;
  border-color: transparent;
}

[data-theme="light"] .ege-task-stopwatch__display-btn {
  color: #475569;
}

[data-theme="light"] .ege-task-stopwatch__display-btn--active {
  color: #0f172a;
  background: #fff;
}

[data-theme="light"] .ege-task-stopwatch__digital-value {
  color: #0f172a;
}

[data-theme="light"] .ege-task-stopwatch__dial-ring {
  fill: #fff;
  stroke: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .ege-task-stopwatch__round--reset {
  background: #e2e8f0;
  color: #0f172a;
}
