/* W2 · БАДы — параметры курса и управляющие диалоги. */
/* ===== MODAL «ПАРАМЕТРЫ КУРСА» (brand-style, перенесено из демо) ===== */
.sp3-cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--w2-s4);
  animation: sp3CpFadeIn .18s ease;
}

.sp3-cp-overlay.active {
  display: flex;
}

@keyframes sp3CpFadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }

}

.sp3-cp-modal {
  background: linear-gradient(180deg, rgba(18,18,18,1), rgba(10,10,10,1));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--w2-s4);
  padding: var(--w2-s5) var(--w2-s6);
  max-width: max(520px, 38vw);
  width: 100%;
  box-shadow: 0 32px 100px rgba(0,0,0,.85), 0 0 60px rgba(200, 241, 53,.04), inset 0 1px 0 rgba(255,255,255,.06);
  animation: sp3CpSlide .22s cubic-bezier(.2,.8,.2,1);
  position: relative;
}

@keyframes sp3CpSlide {
  from {
    transform: translateY(20px) scale(.97);
    opacity: 0
  }

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

}

.sp3-cp-close {
  position: absolute;
  top: var(--w2-s3);
  right: var(--w2-s3);
  width: var(--w2-s8);
  height: var(--w2-s8);
  border-radius: var(--w2-s2);
  background: transparent;
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.4);
  font-size:  14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out, opacity 180ms ease-out;
}

.sp3-cp-close svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
}

.sp3-cp-close:hover {
  color: #fff;
  border-color: rgba(255,255,255,.2);
}

.sp3-cp-eyebrow {
  font: 600  12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: var(--w2-s2);
}

.sp3-cp-title {
  font: 700  18px/1.25 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0 0 var(--w2-s4);
}

.sp3-cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--w2-s4) var(--w2-s4);
  margin: var(--w2-s2) 0 var(--w2-s3);
}

.sp3-cp-field {
  display: flex;
  flex-direction: column;
  gap: var(--w2-s2);
}

.sp3-cp-field.full {
  grid-column: 1 / -1;
}

.sp3-cp-label {
  font: 600  12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  gap: var(--w2-s1);
}

.sp3-cp-label-icon {
  width: var(--w2-s4);
  height: var(--w2-s4);
  flex-shrink: 0;
  color: rgba(255,255,255,.35);
}

.sp3-cp-input {
  background: rgba(255,255,255,.02);
  border: none;
  border-bottom: 1px dashed rgba(255,255,255,.18);
  color: #fff;
  font: 500  14px/1.3 'JetBrains Mono', monospace;
  padding: var(--w2-s2) var(--w2-s3) var(--w2-s2) var(--w2-s3);
  outline: none;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out, opacity 180ms ease-out;
  font-variant-numeric: tabular-nums;
  color-scheme: dark;
  width: 100%;
}

/* Поле «Дата планируемого старта» — компактное по контенту, не на всю ширину */
#sp3-cp-start {
  width: auto;
  min-width: max(160px, 12vw);
  max-width: max(220px, 16vw);
}

.sp3-cp-input:focus {
  border-bottom-color: var(--sp3-green, var(--w2-lime));
  border-bottom-style: solid;
  background: rgba(200, 241, 53,.025);
  box-shadow: 0 2px .5vw rgba(200, 241, 53,.12);
}

.sp3-cp-hint {
  font: 500  12px/1.4 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.4);
  margin-top: var(--w2-s1);
}

.sp3-cp-summary {
  margin-top: var(--w2-s3);
  padding: var(--w2-s3) var(--w2-s3);
  background: rgba(200, 241, 53,.04);
  border: 1px solid rgba(200, 241, 53,.18);
  border-radius: var(--w2-s2);
  font: 500  12px/1.5 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.7);
}

.sp3-cp-summary b {
  color: var(--sp3-green, var(--w2-lime));
  font-weight: 700;
}

.sp3-cp-actions {
  margin-top: var(--w2-s5);
}

.sp3-cp-apply {
  min-height: var(--w2-s8);
  width: 100%;
  padding: var(--w2-s3) var(--w2-s5);
  border-radius: var(--w2-s2);
  font: 700  12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  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, opacity 180ms ease-out;
  background: linear-gradient(135deg, rgba(200, 241, 53,.18), rgba(200, 241, 53,.32));
  border: 1px solid rgba(200, 241, 53,.5);
  color: var(--sp3-green, var(--w2-lime));
}

