:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #292929;
  --panel-alt: #242424;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f3f0f5;
  --muted: #b7afbc;
  --accent: #6e1d7a;
  --accent-strong: #9626a7;
  --accent-soft: rgba(110, 29, 122, 0.22);
  --success: #3bb273;
  --danger: #f25f5c;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  --header-height: 72px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 420px;
  --desktop-rail-width: 160px;
  --desktop-rail-gap: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: #111;
  overflow: auto;
}

.site-frame {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.ad-rail {
  display: none;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  min-height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 16px 32px rgba(110, 29, 122, 0.28);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(150, 38, 167, 0.9);
  outline-offset: 2px;
}

.site-header {
  position: relative;
  min-height: auto;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

.header-inner {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
}

.header-brand {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.eyebrow,
.step {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d4addb;
}

.header-inner h1,
.panel-heading h2 {
  margin: 0;
}

.language-toggle {
  width: auto;
  min-height: 44px;
  align-self: flex-end;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(110, 29, 122, 0.3), transparent 28%),
    radial-gradient(circle at top right, rgba(150, 38, 167, 0.14), transparent 22%),
    linear-gradient(180deg, #212121, #1b1b1b);
}

.ad-rail-slot {
  width: var(--desktop-rail-width);
  min-height: 600px;
}

.page-shell {
  width: 100%;
  margin: 4px 0 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
}

.landing-shell {
  display: grid;
  gap: 8px;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
}

.landing-hero {
  display: flex;
  min-height: 0;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
}

.landing-hero__copy {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.landing-hero__lead {
  margin: 0 0 14px;
  max-width: none;
  color: #f3f0f5;
  line-height: 1.4;
  font-size: 1.08rem;
  font-weight: 700;
}

.landing-hero__visual {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
}

.landing-hero__image-slot {
  width: 100%;
  min-height: clamp(152px, 26vh, 260px);
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(196, 108, 218, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  display: block;
}

.landing-hero__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(152px, 26vh, 260px);
  object-fit: cover;
}

.faq-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.faq-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.landing-faq {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow: visible;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] {
  background: rgba(110, 29, 122, 0.14);
}

.info-hero {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(196, 108, 218, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.info-hero__eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d4addb;
}

.info-hero__title {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.2;
}

.info-hero__lead {
  margin: 14px 0 0;
  max-width: none;
  color: var(--muted);
  line-height: 1.7;
}

.info-hero__meta {
  display: grid;
  gap: 12px;
  align-content: center;
}

.info-hero__chip {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.info-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.info-card h3 {
  margin: 0;
  font-size: 1rem;
}

.info-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-self: start;
}

.stepper__item {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 8px 6px;
  min-height: 34px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.stepper__item.is-active {
  background: linear-gradient(135deg, rgba(110, 29, 122, 0.5), rgba(150, 38, 167, 0.85));
  color: #fff;
}

.stepper__item.is-complete {
  background: rgba(59, 178, 115, 0.16);
  color: #d5f8e5;
}

.stepper__item.is-locked {
  opacity: 0.55;
}

.is-hidden {
  display: none !important;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-alt));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}

.panel--landing,
.panel--setup,
.panel--result {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.panel--setup,
.panel--result {
  display: flex;
  flex-direction: column;
}

.panel-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.panel-subsection {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.panel-subsection h3 {
  margin: 0;
  font-size: 1rem;
}

.setup-option-grid {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.setup-option-card__control {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 12px;
}

.setup-option-card__value {
  font-size: 1.05rem;
  color: #f6e9fa;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.upload-field,
.textarea-field {
  display: block;
}

.textarea-field {
  margin-top: 24px;
}

.upload-field {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(212, 173, 219, 0.34);
  background: rgba(255, 255, 255, 0.02);
}

.upload-field input {
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
}

.upload-field__title,
.textarea-field__title {
  display: block;
  font-weight: 700;
}

.upload-field__hint,
.textarea-field__hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.file-summary {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-summary__title {
  margin: 0 0 10px;
  font-weight: 700;
}

.file-summary__body {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

textarea {
  width: 100%;
  min-height: 220px;
  margin-top: 12px;
  padding: 18px;
  resize: vertical;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(9, 9, 9, 0.34);
  color: var(--text);
  line-height: 1.7;
}

.action-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.landing-hero__copy > button,
.action-row > button,
.modal-method,
.modal-actions > button,
.modal-uploaded-card > button {
  width: 100%;
}

.status-inline {
  width: 100%;
  min-height: 24px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-inline[data-state="loading"]::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.character-list,
.stats-grid,
.battle-selection {
  margin-top: 8px;
}

.owned-character-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.owned-character-card {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 6px 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: none;
}

.owned-character-card.is-locked {
  opacity: 0.5;
}

.owned-character-card__lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.85rem;
}

.owned-character-card__name {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.owned-character-card--empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
}

.battle-slots {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.battle-slots__vs {
  font-weight: 800;
  color: #d4addb;
  font-size: 0.9rem;
}

.battle-slot-card {
  min-height: 92px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  text-align: center;
  gap: 8px;
}

.battle-slot-card.is-filled {
  border-style: solid;
  background: rgba(110, 29, 122, 0.16);
}

.battle-slot-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  height: 100%;
}

.battle-slot-card__button {
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  place-items: center;
}

.battle-slot-card__name {
  margin: 0;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: left;
}

.battle-slot-card__placeholder {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.battle-slot-card__plus {
  font-size: 1.3rem;
  line-height: 1;
  color: #d4addb;
}

.battle-slot-card__clear {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  background: rgba(242, 95, 92, 0.18);
  border: 1px solid rgba(242, 95, 92, 0.42);
  color: #ffb8b6;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.battle-setup-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.setup-fighter-card {
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.setup-fighter-card.is-selected {
  border-color: rgba(196, 108, 218, 0.5);
  background: rgba(110, 29, 122, 0.18);
}

.setup-fighter-card__button {
  width: 100%;
  min-height: 72px;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.setup-fighter-card__name {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.35;
}

.setup-fighter-card__actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.setup-fighter-card__actions .button-secondary,
.setup-fighter-card__actions button {
  width: 100%;
  min-height: 40px;
  padding: 10px 8px;
}

.character-cards,
.battle-cards {
  display: grid;
  gap: 14px;
}

.character-card,
.fighter-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.character-card label,
.fighter-card label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.character-card input,
.fighter-card input {
  margin-top: 5px;
}

.character-card__name,
.fighter-card__name,
.stat-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.character-card__summary,
.fighter-card__meta,
.stat-card__summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #efd7f3;
  font-size: 0.84rem;
}

.stat-cards {
  display: grid;
  gap: 16px;
}

.stat-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.special-move {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(110, 29, 122, 0.14);
  border: 1px solid rgba(196, 108, 218, 0.14);
}

.special-move p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.radar-card {
  display: grid;
  gap: 10px;
}

.radar-chart {
  display: grid;
  place-items: center;
}

.radar-chart svg {
  width: min(156px, 100%);
  aspect-ratio: 1;
  overflow: visible;
}

.radar-chart line,
.radar-chart__grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.2;
}

.radar-chart__grid--inner {
  stroke: rgba(255, 255, 255, 0.08);
}

.radar-chart__fill {
  fill: rgba(196, 108, 218, 0.26);
  stroke: #d4addb;
  stroke-width: 1.5;
}

.radar-chart text {
  fill: #d4addb;
  font-size: 5px;
  font-weight: 700;
}

.radar-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.radar-metric {
  display: grid;
  gap: 0;
  align-content: center;
  min-height: 44px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.radar-metric__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.radar-metric strong {
  font-size: 0.88rem;
}

.radar-metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.stat-summary-box {
  display: grid;
  gap: 8px;
}

.special-move strong {
  display: block;
  margin-bottom: 8px;
}

.battle-log {
  margin: 10px 0 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.battle-log.empty-state {
  display: grid;
}

.panel--setup .action-row,
.panel--result .action-row {
  margin-top: auto;
  padding-top: 12px;
}

.panel--setup .panel-subsection {
  margin-top: 10px;
  gap: 6px;
}

.battle-log__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #d4addb;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.battle-log__message {
  margin: 0;
  max-width: 92%;
  padding: 11px 13px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.6;
}

.battle-log__winner {
  margin-top: 2px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 173, 219, 0.38);
  background: linear-gradient(180deg, rgba(110, 29, 122, 0.3), rgba(196, 108, 218, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.battle-log__winner-title,
.battle-log__winner-overview,
.battle-log__winner-move,
.battle-log__loading-title,
.battle-log__loading-copy {
  margin: 0;
}

.battle-log__winner-title {
  font-weight: 800;
  color: #f8e9fb;
}

.battle-log__winner-overview,
.battle-log__winner-move,
.battle-log__loading-copy {
  margin-top: 8px;
  color: #efe3f3;
  line-height: 1.55;
}

.battle-log__highlights {
  margin-top: 10px;
}

.battle-log__highlights-label {
  margin: 0 0 6px;
  color: #f8e9fb;
  font-weight: 800;
}

.battle-log__highlights-list {
  margin: 0;
  padding-left: 18px;
  color: #efe3f3;
  line-height: 1.5;
}

.battle-log__loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(212, 173, 219, 0.35);
  background: rgba(110, 29, 122, 0.12);
}

.battle-log__loading-title {
  font-weight: 700;
}

.battle-log__spinner {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 12px;
  overscroll-behavior: contain;
}

.modal-shell.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.72);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  width: min(100%, 420px);
  height: min(calc(100vh - 24px), 760px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, #2b2b2b, #222);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.modal-dialog--compact {
  height: min(calc(100vh - 24px), 760px);
  max-height: calc(100vh - 24px);
}

.modal-security {
  margin: 0 44px 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(242, 95, 92, 0.12);
  border: 1px solid rgba(242, 95, 92, 0.32);
  color: #ffaaa8;
  font-weight: 700;
  line-height: 1.6;
}

.modal-status {
  margin-bottom: 10px;
}

.modal-status:empty {
  display: none;
}

.modal-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-top: 4px;
}

.modal-panel h2 {
  margin: 0;
}

.modal-method-grid {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
}

.modal-method-accordion {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.modal-method-accordion.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.modal-method-accordion__summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 16px;
  font-weight: 800;
}

.modal-method-accordion__summary::-webkit-details-marker {
  display: none;
}

.modal-method-accordion[open] {
  border-color: rgba(212, 173, 219, 0.34);
  background: rgba(110, 29, 122, 0.14);
}

.modal-method-accordion__content {
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-method-accordion__content p {
  margin: 0;
}

.modal-method-accordion__content p + p {
  margin-top: 8px;
}

.modal-security--inline {
  margin: 12px 0 0;
}

.modal-method:hover:not(:disabled),
.button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.modal-actions {
  justify-content: stretch;
  margin-top: auto;
  padding-top: 20px;
}

.modal-uploaded-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.modal-uploaded-card__label,
.modal-result-viewer__index {
  margin: 0 0 8px;
  color: #d4addb;
  font-weight: 700;
}

.modal-uploaded-card__name {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 800;
}

.modal-result-viewer {
  margin-top: 12px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}

.modal-result-viewer__header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.modal-result-viewer__header .button-secondary {
  width: auto;
  min-width: 48px;
  padding: 12px 0;
}

.modal-result-viewer__index {
  margin: 0;
  text-align: center;
}

.modal-result-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.modal-shell[data-modal-step="5"] .modal-result-card {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.modal-result-card__name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-result-card__summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-result-card__tags {
  margin-bottom: 18px;
}

.modal-result-card__metrics {
  margin-bottom: 18px;
}

.detail-card {
  display: grid;
  gap: 12px;
}

.detail-modal-panel {
  padding-top: 44px;
}

.detail-modal-panel h2 {
  margin-right: 56px;
}

.detail-modal-panel .modal-result-card {
  margin-top: 8px;
  overflow: visible;
}

.detail-card__section {
  display: grid;
  gap: 8px;
}

.detail-card__label {
  margin: 0;
  color: #d4addb;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-shell[data-modal-step="5"] .modal-dialog {
  padding-top: 20px;
}

.modal-shell[data-modal-step="5"] .modal-security {
  margin-bottom: 10px;
  padding: 9px 12px;
  font-size: 0.92rem;
}

.modal-shell[data-modal-step="5"] .modal-status {
  margin-bottom: 10px;
  min-height: 0;
}

.detail-modal-actions {
  margin-top: 14px;
}

.card-export__heading {
  margin-right: 44px;
}

.card-export__name,
.card-export__index {
  margin: 8px 0 0;
  color: #d4addb;
  font-weight: 700;
}

.card-export__selector {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.card-export__nav {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}

.card-export__status {
  margin-top: 10px;
}

.card-export__status:empty {
  display: none;
}

.card-export__preview {
  margin-top: 10px;
  min-height: 360px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(196, 108, 218, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
}

.card-export__image {
  width: 100%;
  display: block;
  border-radius: 18px;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.28);
}

.card-export__empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 12px;
  left: 12px;
  bottom: 16px;
  max-width: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(242, 95, 92, 0.95);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.fighter-picker-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.fighter-picker-card {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: none;
}

.fighter-picker-card__name {
  font-weight: 800;
}

.site-footer {
  margin-top: 4px;
  padding: 8px 2px 2px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer p {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-footer__links a {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.site-footer__links a:not(:last-child)::after {
  content: "|";
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.25);
}

@media (max-height: 860px) {
  .app-container {
    padding: 12px;
  }

  .panel {
    padding: 12px;
  }

  .landing-hero {
    padding: 12px;
  }

  .landing-hero__lead {
    margin-bottom: 10px;
    font-size: 1rem;
  }

  .landing-hero__visual {
    margin-bottom: 12px;
  }

  .faq-item {
    padding: 8px 10px;
  }

  .faq-item p {
    font-size: 0.82rem;
  }

  .action-row {
    margin-top: 10px;
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  .site-frame {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, var(--max-width)) minmax(120px, 1fr);
    max-width: 1400px;
    margin: 0 auto;
    align-items: stretch;
    gap: var(--desktop-rail-gap);
    padding-inline: 20px;
  }

  .ad-rail {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 16px;
  }

  .ad-rail-slot {
    width: 100%;
    max-width: var(--desktop-rail-width);
    position: sticky;
    top: 16px;
  }
}

@media (max-height: 740px) {
  .header-inner {
    padding-bottom: 6px;
  }

  .language-toggle {
    min-height: 38px;
    padding: 8px 12px;
  }

  .stepper__item {
    min-height: 30px;
    padding: 6px 4px;
    font-size: 0.64rem;
  }

  .landing-hero__image-slot,
  .landing-hero__image {
    min-height: clamp(124px, 22vh, 180px);
  }

  .site-footer {
    font-size: 0.72rem;
  }
}

body.document-page {
  overflow: auto;
}

.doc-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  line-height: 1.65;
}

.doc-shell h1,
.doc-shell h2 {
  line-height: 1.35;
}

.doc-shell h1 {
  margin-bottom: 8px;
}

.doc-shell p,
.doc-shell li {
  color: var(--text);
}

.doc-shell .doc-meta {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-shell .doc-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.doc-shell .doc-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
