:root {
  color-scheme: light;
  --accent: #00897b;
  --accent-dark: #00695c;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-faint: color-mix(in srgb, var(--accent) 10%, transparent);
  --surface: #f5f5f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #616161;
  --border: #bdbdbd;
  --radius: 8px;
}

body[data-theme="aas"] {
  --accent: #f57c00;
  --accent-dark: #e65100;
}

body[data-theme="tirzo"] {
  --accent: #e91e63;
  --accent-dark: #c2185b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}

.header {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

.header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-switcher {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-oval {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--oval);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

.app-oval--calcs {
  --oval: #00897b;
}

.app-oval--aas {
  --oval: #f57c00;
}

.app-oval--tirzo {
  --oval: #e91e63;
}

.app-oval__btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-oval__btn:hover,
.app-oval__btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.app-oval__btn--active,
.app-oval__btn--active:hover,
.app-oval__btn--active:focus-visible {
  background: #fff;
  color: var(--oval);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.chip-group--under-input {
  justify-content: center;
}

.field__control {
  position: relative;
  display: block;
}

.field__unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

.field__unit--toggle {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
  cursor: pointer;
}

.field__unit--toggle:hover,
.field__unit--toggle:focus-visible {
  color: var(--accent);
  outline: none;
}

.field__control--unit-sm input {
  padding-right: 2.75rem;
}

.field__control--unit-md input {
  padding-right: 4.25rem;
}

.field__control--unit-lg input {
  padding-right: 5rem;
}

input[type='text'],
input[type='number'],
select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
}

input[type='text']:focus,
input[type='number']:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

input[type='text']:disabled,
input[type='number']:disabled,
select:disabled {
  background: #eceff1;
  border-color: #cfd8dc;
  color: #8a8f94;
  cursor: not-allowed;
}

.calc-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-block__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
}

.calc-block__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.calc-block__title-row .calc-block__title {
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

/* Пока переключатель формы скрыт — заголовок как раньше по центру */
.calc-block__title-row:has(.dose-form-switch.hidden) .calc-block__title,
.calc-block__title-row:has(.dose-form-switch[hidden]) .calc-block__title {
  text-align: center;
}

.dose-form-switch {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.dose-form-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1.2;
}

.dose-form-switch__btn--active {
  background: var(--accent);
  color: #fff;
}

.dose-calc,
.tablet-calc,
.tirz-calc,
.week-calc {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tablet-visual-wrap[hidden] {
  display: none;
}

.tablet-visual-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.tablet-slot {
  display: flex;
  justify-content: center;
  width: 100%;
}

.tablet-pills {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.tablet-pill__outline {
  fill: none;
  stroke: #9e9e9e;
  stroke-width: 1.5;
}

.tablet-pill__fill {
  fill: url(#tabletPillFill);
}

.tablet-pill__shine {
  fill: rgba(255, 255, 255, 0.45);
}

.tablet-pill__score {
  stroke: rgba(120, 100, 60, 0.35);
  stroke-width: 1;
}

.frequency h2,
.result h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.frequency {
  margin-top: 0;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.radio input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.radio__text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frequency-option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
}

.frequency-option > input[type='radio'] {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.frequency-picker {
  flex: 1;
  min-width: 0;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.frequency-picker--inactive {
  opacity: 0.4;
  filter: blur(1.5px);
  pointer-events: none;
}

.frequency-picker__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.frequency-picker__word {
  font-size: 1rem;
  white-space: nowrap;
  color: var(--text);
}

.chip-group {
  display: flex;
  gap: 6px;
}

.chip-group--stretch {
  flex: 1;
  min-width: 0;
}

.chip-group--flat {
  gap: 0;
}

.chip-group--flat .chip {
  min-width: 0;
  padding: 4px 6px;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-muted);
  box-shadow: inset 0 -2px 0 transparent;
}

.chip-group--flat .chip:hover,
.chip-group--flat .chip:focus-visible {
  background: transparent;
  border: none;
  color: var(--text);
}

.chip-group--flat .chip--selected {
  background: transparent;
  border: none;
  color: var(--accent-dark);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.chip-group--compact {
  gap: 4px;
}

.chip-group--pen {
  flex-wrap: wrap;
}

.chip--pen {
  min-width: 48px;
  padding: 8px 6px;
  font-size: 0.875rem;
}

.chip {
  min-width: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip-group--stretch .chip {
  flex: 1;
}

.chip--compact {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.chip--selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.result {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
}

.result__row {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
}

.result__value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.result__round-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  height: 1.1em;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 1.375rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}

.result__round-btn[aria-pressed='true'] {
  color: var(--accent-dark);
}

.result__round-btn:hover,
.result__round-btn:focus-visible {
  background: var(--accent-faint);
  outline: none;
}

.result__round-btn[hidden] {
  display: none;
}

.result__detail {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.tirz-explain {
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.explain-panel {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #e5e7eb);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, #fafbfc);
}

.explain-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.explain-panel__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #a8b0ba;
  color: #5f6b77;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.explain-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

.tirz-explain__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.tirz-explain__step {
  margin: 0;
}

.tirz-explain__step strong {
  color: var(--text);
  font-weight: 600;
}

.hidden {
  display: none;
}

.syringe-wrap[hidden] {
  display: none;
}

.syringe-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.syringe-mode[hidden] {
  display: none;
}

.syringe-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: center;
}

.syringe-mode .radio {
  padding: 2px 0;
}

.syringe-mode .radio[hidden] {
  display: none;
}

.syringe-mode__option--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.syringe-slot {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 284 / 72;
  display: grid;
  place-items: center;
}

.syringe-slot > .syringe,
.syringe-slot > .syringe__caption {
  grid-area: 1 / 1;
}

.syringe {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
}

.syringe[hidden] {
  display: none;
}

.syringe__barrel {
  fill: rgba(255, 255, 255, 0.85);
  stroke: #9e9e9e;
  stroke-width: 1.5;
}

.syringe__liquid {
  fill: url(#syringeLiquid);
}

.syringe__shine {
  fill: rgba(255, 255, 255, 0.22);
}

.syringe__tick {
  stroke: #757575;
  stroke-width: 1;
}

.syringe__tick--minor {
  stroke: #9e9e9e;
  stroke-width: 0.75;
}

.syringe__tick--u100-minor {
  stroke: #616161;
  stroke-width: 1.1;
}

.syringe__tick--medium {
  stroke: #858585;
  stroke-width: 1;
}

.syringe__tick--major {
  stroke: #616161;
  stroke-width: 1.35;
}

.syringe__tick--major-on-barrel {
  stroke: #424242;
  stroke-width: 1.75;
}

.syringe__label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
}

.syringe__label--on-barrel {
  font-size: 13px;
  font-weight: 600;
  fill: #424242;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
  paint-order: stroke fill;
}

.syringe__label--u100 {
  font-size: 9px;
  stroke-width: 2.5;
}

.syringe__hub {
  fill: #e0e0e0;
  stroke: #757575;
  stroke-width: 1;
}

.syringe__needle {
  stroke: #616161;
  stroke-width: 1.5;
}

.syringe__caption {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

.syringe__caption:empty {
  display: none;
}

.schedule-wrap[hidden] {
  display: none;
}

.schedule-wrap {
  width: 100%;
  max-width: 360px;
  margin-top: 1px;
  padding-top: 1px;
  border-top: 1px solid var(--border);
}

.schedule {
  width: 100%;
  height: auto;
  display: block;
}

.schedule__day {
  fill: var(--card);
  stroke: #bdbdbd;
  stroke-width: 1.25;
}

.schedule__day--shot {
  fill: url(#scheduleLiquid);
  stroke: #c9a85a;
  stroke-width: 1.25;
}

.schedule__week-line {
  stroke: #e0e0e0;
  stroke-width: 1;
}

.ft-calc {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ft-result {
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ft-result__line {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.95rem;
}

.ft-result__label {
  color: var(--text-muted);
}

.ft-result__value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  text-align: right;
}

.ft-result__meta {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.week-calc__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.week-days {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.week-day {
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-day--skip {
  background: #fafbfc;
}

.week-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.week-day__title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.week-day__intakes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-day__skip {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.week-intake {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-intake input {
  flex: 1;
  min-width: 0;
}

.week-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
}

.week-icon-btn:hover,
.week-icon-btn:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

.week-text-btn,
.week-add-day {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px 12px;
}

.week-text-btn {
  align-self: flex-start;
}

.week-add-day {
  width: 100%;
}

.week-text-btn:hover,
.week-add-day:hover,
.week-text-btn:focus-visible,
.week-add-day:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.week-text-btn:disabled,
.week-add-day:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.week-calc .tirz-explain[hidden] {
  display: none;
}

.week-day-avg {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.week-day-avg[hidden] {
  display: none;
}

.app-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-root.hidden {
  display: none;
}

.result__dose {
  margin: 4px 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.activity-mode h3,
.stack-list-section h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.activity-mode .radio {
  align-items: flex-start;
}

.activity-mode .radio input {
  margin-top: 2px;
}

.radio__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.radio__hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.steroid-calc,
.stack-calc {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-mode__custom {
  margin-top: 4px;
}

.mix-card {
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 14%, white),
    color-mix(in srgb, var(--accent) 5%, white)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 42%, white);
}

.mix-card--compact {
  padding: 10px 12px;
}

.mix-card--compact .mix-card__label {
  font-size: 0.68rem;
  margin-bottom: 4px;
}

.mix-card--compact .mix-card__value {
  font-size: 0.85rem;
}

.mix-card__label {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mix-card__value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

.mix-card__dose {
  display: block;
}

.mix-card__meta {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.mix-card__meta:empty {
  display: none;
}

.steroid-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steroid-results--solo .steroid-results__panels {
  grid-template-columns: 1fr;
}

.steroid-results--solo .mix-card--compact {
  padding: 14px;
}

.steroid-results--solo .mix-card--compact .mix-card__label {
  font-size: 0.875rem;
}

.steroid-results--solo .mix-card--compact .mix-card__value {
  font-size: 1.25rem;
}

.steroid-results--solo .mix-card__meta {
  font-weight: 500;
  line-height: 1.45;
  color: #455a64;
}

.steroid-results--solo .steroid-results__slider-row {
  grid-template-columns: 1fr;
}

.steroid-results--solo .steroid-results__slider-row .slider-section {
  grid-column: 1;
}

.custom-target-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.custom-target-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-target-slider.hidden {
  display: none;
}

.custom-target-slider__text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: #455a64;
}

.steroid-results__panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.steroid-results__slider-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.steroid-results__slider-row .slider-section {
  grid-column: 2;
}

.steroid-results__slider-row[hidden],
.steroid-results__slider-row.hidden,
#dynamicMixCard[hidden],
#dynamicMixCard.hidden {
  display: none;
}

.slider-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stack-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-list-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stack-list-section__header h3 {
  margin: 0;
}

.stack-btn {
  font-family: inherit;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, white);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.stack-btn:hover,
.stack-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 20%, white);
  outline: none;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.stack-row .field {
  gap: 4px;
  min-width: 0;
}

.stack-row .field__label {
  font-size: 0.75rem;
}

.stack-btn--remove {
  width: 35px;
  height: 35px;
  padding: 0;
  border-color: #ef9a9a;
  background: #ffebee;
  color: #b71c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.stack-btn__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.stack-btn--remove:hover,
.stack-btn--remove:focus-visible {
  background: #ffe0e3;
}

.stack-btn--remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stack-row--add {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
}

.stack-btn--add-row {
  width: 40px;
  height: 40px;
  padding: 0;
  line-height: 1;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stack-btn--pin {
  width: 35px;
  height: 35px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.stack-pinned-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-pinned-list:empty {
  display: none;
}

.stack-calc--pinned {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, white);
  background: color-mix(in srgb, var(--accent) 4%, white);
}

.stack-pinned__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -4px;
}

.stack-pinned__mark {
  display: inline-flex;
  color: var(--accent-dark);
}

.stack-pinned__mark .stack-btn__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.stack-row--pinned {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal__panel .row {
  margin-bottom: 0;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal__actions .stack-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.modal__actions .stack-btn--primary:hover,
.modal__actions .stack-btn--primary:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.stack-result {
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-result__line {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.95rem;
}

.stack-result__label {
  color: var(--text-muted);
}

.stack-result__value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.stack-result__meta {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  .steroid-results__panels,
  .steroid-results__slider-row {
    grid-template-columns: 1fr;
  }

  .steroid-results__slider-row .slider-section {
    grid-column: 1;
  }
}
