:root {
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
}

[data-theme="dark"] {
  --bg: #07080a;
  --surface: #101216;
  --surface-elevated: #171a20;
  --surface-glass: rgba(16, 18, 22, 0.84);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text: #f5f6f8;
  --text-muted: #8e94a0;
  --accent-bg: #f5f6f8;
  --accent-text: #07080a;
  --card-overlay: linear-gradient(180deg, rgba(7, 8, 10, 0.05) 0%, rgba(7, 8, 10, 0.35) 50%, rgba(7, 8, 10, 0.92) 100%);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.65);
}

[data-theme="light"] {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-elevated: #e9ebf0;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --border: rgba(12, 14, 18, 0.11);
  --border-strong: rgba(12, 14, 18, 0.3);
  --text: #0c0e12;
  --text-muted: #5d6370;
  --accent-bg: #0c0e12;
  --accent-text: #ffffff;
  --card-overlay: linear-gradient(180deg, rgba(12, 14, 18, 0.02) 0%, rgba(12, 14, 18, 0.32) 52%, rgba(12, 14, 18, 0.88) 100%);
  --shadow-lg: 0 24px 60px rgba(12, 14, 18, 0.12);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
}

/* NASDAQ-Style Live Feed Above Header (Left -> Right) */
.nasdaq-ticker {
  position: relative;
  z-index: 32;
  height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow: hidden;
  user-select: none;
}

.ticker-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 14px;
  border-right: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.85);
}

.nasdaq-ticker.paused .ticker-pulse {
  opacity: 0.35;
  box-shadow: none;
}

.ticker-viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: tickerLeftToRight 85s linear infinite;
}

.nasdaq-ticker.paused .ticker-track {
  animation-play-state: paused;
}

@keyframes tickerLeftToRight {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0%, 0, 0);
  }
}

.ticker-quote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
}

.ticker-quote:hover {
  background: var(--surface-elevated);
}

.tq-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  flex-shrink: 0;
}

.tq-user {
  font-weight: 700;
  color: var(--text);
}

.tq-sep {
  color: var(--text-muted);
}

.tq-top {
  color: var(--text);
  font-weight: 500;
}

.tq-thumbs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tq-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

.tq-time {
  color: var(--text-muted);
  font-size: 10.5px;
}

.ticker-stop-btn {
  width: 38px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-stop-btn:hover {
  background: var(--accent-bg);
  color: var(--accent-text);
}

/* Top Navigation Bar */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-triangle {
  width: 20px;
  height: 18px;
  color: var(--accent-bg);
  display: block;
  flex-shrink: 0;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-tld {
  color: var(--text-muted);
  font-weight: 500;
}

.category-dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}

.category-dock::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}

.cat-btn:hover:not(:disabled):not(.active) {
  color: var(--text);
}

.cat-btn.active {
  background: transparent;
  color: var(--accent-text);
}

.cat-btn.is-soon,
.cat-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.soon-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.span-pill {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}

.span-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.span-btn.active {
  background: transparent;
  color: var(--accent-text);
}

/* Sliding Active Pill Indicator */
.switch-slider {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    width 240ms cubic-bezier(0.22, 1, 0.36, 1),
    height 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 140ms ease;
}

.switch-slider.ready {
  opacity: 1;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.x-follow-pill {
  color: var(--text-muted);
}

.x-follow-pill:hover {
  color: var(--text);
}

.icon-pill:hover {
  border-color: var(--border-strong);
}

/* Main Stage Container */
.stage-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 36px 32px 24px;
}

/* Minimal Site Footer — strictly at the very bottom below <main> and docks */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  background: var(--bg);
}

.site-footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 32px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  justify-self: start;
}

.footer-triangle {
  width: 14px;
  height: 13px;
  color: var(--accent-bg);
  display: block;
  flex-shrink: 0;
}

.footer-brand-word {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.footer-center {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  justify-self: center;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.footer-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.footer-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Info Modal (About / Terms / Copyright) */
.modal-info {
  width: min(560px, 100%);
}

.info-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 16px;
}

.info-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.info-tab:hover:not(.active) {
  color: var(--text);
}

.info-tab.active {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.info-panels-stack {
  display: grid;
}

.info-panel {
  grid-area: 1 / 1;
  font-size: 14px;
  line-height: 1.55;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.info-panel.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.info-panel p {
  margin: 0 0 12px;
}

.info-panel a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.info-subhead {
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--text);
  margin-top: 16px !important;
  margin-bottom: 6px !important;
}

.legal-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
}

.legal-list strong {
  color: var(--text);
}

/* Shared Banner */
.shared-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.shared-bar > div:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.shared-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Centered Step 1 Masthead */
.masthead {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 44px;
}

.masthead-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 600px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}

