/* OGT × LO — ogtriple lime (#dfff00) on near-black */

:root {
  --bg-deep: #0a0a0a;
  --bg-panel: #141414;
  --bg-panel-2: #0e0e0e;
  --border-subtle: rgba(223, 255, 0, 0.14);
  --og-lime: #dfff00;
  --og-lime-muted: rgba(223, 255, 0, 0.55);
  /* kept for existing selectors; now maps to ogtriple palette */
  --lo-yellow: var(--og-lime);
  --lo-blue: #c4c4c4;
  --text: #f2f2f2;
  --text-muted: #9a9a9a;
  --danger: #ff7a7a;
  --ok: #5ee3a4;
  --btn-primary-depth: #4d5a00;
  --btn-primary-fg: #0a0a0a;
  --bg-gradient-spot: rgba(223, 255, 0, 0.07);
  --bg-gradient-depth: rgba(0, 0, 0, 0.5);
  --radius: 16px;
  /* Same stack as .brand-bar__logos site-wide */
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* LO + partner marks: same rendered height (LO wordmark needs wide max-width) */
  --lo-brand-logo-height: 5rem;
  --lo-modal-brand-logo-height: 4rem;
}

[data-theme="light"] {
  --bg-deep: #f7f7f5;
  --bg-panel: #ffffff;
  --bg-panel-2: #eceee8;
  --border-subtle: rgba(120, 130, 0, 0.22);
  --og-lime: #c4d400;
  --og-lime-muted: rgba(90, 100, 0, 0.58);
  --lo-blue: #525252;
  --text: #1a1a12;
  --text-muted: #5c5c52;
  --btn-primary-depth: #9aa800;
  --btn-primary-fg: #141414;
  --bg-gradient-spot: rgba(200, 210, 0, 0.12);
  --bg-gradient-depth: rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(
      ellipse 110% 75% at 50% -8%,
      var(--bg-gradient-spot) 0%,
      transparent 52%
    ),
    radial-gradient(
      ellipse 90% 50% at 80% 100%,
      var(--bg-gradient-depth) 0%,
      transparent 45%
    ),
    var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 2.75rem;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}

.back-to-menu {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--og-lime-muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem 0.35rem 0;
  margin: -0.35rem 0 -0.35rem -0.25rem;
  border-radius: 8px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.back-to-menu:hover {
  color: var(--og-lime);
  background: rgba(223, 255, 0, 0.08);
}

.back-to-menu:focus-visible {
  outline: 2px solid var(--og-lime);
  outline-offset: 2px;
}

.theme-toggle {
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
  z-index: 0;
  padding: 3px;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  line-height: 0;
  animation: hero-info-glow 2.2s ease-in-out infinite;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  border: 2px solid rgba(223, 255, 0, 0.65);
  pointer-events: none;
  z-index: -1;
  animation: hero-info-pulse-ring 2.2s ease-out infinite;
}

.theme-toggle__track {
  --theme-toggle-pad: 0.125rem;
  --theme-toggle-thumb: 1.375rem;
  position: relative;
  display: block;
  width: 3.5rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid rgba(223, 255, 0, 0.45);
  background: rgba(223, 255, 0, 0.1);
  box-sizing: border-box;
}

.theme-toggle__icon {
  position: absolute;
  top: 50%;
  margin-top: -0.42rem;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--og-lime-muted);
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.theme-toggle__icon--sun {
  left: 0.35rem;
}

.theme-toggle__icon--moon {
  right: 0.35rem;
}

.theme-toggle__thumb {
  position: absolute;
  top: var(--theme-toggle-pad);
  left: var(--theme-toggle-pad);
  width: var(--theme-toggle-thumb);
  height: var(--theme-toggle-thumb);
  border-radius: 50%;
  background: var(--og-lime);
  box-shadow: 0 0.08rem 0.28rem rgba(0, 0, 0, 0.28);
  z-index: 2;
  transition: transform 0.22s ease;
  transform: translateX(0);
}

.theme-toggle[aria-checked="false"] .theme-toggle__thumb {
  transform: translateX(
    calc(3.5rem - var(--theme-toggle-thumb) - 2 * var(--theme-toggle-pad))
  );
}

.theme-toggle[aria-checked="true"] .theme-toggle__icon--sun {
  color: var(--og-lime);
  opacity: 1;
}

.theme-toggle[aria-checked="false"] .theme-toggle__icon--moon {
  color: var(--og-lime);
  opacity: 1;
}

.theme-toggle:hover .theme-toggle__track {
  border-color: var(--og-lime);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--og-lime);
  outline-offset: 3px;
}