.sp3-cp-apply:hover {
  background: linear-gradient(135deg, rgba(200, 241, 53,.32), rgba(200, 241, 53,.5));
  box-shadow: 0 4px 18px rgba(200, 241, 53,.25);
}

.sp3-cp-apply:disabled, .sp3-cp-apply.disabled {
  opacity: .3;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
  color: rgba(255,255,255,.35);
  box-shadow: none;
}

.sp3-confirm-title-row {
  display: flex;
  align-items: center;
  gap: var(--w2-s3);
  margin-bottom: var(--w2-s4);
}

.sp3-confirm-icon-inline {
  width: var(--w2-s7);
  height: var(--w2-s7);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sp3-confirm-icon-inline svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
}

.sp3-confirm-icon-inline.roman {
  background: rgba(241, 70, 44, .12);
  border: 1.5px solid rgba(241, 70, 44, .5);
  color: var(--sp3-roman, var(--w2-fire));
  box-shadow: 0 0 14px rgba(241, 70, 44, .2);
}

.sp3-confirm-icon-inline.amber {
  background: rgba(241, 70, 44, .12);
  border: 1.5px solid rgba(241, 70, 44, .5);
  color: var(--sp3-amber, var(--w2-fire));
  box-shadow: 0 0 14px rgba(241, 70, 44, .2);
}

#sp3-confirm-title {
  font: 700 18px/1.25 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: -0.01em;
}

.sp3-confirm-body-text {
  font: 500  14px/1.5 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.65);
  margin-bottom: var(--w2-s4);
}

.sp3-confirm-body-text strong {
  color: #fff;
  font-weight: 700;
}

.sp3-confirm-meta {
  padding: var(--w2-s3) var(--w2-s4);
  border-radius: var(--w2-s2);
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  font: 500  12px/1.5 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.02em;
}

.sp3-confirm-meta.roman {
  border-left: 3px solid var(--sp3-roman, var(--w2-fire));
}

.sp3-confirm-meta.amber {
  border-left: 3px solid var(--sp3-amber, var(--w2-fire));
}

.sp3-confirm-meta b {
  font-weight: 700;
}

.sp3-confirm-meta.roman b {
  color: var(--sp3-roman, var(--w2-fire));
}

.sp3-confirm-meta.amber b {
  color: var(--sp3-amber, var(--w2-fire));
}

#sp3-confirm-ok.roman {
  background: linear-gradient(135deg, rgba(241, 70, 44,.18), rgba(241, 70, 44,.32));
  border-color: rgba(241, 70, 44,.5);
  color: var(--sp3-roman, var(--w2-fire));
}

#sp3-confirm-ok.roman:hover {
  background: linear-gradient(135deg, rgba(241, 70, 44,.32), rgba(241, 70, 44,.5));
  box-shadow: 0 4px 18px rgba(241, 70, 44,.25);
}

#sp3-confirm-ok.amber {
  background: linear-gradient(135deg, rgba(241, 70, 44,.18), rgba(241, 70, 44,.32));
  border-color: rgba(241, 70, 44,.5);
  color: var(--sp3-amber, var(--w2-fire));
}

#sp3-confirm-ok.amber:hover {
  background: linear-gradient(135deg, rgba(241, 70, 44,.32), rgba(241, 70, 44,.5));
  box-shadow: 0 4px 18px rgba(241, 70, 44,.25);
}

/* Красный hover для кнопки удаления БАДа */
.sp3-protocol-controls button[title="Удалить"]:hover {
  color: var(--w2-fire);
  border-color: rgba(241, 70, 44, .45);
  background: rgba(241, 70, 44, .06);
}

/* Линия «сегодня» — активная временная позиция, поэтому лайм. */
.sp3-gantt-today {
  width: 2px;
  background: var(--w2-lime);
  box-shadow: 0 0 var(--w2-s2) rgba(200,241,53,.28);
}

.sp3-gantt-today-marker {
  background: var(--w2-lime);
  border: 1px solid rgba(200, 241, 53, .45);
  box-shadow: 0 0 var(--w2-s2) rgba(200,241,53,.28);
}

/* ===== STATUS ACTION ICONS (BRANDED) ===== */
.sp3-status-action {
  background: transparent;
  color: var(--w2-lime);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--w2-s2);
  padding: var(--w2-s2) var(--w2-s3);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sp3-status-action svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
  display: block;
}