.masthead-spacer {
  min-width: 0;
}

/* Unified Tactile 3D Button Pattern (No Darkening on Hover) */
.btn-solid,
.btn-outline,
.icon-pill,
.btn-share-step3,
.btn-yellow,
.icon-close,
.ticker-stop-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -2px 0 rgba(0, 0, 0, 0.24),
    0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 140ms ease;
}

.btn-solid:hover,
.btn-outline:hover,
.icon-pill:hover,
.btn-share-step3:hover,
.btn-yellow:hover,
.icon-close:hover,
.ticker-stop-btn:hover {
  transform: translateY(-1.5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.24),
    0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-solid:active,
.btn-outline:active,
.icon-pill:active,
.btn-share-step3:active,
.btn-yellow:active,
.icon-close:active,
.ticker-stop-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.28),
    0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Unified Switch System (Categories, Time Span, Layouts, # / Aa) */
.cat-btn,
.span-btn,
.dock-btn,
.dock-chip {
  transition:
    background-color 170ms cubic-bezier(0.22, 1, 0.36, 1),
    color 170ms ease,
    border-color 170ms ease,
    transform 150ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 170ms ease;
}

.cat-btn:hover:not(:disabled):not(.active),
.span-btn:hover:not(.active),
.dock-btn:hover:not(.active),
.dock-chip:hover:not(.active) {
  color: var(--text);
  background: rgba(128, 128, 128, 0.12);
}

.cat-btn:active:not(:disabled),
.span-btn:active,
.dock-btn:active,
.dock-chip:active {
  transform: scale(0.96);
}

.cat-btn.active,
.span-btn.active,
.dock-btn.active {
  box-shadow: none;
}

.dock-chip.active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.18);
}

.step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #facc15;
  color: #090a0d;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: none;
}

.dock-step-pill {
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
}

.omni-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.omni-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.omni-search-col {
  position: relative;
  flex: 1;
  min-width: 0;
}

.omni-input-wrap {
  position: relative;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding-right: 10px;
}

.omni-input-wrap:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--border);
}

.omni-search-svg {
  margin-left: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.user-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  flex-shrink: 0;
  max-width: 150px;
}