.brand-bar {
  text-align: center;
  padding: 0.5rem 0 1.35rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-bar__logos {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.2rem;
  width: 100%;
  max-width: 100%;
  --brand-row-h: clamp(3.96rem, 18.6vw, 9.6rem);
}

@media (min-width: 480px) {
  .brand-bar__logos {
    --brand-row-h: clamp(5.55rem, 27vw, 11.55rem);
  }
}

.brand-bar__img {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
  height: var(--brand-row-h);
  max-height: var(--brand-row-h);
  object-fit: contain;
}

.brand-bar__img--lo {
  flex: 1 1 0;
  max-width: min(52%, 39rem);
}

.brand-bar__img--og {
  flex: 0 1 auto;
  max-width: min(34%, 15rem);
}

.brand-bar__x {
  flex-shrink: 0;
  font-size: clamp(2.85rem, 12vw, 5.25rem);
  font-weight: 200;
  color: var(--og-lime);
  line-height: 1;
  user-select: none;
}

.hero {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--og-lime-muted);
  font-weight: 600;
}

.hero__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.65rem;
}

.hero__headline h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__info-btn {
  position: relative;
  z-index: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(223, 255, 0, 0.55);
  background: rgba(223, 255, 0, 0.1);
  color: var(--og-lime);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  animation: hero-info-glow 2.2s ease-in-out infinite;
}

.hero__info-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(223, 255, 0, 0.65);
  pointer-events: none;
  z-index: -1;
  animation: hero-info-pulse-ring 2.2s ease-out infinite;
}

.hero__info-btn:hover {
  background: rgba(223, 255, 0, 0.2);
  border-color: var(--og-lime);
  color: var(--text);
}

.hero__info-btn:focus-visible {
  outline: 2px solid var(--og-lime);
  outline-offset: 3px;
}

@keyframes hero-info-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(223, 255, 0, 0.35),
      0 0 12px rgba(223, 255, 0, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(223, 255, 0, 0.12),
      0 0 18px rgba(223, 255, 0, 0.28);
  }
}

@keyframes hero-info-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  70%,
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__info-btn {
    animation: none;
    box-shadow: 0 0 0 1px rgba(223, 255, 0, 0.35);
  }

  .hero__info-btn::after {
    animation: none;
    opacity: 0.35;
    transform: none;
    inset: -2px;
  }

  .theme-toggle {
    animation: none;
    box-shadow: 0 0 0 1px rgba(223, 255, 0, 0.35);
  }

  .theme-toggle::after {
    animation: none;
    opacity: 0.35;
    transform: none;
    inset: -2px;
  }

  .theme-toggle__thumb {
    transition: none;
  }
}

.hero__info-icon {
  position: relative;
  top: 0.5px;
}

.lede {
  margin: 0 auto;
  max-width: 38rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.mode-panel {
  margin-bottom: 1rem;
}

.lookup-shell {
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.lookup-shell__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 1rem 1.1rem;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-panel-2);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lookup-shell__toggle:hover {
  background: rgba(223, 255, 0, 0.06);
}

.lookup-shell.is-collapsed .lookup-shell__toggle {
  border-bottom: none;
}

.lookup-shell.is-collapsed .lookup-shell__body {
  display: none;
}

.lookup-shell__title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.lookup-shell__title {
  color: var(--og-lime);
}

.lookup-shell__meta {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lookup-shell__chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--og-lime-muted);
  border-bottom: 2px solid var(--og-lime-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.lookup-shell.is-collapsed .lookup-shell__chevron {
  transform: rotate(-45deg);
}

.lookup-shell__body {
  padding: 0 0 0.25rem;
}

.lookup-shell__body .mode-panel {
  margin: 0.85rem 1rem 1rem;
  box-shadow: none;
}

.lookup-shell__body .mode-panel:last-child {
  margin-bottom: 1rem;
}

.wallet-stats {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-2);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.wallet-stats__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.25rem;
}

.wallet-stats .wallet-stats__matched,
.wallet-stats .wallet-stats__ogenies,
.wallet-stats .wallet-stats__certs {
  color: var(--text);
}

.wallet-stats strong {
  color: var(--og-lime);
  font-weight: 800;
}

.wallet-stats__sep {
  color: var(--text-muted);
  user-select: none;
}

.mode-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--og-lime);
  font-weight: 700;
}