.sp3-status-action:hover {
  border-color: var(--w2-lime);
  background: color-mix(in srgb, var(--w2-lime) 6%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--w2-lime) 25%, transparent);
  transform: translateY(-1px);
}

.sp3-status-action:active {
  transform: translateY(0);
  background: color-mix(in srgb, var(--w2-lime) 12%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--w2-lime) 15%, transparent);
}

/* ===== PROTOCOL CONTROL BUTTONS (RIGHT SIDE) ===== */
.sp3-protocol-controls {
  display: flex;
  gap: var(--w2-s2);
  align-items: center;
  flex-shrink: 0;
}

.sp3-btn-control {
  padding: var(--w2-s2) var(--w2-s2);
  font-size:  12px;
  min-width: auto;
  width: var(--w2-s8);
  height: var(--w2-s8);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--w2-s2);
  background: transparent;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out, opacity 180ms ease-out;
}

.sp3-confirm-modal {
  max-width: max(480px, 34vw);
}

@media (max-width: 900px) {
  .sp3-cp-modal {
    max-width: 640px;
  }
}

@media (max-width: 500px) {
  .sp3-cp-overlay {
    align-items: flex-end;
    padding: var(--w2-s3);
  }

  .sp3-cp-modal {
    max-width: none;
    padding: var(--w2-s6) var(--w2-s4) var(--w2-s4);
    border-radius: var(--w2-s5) var(--w2-s5) var(--w2-s3) var(--w2-s3);
  }

  .sp3-cp-grid {
    grid-template-columns: 1fr;
  }

  .sp3-cp-field.full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp3-cp-overlay,
  .sp3-cp-modal {
    animation-duration: .01ms;
    animation-delay: 0ms;
  }

  .sp3-cp-overlay * {
    transition-duration: .01ms;
  }
}

/* Полноэкранный просмотр фотографий упаковки */
.suppl-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--w2-s5);
  background: rgba(0, 0, 0, .92);
}
.suppl-gallery-overlay > img {
  max-width: 90vw;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
}
.suppl-gallery-close {
  position: absolute;
  top: var(--w2-s4);
  right: var(--w2-s4);
  z-index: 2001;
  width: var(--w2-s9);
  height: var(--w2-s9);
  display: grid;
  padding: 0;
  place-items: center;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  color: var(--w2-text);
  cursor: pointer;
}
.suppl-gallery-close svg { width: var(--w2-s5); height: var(--w2-s5); }
.suppl-gallery-nav {
  display: flex;
  align-items: center;
  gap: var(--w2-s4);
  margin-top: var(--w2-s4);
}
.suppl-gallery-nav button {
  min-width: var(--w2-s9);
  min-height: var(--w2-s8);
  padding: 0 var(--w2-s4);
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  background: var(--w2-surface-raised);
  color: var(--w2-text-muted);
  font: 700 12px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .14s, color .14s;
}
.suppl-gallery-nav button:hover:not(:disabled) { border-color: rgba(200, 241, 53, .34); color: var(--w2-lime); }
.suppl-gallery-nav button:disabled { opacity: .3; cursor: default; }
.suppl-gallery-counter { color: var(--w2-text-muted); font: 600 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.suppl-thumb, .suppl-thumb-small {
  flex: none;
  object-fit: cover;
  border: 1px solid var(--w2-line);
  border-radius: var(--w2-s1);
  cursor: pointer;
}
.suppl-thumb { width: 128px; height: 96px; }
.suppl-thumb-small { width: var(--w2-s9); height: var(--w2-s9); }
@media (max-width: 500px) {
  .suppl-gallery-overlay { padding: var(--w2-s3); }
  .suppl-gallery-close { top: var(--w2-s2); right: var(--w2-s2); }
}
@media (prefers-reduced-motion: reduce) {
  .suppl-gallery-nav button { transition: none; }
}

.sp3-btn-icon-svg {
  padding: var(--w2-s2) var(--w2-s2);
}

.sp3-btn-icon-svg svg {
  width: var(--w2-s4);
  height: var(--w2-s4);
  stroke: currentColor;
}

.sp3-btn-control:hover {
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.04);
}

.sp3-btn-control.secondary {
  color: rgba(255,255,255,.45);
  border-color: rgba(255,255,255,.06);
}

.sp3-btn-control.secondary:hover {
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}

/* ====================================================================== */
