/* ==========================================================================
   Generator scenariuszy .slp / .zslp
   Rozszerza /style.css. Zmienne --slp-* pochodzą z data/animation.css i są
   tu nadpisane na wartości ciemnego motywu strony.
   ========================================================================== */

:root {
  --slp-accent: var(--accent);
  --slp-ink: #f5f7fa;
  --slp-muted: #9ca9b8;
  --slp-surface: #151c26;
  --slp-lane: rgba(255, 255, 255, 0.05);
  --slp-line: rgba(255, 255, 255, 0.14);
}

.gen-body {
  background:
    radial-gradient(circle at 82% 4%, rgba(242, 169, 59, 0.09), transparent 26rem),
    var(--bg);
}

.gen-main {
  padding: 44px 0 72px;
}

/* ---------- Nagłówek strony ---------- */

.gen-intro {
  max-width: 780px;
  margin-bottom: 32px;
}

.gen-intro h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 10px 0 14px;
}

.gen-intro p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Zakładki ---------- */

.gen-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.gen-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.gen-tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.gen-tab.is-active {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--text);
}

.gen-tab-num {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(242, 169, 59, 0.14);
  color: var(--accent-strong);
  border-radius: 6px;
  padding: 3px 7px;
}

.gen-tab.is-active .gen-tab-num {
  background: var(--accent);
  color: var(--dark);
}

/* ---------- Układ dwukolumnowy ---------- */

.gen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 26px;
  align-items: start;
}

.gen-wizard,
.gen-preview .preview-sticky,
.set-config,
.set-sequence {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.preview-sticky {
  position: sticky;
  top: 92px;
}

/* ---------- Pasek kroków ---------- */

.wizard-head {
  margin-bottom: 24px;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.wizard-steps li {
  flex: 1 1 auto;
}

.wizard-steps button {
  width: 100%;
  background: none;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 7px 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 150ms ease, color 150ms ease;
}

.wizard-steps button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.wizard-steps button:disabled {
  cursor: default;
  opacity: 0.55;
}

.wizard-steps .is-current button {
  background: rgba(242, 169, 59, 0.13);
  color: var(--accent-strong);
}

.wizard-steps .is-done button {
  color: var(--success);
}

.wizard-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.wizard-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: inherit;
  transition: width 260ms ease;
}

/* ---------- Kroki formularza ---------- */

.wizard-step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.wizard-step legend {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0;
  margin-bottom: 6px;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.step-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

/* ---------- Pola ---------- */

.field {
  display: block;
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 7px;
}

.field-label em {
  color: var(--accent);
  font-style: normal;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 6px;
}

.gen-body input[type="text"],
.gen-body input[type="url"],
.gen-body input[type="number"],
.gen-body textarea,
.gen-body select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 11px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.gen-body textarea {
  resize: vertical;
  line-height: 1.55;
}

.gen-body select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}

.gen-body select option {
  background: var(--panel-2);
  color: var(--text);
}

.gen-body input:focus-visible,
.gen-body textarea:focus-visible,
.gen-body select:focus-visible,
.gen-body button:focus-visible,
.gen-body summary:focus-visible,
.gen-body [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}

.gen-body .is-invalid {
  border-color: #e0684f;
  box-shadow: 0 0 0 3px rgba(224, 104, 79, 0.16);
}

/* ---------- Przełącznik boolean ---------- */

.switch-field {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 18px;
}

.switch-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}

/* ---------- Chipy wielokrotnego wyboru ---------- */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip.is-checked {
  background: rgba(242, 169, 59, 0.14);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}

.chip:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Edytor list ---------- */

.list-editor {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.list-row > input,
.list-row > textarea {
  flex: 1;
  min-width: 0;
}

.list-row-buttons {
  display: flex;
  gap: 4px;
  flex: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 40px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
}

.icon-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.icon-button.is-danger:hover:not(:disabled) {
  color: #ff8f74;
  border-color: rgba(255, 143, 116, 0.45);
}

.list-add {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.list-add:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

/* ---------- Nawigacja i akcje ---------- */

.wizard-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.wizard-nav #btnNext {
  margin-left: auto;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.gen-body .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.gen-body .button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.gen-body .button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.gen-body .button-primary {
  background: var(--accent);
  color: var(--dark);
}

.gen-body .button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.gen-body .button-secondary {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
}

.gen-body .button-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.26);
}