.mode-desc {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.input-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.input-row .btn-primary {
  width: 100%;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-panel-2);
  color: var(--text);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--og-lime);
  box-shadow: 0 0 0 3px rgba(223, 255, 0, 0.14);
}

textarea.wallet-input-multiline {
  width: 100%;
  min-height: 5.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.45;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-panel-2);
  color: var(--text);
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

textarea.wallet-input-multiline:focus {
  border-color: var(--og-lime);
  box-shadow: 0 0 0 3px rgba(223, 255, 0, 0.14);
}

.hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-primary {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--btn-primary-fg);
  background: var(--og-lime);
  box-shadow: 0 4px 0 var(--btn-primary-depth);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--btn-primary-depth);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--btn-primary-depth);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/** Inactive: lime outline + glow; active: full lime (matches collection pills). */
.btn-primary.flex-modal__generate:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--bg-panel-2);
  color: var(--og-lime-muted);
  border: 1px solid rgba(223, 255, 0, 0.5);
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.12),
    0 0 20px rgba(223, 255, 0, 0.18);
}

.btn-primary.flex-modal__generate:disabled:hover {
  transform: none;
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.12),
    0 0 20px rgba(223, 255, 0, 0.18);
}

.btn-primary.flex-modal__download:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--bg-panel-2);
  color: var(--og-lime-muted);
  border: 1px solid rgba(223, 255, 0, 0.5);
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.12),
    0 0 20px rgba(223, 255, 0, 0.18);
}

.btn-primary.flex-modal__download:disabled:hover {
  transform: none;
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.12),
    0 0 20px rgba(223, 255, 0, 0.18);
}

