.inv {
  background: var(--bg-card, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--line, rgba(31, 24, 48, 0.1));
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow, 0 24px 80px rgba(31, 24, 48, 0.12));
  padding: clamp(20px, 4vw, 44px);
}

.inv__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.inv__step + .inv__step {
  margin-top: clamp(22px, 3vw, 34px);
}

.inv__label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink, #1f1830);
}

.inv__label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple, #8b5cf6), var(--pink, #ec4899));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  flex: none;
}

.inv__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.inv__filter {
  appearance: none;
  border: 2px solid var(--line, rgba(31, 24, 48, 0.1));
  background: var(--bg-elevated, #fff);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted, #5d5470);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.inv__filter:hover { transform: translateY(-1px); }

.inv__filter.is-active {
  border-color: var(--purple, #8b5cf6);
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple, #8b5cf6);
}

.inv__themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

.inv__theme {
  appearance: none;
  border: 3px solid transparent;
  background: none;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.inv__theme img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.inv__theme span {
  display: block;
  padding: 8px 6px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted, #5d5470);
  background: var(--bg-elevated, #fff);
}

.inv__theme:hover { transform: translateY(-2px); }

.inv__theme.is-active {
  border-color: var(--gold, #e59c15);
  box-shadow: 0 10px 28px rgba(229, 156, 21, 0.3);
}

.inv__theme.is-active span { color: var(--ink, #1f1830); }

/* Миниатюра не загрузилась: вместо битой иконки — нейтральная подложка. */
.inv__theme--fallback img {
  background: linear-gradient(135deg, var(--purple, #8b5cf6), var(--pink, #ec4899));
}

.inv__fields {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.inv__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.inv__field {
  display: grid;
  gap: 6px;
}

.inv__field > span {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted, #5d5470);
}

.inv__field input,
.inv__field select {
  width: 100%;
  border: 2px solid var(--line, rgba(31, 24, 48, 0.1));
  border-radius: 12px;
  background: var(--bg-elevated, #fff);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink, #1f1830);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inv__field input:focus,
.inv__field select:focus {
  border-color: var(--purple, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.inv__time {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.inv__time i {
  font-style: normal;
  font-weight: 800;
  color: var(--ink-muted, #5d5470);
  padding: 0 2px;
}

.inv__actions {
  margin-top: clamp(22px, 3vw, 30px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* display у .btn перебивает UA-правило [hidden] — глушим явно */
.inv__share[hidden] {
  display: none;
}

.inv__note {
  width: 100%;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-muted, #5d5470);
}

.inv__preview {
  position: sticky;
  top: 96px;
}

.inv__canvas-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow, 0 24px 80px rgba(31, 24, 48, 0.12));
  background: #17102a;
}

.inv__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.inv__canvas-wrap canvas.is-ready { opacity: 1; }

.inv__loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 600;
}

.inv__loader.is-visible { display: flex; }

.inv__preview-note {
  margin: 10px 4px 0;
  font-size: 13px;
  text-align: center;
  color: var(--ink-muted, #5d5470);
}

@media (max-width: 900px) {
  .inv__grid { grid-template-columns: 1fr; }
  .inv__preview {
    position: static;
    order: -1;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .inv__row { grid-template-columns: 1fr; }
  .inv__themes { grid-template-columns: repeat(3, 1fr); }
}

.invite-more {
  margin: 18px 4px 0;
  text-align: center;
  font-size: 15px;
  color: var(--ink-muted, #5d5470);
}

.inv__next {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold, #e59c15) 45%, transparent);
  background: linear-gradient(180deg, rgba(229, 156, 21, 0.12), rgba(255, 255, 255, 0.9) 75%);
}

.inv__next p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-muted, #5d5470);
}

.inv__next p strong { color: var(--ink, #1f1830); }