.gen-body .button-ghost {
  background: none;
  color: var(--muted);
}

.gen-body .button-ghost:hover:not(:disabled) {
  color: var(--text);
}

.file-button {
  position: relative;
}

.file-button:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Walidacja ---------- */

.validation-box {
  background: rgba(224, 104, 79, 0.09);
  border: 1px solid rgba(224, 104, 79, 0.35);
  border-radius: 13px;
  padding: 15px 18px;
  margin-top: 20px;
  font-size: 0.87rem;
}

.validation-box strong {
  display: block;
  color: #ff9b82;
  margin-bottom: 7px;
}

.validation-box ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Podgląd ---------- */

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.preview-head h2 {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.preview-badge {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 11px;
  white-space: nowrap;
}

.preview-stage {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 320 / 290;
}

.preview-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Warstwy sceny SVG */
.slp-lane-band { fill: var(--slp-lane); }
.slp-lane-line { stroke: var(--slp-line); stroke-width: 1; stroke-dasharray: 3 6; }
.slp-target-label {
  fill: var(--slp-muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
}
.slp-dist-label {
  fill: var(--slp-muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 7.5px;
  text-anchor: middle;
}
.slp-target-group { transition: opacity 220ms ease; }
.slp-target-group.is-dim { opacity: 0.42; }
.slp-zone-marker { fill: none; stroke: var(--slp-accent); stroke-width: 2.5; }
.slp-box-label {
  fill: var(--slp-muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 700;
  text-anchor: middle;
}
.slp-shooter { color: var(--accent-strong); }

/* HUD */
.preview-hud {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  margin-top: 14px;
}

.hud-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: rgba(242, 169, 59, 0.12);
  border-radius: 11px;
}

.hud-icon svg {
  width: 24px;
  height: 24px;
}

.hud-body {
  flex: 1;
  min-width: 0;
}

.hud-body strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.hud-body span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 2px;
}

.hud-stats {
  flex: none;
  display: flex;
  gap: 14px;
  text-align: right;
}

.hud-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hud-stats strong {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  margin-top: 3px;
}

.preview-controls {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

/* `display: flex` nadpisuje domyslne ukrycie atrybutem hidden, wiec widok
   Listy (bez animacji) potrzebuje jawnej reguly. */
.preview-controls[hidden],
.transport-step[hidden] {
  display: none;
}

.preview-controls .button {
  flex: 1;
  padding: 10px 14px;
}

.preview-note {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  margin: 11px 0 0;
}

/* Podgląd JSON */
.json-preview {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.json-preview summary {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.json-preview summary::marker,
.json-preview summary::-webkit-details-marker {
  display: none;
}

.json-preview summary::before {
  content: "▸ ";
  color: var(--accent);
}

.json-preview[open] summary::before {
  content: "▾ ";
}

.json-preview summary:hover {
  color: var(--text);
}

.json-preview pre {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  margin: 12px 0 0;
  max-height: 320px;
  overflow: auto;
  padding: 13px;
  white-space: pre;
}

/* ---------- Zakładka zestawu ---------- */

.set-layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.set-config h2,
.sequence-head h2 {
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.set-add {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.set-add h3 {
  font-size: 0.96rem;
  margin: 0 0 16px;
}

.inline-add {
  display: flex;
  gap: 8px;
}

.inline-add select {
  flex: 1;
  min-width: 0;
}

.inline-add .button {
  flex: none;
}

.set-add-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.set-add-buttons .button {
  flex: 1;
  min-width: 150px;
}

.sequence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sequence-head h2 {
  margin: 0;
}

.sequence-count {
  background: rgba(242, 169, 59, 0.14);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
}

.sequence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sequence-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  cursor: grab;
  transition: border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.sequence-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.sequence-item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.sequence-item.is-drop-target {
  border-color: var(--accent);
  background: rgba(242, 169, 59, 0.07);
}

.sequence-grip {
  flex: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
}

.sequence-order {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.sequence-body {
  flex: 1;
  min-width: 0;
}

.sequence-body strong {
  display: block;
  font-size: 0.89rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-body span {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  margin-top: 3px;
}

.sequence-kind {
  display: inline-block;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  margin-right: 6px;
  text-transform: uppercase;
}

.sequence-kind.is-builtin {
  background: rgba(100, 213, 138, 0.14);
  color: var(--success);
}

.sequence-kind.is-embedded {
  background: rgba(242, 169, 59, 0.14);
  color: var(--accent-strong);
}

.sequence-buttons {
  display: flex;
  gap: 4px;
  flex: none;
}

.sequence-empty {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.6;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 13px;
  margin: 0;
  padding: 30px 22px;
}

/* ---------- Stopka i toast ---------- */

.gen-privacy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
  margin: 34px auto 0;
  max-width: 620px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 600;
  padding: 13px 22px;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  max-width: min(460px, calc(100vw - 32px));
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  border-color: rgba(224, 104, 79, 0.5);
  color: #ff9b82;
}

/* ---------- Responsywność ---------- */

@media (max-width: 1040px) {
  .gen-layout,
  .set-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-sticky {
    position: static;
  }
}

@media (max-width: 640px) {
  .gen-main {
    padding: 28px 0 52px;
  }

  .gen-wizard,
  .gen-preview .preview-sticky,
  .set-config,
  .set-sequence {
    padding: 19px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .wizard-steps button {
    font-size: 0.7rem;
    padding: 7px 5px;
  }

  .wizard-nav,
  .wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-nav #btnNext {
    margin-left: 0;
    order: -1;
  }

  .hud-stats {
    flex-direction: column;
    gap: 6px;
  }

  .set-add-buttons .button {
    min-width: 0;
  }
}

/* ---------- Ograniczony ruch ---------- */

@media (prefers-reduced-motion: reduce) {
  .gen-body *,
  .gen-body *::before,
  .gen-body *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ==========================================================================
   v2: edytory celow i kolejnosci ostrzalu, widok listy, biblioteka cwiczen
   ========================================================================== */

/* ---------- Edytor celow fizycznych ---------- */

.targets-editor,
.sequence-editor {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 10px;
}

.target-row,
.seq-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
}

.target-fields,
.seq-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.7fr);
}

.seq-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr) minmax(0, 2fr);
}

.mini-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mini-field > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gen-body .mini-field input,
.gen-body .mini-field select {
  padding: 8px 11px;
  font-size: 0.86rem;
  border-radius: 9px;
}

.gen-body .mini-field select {
  background-position: calc(100% - 15px) calc(50% + 2px), calc(100% - 10px) calc(50% + 2px);
  padding-right: 28px;
}

.seq-order {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 7px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Strefy per strzal */

.zone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 4px 3px 7px;
}

.zone-item > span {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  flex: none;
}

.gen-body .zone-item select {
  width: auto;
  min-width: 78px;
  padding: 4px 22px 4px 7px;
  font-size: 0.76rem;
  border-radius: 6px;
  background-color: transparent;
  border-color: transparent;
  background-position: calc(100% - 11px) calc(50% + 1px), calc(100% - 7px) calc(50% + 1px);
}

.target-row .list-row-buttons,
.seq-row .list-row-buttons {
  margin-bottom: 1px;
}

/* ---------- Przelacznik Wizualizacja / Lista ---------- */

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 13px;
}

.view-toggle-btn {
  flex: 1;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.view-toggle-btn:hover {
  color: var(--text);
}

.view-toggle-btn.is-active {
  background: var(--accent);
  color: var(--dark);
}

/* ---------- Widok listy przebiegu ---------- */

.preview-list {
  list-style: none;
  counter-reset: slp-step;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.preview-list-item {
  counter-increment: slp-step;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.85rem;
}

.preview-list-item::before {
  content: counter(slp-step) ".";
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.preview-list-item.is-beep { border-left-color: var(--accent); }
.preview-list-item.is-start { border-left-color: #2d665f; }
.preview-list-item.is-shots { border-left-color: var(--accent-strong); }
.preview-list-item.is-reload { border-left-color: #8a5a16; }
.preview-list-item.is-move { border-left-color: #7c4b44; }
.preview-list-item.is-position { border-left-color: #4a6fa5; }
.preview-list-item.is-beep .preview-list-text { color: var(--accent-strong); }

.preview-list-text {
  font-weight: 600;
  line-height: 1.4;
}

.preview-list-zones {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* ---------- Biblioteka cwiczen wbudowanych ---------- */

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.library-list-panel,
.library-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.library-list-panel {
  position: sticky;
  top: 92px;
}

.library-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gen-body input[type="search"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 11px 13px;
}

.library-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin: 4px 0 12px;
}

.library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 58vh;
  overflow-y: auto;
}

.library-item {
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 150ms ease, background 150ms ease;
}

.library-item:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.library-item.is-selected {
  background: rgba(242, 169, 59, 0.09);
  border-color: var(--accent);
}

.library-item strong {
  font-size: 0.89rem;
  font-weight: 600;
  line-height: 1.35;
}

.library-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.library-tag {
  background: var(--panel-2);
  border-radius: 5px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  padding: 2px 7px;
}

.library-placeholder {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
  padding: 60px 24px;
  margin: 0;
}

.library-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.library-detail-head h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
}

.library-detail-id {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.library-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.library-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lib-string-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lib-string-picker .field-label {
  margin: 0;
}

.lib-string-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lib-string-btn {
  min-width: 30px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.lib-string-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
}

.lib-string-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--dark);
}

.library-event-list {
  max-height: 260px;
}

.library-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.library-section h3 {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.library-section p {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
}

.library-section ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.library-section li {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Responsywnosc v2 ---------- */

@media (max-width: 1100px) {
  .library-layout,
  .library-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-list-panel {
    position: static;
  }

  .library-list {
    max-height: 320px;
  }
}

@media (max-width: 760px) {
  .target-fields,
  .seq-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .target-row,
  .seq-row {
    flex-wrap: wrap;
  }

  .target-row .list-row-buttons,
  .seq-row .list-row-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}


/* ==========================================================================
   Zmiany 2.10.0: zwijane panele, automatyczne nazwy celow, szeroki HUD
   ========================================================================== */

/* ---------- Zwijane panele Cele / Sekwencja ---------- */

.accordion {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}

.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--bg-soft);
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease;
}

.accordion-head:hover {
  background: var(--panel-2);
}

.accordion-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--dark);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.accordion-title {
  flex: 1;
}

.accordion-count {
  flex: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
}

.accordion.is-open .accordion-count {
  color: var(--accent-strong);
  border-color: rgba(242, 169, 59, 0.4);
}

.accordion-body {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.accordion-body .field-help {
  margin-top: 10px;
}

/* ---------- Automatyczna nazwa celu ---------- */

.target-name-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 37px;
  padding: 0 12px;
  background: rgba(242, 169, 59, 0.13);
  border: 1px solid rgba(242, 169, 59, 0.34);
  border-radius: 9px;
  color: var(--accent-strong);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: default;
}

/* ---------- Element sekwencji ---------- */

.seq-row {
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
}

.seq-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seq-row-title {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.zone-single {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 11px;
}

/* ---------- Szeroki komunikat animacji ---------- */

.preview-hud {
  align-items: flex-start;
}

.hud-body {
  min-width: 0;
}

.hud-body strong,
.hud-body span {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.hud-body span {
  min-height: 2.1em;
}

.hud-stats {
  padding-top: 2px;
}


/* Wymiar figury geometrycznej w animacji cwiczenia wbudowanego (np. 3x5, 8in) */
.slp-shape-label {
  fill: var(--accent-strong);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 7.5px;
  font-weight: 700;
  text-anchor: middle;
}


/* ==========================================================================
   2.10.1: mieszana sekwencja — cztery typy elementow, strzaly jako wiersze
   ========================================================================== */

.seq-type-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.seq-type-icon svg {
  width: 15px;
  height: 15px;
}

.seq-row.is-target .seq-type-icon { background: rgba(242, 169, 59, 0.15); color: var(--accent-strong); }
.seq-row.is-reload .seq-type-icon { background: rgba(138, 90, 22, 0.28); color: #d9a24a; }
.seq-row.is-position .seq-type-icon { background: rgba(74, 111, 165, 0.26); color: #8fb4e8; }
.seq-row.is-move .seq-type-icon { background: rgba(124, 75, 68, 0.3); color: #e0968a; }

.seq-row.is-reload { border-left: 3px solid #8a5a16; }
.seq-row.is-position { border-left: 3px solid #4a6fa5; }
.seq-row.is-move { border-left: 3px solid #7c4b44; }
.seq-row.is-target { border-left: 3px solid var(--accent); }

.seq-row-kind {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.seq-row-head {
  gap: 9px;
}

.seq-row-head .seq-row-title {
  flex: none;
}

.seq-row-head .list-row-buttons {
  margin-left: auto;
}

.seq-fields-single {
  grid-template-columns: minmax(0, 320px);
}

/* Liczba strzalow liczona automatycznie */
.shots-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent-strong);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
}

/* Kazdy strzal jako osobny, usuwalny wiersz */
.shot-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shot-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shot-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 30px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.gen-body .shot-row select {
  flex: 1;
  min-width: 0;
  padding: 6px 24px 6px 9px;
  font-size: 0.8rem;
  border-radius: 8px;
  background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);
}

.shot-row .icon-button {
  width: 28px;
  height: 30px;
  flex: none;
}

.shot-add {
  align-self: flex-start;
  margin-top: 2px;
  padding: 5px 11px;
  font-size: 0.78rem;
}

/* Przyciski dodawania elementow sekwencji */
.seq-add {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.seq-add .field-label {
  margin-bottom: 9px;
}

.seq-add-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seq-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px 8px 9px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.seq-add-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.seq-add-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.seq-add-btn[data-add-type="target"] .seq-type-icon { background: rgba(242, 169, 59, 0.15); color: var(--accent-strong); }
.seq-add-btn[data-add-type="reload"] .seq-type-icon { background: rgba(138, 90, 22, 0.28); color: #d9a24a; }
.seq-add-btn[data-add-type="position"] .seq-type-icon { background: rgba(74, 111, 165, 0.26); color: #8fb4e8; }
.seq-add-btn[data-add-type="move"] .seq-type-icon { background: rgba(124, 75, 68, 0.3); color: #e0968a; }

@media (max-width: 760px) {
  .seq-add-buttons {
    flex-direction: column;
  }

  .seq-add-btn {
    width: 100%;
  }
}


/* Przycisk czyszczenia pojedynczego kroku kreatora */
.step-clear {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.step-clear:hover {
  color: #ff9b82;
  border-color: rgba(224, 104, 79, 0.45);
  background: rgba(224, 104, 79, 0.08);
}

.step-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wizard-step legend {
  width: 100%;
}

@media (max-width: 520px) {
  .step-clear {
    font-size: 0.68rem;
    padding: 4px 9px;
  }
}


/* Numer strzalu na celu (kolejnosc trafien) */
.slp-hit-number {
  fill: #202329;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 6.4px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.slp-hit-marker {
  animation: slp-hit-pop 260ms ease-out;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes slp-hit-pop {
  from { opacity: 0; transform: scale(.5); }
  to { opacity: 1; transform: scale(1); }
}


/* ==========================================================================
   2.10.4: HUD w SVG, etykiety celow, znaczniki trafien
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* HUD jako warstwa SVG */
.slp-hud-panel {
  fill: #ffffff;
  fill-opacity: 0.94;
  stroke: rgba(32, 35, 41, 0.18);
  stroke-width: 1;
}

.slp-hud-icon {
  color: #202329;
}

.slp-hud-text {
  fill: #202329;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.slp-hud-text-sub {
  font-size: 9px;
  font-weight: 600;
  fill: #5a6068;
}

.slp-hud-time {
  fill: #202329;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.slp-hud-shots {
  fill: #5a6068;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

/* Etykiety celow */
.slp-target-name {
  fill: #202329;
  font-family: Inter, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

/* Cel C: nazwa pod czerwona kropka, wciaz w obrebie czarnego okregu */
.slp-target-name-inside {
  fill: #202329;
  font-family: Inter, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

/* Numer trafienia: czarny, wysrodkowany, na kryjacym zoltym tle */
.slp-hit-number {
  fill: #202329;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

/* Pole strzeleckie */
.slp-box-label {
  fill: var(--slp-muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
}


/* ---------- 2.10.4: czytelnosc na ciemnym motywie strony ----------
   Assety drill-visual sa zaprojektowane na jasne tlo aplikacji. Etykiety
   rysowane przez generator (dystans, nazwa pola) musza byc jasne, natomiast
   nazwy celow lezace NA ikonie zostaja ciemne, tak jak w aplikacji. */

.slp-dist-label {
  fill: #c6d0dc;
  font-weight: 700;
  font-size: 8px;
}

.slp-box-label {
  fill: #c6d0dc;
}

.slp-lane-band {
  fill: rgba(255, 255, 255, 0.04);
}

/* Cel C: nazwa wewnatrz bialego okregu, wiec ciemna */
.slp-target-name-inside {
  fill: #202329;
}


/* Nazwa celu lezy NA ikonie, wiec potrzebuje obrysu zeby byla czytelna
   zarowno na brazowym kartonie, jak i na jasnym papierze czy stali. */
.slp-target-name {
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 2.6px;
  stroke-linejoin: round;
}

.slp-target-name-inside {
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 2px;
  stroke-linejoin: round;
}

/* Etykieta dystansu tez dostaje delikatny cien dla czytelnosci nad linia osi */
.slp-dist-label {
  paint-order: stroke fill;
  stroke: rgba(11, 15, 20, 0.75);
  stroke-width: 2.4px;
  stroke-linejoin: round;
}

/* numer w mniejszym znaczniku trafienia */
.slp-hit-number { font-size: 8px; }


/* ---------- 2.10.5: etykiety wewnatrz ikony celu ----------
   Spec: czarny tekst 8px/900 na y+12 (C) albo y+13 (T), bez bialego tekstu.
   Cele C i T maja biale wnetrze, wiec obrys jest zbedny. */
.slp-target-name-inside {
  fill: #202329;
  font-size: 8px;
  font-weight: 900;
  paint-order: normal;
  stroke: none;
}

/* ---------- Zrodlo cwiczenia wbudowanego (2.10.5) ---------- */

.library-source {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.library-source-link {
  display: inline-block;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-source-link:hover {
  color: var(--accent);
}

.library-source-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.library-source-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.library-source-original {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 4px 0 0;
}

.library-source-kind {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  margin: 8px 0 0;
  padding: 3px 10px;
}

/* ---------- Sterowanie animacja krok po kroku (2.10.6) ---------- */

.preview-controls {
  align-items: center;
  gap: 6px;
}

.transport-btn {
  width: 38px;
  height: 38px;
  flex: none;
  font-size: 0.82rem;
  line-height: 1;
}

.transport-btn:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.gen-body .transport-play {
  flex: 1;
  min-width: 0;
}

.transport-step {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  margin: 8px 0 0;
  min-height: 1.1em;
}

/* ---------- Powiekszony podglad animacji (2.10.6) ---------- */

.preview-head {
  gap: 10px;
}

.gen-body .preview-expand {
  flex: none;
  font-size: 0.78rem;
  padding: 7px 14px;
}

/* Automatyczna suma strzalow (2.10.16): nie jest polem edytowalnym,
   wiec wyglada jak wartosc, a nie jak input. */
.rounds-total {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-family: Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* Przycisk powiekszenia nad diagramem cwiczenia wbudowanego */
.library-visual-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.anim-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
}

.anim-modal[hidden] {
  display: none;
}

.anim-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 11, 0.82);
  backdrop-filter: blur(3px);
}

.anim-modal-box {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.anim-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.anim-modal-head h2 {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Duze pole animacji: przy 12 figurach nic sie nie sciska */
.anim-modal-stage {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 320 / 290;
  max-height: calc(100vh - 230px);
  margin-inline: auto;
}

.anim-modal-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.anim-modal .preview-controls {
  max-width: 460px;
  margin: 14px auto 0;
}

body.is-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .anim-modal {
    padding: 12px;
  }

  .anim-modal-box {
    padding: 16px;
  }

  .anim-modal-stage {
    max-height: none;
  }
}