.btn-secondary {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0a0a0a;
  background: var(--lo-blue);
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-secondary:hover {
  filter: brightness(1.08);
}

.status {
  min-height: 1.4rem;
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}

.status.loading {
  color: var(--lo-yellow);
}

.status.error {
  color: var(--danger);
}

.results-block.hidden {
  display: none;
}

.results-block {
  margin-top: 1.25rem;
}

.wallet-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding: 0.75rem 0.95rem;
  background: var(--bg-panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.wallet-filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.filter-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.52rem 1.05rem;
  border-radius: 999px;
  font-family: inherit;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: rgba(223, 255, 0, 0.35);
}

.filter-btn.is-active {
  background: var(--og-lime);
  color: #0a0a0a;
  border-color: var(--og-lime);
  box-shadow: 0 2px 0 var(--btn-primary-depth);
}

.wallet-section-wrap.hidden {
  display: none !important;
}

.unmatched-sub.hidden {
  display: none !important;
}

.wallet-section-wrap {
  margin-bottom: 0;
}

/* Divider: Complete sets vs unmatched block */
.wallet-section-wrap[data-wallet-section="matched"]
  + .wallet-section-wrap[data-wallet-section="unmatched"] {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(223, 255, 0, 0.4);
}

/* Dividers between Missing OGENIEs / Missing CERTs / No CERT for this ID */
.wallet-section-wrap[data-wallet-section="unmatched"] .unmatched-sub + .unmatched-sub {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(223, 255, 0, 0.28);
}

.wallet-section-wrap[data-wallet-section="matched"] > .section-title {
  margin-top: 0;
}

.wallet-section-wrap[data-wallet-section="unmatched"] > .unmatched-sub:first-child .section-title {
  margin-top: 0;
}

.section-title {
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 1.35rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(223, 255, 0, 0.28);
  color: var(--og-lime);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-blurb {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.results-block .section-title:first-child {
  margin-top: 0;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
  padding: 0.35rem 0;
}

.empty-hint.prominent {
  padding: 0.75rem 0;
  font-size: 1rem;
}

.wallet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 520px) {
  .wallet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wallet-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wallet-card--ok {
  border-left: 4px solid var(--ok);
}

.wallet-card--warn {
  border-left: 4px solid var(--danger);
}

.wallet-card--info {
  border-left: 4px solid var(--lo-blue);
}

.wallet-card--nocert {
  border-left: 4px solid rgba(223, 255, 0, 0.35);
  opacity: 0.95;
}

.wallet-card__badge--nocert {
  color: var(--og-lime-muted);
}

.wallet-card__visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.wallet-card__visuals--single {
  grid-template-columns: 1fr;
  max-width: 140px;
}

.wallet-card__id {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--og-lime);
}

.wallet-card__badge {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.wallet-card__badge--ok {
  color: var(--ok);
}

.wallet-card__badge--bad {
  color: var(--danger);
}

.wallet-card__badge--extra {
  color: var(--lo-blue);
}

.wallet-card__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.nft-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nft-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nft-thumb img.is-broken {
  display: none;
}

.nft-thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}

.nft-thumb img.is-broken + .nft-thumb-fallback {
  display: flex;
}

.nft-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.nft-thumb--counterpart {
  position: relative;
  padding: 0;
  cursor: pointer;
  outline: none;
}

.nft-thumb--counterpart:focus-visible {
  box-shadow: 0 0 0 2px var(--og-lime);
}

.nft-thumb__counterpart-visual {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

/* Missing-from-wallet preview: light red wash so it reads as “not yours” */
.nft-thumb--counterpart .nft-thumb__counterpart-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(200, 48, 58, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.22);
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.nft-thumb--counterpart:hover .nft-thumb__counterpart-visual::after,
.nft-thumb--counterpart:focus-within .nft-thumb__counterpart-visual::after,
.nft-thumb--counterpart.is-revealed .nft-thumb__counterpart-visual::after {
  background: rgba(200, 48, 58, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.14);
}

.nft-thumb__counterpart-visual--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.nft-thumb__counterpart-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.52;
  transition: opacity 0.22s ease;
}

.nft-thumb--counterpart:hover .nft-thumb__counterpart-img,
.nft-thumb--counterpart:focus-within .nft-thumb__counterpart-img,
.nft-thumb--counterpart.is-revealed .nft-thumb__counterpart-img {
  opacity: 1;
}

.nft-thumb__counterpart-visual .nft-thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.nft-thumb__counterpart-visual
  .nft-thumb__counterpart-img.is-broken
  + .nft-thumb-fallback {
  display: flex;
}

.nft-thumb__counterpart-label {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.nft-thumb__find {
  position: absolute;
  bottom: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0.38rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0a0a0a;
  background: var(--og-lime);
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.nft-thumb__find:hover {
  filter: brightness(1.08);
}

.nft-thumb__find--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.nft-thumb--empty .nft-thumb-fallback {
  display: block;
  position: static;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
}

.token-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.token-pair--nocert {
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .token-pair {
    grid-template-columns: 1fr 1fr;
  }

  .token-pair--nocert {
    align-items: start;
    grid-template-columns: 1fr 1fr;
  }
}

.token-no-cert-pane {
  background: var(--bg-panel-2);
  border: 1px dashed rgba(223, 255, 0, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  min-height: 100%;
}

.token-no-cert-pane__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--og-lime-muted);
}

.token-no-cert-pane__body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.verdict--nocert {
  background: rgba(223, 255, 0, 0.06);
  border: 1px solid rgba(223, 255, 0, 0.2);
  color: var(--text);
  font-weight: 600;
}

.token-side {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.token-side--ogenie {
  border-top: 3px solid var(--og-lime);
}

.token-side--cert {
  border-top: 3px solid var(--lo-blue);
}

.token-side .nft-thumb {
  max-width: 200px;
  margin: 0 auto 0.75rem;
}

.token-side__label {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.token-side__owner {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.verdict {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.verdict--ok {
  background: rgba(94, 227, 164, 0.12);
  border: 1px solid rgba(94, 227, 164, 0.35);
  color: var(--ok);
}

.verdict--bad {
  background: rgba(255, 122, 122, 0.1);
  border: 1px solid rgba(255, 122, 122, 0.3);
  color: var(--danger);
}

.footer {
  margin-top: 2.75rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer__credit {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.footer__meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.footer__flexgrid {
  margin: 1.15rem 0 0;
}

.footer__flexgrid-btn {
  display: inline-block;
  width: 100%;
  max-width: 22rem;
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  color: #0a0a0a;
  background: var(--lo-blue);
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: filter 0.12s ease;
}

.footer__flexgrid-btn:hover {
  filter: brightness(1.08);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] textarea.wallet-input-multiline {
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] textarea.wallet-input-multiline:focus {
  box-shadow: 0 0 0 3px rgba(180, 195, 0, 0.28);
}

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

/* Flex Your Genies */
.flex-actions {
  margin: 0.85rem 0 1.1rem;
  padding: 0;
}

.flex-open-btn {
  width: 100%;
}

body.flex-modal-active {
  overflow: hidden;
}

body.welcome-modal-active {
  overflow: hidden;
}

/* First-visit intro (above flex modal and loading overlay when stacked) */
.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.welcome-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.welcome-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

.welcome-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(92vw, 520px);
  margin-bottom: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.35rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.welcome-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.welcome-modal__close:hover {
  color: var(--text);
  background: rgba(223, 255, 0, 0.12);
}

.welcome-modal__brands {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 2.75rem 0.85rem 0;
  --brand-row-h: clamp(3.6rem, 17.4vw, 8.55rem);
}

@media (min-width: 480px) {
  .welcome-modal__brands {
    --brand-row-h: clamp(4.65rem, 24vw, 10.05rem);
  }
}

.welcome-modal__brand-img {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
  height: var(--brand-row-h);
  max-height: var(--brand-row-h);
  object-fit: contain;
}

.welcome-modal__brand-img--lo {
  flex: 1 1 0;
  max-width: min(50%, 33rem);
}

.welcome-modal__brand-img--og {
  flex: 0 1 auto;
  max-width: min(32%, 13.5rem);
}

.welcome-modal__brand-x {
  flex-shrink: 0;
  font-size: clamp(2.7rem, 11.4vw, 4.35rem);
  font-weight: 200;
  color: var(--og-lime);
  line-height: 1;
  user-select: none;
}

.welcome-modal__title {
  margin: 0 2.25rem 0.65rem 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--og-lime);
}

.welcome-modal__body {
  margin: 0 0 1.1rem;
}

.welcome-modal__lede {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}

.welcome-modal__lede strong {
  color: var(--og-lime);
  font-weight: 600;
}

.welcome-modal__list {
  margin: 0 0 0.85rem;
  padding: 0 0 0 1.15rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.welcome-modal__list li {
  margin-bottom: 0.55rem;
}

.welcome-modal__list li:last-child {
  margin-bottom: 0;
}

.welcome-modal__list strong {
  color: var(--text);
  font-weight: 600;
}

.welcome-modal__flexgrid-btn {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  color: #0a0a0a;
  background: var(--lo-blue);
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: filter 0.12s ease;
}

.welcome-modal__flexgrid-btn:hover {
  filter: brightness(1.08);
}

.welcome-modal__cta {
  width: 100%;
  margin-top: 0.15rem;
}

.flex-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.flex-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.flex-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.flex-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(92vw, 720px);
  margin-bottom: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.flex-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.flex-modal__close:hover {
  color: var(--text);
  background: rgba(223, 255, 0, 0.12);
}

.flex-modal__brands {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 2.75rem 0.75rem 0;
  --brand-row-h: clamp(3.6rem, 17.4vw, 8.55rem);
}

@media (min-width: 480px) {
  .flex-modal__brands {
    --brand-row-h: clamp(4.65rem, 24vw, 10.05rem);
  }
}

.flex-modal__brand-img {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
  height: var(--brand-row-h);
  max-height: var(--brand-row-h);
  object-fit: contain;
}

.flex-modal__brand-img--lo {
  flex: 1 1 0;
  max-width: min(50%, 33rem);
}

.flex-modal__brand-img--og {
  flex: 0 1 auto;
  max-width: min(32%, 13.5rem);
}

.flex-modal__brand-x {
  flex-shrink: 0;
  font-size: clamp(2.7rem, 11.4vw, 4.35rem);
  font-weight: 200;
  color: var(--og-lime);
  line-height: 1;
  user-select: none;
}

.flex-modal__title {
  margin: 0 2.25rem 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--og-lime);
}

.flex-modal__lede {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.flex-modal__collection-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.flex-collection-pill {
  flex: 1;
  display: block;
  cursor: pointer;
  margin: 0;
  position: relative;
  min-width: 0;
}

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

.flex-collection-pill__label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid rgba(223, 255, 0, 0.5);
  background: var(--bg-panel-2);
  color: var(--og-lime-muted);
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.1),
    0 0 18px rgba(223, 255, 0, 0.14);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  user-select: none;
}

@keyframes flex-collection-pulse-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(223, 255, 0, 0.1),
      0 0 14px rgba(223, 255, 0, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(223, 255, 0, 0.22),
      0 0 32px rgba(223, 255, 0, 0.38);
  }
}

.flex-collection-pill__input:not(:checked) + .flex-collection-pill__label {
  animation: flex-collection-pulse-glow 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .flex-collection-pill__input:not(:checked) + .flex-collection-pill__label {
    animation: none;
  }
}

.flex-collection-pill:hover
  .flex-collection-pill__input:not(:checked)
  + .flex-collection-pill__label {
  animation: none;
  border-color: rgba(223, 255, 0, 0.75);
  color: var(--og-lime);
  box-shadow:
    0 0 0 1px rgba(223, 255, 0, 0.18),
    0 0 26px rgba(223, 255, 0, 0.22);
}

.flex-collection-pill__input:focus-visible + .flex-collection-pill__label {
  outline: 2px solid var(--og-lime);
  outline-offset: 2px;
}

.flex-collection-pill__input:checked + .flex-collection-pill__label {
  background: var(--og-lime);
  border-color: var(--og-lime);
  color: var(--bg-deep);
  box-shadow: 0 4px 0 var(--btn-primary-depth);
}

/* Layout / quality / preview — shown after first successful Generate FlexGrid */
.flex-modal__stage2.hidden {
  display: none !important;
}

.flex-modal__stage2:not(.hidden) {
  margin-top: 1.15rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-subtle);
}

.flex-modal__sort {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1rem;
  padding: 1rem 1.05rem 1.05rem;
  background: var(--bg-panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(223, 255, 0, 0.06);
}

.flex-modal__sort-head {
  margin-bottom: 0.7rem;
}

.flex-modal__sort-title {
  display: block;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--og-lime);
  line-height: 1.2;
  cursor: pointer;
}

.flex-modal__sort-note {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

.flex-modal__sort-note .flex-modal__inline-code {
  font-size: 0.78em;
  font-family: ui-monospace, monospace;
  color: var(--text);
  word-break: break-all;
}

.flex-modal__select-wrap {
  position: relative;
}

.flex-modal__select-wrap::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--og-lime-muted);
  border-bottom: 2px solid var(--og-lime-muted);
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.85;
}

.flex-quality-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.flex-quality-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent, #8aa8ff);
}

.flex-modal__select {
  width: 100%;
  margin: 0;
  padding: 0.72rem 2.65rem 0.72rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.35;
  border-radius: 11px;
  border: 1px solid rgba(223, 255, 0, 0.22);
  background: var(--bg-deep);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.flex-modal__select:hover {
  border-color: rgba(223, 255, 0, 0.4);
}

.flex-modal__select:focus {
  outline: none;
  border-color: var(--og-lime);
  box-shadow: 0 0 0 3px rgba(223, 255, 0, 0.16);
}

.flex-preview-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.flex-preview-grid {
  display: grid;
  gap: 0;
  margin-bottom: 1rem;
  padding: 0;
  background: var(--bg-panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.flex-preview-grid__pblo-fixed {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% / var(--flex-cols, 1));
  height: calc(100% / var(--flex-rows, 1));
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
}

.flex-preview-grid__pblo-fixed > img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 52%;
  object-fit: contain;
  object-position: top center;
  pointer-events: none;

  /* Match FlexGrid watermark visibility */
  opacity: 0.92;
  padding: 6px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  filter:
    drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.35));
}

.flex-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #ffffff;
  border: none;
  outline: none;
}

/* Merged 2.png filler spans two grid cells (row-major adjacency). */
.flex-tile--span2h {
  aspect-ratio: 2 / 1;
}

.flex-tile--span2v {
  aspect-ratio: 1 / 2;
}

/*
 * Grid + aspect-ratio: percentage heights on <img> often don’t resolve for spanned cells,
 * so the image can collapse or fail to paint (user sees only the tile background).
 * Match the brand tile: absolutely fill the cell (cover).
 */
.flex-tile:not(.flex-tile--brand) > .flex-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Seam hide: only wallet NFT tiles — not brand (ogeniegrid/pblo) or fillers (1–3.png). */
.flex-tile:not(.flex-tile--brand):not(.flex-tile--filler) > .flex-tile__img {
  transform: scale(1.01);
  transform-origin: center center;
}

.flex-tile--brand {
  position: relative;
  background: var(--og-lime);
  min-height: 0;
  overflow: hidden;
}

/* Brand grid art (ogeniegrid): slight zoom hides a ~1px seam on some exports */
.flex-tile--brand > .flex-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1.018);
  transform-origin: center center;
  z-index: 0;
  /* Must receive drags; pblo stack above uses pointer-events: none so grabs hit this img */
  pointer-events: auto;
}

