/* ========================================================
   Aqours Campaign - Theme & Live Stage Visual Styles
   Design Reference: Concert Dome Arena with Glowing Emblems,
   Feathers, Milestone Capsule Bar & Twin Glowing Action Buttons
   ======================================================== */
:root {
  /* Brand palette */
  --sky: #5cc8ff;
  --sky-2: #38bdf8;
  --sky-deep: #0284c7;
  --lavender: #c4a1ff;
  --violet: #a855f7;
  --pink: #f0abfc;
  --rose: #f472b6;
  --peach: #fcd29f;
  --gold: #fbbf24;

  --success: #34d399;
  --success-deep: #059669;
  --warning: #fbbf24;
  --danger: #f87171;
  --danger-deep: #dc2626;

  /* Surfaces & lines */
  --bg-dark: #070a12;
  --surface-1: rgba(13, 19, 36, 0.78);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.07);
  --surface-4: rgba(255, 255, 255, 0.11);
  --surface-modal: rgba(12, 18, 34, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --line-glow: rgba(92, 200, 255, 0.45);

  /* Text */
  --text-main: #f1f5f9;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shape & motion */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.65);
  --ring: 0 0 0 3px rgba(92, 200, 255, 0.35);
  --topbar-h: 76px;
  --scrollbar-comp: 0px;

  /* 9 Aqours Signature Colors */
  --c-chika: #FF7F27;
  --c-riko: #E8728A;
  --c-kanan: #00B050;
  --c-dia: #D6000F;
  --c-you: #40BFFF;
  --c-yoshiko: #89989E;
  --c-hanamaru: #E8A010;
  --c-mari: #AE57A4;
  --c-ruby: #E8388C;
}

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

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans JP", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.is-scroll-locked {
  overflow: hidden;
  padding-right: var(--scrollbar-comp);
}

img {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(92, 200, 255, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.45);
}

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

.sr-only-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.spin {
  animation: spin 0.9s linear infinite;
}

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

/* Background image with live concert dome atmosphere */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('/images/background.jpg');
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  filter: brightness(0.68) saturate(1.3) contrast(1.1);
  transform: scale(1.02);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 50% 30%, rgba(14, 22, 44, 0.45) 0%, rgba(6, 9, 18, 0.88) 75%, rgba(3, 5, 10, 0.96) 100%);
  pointer-events: none;
}

/* Boot splash shown until React mounts */
.boot-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.boot-splash img {
  filter: drop-shadow(0 0 18px rgba(92, 200, 255, 0.6));
  animation: gentleFloat 2.4s ease-in-out infinite;
}

.boot-splash-bar {
  position: relative;
  width: 120px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.boot-splash-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--lavender));
  animation: bootSlide 1.1s ease-in-out infinite;
}

@keyframes bootSlide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

/* Three.js 3D Interactive Stage Layer */
.three-canvas-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Lucide & Custom SVG Icons */
.lucide-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ========================================================
   Floating Top Bar
   ======================================================== */
.stage-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem calc(2rem + var(--scrollbar-comp)) 1.1rem 2rem;
  pointer-events: none;
  transition: padding 0.3s var(--ease-out), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

.stage-top-bar.is-scrolled {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.82), rgba(8, 12, 24, 0.62));
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.stage-top-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.5px;
  pointer-events: auto;
  background: rgba(10, 16, 32, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.35rem 1rem 0.35rem 0.45rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.stage-top-brand:hover {
  background: rgba(10, 16, 32, 0.75);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.stage-top-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.stage-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
}

.hamburger-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-spring);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hamburger-btn:hover {
  background: rgba(25, 37, 65, 0.85);
  border-color: var(--sky-2);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  transform: scale(1.05);
}

.hamburger-btn:hover .hamburger-line:nth-child(2) {
  width: 14px;
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: width 0.25s var(--ease-out);
}

/* Ticket Chip */
.ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 44px;
  padding: 0 1rem;
  background: rgba(13, 22, 44, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 159, 232, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
}

.ticket-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(0, 159, 232, 0.55);
}

.ticket-chip .lucide-icon {
  color: var(--sky-2);
}

.ticket-chip.is-empty {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

.ticket-chip.is-empty .ticket-number,
.ticket-chip.is-empty .lucide-icon {
  color: var(--text-muted);
}

.ticket-chip-label {
  color: var(--text-soft);
}

.ticket-number {
  color: var(--sky-2);
  font-size: 1.12rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  animation: ticketPop 0.5s var(--ease-spring);
}

.ticket-chip-total {
  color: var(--text-dim);
  font-weight: 600;
}

@keyframes ticketPop {
  0% { transform: scale(1.6); color: #fff; }
  100% { transform: scale(1); }
}

/* ========================================================
   Drawer Sidebar Navigation
   ======================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 12, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 88vw;
  height: 100%;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(92, 200, 255, 0.12), transparent 60%),
    radial-gradient(100% 50% at 0% 100%, rgba(168, 85, 247, 0.12), transparent 60%),
    rgba(11, 16, 31, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--line);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.38s var(--ease-out), visibility 0.38s;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  padding: 1.4rem 1.35rem 1.2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-sidebar:focus {
  outline: none;
}

.drawer-sidebar.is-open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.drawer-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(92, 200, 255, 0.45));
}

.drawer-title {
  font-size: 1.08rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--sky-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drawer-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.drawer-pass {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.14), rgba(196, 161, 255, 0.1));
  border: 1px solid rgba(92, 200, 255, 0.25);
  font-size: 0.88rem;
  color: var(--text-soft);
}

.drawer-pass > .lucide-icon {
  color: var(--sky-2);
}

.drawer-pass strong {
  color: #fff;
  font-size: 1.05rem;
}

.drawer-pass-tag {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  white-space: nowrap;
}

.drawer-pass-tag.is-unlocked {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
}

.drawer-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.drawer-section-label {
  margin: 1.2rem 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.drawer-nav-item {
  --nav-color: var(--sky-2);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--r-md);
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid transparent;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.drawer-nav-item:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  transform: translateX(3px);
}

.drawer-nav-item.is-active {
  background: color-mix(in srgb, var(--nav-color) 12%, transparent);
  border-color: color-mix(in srgb, var(--nav-color) 40%, transparent);
}

.drawer-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--nav-color);
  background: color-mix(in srgb, var(--nav-color) 16%, transparent);
  flex-shrink: 0;
}

.drawer-nav-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
}

.drawer-nav-text small {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
}

.drawer-nav-arrow {
  color: var(--text-dim);
  transition: transform 0.2s var(--ease-out), color 0.2s;
}

.drawer-nav-item:hover .drawer-nav-arrow,
.drawer-nav-item.is-active .drawer-nav-arrow {
  color: var(--nav-color);
  transform: translateX(2px);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.drawer-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--text-dim);
  text-align: center;
}

/* ========================================================
   Stage Hero Section
   ======================================================== */
.stage-hero-viewport {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  scroll-margin-top: 0;
}

/* Japanese Poetic Phrases on Left & Right */
.stage-poem-left,
.stage-poem-right {
  position: absolute;
  top: 14%;
  color: #ffffff;
  font-family: "Yuji Boku", "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", "SimSun", serif;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.7), 0 0 28px rgba(56, 189, 248, 0.55);
  z-index: 5;
  pointer-events: none;
  letter-spacing: 2px;
  animation: gentleFloat 6s ease-in-out infinite;
}

.stage-poem-left {
  left: 5%;
}

.stage-poem-right {
  right: 6%;
  animation-delay: -3s;
}

.stage-poem-line {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.7;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-poem-line.indent-1 {
  margin-left: 1.5rem;
}

.stage-poem-line.indent-2 {
  margin-left: 2.75rem;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

/* Center Glowing Logo */
.stage-logo-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  z-index: 6;
  width: 100%;
  max-width: 780px;
}

.stage-hero-logo-img {
  display: block;
  width: min(100%, 420px, 46svh);
  height: auto;
  object-fit: contain;
  animation: heroLogoIn 1s var(--ease-out) both, heroLogoFloat 5s ease-in-out 1s infinite;
  user-select: none;
  pointer-events: none;
}

@keyframes heroLogoIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes heroLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ========================================================
   The 9 Members Glowing Emblems Rail
   ======================================================== */
.member-emblems-rail {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem auto 2.25rem;
  flex-wrap: wrap;
  z-index: 6;
  max-width: 980px;
}

.member-emblem-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  transition: transform 0.25s var(--ease-spring);
  position: relative;
  padding: 0.3rem 0.35rem;
  color: #fff;
  animation: emblemIn 0.6s var(--ease-out) both;
  animation-delay: calc(0.35s + var(--i, 0) * 60ms);
}

@keyframes emblemIn {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}

.member-emblem-btn:hover,
.member-emblem-btn:focus-visible {
  transform: translateY(-8px) scale(1.12);
}

.member-emblem-btn:focus-visible {
  outline-color: var(--emblem-color);
}

.member-emblem-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
}

