/* W2 · История тренировок — фильтры, календарь, лента и пагинация. */
:is(#screen-history, #sf-history-inline),
:is(#screen-history, #sf-history-inline) * {
  font-variant-numeric: tabular-nums;
}

#screen-history {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--w2-text);
  background: var(--w2-bg);
}

:is(#screen-history, #sf-history-inline) {
  --surface: var(--w2-surface);
  --surface-hi: var(--w2-surface-raised);
  --brd: var(--w2-line);
  --brd-hi: rgba(255,255,255,.16);
}

:is(#screen-history, #sf-history-inline) .sh-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--w2-s8) var(--w2-s6) var(--w2-s9);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}

:is(#screen-history, #sf-history-inline) .sh-body::-webkit-scrollbar {
  width: var(--w2-s2);
}

:is(#screen-history, #sf-history-inline) .sh-body::-webkit-scrollbar-track {
  background: transparent;
}

:is(#screen-history, #sf-history-inline) .sh-body::-webkit-scrollbar-thumb {
  border-radius: var(--w2-s1);
  background: rgba(255,255,255,.16);
}

:is(#screen-history, #sf-history-inline) .sh-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--w2-s5);
}

/* Фильтры */
:is(#screen-history, #sf-history-inline) .sh-filters {
  display: flex;
  align-items: center;
  gap: var(--w2-s2);
  flex-wrap: wrap;
}

:is(#screen-history, #sf-history-inline) .sh-filter-group {
  display: flex;
  align-items: center;
  gap: var(--w2-s2);
  flex-wrap: wrap;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn,
:is(#screen-history, #sf-history-inline) .sh-back-btn,
:is(#screen-history, #sf-history-inline) .sh-analytics-btn {
  min-height: var(--w2-s8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--w2-s2);
  padding: var(--w2-s2) var(--w2-s4);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s2);
  background: transparent;
  color: var(--w2-text-muted);
  font: 600 12px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn:hover,
:is(#screen-history, #sf-history-inline) .sh-back-btn:hover {
  border-color: rgba(255,255,255,.16);
  color: var(--w2-text);
  background: rgba(255, 255, 255, .035);
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn.active {
  border-color: rgba(200, 241, 53, .42);
  color: var(--w2-lime);
  background: rgba(200, 241, 53, .08);
  box-shadow: 0 0 var(--w2-s4) rgba(200, 241, 53, .09);
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn svg,
:is(#screen-history, #sf-history-inline) .sh-back-btn svg,
:is(#screen-history, #sf-history-inline) .sh-analytics-btn svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn.person::before {
  content: '';
  width: var(--w2-s2);
  height: var(--w2-s2);
  flex: 0 0 auto;
  border: 1px solid currentColor;
  background: transparent;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn.person:first-child::before {
  display: none;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn.person.roman::before {
  border-radius: 50%;
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn.person.vlad::before {
  border-radius: var(--w2-s1);
}

:is(#screen-history, #sf-history-inline) .sh-filter-sep {
  width: 1px;
  height: var(--w2-s6);
  margin: 0 var(--w2-s1);
  background: var(--w2-line);
}

:is(#screen-history, #sf-history-inline) .sh-program-btn {
  color: var(--w2-text);
  border-color: rgba(255,255,255,.16);
}

:is(#screen-history, #sf-history-inline) .sh-filter-btn .sh-filter-chevron {
  width: var(--w2-s3);
  height: var(--w2-s3);
  margin-left: var(--w2-s1);
}

:is(#screen-history, #sf-history-inline) .sh-analytics-btn {
  margin-left: auto;
  border-color: rgba(200, 241, 53, .32);
  color: var(--w2-lime);
  background: rgba(200, 241, 53, .06);
}

:is(#screen-history, #sf-history-inline) .sh-analytics-btn:hover {
  border-color: rgba(200, 241, 53, .52);
  background: rgba(200, 241, 53, .11);
  box-shadow: 0 0 var(--w2-s4) rgba(200, 241, 53, .1);
  transform: translateY(-1px);
}

:is(#screen-history, #sf-history-inline) .sh-analytics-btn .sh-arr {
  width: var(--w2-s3);
  height: var(--w2-s3);
  transition: transform 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-analytics-btn:hover .sh-arr {
  transform: translateX(var(--w2-s1));
}

/* Календарь активности */
:is(#screen-history, #sf-history-inline) .sh-heatmap {
  overflow: hidden;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s5);
  background: var(--w2-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

:is(#screen-history, #sf-history-inline) .sh-hm-header {
  min-height: var(--w2-s9);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--w2-s4);
  padding: var(--w2-s4) var(--w2-s5);
  cursor: pointer;
  user-select: none;
  transition: background-color 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-hm-header:hover {
  background: rgba(255, 255, 255, .03);
}

:is(#screen-history, #sf-history-inline) .sh-hm-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--w2-s2);
  color: var(--w2-text);
  font: 700 14px/1.2 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}

:is(#screen-history, #sf-history-inline) .sh-hm-title svg {
  width: var(--w2-s5);
  height: var(--w2-s5);
  color: var(--w2-lime);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

:is(#screen-history, #sf-history-inline) .sh-hm-stats {
  display: flex;
  align-items: center;
  gap: var(--w2-s2);
  color: var(--w2-text-quiet);
  font: 500 12px/1.35 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

:is(#screen-history, #sf-history-inline) .sh-hm-stats .streak {
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s1);
  color: var(--w2-gold);
}

:is(#screen-history, #sf-history-inline) .sh-hm-stats .streak svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
}

:is(#screen-history, #sf-history-inline) .sh-hm-chevron {
  width: var(--w2-s5);
  height: var(--w2-s5);
  stroke: var(--w2-text-quiet);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform 220ms ease-out, stroke 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-hm-chevron.open {
  transform: rotate(180deg);
}

:is(#screen-history, #sf-history-inline) .sh-hm-body {
  min-height: 160px;
  padding: var(--w2-s3) var(--w2-s5) var(--w2-s5);
  border-top: 1px solid var(--w2-line);
}

:is(#screen-history, #sf-history-inline) .sh-hm-body.collapsed {
  display: none;
}

:is(#screen-history, #sf-history-inline) .sh-hm-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--w2-s3);
  margin-top: var(--w2-s3);
  color: var(--w2-text-quiet);
  font: 500 12px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}

:is(#screen-history, #sf-history-inline) .sh-calendar-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}

:is(#screen-history, #sf-history-inline) .sh-hm-legend-item,
:is(#screen-history, #sf-history-inline) .sh-hm-tonnage {
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s2);
}

:is(#screen-history, #sf-history-inline) .sh-hm-tonnage {
  margin-left: var(--w2-s3);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch {
  width: var(--w2-s3);
  height: var(--w2-s3);
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.16);
  background: var(--w2-text-quiet);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.roman {
  border-radius: 50%;
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.vlad {
  border-radius: var(--w2-s1);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.both {
  border-radius: var(--w2-s1);
  transform: rotate(45deg) scale(.78);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.none {
  border-radius: var(--w2-s1);
  background: rgba(255, 255, 255, .025);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.lime-1 {
  border-color: rgba(200, 241, 53, .18);
  background: rgba(200, 241, 53, .16);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.lime-2 {
  border-color: rgba(200, 241, 53, .34);
  background: rgba(200, 241, 53, .42);
}

:is(#screen-history, #sf-history-inline) .sh-hm-swatch.lime-3 {
  border-color: rgba(200, 241, 53, .52);
  background: rgba(200, 241, 53, .78);
}

/* Лента тренировок */
:is(#screen-history, #sf-history-inline) .sh-feed {
  display: flex;
  flex-direction: column;
  gap: var(--w2-s5);
}

:is(#screen-history, #sf-history-inline) .sh-day-group {
  display: flex;
  flex-direction: column;
  gap: var(--w2-s2);
}

:is(#screen-history, #sf-history-inline) .sh-day-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--w2-s2);
}

:is(#screen-history, #sf-history-inline) .sh-day-date {
  color: var(--w2-text-muted);
  font: 600 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: .1em;
  text-transform: uppercase;
}

:is(#screen-history, #sf-history-inline) .sh-day-type {
  color: var(--w2-text);
  font: 700 13px/1.2 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}

:is(#screen-history, #sf-history-inline) .sh-day-program {
  padding: var(--w2-s1) var(--w2-s2);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: rgba(255, 255, 255, .03);
  color: var(--w2-text-quiet);
  font: 600 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

:is(#screen-history, #sf-history-inline) .sh-day-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--w2-s2);
}

:is(#screen-history, #sf-history-inline) .sh-tile {
  min-height: var(--w2-s9);
  display: flex;
  align-items: center;
  gap: var(--w2-s3);
  padding: var(--w2-s3) var(--w2-s4);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s3);
  background: var(--w2-surface);
  cursor: pointer;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-tile:hover {
  border-color: rgba(200, 241, 53, .22);
  background: var(--w2-surface-raised);
  box-shadow: 0 var(--w2-s1) var(--w2-s4) rgba(0, 0, 0, .2);
  transform: translateY(-1px);
}

:is(#screen-history, #sf-history-inline) .sh-tile-person {
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s2);
  color: var(--w2-text);
  font: 700 13px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}

:is(#screen-history, #sf-history-inline) .sh-tile-person::before {
  content: '';
  width: var(--w2-s2);
  height: var(--w2-s2);
  border: 1px solid var(--w2-text-muted);
}

:is(#screen-history, #sf-history-inline) .sh-tile-person.roman::before {
  border-radius: 50%;
}

:is(#screen-history, #sf-history-inline) .sh-tile-person.vlad::before {
  border-radius: var(--w2-s1);
}

:is(#screen-history, #sf-history-inline) .sh-tile-time {
  color: var(--w2-text-quiet);
  font: 500 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
}

:is(#screen-history, #sf-history-inline) .sh-tile-tonnage {
  margin-left: auto;
  color: var(--w2-text-muted);
  font: 700 13px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Пагинация */
:is(#screen-history, #sf-history-inline) .sh-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--w2-s4);
  padding: var(--w2-s3) 0;
}

:is(#screen-history, #sf-history-inline) .sh-page-btn {
  width: var(--w2-s8);
  height: var(--w2-s8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s2);
  background: transparent;
  color: var(--w2-text-muted);
  cursor: pointer;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, opacity 180ms ease-out;
}

:is(#screen-history, #sf-history-inline) .sh-page-btn:hover:not(:disabled) {
  border-color: rgba(200, 241, 53, .34);
  color: var(--w2-lime);
  background: rgba(200, 241, 53, .06);
}

:is(#screen-history, #sf-history-inline) .sh-page-btn:disabled {
  opacity: .3;
  cursor: default;
}

:is(#screen-history, #sf-history-inline) .sh-page-btn svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
}

:is(#screen-history, #sf-history-inline) .sh-page-info {
  color: var(--w2-text-quiet);
  font: 600 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.wd-btn-duration {
  min-height: var(--w2-s8);
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s2);
}

.wd-btn-duration svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
  flex: 0 0 auto;
}

@keyframes w2HistoryEnter {
  from {
    opacity: 0;
    transform: translateY(var(--w2-s2));
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-history.active:not(.w2-no-enter) .sh-filters,
#screen-history.active:not(.w2-no-enter) .sh-heatmap,
#screen-history.active:not(.w2-no-enter) .sh-feed,
#screen-history.active:not(.w2-no-enter) .sh-pagination {
  animation: w2HistoryEnter 420ms ease-out both;
}

#screen-history.active:not(.w2-no-enter) .sh-heatmap {
  animation-delay: 80ms;
}

#screen-history.active:not(.w2-no-enter) .sh-feed {
  animation-delay: 160ms;
}

#screen-history.active:not(.w2-no-enter) .sh-pagination {
  animation-delay: 240ms;
}

@media (max-width: 900px) {
  :is(#screen-history, #sf-history-inline) .sh-body {
    padding: var(--w2-s7) var(--w2-s4) var(--w2-s9);
  }

  :is(#screen-history, #sf-history-inline) .sh-analytics-btn {
    width: 100%;
    margin-left: 0;
  }

  :is(#screen-history, #sf-history-inline) .sh-hm-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  :is(#screen-history, #sf-history-inline) .sh-hm-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
  }
}

@media (max-width: 500px) {
  :is(#screen-history, #sf-history-inline) .sh-body {
    padding: var(--w2-s6) var(--w2-s3) var(--w2-s9);
  }

  :is(#screen-history, #sf-history-inline) .sh-filter-sep {
    display: none;
  }

  :is(#screen-history, #sf-history-inline) .sh-filter-group {
    width: 100%;
  }

  :is(#screen-history, #sf-history-inline) .sh-filter-btn {
    flex: 1 1 auto;
  }

  :is(#screen-history, #sf-history-inline) .sh-hm-header,
  :is(#screen-history, #sf-history-inline) .sh-hm-body {
    padding-left: var(--w2-s4);
    padding-right: var(--w2-s4);
  }

  :is(#screen-history, #sf-history-inline) .sh-hm-tonnage {
    width: 100%;
    margin-left: 0;
  }

  :is(#screen-history, #sf-history-inline) .sh-day-tiles {
    grid-template-columns: 1fr;
  }

  :is(#screen-history, #sf-history-inline) .sh-tile {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(#screen-history, #sf-history-inline) *,
  :is(#screen-history, #sf-history-inline) *::before,
  :is(#screen-history, #sf-history-inline) *::after {
    scroll-behavior: auto;
    animation-duration: .01ms;
    animation-delay: 0ms;
    transition-duration: .01ms;
  }
}

/* Детали тренировки и редактирование значений */
.md-val {
  min-height: var(--w2-s8);
  display: inline-flex;
  align-items: center;
  padding-bottom: var(--w2-s1);
  border-bottom: 1px dashed rgba(255, 255, 255, .2);
  color: var(--w2-text);
  cursor: pointer;
  transition: border-color .14s, color .14s, background-color .14s;
}
.md-val:hover { border-color: rgba(200, 241, 53, .5); color: var(--w2-lime); }
.md-val.editing, input.md-val:focus {
  border-bottom-color: var(--w2-lime);
  outline: none;
  background: rgba(200, 241, 53, .06);
  color: var(--w2-text);
}
input.md-val {
  width: auto;
  min-height: var(--w2-s8);
  max-width: 56px;
  padding: 0 var(--w2-s1) var(--w2-s1);
  border: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .2);
  outline: none;
  background: transparent;
  color: var(--w2-text);
  font: inherit; font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}
input.md-val::-webkit-inner-spin-button, input.md-val::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.md-band {
  min-height: var(--w2-s8);
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s1);
  margin-left: var(--w2-s2);
  padding: 0 var(--w2-s2);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  color: var(--w2-text-muted);
  font: 600 10px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .14s, background-color .14s, color .14s;
}
.md-band:hover { border-color: rgba(200, 241, 53, .3); color: var(--w2-text); }
.md-band svg { width: var(--w2-s3); height: var(--w2-s3); fill: none; stroke: currentColor; stroke-width: 2; }
.md-plateau, .md-pr {
  min-height: var(--w2-s6);
  display: inline-flex;
  align-items: center;
  margin-left: var(--w2-s2);
  padding: 0 var(--w2-s2);
  border-radius: var(--w2-s1);
  font: 700 9px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.md-plateau { border: 1px solid rgba(241, 70, 44, .28); background: rgba(241, 70, 44, .08); color: var(--w2-fire); }
.md-pr { border: 1px solid rgba(255, 215, 64, .28); background: rgba(255, 215, 64, .08); color: var(--w2-gold); }
.md-time { margin-left: var(--w2-s3); color: rgba(200, 241, 53, .58); font: 500 11px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-time-set { color: rgba(200, 241, 53, .34); }
.md-person {
  min-height: var(--w2-s7);
  display: inline-flex;
  align-items: center;
  gap: var(--w2-s2);
  padding: 0 var(--w2-s3);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  color: var(--w2-text-muted);
  font: 700 11px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}
.md-person::before { content: ''; width: var(--w2-s2); height: var(--w2-s2); border: 1px solid var(--w2-lime); border-radius: 50%; }
.md-person.vlad::before { border-radius: var(--w2-s1); }
.md-band-dd {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 160px;
  display: none;
  margin-top: var(--w2-s1);
  padding: var(--w2-s1);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  box-shadow: 0 var(--w2-s2) var(--w2-s6) rgba(0, 0, 0, .5);
}
.md-band-dd.show { display: block; }
.md-band-dd div {
  min-height: var(--w2-s8);
  display: flex;
  align-items: center;
  padding: 0 var(--w2-s3);
  color: var(--w2-text-muted);
  font: 500 11px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .14s, color .14s;
}
.md-band-dd div:hover { background: rgba(255, 255, 255, .05); color: var(--w2-text); }
.md-band-dd div.sel { color: var(--w2-lime); }
.wd-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--w2-s4);
  background: rgba(0, 0, 0, .72);
}
.wd-overlay.active { display: flex; }
.wd-modal {
  width: min(100%, 440px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  color: var(--w2-text);
}
.wd-header { padding: var(--w2-s5) var(--w2-s5) var(--w2-s4); border-bottom: 1px solid var(--w2-line); }
.wd-body { flex: 1; padding: var(--w2-s1) var(--w2-s5) 0; overflow-y: auto; overflow-x: visible; }
.wd-footer { padding: var(--w2-s3) var(--w2-s5) var(--w2-s5); border-top: 1px solid var(--w2-line); }
.wd-ex { padding: var(--w2-s4) 0; border-bottom: 1px solid var(--w2-line); }
.wd-ex:last-child { border-bottom: 0; }
.wd-ex-head { min-height: var(--w2-s7); display: flex; align-items: baseline; justify-content: space-between; gap: var(--w2-s2); margin-bottom: var(--w2-s2); }
.wd-ex-name { color: var(--w2-text); font: 600 13px/1.3 'Inter', sans-serif; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.wd-level-sel { display: inline-flex; gap: var(--w2-s1); margin-left: var(--w2-s2); vertical-align: baseline; }
.wd-level-opt {
  min-width: var(--w2-s8);
  min-height: var(--w2-s8);
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--w2-s1);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 215, 64, .34);
  font-size: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color .14s, background-color .14s, color .14s;
}
.wd-level-opt:hover { border-color: rgba(255, 215, 64, .24); color: rgba(255, 215, 64, .72); }
.wd-level-opt.active { border-color: rgba(255, 215, 64, .32); background: rgba(255, 215, 64, .1); color: var(--w2-gold); cursor: default; }
.wd-sets { display: flex; flex-direction: column; gap: var(--w2-s1); margin-bottom: var(--w2-s2); }
.wd-set { min-height: var(--w2-s7); display: flex; align-items: center; color: var(--w2-text-muted); font: 500 12px/1.4 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.wd-tonnage { color: var(--w2-text-muted); font: 600 11px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.wd-total { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--w2-s3); padding: var(--w2-s3) var(--w2-s5); border-top: 1px solid var(--w2-line); }
.wd-total-val { color: var(--w2-text-muted); font: 700 14px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.wd-total-val span { color: var(--w2-text); }
.wd-total-info { color: var(--w2-text-quiet); font: 500 11px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.wd-actions { display: flex; gap: var(--w2-s2); }
.wd-btn-save, .wd-btn-delete, .wd-btn-duration, .wd-close {
  min-height: var(--w2-s8);
  border-radius: var(--w2-s1);
  font: 700 12px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}
.wd-btn-save {
  flex: 1;
  padding: 0 var(--w2-s4);
  border: 1px solid var(--w2-line);
  background: rgba(255, 255, 255, .04);
  color: var(--w2-text-quiet);
  cursor: default;
  transition: border-color .14s, background-color .14s, color .14s;
}
.wd-btn-save.dirty { border-color: rgba(200, 241, 53, .34); background: rgba(200, 241, 53, .1); color: var(--w2-lime); cursor: pointer; }
.wd-btn-delete { padding: 0 var(--w2-s4); border: 1px solid rgba(241, 70, 44, .28); background: rgba(241, 70, 44, .08); color: var(--w2-fire); cursor: pointer; }
.wd-btn-duration { display: inline-flex; align-items: center; gap: var(--w2-s1); padding: 0 var(--w2-s3); border: 1px dashed rgba(200, 241, 53, .25); background: transparent; color: rgba(200, 241, 53, .62); cursor: pointer; transition: border-color .14s; }
.wd-btn-duration:hover { border-color: rgba(200, 241, 53, .5); }
.wd-btn-duration svg { width: var(--w2-s4); height: var(--w2-s4); }
.wd-close { width: var(--w2-s8); display: grid; padding: 0; place-items: center; border: 0; background: transparent; color: var(--w2-text-quiet); cursor: pointer; }
.wd-close svg { width: var(--w2-s4); height: var(--w2-s4); }
@media (max-width: 500px) {
  .wd-overlay { padding: var(--w2-s2); }
  .wd-modal { max-height: 94vh; }
  .wd-header, .wd-footer { padding-right: var(--w2-s4); padding-left: var(--w2-s4); }
  .wd-body { padding-right: var(--w2-s4); padding-left: var(--w2-s4); }
}
@media (prefers-reduced-motion: reduce) {
  .md-val, .md-band, .md-band-dd div, .wd-level-opt, .wd-btn-save, .wd-btn-duration { transition: none; }
}

.wd-level-star {
  width:1em;
  height:1em;
  fill:currentColor;
  vertical-align:-.1em
}

/* Ряд подхода в модалке правки: выпадашка резинки не липнет к «×»,
   точка-метка инвентаря в аккуратной оправе (правки Романа 12.08) */
.wd-set { display: flex; align-items: center; gap: var(--w2-s2); flex-wrap: wrap; }
.wd-set .md-band { margin-right: var(--w2-s2); }
.wd-set .md-band > span:first-of-type {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); vertical-align: middle;
}
.wd-set .md-val { margin-inline: var(--w2-s1); }

/* Пагинация истории: заметная — кнопки как активные элементы, счётчик читаемый
   (правка Романа 12.08) */
:is(#screen-history, #sf-history-inline) .sh-pagination { display: flex; align-items: center; justify-content: center; gap: var(--w2-s4); padding: var(--w2-s5) 0; }
:is(#screen-history, #sf-history-inline) .sh-pagination button {
  min-width: var(--w2-s8); min-height: var(--w2-s8);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(200, 241, 53, .24); border-radius: var(--w2-s3);
  background: rgba(200, 241, 53, .06); color: var(--w2-lime); cursor: pointer;
  transition: transform 150ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out, opacity 160ms ease-out;
}
:is(#screen-history, #sf-history-inline) .sh-pagination button:hover:not(:disabled) { background: rgba(200, 241, 53, .12); border-color: rgba(200, 241, 53, .4); }
:is(#screen-history, #sf-history-inline) .sh-pagination button:active:not(:disabled) { transform: scale(.96); }
:is(#screen-history, #sf-history-inline) .sh-pagination button:disabled { border-color: var(--w2-line); background: var(--w2-surface); color: var(--w2-text-quiet); cursor: default; }
:is(#screen-history, #sf-history-inline) .sh-page-info {
  min-width: var(--w2-s9); text-align: center;
  color: var(--w2-text); font: 700 15px/1 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums; letter-spacing: .08em;
}