/* pblo sits above the grid art */
.flex-tile__brand-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-height: 52%;
  min-height: 0;
  box-sizing: border-box;
  padding: 0;
  gap: 0;
  line-height: 0;
  pointer-events: none;
}

.flex-tile__brand-pblo {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top center;
  flex-shrink: 0;
  pointer-events: none;
  display: block;

  /* Match FlexGrid watermark visibility */
  opacity: 0.92;
  padding: 6px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  filter:
    drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.35));
}

/* Filler art (1/2/3.png): keep paint above any stray grid bleed */
.flex-tile--filler {
  background: #ffffff;
}

.flex-tile--filler > .flex-tile__img {
  z-index: 1;
}

.flex-tile--empty {
  background: #ffffff;
}

.flex-tile--dragging {
  opacity: 0.92;
}

.flex-tile--reordering {
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}

.flex-tile--shuffle-in {
  will-change: opacity, transform;
}

.flex-tile__img {
  display: block;
  pointer-events: auto;
}

.flex-modal__generate {
  width: 100%;
}

.flex-modal__error {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--danger);
  line-height: 1.4;
  display: none;
}

.flex-modal__error.is-visible {
  display: block;
}

.flex-preview-wrap {
  margin-top: 1.15rem;
}

.flex-modal__stage2 .flex-preview-wrap {
  margin-top: 0.85rem;
}