.member-emblem-icon-wrap::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--emblem-color, #fff) 0%, transparent 70%);
  opacity: 0.25;
  transition: opacity 0.25s, inset 0.25s;
}

.member-emblem-btn:hover .member-emblem-icon-wrap::after {
  opacity: 0.65;
  inset: -8px;
}

.member-emblem-icon-wrap img {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px var(--emblem-color, #fff));
  transition: filter 0.25s;
}

.member-emblem-btn:hover .member-emblem-icon-wrap img {
  filter: drop-shadow(0 0 14px var(--emblem-color, #fff)) drop-shadow(0 0 24px var(--emblem-color, #fff));
}

.member-emblem-name {
  font-family: "Caveat", "Brush Script MT", "Dancing Script", cursive, sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 8px var(--emblem-color, #fff);
  white-space: nowrap;
}

/* ========================================================
   Glassmorphic Milestone Card
   ======================================================== */
.stage-milestone-card {
  position: relative;
  width: 100%;
  max-width: 820px;
  background: rgba(14, 22, 42, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  padding: 1.4rem 2.25rem 1.1rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.55), 0 0 35px rgba(56, 189, 248, 0.15);
  z-index: 6;
  margin-bottom: 2rem;
}

.stage-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  margin-bottom: 1.1rem;
}

.stage-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.stage-stat-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.stage-stat-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.stage-stat-digits {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.stage-stat-num {
  font-size: 2.7rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.8), 0 0 30px rgba(56, 189, 248, 0.4);
}

.stage-stat-unit {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stage-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.stage-nodes-row {
  position: relative;
  height: 40px;
  margin-bottom: 8px;
}

.stage-node-item {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  white-space: nowrap;
}

.stage-node-item.is-end {
  transform: translateX(-100%);
  align-items: flex-end;
  text-align: right;
}

.stage-node-title {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
}

.stage-node-title.is-pink { color: var(--rose); }
.stage-node-title.is-sky { color: var(--sky-2); }
.stage-node-title.is-done { color: var(--success); }

.stage-node-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.stage-capsule-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--r-pill);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stage-capsule-fill {
  height: 100%;
  min-width: 12px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 60%, #e879f9 100%);
  border-radius: var(--r-pill);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8), 0 0 28px rgba(232, 121, 249, 0.5);
  transition: width 1.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stage-capsule-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: capsuleShine 2.8s ease-in-out infinite;
}

@keyframes capsuleShine {
  0%, 30% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stage-pin-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid var(--sky-2);
  box-shadow: 0 0 10px var(--sky-2);
  z-index: 2;
}

.stage-pin-dot:last-child {
  transform: translate(-100%, -50%);
}

.stage-pin-dot.pin-pink {
  border-color: var(--rose);
  box-shadow: 0 0 12px var(--rose);
}

.stage-pin-dot.active {
  background: #ffffff;
  animation: pinPulse 1.8s infinite alternate;
}

@keyframes pinPulse {
  0% { box-shadow: 0 0 6px currentColor, 0 0 0 0 rgba(255, 255, 255, 0.5); }
  100% { box-shadow: 0 0 14px currentColor, 0 0 0 6px rgba(255, 255, 255, 0); }
}

.stage-milestone-foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.stage-milestone-foot .lucide-icon {
  color: var(--peach);
}

.stage-milestone-foot strong {
  color: #fff;
  font-size: 1rem;
  margin: 0 2px;
}

/* ========================================================
   Twin Glowing Action Buttons
   ======================================================== */
.stage-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 6;
  width: 100%;
  max-width: 820px;
}

.stage-big-btn {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.1rem 2rem;
  font-size: 1.22rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.stage-big-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}

.stage-big-btn:hover::before {
  transform: translateX(120%);
}

.stage-big-btn-arrow {
  transition: transform 0.3s var(--ease-out);
}

.stage-big-btn:hover .stage-big-btn-arrow {
  transform: translateX(4px);
}

.stage-big-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.stage-big-btn-blue {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 30px rgba(2, 132, 199, 0.65), 0 0 45px rgba(56, 189, 248, 0.45);
}

.stage-big-btn-blue:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 40px rgba(2, 132, 199, 0.85), 0 0 60px rgba(56, 189, 248, 0.7);
}

.stage-big-btn-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.65), 0 0 45px rgba(192, 132, 252, 0.45);
}

.stage-big-btn-purple:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.85), 0 0 60px rgba(192, 132, 252, 0.7);
}

/* Oval Ambient Glow Orbit & Feathers */
.stage-orbit-ring {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 950px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.18), inset 0 0 40px rgba(168, 85, 247, 0.12);
}

.stage-orbit-feather-left {
  position: absolute;
  left: -25px;
  top: 40%;
  width: 95px;
  height: auto;
  transform: rotate(-25deg);
  opacity: 0.9;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 30px rgba(56, 189, 248, 0.6));
  animation: featherFloatL 6s ease-in-out infinite;
}

.stage-orbit-feather-right {
  position: absolute;
  right: -25px;
  top: 45%;
  width: 95px;
  height: auto;
  transform: rotate(25deg);
  opacity: 0.9;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 30px rgba(232, 121, 249, 0.6));
  animation: featherFloatR 6s ease-in-out infinite;
}

@keyframes featherFloatL {
  0%, 100% { transform: rotate(-25deg) translateY(0); }
  50% { transform: rotate(-20deg) translateY(-8px); }
}

@keyframes featherFloatR {
  0%, 100% { transform: rotate(25deg) translateY(0); }
  50% { transform: rotate(30deg) translateY(-8px); }
}

.stage-scroll-cue {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  translate: -50% 0;
  z-index: 7;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  animation: cueBounce 2.2s ease-in-out infinite;
  transition: background 0.2s, border-color 0.2s;
}

.stage-scroll-cue:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--sky-2);
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ========================================================
   UI Primitives
   ======================================================== */

/* Buttons */
.btn {
  --btn-h: 42px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--btn-h);
  padding: 0 1.25rem;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out), opacity 0.2s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn-sm {
  --btn-h: 32px;
  padding: 0 0.8rem;
  font-size: 0.82rem;
  gap: 0.35rem;
  border-radius: 9px;
}