.user-pill > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill-close {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.user-pill-close:hover {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.omni-input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.omni-clear {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
  flex-shrink: 0;
}

.csv-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  margin-left: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.csv-pill:hover {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.omni-bar .span-pill {
  height: 48px;
  padding: 4px;
  align-items: center;
  flex-shrink: 0;
}

.omni-bar .span-btn {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  font-size: 13px;
}

.btn-import-main {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.omni-helper-row {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: max-content;
  max-width: 150%;
  display: flex;
  align-items: center;
  padding: 0;
  font-size: 12.5px;
  pointer-events: none;
}

.omni-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(720px, 100%);
  z-index: 40;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item:hover {
  background: var(--surface-elevated);
}

.search-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.search-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.search-item-title {
  font-weight: 600;
  font-size: 15px;
  display: block;
}

.search-item-sub {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
}

/* Discovery Drawer (Large Artwork Picks) */
.discovery-drawer {
  margin-bottom: 36px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.drawer-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.text-action:hover {
  color: var(--text);
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 18px;
}

.pick-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, border-color 180ms ease;
}

.pick-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.pick-art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.pick-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pick-plus {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.pick-meta {
  padding: 12px 14px 14px;
}

.pick-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.pick-creator {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* Smooth Non-Flicker Stage Switch Animation */
@keyframes stageCardIn {
  from {
    opacity: 0.88;
    transform: translate3d(0, 4px, 0) scale(0.996);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.stage-grid.is-switching .stage-card {
  animation: stageCardIn 170ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .stage-grid.is-switching .stage-card {
    animation: none;
  }
}

/* THE EXHIBITION STAGE: Monumental Visual Layouts */
.stage-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

/* Layout 1: Bento Stage (#1 is massive 2x2 hero, #2-#3 large, #4-#10 gallery cards) */
.stage-grid.layout-bento {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 260px;
}

.stage-grid.layout-bento .stage-card:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.stage-grid.layout-bento .stage-card:nth-child(2),
.stage-grid.layout-bento .stage-card:nth-child(3) {
  grid-column: span 1;
  grid-row: span 2;
}

/* Layout 2: Cinema Posters (5 large vertical 2:3 posters per row) */
.stage-grid.layout-posters {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 390px;
}

/* Layout 3: Architectural Slabs (2 columns of wide visual cards with huge cover blocks) */
.stage-grid.layout-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 170px;
}

/* Layout 4: List (Compact High-Density Index) */
.stage-grid.layout-minimal {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 74px;
  gap: 8px;
}

/* Stage Card Base */
.stage-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: grab;
  transition: transform 200ms ease, border-color 200ms ease;
}

.stage-card:hover {
  border-color: var(--border-strong);
}

.stage-card.dragging {
  opacity: 0.35;
  transform: scale(0.97);
}

.stage-card.drop-target {
  border-color: #facc15 !important;
  box-shadow: 0 0 0 2px #facc15, 0 14px 36px rgba(250, 204, 21, 0.22);
  transform: scale(1.015);
}

.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-card:hover .card-art {
  transform: scale(1.03);
}

.card-shade {
  position: absolute;
  inset: 0;
  background: var(--card-overlay);
  pointer-events: none;
}

.card-rank {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: rgba(7, 8, 10, 0.78);
  color: #f5f6f8;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.stage-grid.layout-bento .stage-card:nth-child(1) .card-rank {
  font-size: 18px;
  padding: 8px 16px;
}

/* Hover Control Pill on Each Card */
.card-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.stage-card:hover .card-controls,
.stage-card:focus-within .card-controls {
  opacity: 1;
  transform: translateY(0);
}

.ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 8, 10, 0.82);
  color: #f5f6f8;
  font-size: 15px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.ctrl-btn:hover:not(:disabled) {
  background: #f5f6f8;
  color: #07080a;
}

.ctrl-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.card-caption {
  position: relative;
  z-index: 2;
  padding: 22px;
  color: #f5f6f8;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stage-grid.layout-bento .stage-card:nth-child(1) .card-title {
  font-size: 32px;
}

.card-creator {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(245, 246, 248, 0.76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Horizontal Cards & Compact List Overrides */
.stage-grid.layout-stack .stage-card {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 22px;
  gap: 20px;
}

.stage-grid.layout-minimal .stage-card {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 16px;
  gap: 14px;
  border-radius: var(--radius-md);
}

.stage-grid.layout-stack .card-art {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stage-grid.layout-minimal .card-art {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
}

.stage-grid.layout-stack .card-shade,
.stage-grid.layout-minimal .card-shade {
  display: none;
}

.stage-grid.layout-stack .card-rank {
  position: static;
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border-strong);
  font-size: 16px;
  padding: 8px 14px;
  flex-shrink: 0;
}

.stage-grid.layout-minimal .card-rank {
  position: static;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  font-size: 14px;
  padding: 0 4px;
  flex-shrink: 0;
}

.stage-grid.layout-stack .card-caption,
.stage-grid.layout-minimal .card-caption {
  padding: 0;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.stage-grid.layout-minimal .card-title {
  font-size: 16px;
  -webkit-line-clamp: 1;
}

.stage-grid.layout-minimal .card-creator {
  margin-top: 2px;
  font-size: 13px;
}

.stage-grid.layout-stack .card-creator,
.stage-grid.layout-minimal .card-creator {
  color: var(--text-muted);
}

.stage-grid.layout-stack .card-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transform: translateY(-4px);
}

.stage-grid.layout-minimal .card-controls {
  position: static;
  order: 4;
  margin-left: auto;
  opacity: 0;
  transform: none;
  flex-shrink: 0;
}

.stage-grid.layout-stack .stage-card:hover .card-controls,
.stage-grid.layout-stack .stage-card:focus-within .card-controls,
.stage-grid.layout-minimal .stage-card:hover .card-controls,
.stage-grid.layout-minimal .stage-card:focus-within .card-controls {
  opacity: 1;
  transform: translateY(0);
}

/* Empty Stage Card Slot */
.empty-slot-card {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 16px;
}

.empty-slot-card:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface);
}

/* Sticky Bottom Docks: float while scrolling cards, stop cleanly above footer */
.floating-docks-wrap {
  position: sticky;
  bottom: 18px;
  z-index: 35;
  margin: 36px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
}

.dock-capsule {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 24px);
}

.dock-capsule .span-pill {
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.dock-capsule .span-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
}

.dock-group {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.dock-btn,
.dock-chip {
  position: relative;
  z-index: 1;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}

.dock-chip {
  font-family: var(--font-mono);
  border-color: var(--border);
  padding: 0 12px;
}

.dock-btn:hover,
.dock-chip:hover {
  color: var(--text);
}

.dock-btn.active {
  background: transparent;
  color: var(--accent-text);
}

.dock-chip.active {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.slot-counter {
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 6px;
  white-space: nowrap;
}

.btn-share-step3 {
  height: 56px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
  color: #090a0d;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
  color: #090a0d;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Buttons & Tags */
.mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.btn-solid,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-solid {
  border: 1px solid var(--accent-bg);
  background: var(--accent-bg);
  color: var(--accent-text);
}

.btn-solid:hover {
  opacity: 0.9;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
}

.modal-card {
  width: min(580px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: min(940px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
}

.icon-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.platform-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.platform-chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

.platform-chip:hover,
.platform-chip.active {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.modal-card textarea,
.url-copy-row input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.share-modal-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.share-preview-box {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.share-preview-box img {
  width: 100%;
  height: auto;
  display: block;
}

.caption-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 6px;
}

.caption-head .field-label {
  margin: 0;
}

.caption-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.caption-counter.is-near {
  color: #facc15;
}

.caption-counter.is-limit {
  color: #ef4444;
  font-weight: 700;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}

.url-copy-row {
  display: flex;
  gap: 8px;
}

.small-note {
  font-size: 12.5px;
  margin: 8px 0 18px;
}

.share-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: #facc15;
  color: #090a0d;
  border: 1px solid rgba(0, 0, 0, 0.22);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
  .masthead-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .masthead-spacer {
    display: none;
  }

  .stage-grid.layout-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 260px;
  }

  .stage-grid.layout-posters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 340px;
  }

  .share-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .nav-import-btn {
    display: none;
  }

  .btn-import-hero {
    width: 100%;
  }

  .category-dock {
    order: 3;
    width: 100%;
  }

  .stage-container {
    padding: 22px 16px 18px;
  }

  .site-footer-inner {
    padding: 18px 16px 26px;
    grid-template-columns: 1fr auto;
    row-gap: 12px;
  }

  .footer-center {
    grid-column: 1 / -1;
    order: 3;
    justify-self: center;
  }

  .omni-helper-row {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
  }

  .omni-input-wrap {
    width: 100%;
  }

  /* Distinct Mobile Layouts for All 4 Views */
  .stage-grid.layout-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 12px;
  }

  .stage-grid.layout-bento .stage-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
    height: 255px;
  }

  .stage-grid.layout-bento .stage-card:nth-child(2),
  .stage-grid.layout-bento .stage-card:nth-child(3) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .stage-grid.layout-bento .stage-card:not(:first-child) {
    height: 175px;
  }

  .stage-grid.layout-bento .stage-card:not(:first-child) .card-title {
    font-size: 15px;
  }

  .stage-grid.layout-posters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 265px;
    gap: 12px;
  }

  .stage-grid.layout-posters .card-title {
    font-size: 15px;
  }

  .stage-grid.layout-stack {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 114px;
    gap: 12px;
  }

  .stage-grid.layout-stack .stage-card {
    padding: 12px 14px;
    gap: 14px;
  }

  .stage-grid.layout-stack .card-art {
    width: 88px;
    height: 88px;
  }

  .stage-grid.layout-minimal {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 66px;
    gap: 6px;
  }

  .dock-divider {
    display: none;
  }

  .dock-capsule {
    padding: 8px 10px;
    gap: 6px;
    border-radius: 22px;
  }

  .btn-share-step3 {
    width: 100%;
    height: 46px;
    font-size: 14px;
  }

  .card-controls,
  .stage-grid.layout-stack .card-controls,
  .stage-grid.layout-minimal .card-controls {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 440px) {
  .x-handle {
    display: none;
  }

  .omni-bar {
    flex-wrap: wrap;
  }

  .omni-row-main {
    width: 100%;
    flex: 1 1 100%;
    gap: 8px;
  }

  .btn-import-main {
    width: 100%;
  }
}