.flex-preview-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--og-lime);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flex-modal__download {
  width: 100%;
  margin-top: 0.85rem;
}

.flex-gif-section,
.flex-export-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.flex-gif-create {
  width: 100%;
  margin-top: 0.15rem;
}

.export-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.export-controls .export-controls__credit {
  margin: 0.9rem 0 0;
  text-align: center;
}

.export-controls__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.export-controls__btn {
  flex: 1 1 140px;
  min-width: 0;
  margin-top: 0;
}

.export-controls__progress {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* GIF frame count — above flex modal (9990), below global loading (10050) */
.flex-gif-options-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.flex-gif-options-modal.hidden {
  display: none;
}

.flex-gif-options-modal:not(.hidden) {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.flex-gif-options-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.flex-gif-options-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.flex-gif-options-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.flex-gif-options-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--og-lime);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flex-gif-options-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin: -0.25rem -0.25rem 0 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.flex-gif-options-modal__close:hover {
  color: var(--text);
  background: rgba(223, 255, 0, 0.08);
}

.flex-gif-options-modal__summary {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.flex-gif-options-modal__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.flex-gif-options-modal__label--section {
  margin-top: 0.9rem;
}

.flex-gif-options-modal__hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--og-lime-muted);
}

.flex-gif-options-modal__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(223, 255, 0, 0.28);
  background: var(--bg-deep);
  color: var(--text);
}