.btn-lg {
  --btn-h: 50px;
  padding: 0 1.6rem;
  font-size: 1.02rem;
  border-radius: 14px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.is-loading:disabled {
  opacity: 0.85;
  cursor: progress;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-themed {
  background: var(--modal-accent, var(--sky));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--modal-accent, var(--sky)) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-themed:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-soft {
  background: rgba(92, 200, 255, 0.12);
  color: #bae6fd;
  border-color: rgba(92, 200, 255, 0.25);
}

.btn-soft:hover:not(:disabled) {
  background: rgba(92, 200, 255, 0.2);
  border-color: rgba(92, 200, 255, 0.45);
  color: #fff;
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-soft);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.5);
}

.btn-ghost-danger {
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-ghost-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fff;
}

/* Icon Button */
.icon-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-4);
  color: #fff;
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Switch */
.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.switch-row:hover {
  background: var(--surface-3);
}

.switch-row.is-compact {
  padding: 0.3rem 0.35rem 0.3rem 0.75rem;
  gap: 0.6rem;
  border-radius: var(--r-pill);
}

.switch-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.switch-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switch-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.is-compact .switch-label {
  font-size: 0.82rem;
}

.switch-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: rgba(148, 163, 184, 0.3);
  transition: background 0.25s var(--ease-out), box-shadow 0.25s;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s var(--ease-spring);
}

.sr-only-input:checked + .switch-track {
  background: linear-gradient(135deg, var(--sky-2), var(--violet));
  box-shadow: 0 0 12px rgba(92, 200, 255, 0.45);
}

.sr-only-input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}

.sr-only-input:focus-visible + .switch-track,
.sr-only-input:focus-visible + .checkbox-box {
  box-shadow: var(--ring);
}

/* Checkbox */
.checkbox-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-soft);
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-row:hover {
  background: var(--surface-3);
}

.checkbox-row.is-invalid {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.06);
}

.checkbox-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(148, 163, 184, 0.55);
  background: rgba(0, 0, 0, 0.2);
  color: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.checkbox-box .lucide-icon {
  transform: scale(0.4);
  transition: transform 0.25s var(--ease-spring);
}

.sr-only-input:checked + .checkbox-box {
  background: linear-gradient(135deg, var(--sky-2), var(--violet));
  border-color: transparent;
  color: #fff;
}

.sr-only-input:checked + .checkbox-box .lucide-icon {
  transform: scale(1);
}

/* Fields & Inputs */
.field {
  margin-bottom: 1.15rem;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-soft);
}

.field-required {
  color: var(--rose);
  margin-left: 3px;
}

.field-hint {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  animation: fieldErrorIn 0.25s var(--ease-out);
}

@keyframes fieldErrorIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

.char-counter {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  transition: color 0.2s;
}

.char-counter.is-near {
  color: var(--warning);
}

.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder {
  color: var(--text-dim);
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.input:focus {
  border-color: var(--sky-2);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: var(--ring);
}

.input[aria-invalid="true"] {
  border-color: rgba(248, 113, 113, 0.7);
}

.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}

.input-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.input-group {
  display: flex;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
  border-color: var(--sky-2);
  box-shadow: var(--ring);
}

.input-group.is-invalid {
  border-color: rgba(248, 113, 113, 0.7);
}

.input-group .input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.input-addon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.9rem;
  margin: 4px;
  border: none;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.input-addon:hover {
  background: var(--surface-4);
  color: #fff;
}

.input-addon.is-icon {
  padding: 0 0.7rem;
  background: transparent;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.05rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* Badges, Tags & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-approved { background: rgba(16, 185, 129, 0.14); color: var(--success); border-color: rgba(16, 185, 129, 0.35); }
.badge-rejected { background: rgba(239, 68, 68, 0.14); color: var(--danger); border-color: rgba(239, 68, 68, 0.35); }
.badge-pending  { background: rgba(245, 158, 11, 0.14); color: var(--warning); border-color: rgba(245, 158, 11, 0.35); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.05rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tag-gold {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--surface-4);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}

.chip:hover {
  background: var(--surface-3);
  color: #fff;
}

.chip:active {
  transform: scale(0.96);
}

.chip.is-active {
  color: #fff;
  background: color-mix(in srgb, var(--modal-accent, var(--sky)) 22%, transparent);
  border-color: color-mix(in srgb, var(--modal-accent, var(--sky)) 60%, transparent);
}

/* Callout */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1.15rem;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  line-height: 1.55;
  border: 1px solid;
}

.callout > .lucide-icon {
  margin-top: 2px;
}

.callout strong {
  color: #fff;
}

.callout-info { background: rgba(92, 200, 255, 0.08); border-color: rgba(92, 200, 255, 0.25); color: #bae6fd; }
.callout-success { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.28); color: #a7f3d0; }
.callout-warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.3); color: #fde68a; }
.callout-danger { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.3); color: #fecaca; }

.field + .callout,
form > .callout:last-child {
  margin-bottom: 0;
}

/* Segmented Control */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.segmented-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.95rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented-sm .segmented-item {
  height: 30px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.segmented-item:hover {
  color: #fff;
}

.segmented-item.is-active {
  color: #fff;
  background: var(--surface-4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.segmented-badge {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--surface-4);
  color: var(--text-soft);
}

.segmented-badge.is-amber {
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold);
}

/* Empty State */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2.25rem 1.25rem;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
}

.empty-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 0.35rem;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--sky);
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.16), rgba(196, 161, 255, 0.14));
  border: 1px solid rgba(92, 200, 255, 0.25);
}

.empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.empty-desc {
  max-width: 380px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Skeleton */
.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ========================================================
   Modal System
   ======================================================== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(30, 41, 80, 0.35), transparent 70%),
    rgba(3, 6, 14, 0.72);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.modal-root.is-open .modal-backdrop {
  opacity: 1;
}

.modal-scroller {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-panel {
  --modal-accent: var(--sky);
  position: relative;
  width: 100%;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--modal-accent) 16%, transparent), transparent 60%),
    var(--surface-modal);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 60px color-mix(in srgb, var(--modal-accent) 14%, transparent);
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.26s ease, transform 0.34s var(--ease-out);
  overflow: hidden;
}

.modal-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--modal-accent) 80%, white), transparent);
  opacity: 0.8;
  pointer-events: none;
}

.modal-panel:focus {
  outline: none;
}

.modal-root.is-open .modal-panel {
  opacity: 1;
  transform: none;
}

.modal-sm { max-width: 460px; }
.modal-md { max-width: 580px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1180px; height: min(calc(100dvh - 3rem), 900px); }

.modal-panel.is-shaking {
  animation: modalShake 0.42s var(--ease-out);
}

@keyframes modalShake {
  0%, 100% { translate: 0 0; }
  20% { translate: -8px 0; }
  40% { translate: 7px 0; }
  60% { translate: -5px 0; }
  80% { translate: 3px 0; }
}

.modal-grabber {
  display: none;
}

.modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.35rem 1.35rem 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.modal-head-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--modal-accent);
  background: color-mix(in srgb, var(--modal-accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--modal-accent) 35%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--modal-accent) 22%, transparent);
}

.modal-head-text {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.modal-title {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
}

.modal-subtitle {
  margin-top: 2px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.modal-close {
  margin: -2px -2px 0 0;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 1.35rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.95rem 1.5rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.modal-tone-danger .modal-title {
  color: #fecaca;
}

/* Upload progress in modal footer */
.upload-progress {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.upload-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-4);
  overflow: hidden;
}

.upload-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky-2), var(--violet));
  box-shadow: 0 0 10px rgba(92, 200, 255, 0.6);
  transition: width 0.2s linear;
}

.upload-progress-text {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ========================================================
   Lightbox
   ======================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(2, 4, 10, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.lightbox:focus {
  outline: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-toolbar {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

.lightbox-counter {
  padding-left: 0.5rem;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.lightbox-actions {
  display: flex;
  gap: 0.35rem;
}

.lightbox-actions .icon-btn {
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-stage {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 4.5rem;
  overflow: hidden;
}

.lightbox-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  padding: 0.75rem 1rem;
}

.lightbox-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -16px 0 0 -16px;
  color: var(--text-muted);
}

.lightbox-img {
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-in;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out);
  user-select: none;
}

.lightbox-img.is-loaded {
  opacity: 1;
  transform: none;
}

.is-zoomed .lightbox-img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: auto;
  cursor: zoom-out;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.2s, transform 0.2s var(--ease-out);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-nav:active {
  transform: scale(0.92);
}

.lightbox-nav.is-prev { left: 1rem; }
.lightbox-nav.is-next { right: 1rem; }

.lightbox-caption {
  position: relative;
  flex-shrink: 0;
  margin: 0.5rem auto 1rem;
  max-height: 25vh;
  max-width: min(90vw, 720px);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--text-soft);
  text-align: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--line);
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* ========================================================
   Toast Notifications
   ======================================================== */
.toast-viewport {
  position: fixed;
  top: calc(var(--topbar-h) + 0.5rem);
  right: 1.25rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  --toast-c: var(--sky);
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.8rem 0.95rem 0.95rem;
  border-radius: 16px;
  background: rgba(13, 19, 36, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg), 0 0 24px color-mix(in srgb, var(--toast-c) 18%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  overflow: hidden;
  pointer-events: auto;
  animation: toastIn 0.38s var(--ease-out);
}

.toast.is-leaving {
  animation: toastOut 0.24s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

.toast-success { --toast-c: var(--success); }
.toast-error { --toast-c: var(--danger); }
.toast-info { --toast-c: var(--sky); }
.toast-warn { --toast-c: var(--warning); }

.toast-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--toast-c);
  background: color-mix(in srgb, var(--toast-c) 15%, transparent);
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.3;
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-soft);
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: var(--surface-4);
  color: #fff;
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--toast-c);
  opacity: 0.75;
  transform-origin: left center;
  animation-name: toastProgress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.toast:hover .toast-progress,
.toast:focus-within .toast-progress {
  animation-play-state: paused;
}

.toast.is-leaving .toast-progress {
  animation-play-state: paused;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Confetti */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
  overflow: hidden;
}

.confetti-layer i {
  position: absolute;
  width: 8px;
  height: 12px;
  margin: -6px 0 0 -4px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiBurst 1.3s var(--ease-out) forwards;
}

@keyframes confettiBurst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 120px)) rotate(var(--r)) scale(1); }
}

/* ========================================================
   Content Sections Below Hero
   ======================================================== */
.main-container {
  max-width: 1240px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 10;
}

.main-container > section {
  scroll-margin-top: calc(var(--topbar-h) + 0.5rem);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--sky);
  margin-bottom: 0.45rem;
}

.eyebrow.is-center {
  justify-content: center;
}

.section-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.section-title {
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  font-weight: 850;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 40%, #7dd3fc 75%, var(--lavender) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* Glass panel */
.panel {
  position: relative;
  padding: 2rem 2.1rem;
  margin-bottom: 4rem;
  border-radius: 24px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.4), transparent 35%, transparent 65%, rgba(196, 161, 255, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.panel-head-main {
  flex: 1;
  min-width: 0;
}

.panel-title {
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.3;
  color: #fff;
}

.panel-desc {
  max-width: 520px;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Stage pass (token) card */
.pass-card {
  position: relative;
  flex-shrink: 0;
  width: 300px;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(252, 210, 159, 0.2), transparent 55%),
    linear-gradient(135deg, rgba(92, 200, 255, 0.14), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(252, 210, 159, 0.3);
  overflow: hidden;
}

.pass-card-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--peach);
}

.pass-card-code {
  display: block;
  margin: 0.35rem 0 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}

.pass-card-actions {
  display: flex;
  gap: 0.45rem;
}

/* Stat tiles */
.stat-tiles {
  display: grid;
  grid-template-columns: 1.35fr 1.2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-tile {
  --tone: var(--sky);
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 1.05rem 1.15rem;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.25s, transform 0.25s var(--ease-out), background 0.25s;
}

.stat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.stat-tile-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
}

.stat-tile-main {
  flex: 1;
  min-width: 0;
}

.stat-tile-val {
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.2;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat-tile-val small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-tile-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-tile.is-primary {
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.16), rgba(99, 102, 241, 0.1));
  border-color: rgba(92, 200, 255, 0.35);
}

.stat-tile.is-primary .stat-tile-val {
  font-size: 1.9rem;
  text-shadow: 0 0 18px rgba(92, 200, 255, 0.55);
}

.stat-tile.is-success {
  --tone: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.07);
}

.stat-tile.is-locked {
  --tone: var(--text-muted);
  border-style: dashed;
}

.stat-tile.is-locked .stat-tile-val {
  font-size: 1.15rem;
  color: var(--text-soft);
}

.ticket-stubs {
  display: flex;
  gap: 5px;
  width: 100%;
}

.ticket-stub {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-4);
  transition: background 0.4s;
}

.ticket-stub.is-available {
  background: linear-gradient(90deg, var(--sky-2), var(--lavender));
  box-shadow: 0 0 8px rgba(92, 200, 255, 0.55);
}

/* Subsections */
.subsection + .subsection {
  margin-top: 1.9rem;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 750;
  color: #fff;
}

.subsection-title > .lucide-icon {
  color: var(--pink);
}

.vote-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.vote-chip {
  --c: var(--sky);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c) 12%, rgba(0, 0, 0, 0.2));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 18%, transparent);
}

.vote-chip svg {
  filter: drop-shadow(0 0 5px var(--c));
}

.vote-chip-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.vote-chip-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Submission cards */
.submission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.submission-card {
  --status-c: var(--warning);
  position: relative;
  display: flex;
  gap: 0.95rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
}

.submission-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--status-c);
  box-shadow: 0 0 10px var(--status-c);
}

.submission-card.is-approved { --status-c: var(--success); }
.submission-card.is-rejected { --status-c: var(--danger); }

.submission-card:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.submission-thumb {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
}

.submission-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}

.submission-thumb-zoom {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}

.submission-thumb:hover img,
.submission-thumb:focus-visible img {
  transform: scale(1.08);
}

.submission-thumb:hover .submission-thumb-zoom,
.submission-thumb:focus-visible .submission-thumb-zoom {
  opacity: 1;
}