.flex-gif-options-modal__input:focus {
  outline: none;
  border-color: var(--og-lime);
  box-shadow: 0 0 0 3px rgba(223, 255, 0, 0.14);
}

.flex-gif-options-modal__range-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.flex-gif-options-modal__range-row--speed {
  margin-bottom: 0.65rem;
}

.flex-gif-options-modal__speed-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.35rem;
  padding: 0 0.05rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--og-lime-muted);
}

.flex-gif-options-modal__range {
  flex: 1 1 auto;
  min-width: 0;
  height: 0.45rem;
  accent-color: var(--og-lime);
  cursor: pointer;
}

.flex-gif-options-modal__range-val {
  flex: 0 0 auto;
  min-width: 3.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--og-lime);
  text-align: right;
}

.flex-gif-options-modal__duration {
  margin: 0.15rem 0 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  background: rgba(223, 255, 0, 0.06);
  border: 1px solid rgba(223, 255, 0, 0.2);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.flex-gif-options-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.flex-gif-options-modal__btn {
  flex: 1 1 120px;
  min-width: 0;
}

.flex-gif-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.flex-gif-modal.hidden {
  display: none;
}

.flex-gif-modal:not(.hidden) {
  display: grid;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.flex-gif-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.flex-gif-modal__panel {
  position: relative;
  z-index: 1;
  min-width: min(280px, 92vw);
  padding: 1.35rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: var(--panel-bg, rgba(24, 28, 40, 0.96));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.flex-gif-modal__text {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}

.flex-gif-modal__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent, #8aa8ff);
  border-radius: 50%;
  animation: flex-gif-spin 0.75s linear infinite;
}

@keyframes flex-gif-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Full-screen loader: ogtriple pops in and spins on the spot */
.global-loading {
  position: fixed;
  inset: 0;
  /* Above flex-gif-modal (10001) so label + pill stay visible during export */
  z-index: 10050;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}

.global-loading.is-active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.global-loading__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.global-loading__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: min(320px, 88vw);
  padding: 0 1rem;
}

.global-loading__label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  min-height: 1.35em;
}