.submission-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.submission-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.submission-name {
  font-weight: 750;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-msg {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.submission-reason {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  font-size: 0.76rem;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.submission-reason .lucide-icon {
  margin-top: 3px;
}

.submission-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.submission-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ========================================================
   Character Voting
   ======================================================== */
.voting-section {
  margin-bottom: 2rem;
}

.vote-notice-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.notice-pill {
  --pill-c: var(--sky);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--pill-c) 70%, white);
  background: color-mix(in srgb, var(--pill-c) 12%, rgba(0, 0, 0, 0.3));
  border: 1px solid color-mix(in srgb, var(--pill-c) 40%, transparent);
  backdrop-filter: blur(8px);
}

.notice-pill.is-sky { --pill-c: var(--sky); }
.notice-pill.is-amber { --pill-c: var(--gold); }
.notice-pill.is-pink { --pill-c: var(--rose); }
.notice-pill.is-muted { --pill-c: #94a3b8; }

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: livePing 1.6s ease-out infinite;
}

@keyframes livePing {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(2.8); opacity: 0; }
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.char-card {
  --char-theme: var(--sky);
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: rgba(13, 19, 36, 0.84);
  border: 1px solid var(--line);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.35s;
}

.reveal .char-card {
  opacity: 0;
}

.reveal.is-visible .char-card {
  animation: cardIn 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes cardIn {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

.char-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--char-theme) 70%, transparent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--char-glow, rgba(56, 189, 248, 0.35));
}

.char-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--char-theme), 0 0 40px var(--char-theme);
  opacity: 0;
}

.char-card.is-spotlight::after {
  animation: spotlight 2.2s ease-out;
}

@keyframes spotlight {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

.char-banner {
  position: relative;
  height: 230px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--char-theme) 45%, transparent) 0%, transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.35));
}

.char-banner-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--char-theme) 35%, transparent), transparent 60%);
  opacity: 0.5;
  transition: opacity 0.35s;
}

.char-card:hover .char-banner-glow {
  opacity: 1;
}

.char-photo {
  position: relative;
  height: 100%;
  width: 95%;
  max-width: 95%;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.6));
}

.char-card:hover .char-photo {
  transform: none;
}

.char-grade-badge,
.char-rank-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.char-grade-badge { left: 12px; }
.char-rank-badge { right: 12px; font-weight: 850; }

.char-rank-1 { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px rgba(251, 191, 36, 0.45); }
.char-rank-2 { border-color: #cbd5e1; color: #e2e8f0; }
.char-rank-3 { border-color: #d97706; color: #fbbf77; }

.char-emblem {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid color-mix(in srgb, var(--char-theme) 55%, transparent);
  backdrop-filter: blur(6px);
}

.char-emblem img {
  filter: drop-shadow(0 0 6px var(--char-theme));
}

.char-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.3rem 1.3rem;
}

.char-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.char-name {
  font-size: 1.3rem;
  font-weight: 850;
  color: #fff;
}

.char-myvote {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--char-theme) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--char-theme) 65%, transparent);
  white-space: nowrap;
}

.yohane-name {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  line-height: inherit;
}

.yohane-crossed {
  position: relative;
  opacity: 0.72;
}

.yohane-crossed::before,
.yohane-crossed::after {
  content: '';
  position: absolute;
  left: -6%;
  top: 48%;
  width: 112%;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  transform: rotate(-12deg);
}

.yohane-crossed::after {
  transform: rotate(10deg);
  height: 1.5px;
}

.yohane-signature {
  position: absolute;
  left: 50%;
  top: 1.15em;
  display: block;
  width: 3.2em;
  height: 1.1em;
  overflow: visible;
  color: #dbc5ff;
  transform: translateX(-50%);
  pointer-events: none;
}

.char-romaji .yohane-fullname,
.rank-name .yohane-fullname {
  display: inline-block;
  padding-bottom: 1.65em;
}

.char-romaji .yohane-signature {
  width: 4em;
  height: 1.35em;
}

.member-emblem-name .yohane-signature {
  width: 2.4em;
  height: 0.8em;
  left: 50%;
  top: 1.15em;
  transform: translateX(-50%);
}

.char-romaji {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  line-height: 1.2;
  color: color-mix(in srgb, var(--char-theme) 60%, white);
  margin-bottom: 0.45rem;
}

.char-tagline {
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.char-vote-box {
  margin-top: auto;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.char-vote-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.char-votes-val {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.char-votes-val strong {
  font-size: 1.05rem;
  color: #fff;
}

.char-percent-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.char-percent-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--char-theme) 70%, white), var(--char-theme));
  box-shadow: 0 0 10px var(--char-theme);
  transition: width 0.9s var(--ease-out);
}

.char-vote-hidden {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  height: 44px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--char-theme) 70%, white);
  background: linear-gradient(135deg, color-mix(in srgb, var(--char-theme) 85%, white), var(--char-theme));
  color: #fff;
  font-size: 0.94rem;
  font-weight: 750;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--char-theme) 40%, transparent);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, filter 0.2s;
}

.vote-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--char-theme) 55%, transparent);
}

.vote-btn:hover .lucide-icon {
  animation: heartBeat 0.8s ease-in-out infinite;
}

.vote-btn:active {
  transform: scale(0.98);
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.25); }
  60% { transform: scale(0.95); }
}

.vote-btn.is-disabled {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--text-muted);
  text-shadow: none;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.vote-btn.is-disabled .lucide-icon {
  animation: none;
}

.char-card.is-skeleton .char-banner {
  align-items: center;
  background: var(--surface-2);
}

.char-card.is-skeleton:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}

/* Site footer */
.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
}

.site-footer img {
  width: 36px;
  height: 36px;
  opacity: 0.85;
}

.site-footer-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.76rem;
  transition: color 0.2s, background 0.2s;
}

.site-footer-admin:hover {
  color: var(--text-soft);
  background: var(--surface-3);
}

/* ========================================================
   Submit Modal: Dropzone & Options
   ======================================================== */
.dropzone {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out);
}

.dropzone:hover {
  border-color: rgba(92, 200, 255, 0.6);
  background: rgba(92, 200, 255, 0.04);
}

.dropzone:focus-visible {
  outline: none;
  border-color: var(--sky-2);
  box-shadow: var(--ring);
}

.dropzone.is-dragover {
  border-color: var(--sky);
  border-style: solid;
  background: rgba(92, 200, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.15), 0 0 30px rgba(92, 200, 255, 0.25);
  transform: scale(1.01);
}

.dropzone.is-invalid {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.04);
}

.dropzone.has-file {
  cursor: default;
  border-style: solid;
  border-color: var(--line-strong);
  background: rgba(0, 0, 0, 0.2);
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: 2rem 1.25rem;
}

.dropzone-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 0.3rem;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--sky);
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.18), rgba(196, 161, 255, 0.16));
  border: 1px solid rgba(92, 200, 255, 0.3);
  transition: transform 0.3s var(--ease-spring);
}

.dropzone:hover .dropzone-icon,
.dropzone.is-dragover .dropzone-icon {
  transform: translateY(-3px) scale(1.06);
}

.dropzone-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.dropzone-preview {
  display: flex;
  flex-direction: column;
}

.dropzone-image {
  display: grid;
  place-items: center;
  height: 240px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0.75rem;
  border-radius: 16px 16px 0 0;
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.03) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px,
    rgba(0, 0, 0, 0.25);
}

.dropzone-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  animation: previewIn 0.35s var(--ease-out);
}

@keyframes previewIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.dropzone-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--line);
}

.dropzone-file {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.dropzone-file > .lucide-icon {
  color: var(--sky);
}

.dropzone-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-filesize {
  flex-shrink: 0;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.dropzone-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.form-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.form-options .field-error {
  margin-top: 0;
}

/* ========================================================
   Token Modal
   ======================================================== */
.token-current {
  padding: 0.95rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--r-md);
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.token-current-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

.token-current-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.45rem 0;
}

.token-code {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #fff;
  word-break: break-all;
  user-select: all;
}

.token-current-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ========================================================
   Vote Confirm Modal
   ======================================================== */
.vote-confirm {
  --c: var(--sky);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.vote-confirm-portrait {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--c) 40%, transparent), rgba(0, 0, 0, 0.3) 70%);
  border: 2px solid color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 35%, transparent);
  overflow: visible;
}

.vote-confirm-halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent);
  animation: spin 18s linear infinite;
}

.vote-confirm-portrait > .vote-confirm-character {
  position: absolute;
  inset: 0;
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
}

.vote-confirm-emblem {
  position: absolute;
  bottom: -6px;
  right: 6px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}

.vote-confirm-name {
  font-size: 1.45rem;
  font-weight: 850;
  color: #fff;
}

.vote-confirm-romaji {
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--c) 55%, white);
}

.vote-confirm-tagline {
  max-width: 340px;
  margin: 0.55rem 0 1.1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.ticket-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ticket-flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.ticket-flow-num {
  font-size: 1.6rem;
  font-weight: 850;
  line-height: 1.2;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.ticket-flow-item.is-after .ticket-flow-num {
  color: color-mix(in srgb, var(--c) 60%, white);
}

.ticket-flow-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.ticket-flow-arrow {
  color: var(--text-dim);
}

.vote-confirm .callout {
  width: 100%;
  margin-bottom: 0;
  text-align: left;
}

/* ========================================================
   Reject Modal
   ======================================================== */
.reject-preview {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 1.1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.reject-preview img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
}

.reject-preview-info {
  min-width: 0;
}

.reject-preview-name {
  font-weight: 700;
  color: #fff;
}

.reject-preview-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-tone-danger .field {
  margin-bottom: 0.75rem;
}

/* ========================================================
   Admin Console
   ======================================================== */
.admin-modal .modal-body {
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
}

.admin-modal .modal-body > * {
  flex-shrink: 0;
}

.admin-modal .modal-body > .admin {
  flex: 1 1 auto;
  min-height: 0;
}

.admin-login {
  display: flex;
  flex-direction: column;
}

.admin-login-emblem {
  align-self: center;
  width: 72px;
  height: 72px;
  margin: 0.25rem 0 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--lavender);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(92, 200, 255, 0.12));
  border: 1px solid rgba(196, 161, 255, 0.35);
  box-shadow: 0 0 34px rgba(168, 85, 247, 0.3);
}

.admin {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
}

.admin-stat {
  --tone: var(--sky);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.admin-stat.is-highlight {
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
  background: color-mix(in srgb, var(--tone) 8%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tone) 18%, transparent);
}

.admin-stat-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
}

.admin-stat-val {
  font-size: 1.3rem;
  font-weight: 850;
  line-height: 1.15;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.admin-stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Desktop: the pane fills the modal so the table scrolls internally with a sticky header */
.admin-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  overflow: auto;
}

.admin-pane > * {
  flex-shrink: 0;
}

.admin-pane > .table-wrap {
  flex: 1 1 auto;
  min-height: 240px;
}

.admin-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 260px;
  height: 38px;
  padding: 0 0.5rem 0 0.8rem;
  border-radius: 11px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-strong);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--sky-2);
  box-shadow: var(--ring);
  color: var(--sky);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.86rem;
  color: #fff;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-clear {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-muted);
}

.search-clear:hover {
  background: var(--surface-4);
  color: #fff;
}

/* Data table */
.table-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s;
}