/* Track + fill: red → green as progress approaches 100% */
.global-loading__pill {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.global-loading__pill-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition:
    width 0.22s ease,
    background 0.22s ease;
  background: hsl(0, 72%, 52%);
}

.global-loading--indeterminate .global-loading__pill-fill {
  width: 42% !important;
  background: linear-gradient(90deg, #e85555, #c9a227, #3dbf6e);
  background-size: 200% 100%;
  animation: global-loading-pill-flow 1.35s ease-in-out infinite;
}

@keyframes global-loading-pill-flow {
  0% {
    transform: translateX(-100%);
    background-position: 0% 50%;
  }
  100% {
    transform: translateX(350%);
    background-position: 100% 50%;
  }
}

.global-loading__spin-wrap {
  position: relative;
  transform: scale(0.65);
  opacity: 0;
}

.global-loading.is-active .global-loading__spin-wrap {
  animation: global-loading-pop 0.4s cubic-bezier(0.34, 1.35, 0.64, 1) forwards;
}

.global-loading__img {
  display: block;
  width: min(120px, 32vw);
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.global-loading.is-active .global-loading__img {
  animation: global-loading-spin 1.05s linear infinite;
}

@keyframes global-loading-pop {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes global-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-loading.is-active .global-loading__spin-wrap {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }

  .global-loading.is-active .global-loading__img {
    animation: global-loading-spin 2.5s linear infinite;
  }

  .global-loading--indeterminate .global-loading__pill-fill {
    animation: none;
    transform: none;
    width: 100% !important;
    opacity: 0.85;
  }
}