.table-wrap.is-refreshing {
  opacity: 0.6;
  pointer-events: none;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  background: rgba(17, 24, 43, 0.98);
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 0.7rem 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tbody tr {
  transition: background 0.15s, opacity 0.2s;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tr.is-busy {
  opacity: 0.55;
}

.data-table tr.is-empty-row:hover {
  background: transparent;
}

.data-table tr.is-empty-row td {
  padding: 1.25rem;
}

.data-table tr.is-empty-row .empty {
  border: none;
  background: transparent;
}

.ta-right {
  text-align: right !important;
}

.thumb-btn {
  display: block;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
  transition: transform 0.2s var(--ease-out), border-color 0.2s;
}

.thumb-btn:hover {
  transform: scale(1.08);
  border-color: var(--sky-2);
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cell-title {
  font-weight: 700;
  color: #fff;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.cell-id {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.cell-message {
  max-width: 280px;
  color: var(--text-soft);
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.cell-reason {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.74rem;
  color: #fca5a5;
}

.cell-time {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.token-chip:hover {
  color: #fff;
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-page {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pagination-page:hover:not(:disabled) {
  background: var(--surface-3);
  color: #fff;
}

.pagination-page.is-active {
  color: #fff;
  background: rgba(92, 200, 255, 0.18);
  border-color: rgba(92, 200, 255, 0.45);
}

.pagination-gap {
  padding: 0 0.3rem;
  color: var(--text-dim);
}

/* Ranking list */
.rank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-row {
  --c: var(--sky);
  display: grid;
  grid-template-columns: 52px 40px minmax(140px, 1.2fr) 2fr 90px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}

.rank-row:hover {
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
}

.rank-row.is-top {
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), var(--surface-2) 60%);
}

.rank-no {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  font-weight: 850;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.is-top-1 .rank-no { color: var(--gold); }
.is-top-2 .rank-no { color: #e2e8f0; }
.is-top-3 .rank-no { color: #fbbf77; }

.rank-emblem {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}

.rank-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.rank-name strong {
  color: #fff;
}

.rank-name small {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.rank-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, white), var(--c));
  box-shadow: 0 0 10px var(--c);
  transition: width 0.8s var(--ease-out);
}

.rank-votes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.rank-votes strong {
  font-size: 1.05rem;
  color: #fff;
}

/* ========================================================
   Responsive
   ======================================================== */
@media (max-width: 1100px) {
  .admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 64px;
  }

  .stage-poem-left,
  .stage-poem-right,
  .stage-orbit-ring {
    display: none;
  }

  .stage-card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .stage-stat-col {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .stage-actions-row {
    flex-direction: column;
    gap: 0.9rem;
  }

  .stage-big-btn {
    width: 100%;
    max-width: 100%;
  }

  .member-emblems-rail {
    gap: 0.9rem;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pass-card {
    width: 100%;
  }

  .rank-row {
    grid-template-columns: 44px 36px 1fr 80px;
  }

  .rank-bar {
    grid-column: 1 / -1;
    order: 5;
  }
}

/* Admin table collapses into stacked cards */
@media (max-width: 820px) {
  .admin-modal .modal-body > .admin,
  .admin-pane,
  .admin-pane > .table-wrap {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  .table-wrap {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .data-table tbody tr {
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 0.85rem;
    padding: 0.85rem;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
  }

  .data-table td {
    padding: 0.25rem 0;
    border: none;
  }

  .data-table td[data-label="作品"] {
    grid-row: span 2;
  }

  .data-table td[data-label="寄语"],
  .data-table td[data-label="凭证"],
  .data-table td[data-label="提交时间"],
  .data-table td[data-label="状态"],
  .data-table td[data-label="操作"] {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .data-table td[data-label="寄语"]::before,
  .data-table td[data-label="凭证"]::before,
  .data-table td[data-label="提交时间"]::before,
  .data-table td[data-label="状态"]::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 64px;
    font-size: 0.74rem;
    color: var(--text-dim);
  }

  .data-table td[data-label="寄语"] {
    flex-wrap: wrap;
  }

  .cell-message,
  .cell-title {
    max-width: none;
  }

  .data-table td[data-label="操作"] {
    padding-top: 0.6rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--line);
  }

  .row-actions {
    width: 100%;
  }

  .row-actions .btn {
    flex: 1;
  }

  .data-table tr.is-skeleton-row td:not(:first-child) {
    grid-column: 2;
  }

  .data-table tr.is-empty-row {
    display: block;
  }

  .search-box {
    width: 100%;
  }

  .admin-toolbar,
  .admin-filters {
    align-items: stretch;
  }

  .admin-toolbar-actions {
    width: 100%;
  }

  .admin-toolbar-actions .switch-row {
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  .stage-top-bar {
    padding: 0.75rem 1rem;
  }

  .stage-top-bar.is-scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .stage-top-brand span,
  .ticket-chip-label {
    display: none;
  }

  .stage-top-brand {
    padding: 0.35rem;
  }

  .stage-hero-viewport {
    padding: 4.5rem 1rem 4rem;
  }

  .stage-milestone-card {
    padding: 1.15rem 1.15rem 0.95rem;
    border-radius: 20px;
  }

  .stage-card-header {
    font-size: 0.9rem;
  }

  .stage-stat-num {
    font-size: 2.2rem;
  }

  .stage-node-sub {
    font-size: 0.66rem;
  }

  .stage-big-btn {
    padding: 0.95rem 1.5rem;
    font-size: 1.08rem;
  }

  .member-emblems-rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem 0.25rem;
    width: 100%;
  }

  .member-emblem-icon-wrap {
    width: 40px;
    height: 40px;
  }

  .member-emblem-icon-wrap img {
    width: 30px;
    height: 30px;
  }

  .member-emblem-name {
    font-size: 1rem;
  }

  .main-container {
    padding: 0 0.85rem 3rem;
  }

  .panel {
    padding: 1.35rem 1.1rem;
    border-radius: 20px;
  }

  .stat-tiles {
    gap: 0.65rem;
  }

  .stat-tile {
    padding: 0.85rem;
    gap: 0.6rem;
  }

  .stat-tile-icon {
    width: 36px;
    height: 36px;
  }

  .stat-tile-val {
    font-size: 1.3rem;
  }

  .stat-tile.is-primary {
    grid-column: 1 / -1;
  }

  .submission-grid {
    grid-template-columns: 1fr;
  }

  .submission-thumb {
    width: 80px;
    height: 80px;
  }

  .char-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .char-banner {
    height: 170px;
  }

  .char-content {
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .char-name {
    font-size: 1.08rem;
  }

  .char-tagline {
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .char-name-row {
    flex-wrap: wrap;
  }

  .vote-btn {
    height: 40px;
    font-size: 0.86rem;
  }

  .toast-viewport {
    top: auto;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    right: 50%;
    translate: 50% 0;
    align-items: center;
  }

  @keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: none; }
  }

  @keyframes toastOut {
    to { opacity: 0; transform: translateY(16px) scale(0.96); }
  }

  /* Modals become bottom sheets */
  .modal-scroller {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel,
  .modal-sm,
  .modal-md,
  .modal-lg {
    max-width: none;
    max-height: calc(100dvh - 2.5rem);
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    transform: translateY(100%);
    transition: opacity 0.2s ease, transform 0.38s var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-xl {
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal-grabber {
    display: block;
    flex-shrink: 0;
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.22);
  }

  .modal-xl .modal-grabber {
    display: none;
  }

  .modal-head {
    padding: 0.85rem 1rem 0.9rem 1.15rem;
  }

  .modal-head-icon {
    width: 38px;
    height: 38px;
  }

  .modal-title {
    font-size: 1.06rem;
  }

  .modal-body {
    padding: 1.1rem 1.15rem 1.25rem;
  }

  .modal-foot {
    flex-wrap: wrap;
    padding: 0.8rem 1.15rem;
  }

  .modal-foot > .btn {
    flex: 1;
  }

  .upload-progress {
    flex-basis: 100%;
  }

  .dropzone-image {
    height: 190px;
  }

  .dropzone-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .dropzone-actions .btn {
    flex: 1;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .admin-stat {
    padding: 0.6rem 0.7rem;
  }

  .segmented {
    display: flex;
    width: 100%;
  }

  .segmented-item {
    flex: 1;
    justify-content: center;
    padding: 0 0.5rem;
  }

  .lightbox-stage {
    padding: 0.5rem;
  }

  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    margin-top: 0;
    width: 42px;
    height: 42px;
  }

  .lightbox-caption {
    max-width: calc(100vw - 8rem);
  }

  .rank-row {
    grid-template-columns: 38px 34px 1fr 64px;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
  }
}

@media (hover: none) {
  .char-card:hover,
  .stat-tile:hover {
    transform: none;
  }

  .submission-thumb-zoom {
    opacity: 1;
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
    place-items: end;
    padding: 6px;
  }
}

/* ========================================================
   Reduced Motion
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *:not(.toast-progress),
  *:not(.toast-progress)::before,
  *:not(.toast-progress)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal .char-card {
    opacity: 1;
    transform: none;
  }

  .spin {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }
}

/* Keep the voting grid in three columns on small screens. */
@media (max-width: 600px) {
  .char-grid { gap: 0.45rem; }
  .char-card { min-width: 0; }
  .char-content { padding: 0.65rem 0.4rem; }
  .char-name { font-size: 0.9rem; }
  .char-romaji { font-size: 0.62rem; overflow-wrap: anywhere; }
  .char-name-row { flex-wrap: wrap; }
  .char-vote-stat { flex-wrap: wrap; gap: 0.2rem; font-size: 0.68rem; }
  .vote-btn { padding: 0.5rem 0.25rem; font-size: 0.68rem; gap: 0.2rem; }
  .char-rank-badge { right: 4px; padding: 3px 5px; font-size: 0.65rem; }
  .char-grade-badge { left: 4px; padding: 3px 5px; font-size: 0.6rem; }
  .char-banner { height: 150px; }
}

.stage-top-brand.music-record {
  position: relative;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  min-height: 48px;
  padding-left: 0.35rem;
}

.music-record-disc {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #6a758c;
  background: repeating-radial-gradient(circle at center, #10131b 0 2px, #2c3240 2.5px 3px, #11141d 3.5px 5px);
  box-shadow: 0 2px 8px #0008, inset 0 0 0 1px #000;
  animation: musicRecordSpin 7s linear infinite;
  animation-play-state: paused;
}

.music-record.is-playing .music-record-disc { animation-play-state: running; }
.stage-top-brand .music-record-disc img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  background: #273b52;
}
.music-record-state {
  position: absolute;
  left: 34px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #d7f1ff;
  background: #142a40;
  border: 1px solid #65bde2;
}
.music-record-copy { display: flex; flex-direction: column; gap: 3px; }
.music-record-copy strong { font-size: inherit; font-weight: 700; }
.music-record-copy small { font-size: 0.64rem; color: #b9cfe1; letter-spacing: 0; }
.music-record:focus-visible { outline: 2px solid #82d6ff; outline-offset: 3px; }
@keyframes musicRecordSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .music-record-disc { animation: none; } }
.wish-wall-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; padding: 1.2rem 1.4rem; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface-2);
}
.wish-wall-entry h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
.wish-wall-entry p { font-size: .85rem; color: var(--text-muted); margin: 0; }
.wish-wall-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.wish-wall-card { min-width: 0; overflow: hidden; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.wish-wall-image { display: block; position: relative; width: 100%; aspect-ratio: 4/3; background: #0b1222; border: 0; padding: .5rem; cursor: zoom-in; }
.wish-wall-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.wish-wall-image > .lucide-icon { position: absolute; bottom: .7rem; right: .7rem; color: white; filter: drop-shadow(0 1px 3px #000); }
.wish-wall-copy { padding: .85rem; overflow-wrap: anywhere; }
.wish-wall-copy h3 { margin: 0 0 .55rem; font-size: .9rem; }
.wish-wall-copy p { white-space: pre-wrap; line-height: 1.7; font-size: .85rem; margin: 0 0 .7rem; }
.wish-wall-copy time { font-size: .72rem; color: var(--text-muted); }
.wish-wall-loading { padding: 1rem; text-align: center; color: var(--text-muted); }
.archive-records { min-width: 0; }
.archive-vote-list { margin-top: 1rem; }
.archive-vote-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr); gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .85rem; overflow-wrap: anywhere; }
.archive-vote-row time { color: var(--text-muted); font-size: .75rem; }
.archive-account-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.archive-records details { margin-top: 1rem; }
.archive-records summary { cursor: pointer; padding: .6rem 0; }
.archive-banner { position: fixed; z-index: 105; bottom: .5rem; left: .5rem; padding: .45rem .7rem; font-size: .75rem; border-radius: 8px; background: #102135ed; color: #ccecff; border: 1px solid #6599bb; pointer-events: none; }
.is-archive [data-demo-reset] { display: none; }
.yohane-name { white-space: nowrap; }
.char-card, .char-content, .section, .field, .submission-info { min-width: 0; }
.submission-name, .submission-msg, .field-error, .callout, .modal-title { overflow-wrap: anywhere; }
.dropzone-image { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
@media(max-width:640px) {
  .main-container { padding-left: .75rem; padding-right: .75rem; }
  .stage-top-bar { padding-left: .65rem; padding-right: .65rem; padding-top: max(.5rem,env(safe-area-inset-top)); }
  .stage-top-right { gap: .4rem; }
  .stage-top-brand.music-record { min-height: 44px; }
  .ticket-chip { padding: 0 .65rem; }
  .member-emblems-rail { row-gap: 1.1rem; padding-bottom: .55rem; }
  .char-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; }
  .char-banner { height: auto; aspect-ratio: 1; }
  .char-content { padding: .6rem .4rem .7rem; }
  .char-name-row { flex-wrap: wrap; gap: .2rem; }
  .char-name { font-size: clamp(.73rem,2.8vw,1rem); overflow-wrap: anywhere; }
  .char-romaji { font-size: .62rem; min-height: 2.8em; line-height: 1.35; overflow-wrap: anywhere; }
  .char-grade-badge, .char-rank-badge { font-size: .56rem; padding: .2rem .3rem; }
  .char-emblem { width: 26px; height: 26px; right: 4px; bottom: 4px; }
  .char-emblem img { width: 18px; height: 18px; }
  .char-vote-stat { flex-wrap: wrap; gap: .2rem; font-size: .6rem; }
  .char-votes-val { font-size: .65rem; }
  .char-vote-box { gap: .55rem; padding-top: .65rem; }
  .vote-btn { min-height: 44px; padding: .55rem .15rem; font-size: .67rem; gap: .2rem; white-space: normal; }
  .vote-btn .lucide-icon { width: 12px; height: 12px; flex-shrink: 0; }
  .char-myvote { font-size: .56rem; }
  .modal-scroller { padding: .5rem; padding-bottom: max(.5rem,env(safe-area-inset-bottom)); }
  .modal-panel { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); border-radius: 18px; min-width: 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: .9rem; padding-right: .9rem; }
  .modal-body { min-height: 0; overscroll-behavior: contain; }
  .modal-title { font-size: 1.05rem; }
  .modal-foot { flex-wrap: wrap; gap: .5rem; padding-bottom: max(.9rem,env(safe-area-inset-bottom)); }
  .modal-foot > .btn { flex: 1 1 100px; min-height: 44px; }
  .input, textarea.input, select.input { font-size: 16px; }
  .dropzone-image { height: clamp(150px,30dvh,220px); }
  .dropzone-meta, .submission-top, .subsection-head { flex-wrap: wrap; }
  .dropzone-actions { width: 100%; justify-content: flex-end; }
  .dropzone-file { width: 100%; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-start; }
  .admin-toolbar-actions > .btn { flex: 1 1 130px; min-height: 44px; white-space: normal; }
  .admin-toolbar .segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .admin-toolbar .segmented-item { font-size: .73rem; padding: .5rem .2rem; min-width: 0; }
  .admin-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wish-wall-entry { padding: 1rem; flex-wrap: wrap; }
  .wish-wall-entry > .btn { width: 100%; min-height: 44px; }
  .wish-wall-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .wish-wall-copy { padding: .7rem; }
  .wish-wall-copy p { font-size: .8rem; }
  .archive-vote-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .archive-vote-row time { grid-column: 1/-1; }
  .lightbox-caption { max-height: 25dvh; padding: .6rem; overflow-wrap: anywhere; }
  .ticket-flow { gap: .5rem; padding: .65rem; }
  .ticket-flow-item { min-width: 65px; }
}
@media(max-width:360px) {
  .stage-top-right { gap: .3rem; }
  .ticket-chip { font-size: .75rem; padding: 0 .5rem; }
  .hamburger-btn { width: 40px; }
  .wish-wall-grid { grid-template-columns: minmax(0,1fr); }
  .admin-toolbar .segmented-item .lucide-icon { display: none; }
}

/* Preserve desktop's natural rail; wrap a mobile rail into staggered 5 + 4 only when measured necessary. */
@media(max-width:820px) {
  .member-emblems-rail:not(.is-staggered) { display:flex; flex-wrap:nowrap; }
}
.member-emblems-rail.is-staggered {
  display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); column-gap:0; row-gap:1.3rem;
  width:100%; padding-bottom:.6rem;
}
.member-emblems-rail.is-staggered .member-emblem-btn {
  grid-column:span 2; width:100%; min-width:0; padding:.3rem .1rem; justify-self:center;
}
.member-emblems-rail.is-staggered .member-emblem-btn:nth-child(6) { grid-row:2; grid-column:2 / span 2; }
.member-emblems-rail.is-staggered .member-emblem-btn:nth-child(7) { grid-row:2; grid-column:4 / span 2; }
.member-emblems-rail.is-staggered .member-emblem-btn:nth-child(8) { grid-row:2; grid-column:6 / span 2; }
.member-emblems-rail.is-staggered .member-emblem-btn:nth-child(9) { grid-row:2; grid-column:8 / span 2; }
.member-emblems-rail.is-staggered .member-emblem-name { font-size:clamp(.76rem,3.5vw,1rem); }
.rank-row.is-locked .rank-no { font-size:.65rem; white-space:nowrap; font-weight:800; }
.rank-row.is-locked .rank-votes small { white-space:normal; font-size:.65rem; }
.account-help { margin:0 0 1rem; color:var(--text-muted); font-size:.85rem; line-height:1.7; }
.account-search-row { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.85rem 0; border-bottom:1px solid var(--line); }
.account-search-row > div { display:flex; flex-direction:column; gap:.3rem; min-width:0; overflow-wrap:anywhere; }
.account-search-row small { color:var(--text-muted); font-size:.75rem; }
.account-reset-result { padding:1rem; margin:1rem 0; background:var(--surface-2); border:1px solid var(--line-strong); border-radius:14px; overflow-wrap:anywhere; }
.account-reset-result .input { margin:.7rem 0; }
.account-reset-result p { font-size:.8rem; line-height:1.7; color:var(--text-muted); }
@media(max-width:640px) {
  .admin-toolbar .segmented { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-toolbar .segmented-item { min-height:44px; }
  .account-search-row { flex-wrap:wrap; }
  .account-search-row > .btn { min-height:44px; }
  .account-reset-result { padding:.8rem; }
}
