:root {
  --bg: #F6F2E9;
  --bg-card: #FFFDF8;
  --ink: #17181C;
  --ink-soft: #4F5462;
  --muted: #767C8C;
  --line: #17181C;
  --line-soft: rgba(23, 24, 28, 0.14);
  --accent: #FF542E;
  --accent-2: #2B59FF;
  --mint: #00A87E;
  --gold: #FFB800;
  --purple: #7C4DFF;
  --amber-bg: #FFF3BF;
  --shadow: 4px 4px 0 #17181C;
  --shadow-lg: 6px 6px 0 #17181C;
  --shadow-sm: 2px 2px 0 #17181C;
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(23, 24, 28, 0.11) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

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

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--ink-soft);
}

/* Topbar (solid paper bg avoids expensive full-width backdrop-filter blur stalls on route switch) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #F6F2E9;
  border-bottom: 2.5px solid var(--ink);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #FFFDF8;
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
  font-family: var(--font-mono);
}

.brand-text strong {
  display: block;
  font-size: 16.5px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-pill {
  padding: 6px 8px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease;
  cursor: pointer;
  background: transparent;
}

.nav-pill:hover {
  background: rgba(23, 24, 28, 0.06);
}

.nav-pill.active {
  background: var(--ink);
  color: #FFFDF8;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 681px) and (max-width: 1340px) {
  .topbar-inner {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 9px 12px;
  }
  .brand-text span {
    display: none;
  }
  .nav-links {
    flex-wrap: nowrap;
    gap: 1px;
  }
  .nav-pill {
    padding: 5px 7px;
    font-size: 12px;
  }
  .topbar-actions {
    gap: 5px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 2.2px solid var(--ink);
  background: var(--bg-card);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-accent {
  background: var(--accent);
  color: #FFFDF8;
}

.btn-dark {
  background: var(--ink);
  color: #FFFDF8;
}

.btn-mint {
  background: var(--mint);
  color: #FFFDF8;
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--ink);
}

.btn-danger {
  background: #E11D48;
  color: #FFFDF8;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-width: 2px;
}

.vault-pill {
  border-radius: 999px;
  font-size: 13px;
  padding: 7px 14px;
}

.vault-count {
  background: var(--gold);
  color: var(--ink);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 800;
}

/* Layout */
.main-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 20px 64px;
  min-height: calc(100vh - 140px);
}

.loading-box {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* Hero Banner */
.hero-panel {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 84, 46, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 58ch;
}

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

.cartridge-stats {
  background: var(--ink);
  color: #FFFDF8;
  border-radius: 14px;
  padding: 18px;
  border: 2.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.cartridge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #D4D7E0;
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.22);
  padding-bottom: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.stat-tile.clickable {
  cursor: pointer;
}

.stat-tile.clickable:hover {
  background: rgba(255, 210, 63, 0.16);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.stat-tile .num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--gold);
}

.stat-tile .lbl {
  font-size: 12px;
  color: #D4D7E0;
  margin-top: 2px;
}

/* Section Heading & Filter Bar */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 0 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFDF8;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

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

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

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

.chip.active {
  background: var(--ink);
  color: #FFFDF8;
}

.search-input {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--bg-card);
  font-size: 13.5px;
  min-width: 220px;
  outline: none;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 84, 46, 0.25);
}

/* Collectible Brother Cards */
.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}

.bro-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}

.bro-card:hover {
  transform: translate(-3px, -4px);
  box-shadow: 7px 8px 0 var(--ink);
}

.bro-card-top {
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F7F3EA;
  color: var(--ink);
  border-top: 4px solid var(--card-accent, var(--ink));
  border-bottom: 1.8px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
}

.bro-card-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bro-accent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card-accent, var(--accent));
  border: 1.5px solid var(--ink);
}

.bro-card-lv {
  color: var(--ink-soft);
}

.rarity-badge {
  background: #FFFDF8;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.bro-avatar-wrap {
  position: relative;
  aspect-ratio: 4 / 3.4;
  overflow: hidden;
  border-bottom: 2.5px solid var(--ink);
  background: #EFE9DC;
}

.bro-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bro-card:hover .bro-avatar-wrap img {
  transform: scale(1.04);
}

.mbti-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: var(--ink);
  color: var(--gold);
  border: 2px solid #FFFDF8;
  border-radius: 7px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.bro-card-body {
  padding: 15px 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bro-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.bro-name-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.bro-name-row .real-name {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.bro-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.bro-motto {
  background: #F4EFE4;
  border-left: 4px solid var(--card-accent, var(--accent));
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--ink);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meme-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F3EFE6;
  border: 1.5px solid var(--ink);
}

.mini-stats {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
}

.mini-stat-row {
  display: grid;
  grid-template-columns: 64px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: #E8E2D4;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--card-accent, var(--accent));
}

.bro-card-foot {
  padding: 10px 15px;
  border-top: 2px dashed var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
}

/* Member Profile Page */
.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dossier-hero {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 26px;
}

.dossier-banner {
  padding: 12px 22px;
  color: #FFFDF8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 2.5px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 800;
}

.dossier-grid {
  display: grid;
  grid-template-columns: 270px 1.2fr 300px;
  gap: 24px;
  padding: 24px;
  align-items: start;
}

.dossier-portrait {
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #EFE9DC;
}

.dossier-portrait img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.dossier-meta-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.meta-pill-box {
  background: #F4EFE4;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 7px 10px;
  text-align: center;
}

.meta-pill-box .k {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.meta-pill-box .v {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 14px;
}

.dossier-info h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.15;
}

.dossier-info .subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.dossier-bio {
  font-size: 15px;
  line-height: 1.75;
  margin: 14px 0 18px;
  white-space: pre-line;
}

.radar-card {
  background: #F7F3EA;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px;
}

.radar-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.radar-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Gallery & Secret Cards */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.photo-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.photo-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.photo-thumb {
  aspect-ratio: 4 / 3;
  background: #EAE4D7;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}

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

.secret-thumb {
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(
    -45deg,
    #1C1E26,
    #1C1E26 12px,
    #282B36 12px,
    #282B36 24px
  );
  color: var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  gap: 6px;
  border-bottom: 2px solid var(--ink);
}

.secret-thumb .lock-icon {
  font-size: 28px;
}

.secret-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--ink);
  color: var(--gold);
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.photo-cap {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

/* Reviews */
.two-col-section {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 22px;
  align-items: start;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  background: var(--bg-card);
  border: 2.2px solid var(--ink);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.review-author {
  font-weight: 900;
  font-size: 14.5px;
}

.review-tag {
  background: var(--amber-bg);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 800;
}

/* Timeline */
.timeline-list {
  position: relative;
  padding-left: 26px;
  display: grid;
  gap: 24px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--ink);
}

.year-divider {
  position: relative;
  margin: 8px 0 -6px;
}

.year-divider::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--ink);
}

.year-pill {
  display: inline-block;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 14px;
  padding: 4px 14px;
  border-radius: 999px;
}

.memory-card {
  position: relative;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.memory-card::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
}

.memory-card.locked-card {
  border-style: solid;
}

.hazard-strip {
  background: repeating-linear-gradient(
    -45deg,
    #17181C,
    #17181C 10px,
    #2E303B 10px,
    #2E303B 20px
  );
  color: var(--gold);
  padding: 10px 18px;
  border-bottom: 2.5px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.memory-body {
  padding: 20px;
}

.memory-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
}

.meta-chip {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: #F4EFE4;
}

.memory-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.memory-story {
  margin: 0 0 14px;
  color: var(--ink-soft);
  white-space: pre-line;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: #FFFDF8;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.member-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--ink);
}

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

.memory-photos.single {
  grid-template-columns: minmax(0, 540px);
}

/* Quotes Wall */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.quote-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-text {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0;
}

.quote-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 2px dashed var(--line-soft);
}

.like-btn {
  border: 2px solid var(--ink);
  background: #FFF3BF;
  border-radius: 999px;
  padding: 4px 11px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}

.like-btn:hover {
  background: var(--gold);
}

/* Forms & Panels */
.panel-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stack-form {
  display: grid;
  gap: 13px;
}

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

.field label {
  font-size: 13px;
  font-weight: 800;
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: #FFFDF8;
  font-size: 14px;
  outline: none;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus, .textarea:focus, .select:focus {
  box-shadow: 0 0 0 3px rgba(43, 89, 255, 0.2);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.checkbox-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #F4EFE4;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.dropzone {
  border: 2.5px dashed var(--ink);
  border-radius: 14px;
  background: #F6F1E6;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s ease;
}

.dropzone:hover, .dropzone.dragover {
  background: #FFF3BF;
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.preview-item {
  border: 2px solid var(--ink);
  border-radius: 9px;
  overflow: hidden;
  background: #FFF;
}

.preview-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.preview-item input {
  width: 100%;
  border: none;
  border-top: 1.5px solid var(--ink);
  padding: 4px 6px;
  font-size: 11.5px;
  outline: none;
}

/* Studio Tabs */
.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.studio-tab {
  padding: 9px 16px;
  border-radius: 10px;
  border: 2.2px solid var(--ink);
  background: var(--bg-card);
  font-weight: 800;
  cursor: pointer;
}

.studio-tab.active {
  background: var(--ink);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.manage-list {
  display: grid;
  gap: 10px;
}

.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #F8F4EB;
  border: 2px solid var(--ink);
  border-radius: 11px;
}

.manage-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.manage-thumb {
  width: 54px;
  height: 44px;
  border-radius: 7px;
  border: 1.8px solid var(--ink);
  object-fit: cover;
  flex-shrink: 0;
}

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

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 2.2px solid var(--ink);
  cursor: pointer;
}

.swatch.active {
  outline: 3px solid var(--gold);
  transform: scale(1.08);
}

.slider-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

/* Modals & Lightbox */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 16, 22, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.dialog-card {
  width: min(440px, 100%);
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 8px 8px 0 #000;
}

.dialog-body {
  padding: 20px;
}

.dialog-body h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.form-error {
  background: #FFE4E6;
  color: #BE123C;
  border: 1.8px solid #BE123C;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.lightbox-frame {
  position: relative;
  width: min(980px, 100%);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-body {
  background: var(--ink);
  border: 3px solid #FFFDF8;
  border-radius: 14px;
  overflow: hidden;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.lightbox-body img {
  max-height: 76vh;
  max-width: 88vw;
  object-fit: contain;
  margin: 0 auto;
  background: #101116;
}

.lightbox-meta {
  padding: 12px 16px;
  color: #FFFDF8;
  background: #17181C;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lightbox-caption {
  font-weight: 800;
  font-size: 15px;
}

.lightbox-sub {
  font-size: 12.5px;
  color: #C7CBD6;
  font-family: var(--font-mono);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.2px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.icon-btn.small {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -10px;
  z-index: 3;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

/* Toast */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

.toast {
  background: var(--ink);
  color: #FFFDF8;
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
  border-top: 2.5px solid var(--ink);
  background: var(--bg-card);
  padding: 18px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Responsive */
@media (max-width: 960px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
  .dossier-grid {
    grid-template-columns: 1fr;
  }
  .dossier-portrait {
    max-width: 280px;
  }
  .two-col-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .timeline-list {
    padding-left: 18px;
  }
  .memory-body {
    padding: 15px;
  }
}

/* ==================== Quiet Editorial Ticker (Reduced Visual Noise) ==================== */
.goofy-marquee {
  background: #F3EEE3;
  color: var(--ink-soft);
  border: 1.8px solid rgba(23, 24, 28, 0.25);
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 12.5px;
}

.goofy-marquee-track {
  display: inline-flex;
  gap: 36px;
  padding-left: 20px;
  animation: marqueeScroll 28s linear infinite;
}

.goofy-marquee:hover .goofy-marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Home Meal Roulette */
.roulette-panel {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.roulette-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.roulette-mascot {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
  transform: rotate(-6deg);
}

.roulette-result {
  background: #FFF3BF;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 14px;
  min-width: 240px;
  text-align: center;
}

.card-sticker-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  background: #E23B2E;
  color: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  transform: rotate(-5deg);
  box-shadow: 2px 2px 0 var(--ink);
}

/* Member Goofy Hero Stage (inspired by 个人介绍.html) */
.goofy-hero-stage {
  background: #FFF6E3;
  background-image: radial-gradient(rgba(29, 25, 16, 0.08) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 36px 24px 28px;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.goofy-stage-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 2vw, 28px);
  margin-bottom: 22px;
}

.goofy-flank {
  width: clamp(76px, 14vw, 152px);
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(29, 25, 16, 0.12));
  transition: transform 0.25s ease;
}

.goofy-flank.left {
  transform: scaleX(-1) rotate(7deg);
}

.goofy-flank.right {
  transform: rotate(-7deg);
}

.goofy-hero-stage:hover .goofy-flank.left {
  transform: scaleX(-1) rotate(11deg) translateY(-4px);
}

.goofy-hero-stage:hover .goofy-flank.right {
  transform: rotate(-11deg) translateY(-4px);
}

.goofy-avatar-box {
  position: relative;
  width: clamp(160px, 26vw, 240px);
  flex: 0 0 auto;
}

.goofy-avatar-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  border: 3px solid var(--ink);
  background: #FFF;
  box-shadow: 10px 12px 0 #FFD23F;
  overflow: hidden;
}

.goofy-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.goofy-red-badge {
  position: absolute;
  right: -14px;
  bottom: -12px;
  background: #E23B2E;
  color: #FFF;
  font-weight: 900;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  transform: rotate(-7deg);
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink);
}

.goofy-hero-name {
  margin: 6px 0 8px;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.goofy-stare-gag {
  margin: 0 auto 18px;
  font-size: clamp(15px, 1.8vw, 18px);
  color: #5D5648;
  font-weight: 700;
  max-width: 34em;
}

.goofy-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.goofy-scroll-hint {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.14em;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.goofy-scroll-arrow {
  animation: bobDown 2s ease-in-out infinite;
  font-size: 16px;
  color: var(--ink);
}

@keyframes bobDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Goofy Section Header with Mascot & Yellow Highlight */
.goofy-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 18px;
}

.goofy-sec-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
}

.yellow-mark {
  background-image: linear-gradient(to top, #FFD23F 0 42%, transparent 42%);
  padding: 0 7px 2px;
}

.goofy-sec-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.mascot-fig {
  margin: 0;
  text-align: center;
  flex: 0 0 auto;
}

.mascot-fig img {
  width: clamp(72px, 9vw, 112px);
  height: auto;
  margin: 0 auto;
}

.mascot-fig figcaption {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

/* Deadpan Dossier Fields */
.deadpan-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 14px 0 16px;
}

.deadpan-field {
  padding: 10px 0;
  border-bottom: 1.5px dotted var(--line-soft);
}

.deadpan-field dt {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.deadpan-field dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}

/* Absurd Bookshelf */
.book-shelf {
  display: grid;
  gap: 14px;
}

.book-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: center;
  background: var(--bg-card);
  border: 2.2px solid var(--ink);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.book-item:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 #FFD23F;
}

.book-spine {
  width: 14px;
  height: 100%;
  min-height: 64px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
}

.book-item h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.book-author {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 6px;
}

.book-note {
  margin: 0;
  font-size: 14px;
  color: #4A453A;
}

.book-prog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 6px;
}

.book-prog-head em {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
}

/* Absurd Hobby Grid */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hobby-card {
  background: var(--bg-card);
  border: 2.2px solid var(--ink);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hobby-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 6px 6px 0 #FFD23F;
}

.hobby-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #FFF6E3;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.hobby-card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 900;
}

.hobby-card p {
  margin: 0;
  font-size: 13.5px;
  color: #4A453A;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .hobby-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-item { grid-template-columns: 12px minmax(0, 1fr); }
  .book-prog { grid-column: 2; }
}

@media (max-width: 640px) {
  .deadpan-fields { grid-template-columns: 1fr; }
  .goofy-flank { width: 64px; }
  .goofy-red-badge { right: -6px; bottom: -10px; font-size: 11.5px; padding: 5px 10px; }
}

/* Empty Collector Card Slot for Adding New Member */
.add-member-card {
  background: rgba(255, 253, 248, 0.72);
  border: 3px dashed var(--ink);
  border-radius: 16px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.add-member-card:hover {
  background: #FFF6E3;
  transform: translate(-3px, -4px);
  box-shadow: 6px 7px 0 var(--ink);
}

.add-member-plus {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFD23F;
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

/* ==================== Hot Places Column ==================== */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.place-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.place-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 6px 7px 0 var(--ink);
}

.place-head {
  padding: 9px 14px;
  background: #F7F3EA;
  color: var(--ink);
  border-top: 4px solid var(--place-accent, var(--accent));
  border-bottom: 1.8px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
}

.place-vibe {
  background: #FFFDF8;
  color: var(--ink);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 800;
}

.place-cover {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 2.2px solid var(--ink);
  background: #EFE9DC;
  cursor: pointer;
}

.place-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.place-card:hover .place-cover img {
  transform: scale(1.03);
}

.place-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.place-body h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.place-addr {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

.place-desc {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.place-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px dashed var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== Multi-Photo Card Slideshow ==================== */
.slide-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide-stage .slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.75s ease, transform 1.1s ease;
  pointer-events: none;
}

.slide-stage .slide-img.active {
  opacity: 1;
  transform: scale(1);
}

.slide-indicator {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(23, 24, 28, 0.84);
  color: #FFFDF8;
  border: 1.5px solid rgba(255, 253, 248, 0.85);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
}

.slide-dots {
  display: inline-flex;
  gap: 3px;
}

.slide-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  transition: background 0.25s ease, transform 0.25s ease;
}

.slide-dot.active {
  background: #FFD23F;
  transform: scale(1.25);
}

.avatar-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.avatar-gallery-item {
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: #FFFDF8;
  display: flex;
  flex-direction: column;
}

.avatar-gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1.5px solid var(--ink);
}

.avatar-gallery-actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 5px;
  background: #F6F2E9;
}

.avatar-gallery-actions button {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFDF8;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 5px;
  cursor: pointer;
}

.avatar-gallery-actions button.cover-active {
  background: #FFD23F;
}

.avatar-gallery-actions button.rm-btn {
  background: #FFE4E6;
  color: #BE123C;
}

/* ==================== McDonald's Treat Ledger ==================== */
.ledger-panel {
  background: #FFFDF8;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ledger-list {
  display: grid;
  gap: 8px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #FFF6E3;
  border: 1.8px solid var(--ink);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13.5px;
}

.ledger-who {
  font-weight: 800;
}

.ledger-arrow {
  display: inline-block;
  margin: 0 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #FFD23F;
  border: 1.5px solid var(--ink);
  font-size: 11.5px;
  font-weight: 900;
}

.ledger-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ==================== Today Calendar & On-This-Day Widget ==================== */
.calendar-strip {
  display: grid;
  grid-template-columns: 118px 1fr 1.15fr;
  gap: 16px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 24px;
  align-items: stretch;
}

.cal-tearoff {
  border: 2.2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: #FFFDF8;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-align: center;
}

.cal-tearoff-top {
  background: #E23B2E;
  color: #FFFDF8;
  font-weight: 900;
  font-size: 12px;
  padding: 4px 6px;
  border-bottom: 2px solid var(--ink);
  letter-spacing: 0.04em;
}

.cal-tearoff-day {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  padding: 6px 0 2px;
}

.cal-tearoff-week {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  padding-bottom: 6px;
}

.cal-info-box {
  background: #FFF6E3;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.cal-info-box.birthday-today {
  background: #FFD23F;
}

.cal-box-label {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-box-main {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.cal-box-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.cal-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFDF8;
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  margin: 0 2px;
}

.cal-link-pill:hover {
  background: #FFD23F;
}

.cal-days-num {
  display: inline-block;
  background: var(--ink);
  color: #FFD23F;
  font-family: var(--font-mono);
  padding: 0 7px;
  border-radius: 6px;
  font-weight: 900;
  margin: 0 2px;
}

@media (max-width: 860px) {
  .calendar-strip {
    grid-template-columns: 1fr;
  }
  .cal-tearoff {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .cal-tearoff-top {
    border-bottom: none;
    border-right: 2px solid var(--ink);
    padding: 10px 14px;
    align-self: stretch;
    display: grid;
    place-items: center;
  }
  .cal-tearoff-day {
    font-size: 26px;
    padding: 4px 12px;
  }
  .cal-tearoff-week {
    padding: 0 14px 0 0;
  }
}

/* Member Account Topbar Chip */
.user-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: #FFFDF8;
}

.user-chip-btn img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.8px solid var(--ink);
}

.author-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #FFF3BF;
  border: 1.5px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
}

/* ==================== Navigation Home: Cinema Album & Activity Feed ==================== */
.home-showcase-grid {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
  align-items: stretch;
}

.cinema-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cinema-head {
  background: var(--ink);
  color: #FFFDF8;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cinema-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 14.5px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FF542E;
  box-shadow: 0 0 0 3px rgba(255, 84, 46, 0.35);
  animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.cinema-viewport {
  position: relative;
  aspect-ratio: 16 / 10.5;
  background: #14151B;
  overflow: hidden;
  cursor: pointer;
}

.cinema-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: opacity 0.6s ease, transform 0.9s ease;
}

.cinema-viewport img.fading {
  opacity: 0.15;
  transform: scale(1.03);
}

.cinema-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(16, 17, 22, 0.9), rgba(16, 17, 22, 0.4) 60%, transparent);
  color: #FFFDF8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cinema-caption {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.cinema-meta {
  font-size: 12px;
  color: #E2E5EE;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cinema-controls {
  padding: 11px 14px;
  background: #FFF6E3;
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Recent Activity Feed Panel */
.activity-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-head {
  background: #FFD23F;
  padding: 11px 16px;
  border-bottom: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.activity-spotlight {
  background: #17181C;
  color: #FFFDF8;
  padding: 12px 15px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 62px;
}

.activity-spotlight-tag {
  background: #FF542E;
  color: #FFF;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.activity-spotlight-text {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.4;
  transition: opacity 0.35s ease;
}

.activity-list {
  padding: 12px 14px;
  display: grid;
  gap: 9px;
  overflow-y: auto;
  max-height: 360px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #F8F4EB;
  border: 1.8px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.activity-item:hover {
  background: #FFF3BF;
  transform: translateX(2px);
}

.activity-item-main {
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
}

.activity-actor {
  font-weight: 900;
  color: #E23B2E;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Calm Uniform Home Quick-Jump Strip (replaces 7 noisy rainbow portal tiles) */
.home-quick-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.quick-strip-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--bg-card);
  box-shadow: 2px 2px 0 rgba(23, 24, 28, 0.85);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s ease, background 0.14s ease, box-shadow 0.12s ease;
}

.quick-strip-item:hover {
  background: #FFF6DC;
  transform: translate(-1px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.qs-ic {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.qs-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.qs-txt strong {
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-txt small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-arr {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink-soft);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .home-quick-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .home-showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-pill {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 11px;
    font-size: 13px;
  }
  .goofy-hero-actions .btn {
    width: 100%;
    justify-content: center;
    line-height: 1.35;
  }
  .cinema-viewport {
    aspect-ratio: 4 / 3;
    min-height: 220px;
  }
  .dialog-card {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dialog-body {
    padding-bottom: 24px;
  }
}

/* ==================== Studio Admin Message Board ==================== */
.admin-msg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
}

.admin-msg-item {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-msg-item.is-done {
  background: #F6F9F4;
  opacity: 0.92;
}

.admin-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-msg-status {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
}

.admin-msg-status.pending {
  background: #FFD23F;
  color: var(--ink);
}

.admin-msg-status.done {
  background: #B8F2C6;
  color: #14532D;
}

.admin-msg-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-msg-reply {
  background: #FFF6E3;
  border-left: 4px solid #FF542E;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.admin-msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1.5px dashed var(--line-soft);
}

@media (max-width: 820px) {
  .admin-msg-grid {
    grid-template-columns: 1fr;
  }
}

/* Portrait-friendly framing for member avatars & slideshows */
.bro-avatar-wrap img,
.slide-stage .slide-img,
.goofy-avatar-box img {
  object-position: center 20%;
}

/* Inline admin reply form */
.admin-inline-reply {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1.5px dashed var(--line-soft);
}

/* Keyboard focus accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #FF542E;
  outline-offset: 2px;
}

/* Floating Back-to-Top button */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 65;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: #FFD23F;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.2s ease;
}

.back-to-top:hover {
  transform: translate(-1px, -2px);
  box-shadow: 4px 5px 0 var(--ink);
}

.back-to-top.hidden {
  display: none;
}

@media (max-width: 640px) {
  .back-to-top {
    right: 14px;
    bottom: 18px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 14px;
    align-items: center;
  }
}

/* ==================== Interactive Focal-Point / Crop Framing Modal ==================== */
.photo-focus-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 4;
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.94);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

.photo-focus-btn:hover {
  background: #FF542E;
  color: #FFFDF8;
}

.focal-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crop-ratio-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.crop-viewport {
  position: relative;
  width: 100%;
  max-height: 360px;
  margin: 0 auto;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: #14151B;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.crop-viewport.dragging {
  cursor: grabbing;
}

.crop-viewport img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  pointer-events: none;
  will-change: transform;
}

.crop-grid-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}

.crop-grid-overlay span {
  border: 0.8px solid rgba(255, 255, 255, 0.35);
}

.crop-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.82);
  color: #FFD23F;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}

.crop-zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #FFF6E3;
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.focal-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.focal-preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focal-preview-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.focal-preview-box {
  border: 2.2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: #EFE9DC;
  box-shadow: 3px 3px 0 var(--ink);
}

.focal-preview-box.ratio-43 {
  aspect-ratio: 4 / 3;
}

.focal-preview-box.ratio-11 {
  width: 132px;
  aspect-ratio: 1 / 1;
}

.focal-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.focal-sliders {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: #FFF6E3;
  border: 2px solid var(--ink);
  border-radius: 10px;
}

@media (max-width: 720px) {
  .focal-editor-layout {
    grid-template-columns: 1fr;
  }
  .focal-source-stage img {
    max-height: 260px;
  }
}

/* ==================== Floating Real-Time QQ-Style Group Chat ==================== */
.chat-widget-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 85;
}

.chat-widget-root.hidden {
  display: none;
}

/* Topbar docked group-chat button (zero obstruction over page content!) */
.topbar-chat-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #17181C;
  color: #FFFDF8;
  border: 2px solid var(--ink);
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 2px 2px 0 #FFD23F;
}

.topbar-chat-btn:hover {
  background: #2A2C34;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #FFD23F;
}

.topbar-chat-btn.is-open {
  background: #FFD23F;
  color: #17181C;
  box-shadow: 2px 2px 0 var(--ink);
}

.topbar-chat-count {
  font-size: 11px;
  color: #FFD23F;
  font-weight: 900;
}

.topbar-chat-btn.is-open .topbar-chat-count {
  color: #17181C;
}

.topbar-chat-unread {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #FF542E;
  color: #FFFDF8;
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.topbar-chat-unread.hidden {
  display: none;
}

.chat-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
  flex-shrink: 0;
}

.chat-window {
  width: min(390px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 110px));
  background: #FFFDF8;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: #FFD23F;
  border-bottom: 2.5px solid var(--ink);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.chat-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-header-title strong {
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-online-bar {
  font-size: 11.5px;
  color: #3D382E;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 8px;
  background: #F6F1E6;
  display: flex;
  flex-direction: column;
  gap: 11px;
  position: relative;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
}

.chat-row.is-me {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
  object-position: center 20%;
  background: #FFD23F;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
}

.chat-bubble-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 78%;
  min-width: 0;
}

.chat-row.is-me .chat-bubble-col {
  align-items: flex-end;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.chat-row.is-me .chat-meta {
  flex-direction: row-reverse;
}

.chat-bubble {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: 8px 11px;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-row.is-me .chat-bubble {
  background: #FFF3BF;
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}

.chat-quote-box {
  font-size: 11.5px;
  color: #575246;
  background: rgba(23, 24, 28, 0.06);
  border-left: 3px solid #FF542E;
  padding: 3px 7px;
  border-radius: 6px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-img {
  display: block;
  max-width: 195px;
  max-height: 210px;
  border-radius: 10px;
  border: 1.8px solid var(--ink);
  cursor: pointer;
  margin-top: 4px;
  object-fit: cover;
}

.chat-msg-actions {
  display: flex;
  gap: 8px;
  font-size: 11px;
  opacity: 0.72;
}

.chat-msg-actions button {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.chat-msg-actions button:hover {
  color: #FF542E;
  text-decoration: underline;
}

.chat-msg-actions .chat-quoted-btn {
  color: #B45309;
}

.chat-quote-capture {
  background: #FFF3BF;
  border-top: 2.5px solid var(--ink);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-quote-capture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.chat-quote-capture-text {
  font-size: 12.5px;
  color: var(--ink);
  background: #FFFDF8;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 5px 8px;
  line-height: 1.45;
  max-height: 60px;
  overflow-y: auto;
}

.chat-quote-capture-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-system-pill {
  align-self: center;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(23, 24, 28, 0.07);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-new-pill {
  position: sticky;
  bottom: 6px;
  align-self: center;
  background: #FF542E;
  color: #FFF;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #FFF6E3;
  border-top: 2px solid var(--ink);
  font-size: 12px;
  color: var(--ink-soft);
}

.chat-picker-pop {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  background: #FFFDF8;
  border-top: 2px solid var(--ink);
  max-height: 110px;
  overflow-y: auto;
}

.chat-picker-pop button {
  border: 1.5px solid var(--ink);
  background: #FFF6E3;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.chat-picker-pop button:hover {
  background: #FFD23F;
}

.chat-composer {
  border-top: 2.5px solid var(--ink);
  background: #FFFDF8;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-tool-btn {
  border: 1.8px solid var(--ink);
  background: #F6F1E6;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.chat-tool-btn:hover {
  background: #FFD23F;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-textarea {
  flex: 1;
  min-height: 38px;
  max-height: 92px;
  resize: none;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  background: #FFFDF8;
}

@media (max-width: 640px) {
  .chat-widget-root {
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
  .chat-window {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(78dvh, 560px);
    z-index: 105;
  }
}

/* ==================== Mobile-First Native Feel & Touch Ergonomics ==================== */
button,
a,
.bro-card,
.portal-tile,
.stat-tile.clickable,
.activity-item,
.photo-card {
  -webkit-tap-highlight-color: transparent;
}

.chat-messages,
.dialog-card,
.admin-msg-list {
  overscroll-behavior-y: contain;
}

.mobile-bottom-nav,
.mobile-more-backdrop,
.mobile-more-sheet {
  display: none;
}

/* Prevent iOS Safari auto-zoom when focusing inputs/selects/textareas */
@media (max-width: 768px) {
  .input,
  .textarea,
  .select,
  .chat-textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 680px) {
  /* Slim 1-row topbar on mobile; primary navigation moves to thumb-friendly bottom bar */
  .topbar-inner {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .topbar .nav-links {
    display: none;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .brand-text strong {
    font-size: 15.5px;
  }
  .brand-text span {
    display: none;
  }
  .topbar-actions {
    gap: 5px;
  }
  .topbar-actions .btn {
    padding: 5px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .user-chip-btn {
    padding: 4px 8px 4px 4px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .topbar-chat-btn {
    padding: 5px 8px !important;
    gap: 4px;
  }
  .topbar-chat-label {
    font-size: 12px;
  }

  /* Fixed thumb-reachable bottom tab bar with iPhone safe-area */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #FFFDF8;
    border-top: 2.5px solid var(--ink);
    padding: 5px 4px max(6px, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 14px rgba(23, 24, 28, 0.08);
  }

  .mob-tab {
    border: 2px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    color: var(--ink-soft);
    transition: transform 0.1s ease, background 0.14s ease;
  }

  .mob-tab:active {
    transform: scale(0.93);
  }

  .mob-tab.active {
    background: #FFD23F;
    border-color: var(--ink);
    color: var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
  }

  .mob-tab-ic {
    font-size: 17px;
    line-height: 1.15;
  }

  .mob-tab-lbl {
    font-size: 10.5px;
    font-weight: 900;
    line-height: 1.1;
  }

  .mob-tab.menu-open {
    background: #17181C;
    color: #FFD23F;
    border-color: var(--ink);
  }

  .mobile-more-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 73;
    background: rgba(23, 24, 28, 0.36);
    backdrop-filter: blur(2px);
  }

  .mobile-more-backdrop.hidden {
    display: none;
  }

  .mobile-more-sheet {
    display: block;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 74;
    background: var(--bg-card);
    border: 2.5px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: mobSheetUp 0.16s ease-out;
  }

  .mobile-more-sheet.hidden {
    display: none;
  }

  @keyframes mobSheetUp {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #FFD23F;
    border-bottom: 2px solid var(--ink);
    font-weight: 900;
    font-size: 14px;
  }

  .mobile-more-list {
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .mobile-more-item {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 13px;
    border: 2px solid var(--ink);
    background: #FFF6E3;
    cursor: pointer;
    color: var(--ink);
  }

  .mobile-more-item.active {
    background: #FFD23F;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .mobile-more-ic {
    font-size: 21px;
    line-height: 1;
    flex-shrink: 0;
  }

  .mobile-more-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-more-txt strong {
    font-size: 14.5px;
    font-weight: 900;
  }

  .mobile-more-txt small {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 700;
  }

  .mobile-more-arrow {
    margin-left: auto;
    font-weight: 900;
    font-size: 15px;
  }

  /* Give footer, floating back-to-top, and toasts safe clearance above bottom tab bar */
  .site-footer {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .back-to-top {
    right: 12px;
    bottom: calc(132px + env(safe-area-inset-bottom, 0px));
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }

  /* Better mobile modals, lightbox, forms, and studio management rows */
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .dialog-card {
    max-height: 88dvh;
    border-radius: 18px;
  }

  .dialog-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .lightbox-frame {
    max-height: 92dvh;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 18px;
    background: rgba(255, 253, 248, 0.86);
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .studio-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .studio-tabs::-webkit-scrollbar {
    display: none;
  }
  .studio-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .manage-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .chat-msg-actions {
    gap: 4px;
    flex-wrap: wrap;
    opacity: 0.9;
  }

  .chat-msg-actions button {
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 6px;
    background: rgba(23, 24, 28, 0.05);
  }
}

/* ==================== Site-Wide All Photos Gallery (#/gallery) ==================== */
.gallery-toolbar {
  justify-content: space-between;
}

.all-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.gallery-photo-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.gallery-photo-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 5px 6px 0 var(--ink);
}

.gallery-photo-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #EFE9DC;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}

.gallery-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-photo-card:hover .gallery-photo-thumb img {
  transform: scale(1.03);
}

.gallery-src-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  background: rgba(23, 24, 28, 0.8);
  color: #FFFDF8;
  border: 1.5px solid rgba(255, 253, 248, 0.85);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.gallery-photo-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-photo-cap {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
}

.gallery-link-btn {
  border: 1.5px solid var(--ink);
  background: #FFF6E3;
  color: var(--ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.gallery-link-btn:hover {
  background: #FFD23F;
}

@media (max-width: 640px) {
  .all-photos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .gallery-photo-info {
    padding: 8px 9px;
  }
  .gallery-photo-cap {
    font-size: 12.5px;
  }
  .gallery-photo-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ==================== China Footprint Map (#/map) ==================== */
.map-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.map-stat-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.map-stat-num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.15;
}

.map-stat-lbl {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 3px;
}

.map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.map-canvas-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.china-map-stage {
  position: relative;
  overflow: hidden;
  background-color: #DCEEF9;
  background-image:
    radial-gradient(rgba(43, 89, 255, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, #E7F3FB 0%, #D5EBF7 100%);
  background-size: 18px 18px, 100% 100%;
}

.china-map-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 680;
  user-select: none;
  cursor: grab;
  touch-action: pan-y;
}

.china-map-svg.is-dragging {
  cursor: grabbing;
}

.china-map-svg.is-zoomed {
  touch-action: none;
}

.map-world-group {
  will-change: transform;
}

.china-map-svg.is-interacting .map-uni-arc,
.china-map-svg.is-interacting .map-pulse-ring {
  animation-play-state: paused;
}

.china-map-svg.is-interacting .china-province {
  transition: none;
  pointer-events: none;
}

.map-graticule-line {
  fill: none;
  stroke: rgba(23, 24, 28, 0.08);
  stroke-dasharray: 4 4;
}

.china-province {
  stroke: #7D7057;
  stroke-linejoin: round;
  transition: fill 0.12s ease;
  cursor: pointer;
}

.china-province.is-unlit-prov {
  fill: #FAF5E8;
}

.china-province.is-unlit-prov:hover {
  fill: #F3E8CE;
  stroke: #17181C;
}

.china-province.is-lit-prov {
  fill: #FFF0BE;
  stroke: #66583E;
}

.china-province.is-lit-prov:hover {
  fill: #FFE17D;
  stroke: #17181C;
}

.china-province.is-origin-prov {
  fill: #FFE484;
  stroke: #17181C;
}

.china-province.is-active-prov {
  fill: #FFD95A;
  stroke: #17181C;
}

.map-prov-label {
  font-size: 9px;
  font-weight: 800;
  fill: rgba(23, 24, 28, 0.36);
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.5px;
}

.map-prov-label.is-lit {
  fill: rgba(23, 24, 28, 0.56);
}

.map-prov-label.zoom-only {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.china-map-svg.is-zoomed .map-prov-label.zoom-only {
  opacity: 1;
  font-size: 5.5px;
}

.china-map-svg.is-zoomed .map-prov-label.show-1x {
  font-size: 6px;
}

@keyframes mapArcFlow {
  from { stroke-dashoffset: 32; }
  to { stroke-dashoffset: 0; }
}

.map-uni-arc {
  fill: none;
  stroke: #2B59FF;
  stroke-opacity: 0.45;
  stroke-linecap: round;
  animation: mapArcFlow 2.6s linear infinite;
  pointer-events: none;
}

.map-uni-arc.active {
  stroke: #2B59FF;
  stroke-opacity: 0.92;
  animation-duration: 1.5s;
}

.map-trip-arc {
  fill: none;
  stroke: #FF542E;
  stroke-opacity: 0.78;
  stroke-linecap: round;
  pointer-events: none;
}

.map-trip-arc.active {
  stroke-opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255, 84, 46, 0.55));
}

@keyframes mapPinPulse {
  0% { transform: scale(1); opacity: 0.85; }
  70% { transform: scale(2.05); opacity: 0; }
  100% { transform: scale(2.05); opacity: 0; }
}

.map-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: mapPinPulse 2.1s ease-out infinite;
  pointer-events: none;
}

.map-pulse-ring.is-origin {
  animation-duration: 2.8s;
}

.map-pin-dot {
  transition: transform 0.14s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.map-pin:hover .map-pin-dot {
  transform: scale(1.18);
}

.scs-inset-group,
.map-decor-group,
.map-east-hint {
  transition: opacity 0.2s ease;
}

.scs-inset-group.is-hidden,
.map-decor-group.is-hidden,
.map-east-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.map-hud-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 253, 248, 0.9);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  pointer-events: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.map-hud-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 4;
}

.map-hud-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, background 0.12s ease;
}

.map-hud-btn:hover {
  background: #FFD23F;
  transform: translate(-1px, -1px);
}

.map-hud-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.map-hud-zoom-pill {
  background: #17181C;
  color: #FFD23F;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  padding: 3px 4px;
  border-radius: 7px;
  border: 1.5px solid var(--ink);
}

.map-hover-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
  max-width: 220px;
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 11px;
  padding: 7px 10px;
  box-shadow: 3px 3px 0 var(--ink);
  will-change: transform;
}

.map-tt-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.map-tt-title small {
  font-weight: 700;
  color: var(--muted);
  margin-left: 3px;
}

.map-tt-sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
  font-weight: 700;
}

.map-tt-who {
  font-size: 11px;
  color: var(--accent-blue);
  margin-top: 3px;
  font-weight: 800;
}

.map-dot-sq {
  border-radius: 3px;
}

@media (max-width: 680px) {
  .map-hud-hint {
    display: none;
  }
  .map-hud-controls {
    top: 7px;
    right: 7px;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .map-hud-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 8px;
  }
  .map-hud-zoom-pill {
    padding: 4px 6px;
    font-size: 10px;
  }
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: #FFF6E3;
  border-top: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.8px solid var(--ink);
}

.map-subhead {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.map-member-list,
.map-mem-list {
  display: grid;
  gap: 8px;
}

.map-member-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  background: #FFF6E3;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.map-member-row:hover {
  background: #FFD23F;
  transform: translateX(2px);
}

.map-member-row img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

.map-member-row strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
}

.map-member-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.map-mem-row {
  padding: 8px 11px;
  border-radius: 10px;
  border: 1.8px solid var(--ink);
  background: #F8F4EB;
  cursor: pointer;
  transition: background 0.12s ease;
}

.map-mem-row:hover {
  background: #FFF3BF;
}

@media (max-width: 960px) {
  .map-workspace {
    grid-template-columns: 1fr;
  }
  .map-stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==================== Mobile-Optimized Admin Editing Experience ==================== */
.studio-members-grid {
  grid-template-columns: 0.85fr 1.35fr;
}

.mobile-member-quickbar {
  display: none;
  margin-bottom: 14px;
  background: #FFF6E3;
}

.admin-collapse {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #FFF6E3;
  overflow: hidden;
}

.admin-collapse summary {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.admin-collapse summary::-webkit-details-marker {
  display: none;
}

.admin-collapse summary::after {
  content: "▾";
  font-size: 14px;
  transition: transform 0.16s ease;
}

.admin-collapse[open] summary::after {
  transform: rotate(180deg);
}

.admin-collapse-body {
  padding: 12px 14px 14px;
  border-top: 2px solid var(--ink);
  display: grid;
  gap: 12px;
}

.admin-sticky-save {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.manage-row-text {
  max-width: 72%;
  min-width: 0;
  word-break: break-word;
}

.manage-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.content-filter-bar {
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 900px) {
  .studio-members-grid {
    grid-template-columns: 1fr !important;
  }
  .mobile-member-quickbar {
    display: block;
  }
  .desktop-member-list {
    display: none;
  }
}

@media (max-width: 680px) {
  .manage-row-text {
    max-width: 100%;
    width: 100%;
  }
  .manage-row-actions {
    width: 100%;
  }
  .manage-row-actions .btn {
    min-height: 34px;
  }
  .content-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .content-filter-bar input[type="search"] {
    max-width: 100% !important;
  }
  .admin-sticky-save {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    background: #FFFDF8;
    padding: 10px 12px;
    margin: 6px -14px -10px;
    border-top: 2.5px solid var(--ink);
    box-shadow: 0 -4px 14px rgba(23, 24, 28, 0.1);
  }
  body.route-studio .back-to-top {
    bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  }
  .admin-sticky-save .btn {
    flex: 1;
    min-height: 42px;
    font-size: 14.5px;
  }
  .avatar-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .avatar-gallery-actions button {
    min-height: 32px;
    font-size: 12px;
    padding: 4px 7px;
  }
  .slider-row {
    grid-template-columns: 78px 1fr 34px;
    gap: 8px;
  }
  .slider-row input[type="range"] {
    height: 28px;
  }
  .swatch {
    width: 30px;
    height: 30px;
  }
}

/* ==================== Timeline Reactions, Comments, Confetti & Lightbox Upgrades ==================== */
.mem-interact-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dashed var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mem-react-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mem-react-btn {
  border: 2px solid var(--ink);
  background: #FFFDF8;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s ease, background 0.14s ease;
}

.mem-react-btn:hover {
  background: #FFF3BF;
  transform: translateY(-1px);
}

.mem-react-btn.popped {
  background: #FFD23F;
  transform: scale(1.1);
}

.mem-comments-box {
  background: #FAF6EE;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
}

.mem-comments-box summary {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  background: #F4EDE0;
}

.mem-comments-inner {
  padding: 10px 12px;
  border-top: 1.8px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mem-comment-list {
  display: grid;
  gap: 6px;
}

.mem-comment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FFFDF8;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.5;
}

.mem-cm-del {
  border: 1.5px solid #BE123C;
  background: #FFE4E6;
  color: #BE123C;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.mem-comment-form {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 8px;
  align-items: center;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-search-bar {
  padding: 7px 10px;
  background: #FFF6E3;
  border-bottom: 2px solid var(--ink);
}

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

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border: 1.5px solid #17181C;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(680deg); opacity: 0; }
}

@media (max-width: 640px) {
  .mem-comment-form {
    grid-template-columns: 1fr;
  }
}

/* ==================== Birthday Star Greeting Modal & Site-Wide Live Broadcast ==================== */
.bday-avatar-crown-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin-top: 8px;
}

.bday-avatar-crown-wrap img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3.5px solid var(--ink);
  box-shadow: 5px 5px 0 #FFD23F, 7px 7px 0 var(--ink);
  background: #FFF6E3;
}

.bday-crown {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(23, 24, 28, 0.35));
}

.site-broadcast-stack {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, calc(100vw - 24px));
  pointer-events: none;
}

.birthday-broadcast-banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #FFD23F 0%, #FFE999 100%);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  animation: bdayBannerDrop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bdayBannerDrop {
  from { opacity: 0; transform: translateY(-18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bday-banner-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.2px solid var(--ink);
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
  background: #FFFDF8;
}

.bday-banner-text {
  flex: 1;
  min-width: 0;
}

.bday-banner-tag {
  font-size: 11px;
  font-weight: 900;
  color: #C81E1E;
  letter-spacing: 0.02em;
}

.bday-banner-msg {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.4;
}

.bday-banner-close {
  border: none;
  background: rgba(23, 24, 28, 0.1);
  color: var(--ink);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.bday-banner-close:hover {
  background: rgba(23, 24, 28, 0.22);
}

@media (max-width: 680px) {
  .site-broadcast-stack {
    top: 62px;
    width: calc(100vw - 18px);
  }
  .birthday-broadcast-banner {
    padding: 9px 10px;
    gap: 8px;
  }
  .bday-banner-av {
    width: 38px;
    height: 38px;
  }
  .bday-banner-msg {
    font-size: 12.5px;
  }
}

/* ==================== Admin Batch Birthday Editor ==================== */
.bday-batch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bday-batch-row {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bday-batch-who {
  display: flex;
  align-items: center;
  gap: 9px;
}

.bday-batch-who img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

.bday-status-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: #F3ECE0;
  color: var(--ink-soft);
}

.bday-status-pill.filled {
  background: #B8F2C6;
  color: #14532D;
}

@media (max-width: 720px) {
  .bday-batch-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== Global Polish: Scroll Lock, Lightbox Zoom, A11y ==================== */
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

#lightboxImg {
  cursor: zoom-in;
  transition: transform 0.22s ease;
}

#lightboxImg.is-zoomed {
  cursor: zoom-out;
  transform: scale(1.65);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2.5px solid var(--accent-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== Install to Home Screen (PWA App) Modal ==================== */
.install-app-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #FFF6E3;
  border: 2px solid var(--ink);
  border-radius: 14px;
  margin-bottom: 14px;
}

.install-app-preview img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 2.2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  flex-shrink: 0;
}

.install-env-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: #17181C;
  color: #FFD23F;
}

.install-steps-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.install-steps-list code {
  background: #FFF0BE;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0 5px;
  font-weight: 900;
}

.install-tip-note,
.install-step-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.8px dashed var(--ink);
  background: #FFFDF8;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ==================== Route KeepAlive & Offscreen Paint Optimization ==================== */
.route-pane[hidden] {
  display: none !important;
}

.bro-card,
.gallery-photo-card,
.memory-card,
.quote-card,
.place-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}

/* ==================== Global Search, Memory Anchor Flash & Storage Cleaner ==================== */
.topbar-search-btn {
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border-radius: 10px;
  background: #FFFDF8;
  border: 2px solid var(--ink);
  font-size: 14px;
  box-shadow: 2px 2px 0 rgba(23, 24, 28, 0.85);
}

.topbar-search-btn:hover {
  background: #FFD23F;
}

.gsearch-results {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.gsearch-empty {
  text-align: center;
  padding: 20px 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.gsearch-group {
  display: grid;
  gap: 6px;
}

.gsearch-group-title {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.gsearch-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.8px solid var(--ink);
  background: #FAF6EE;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.12s ease, transform 0.1s ease;
}

.gsearch-row:hover {
  background: #FFD23F;
  transform: translateX(2px);
}

.gsearch-row img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.8px solid var(--ink);
  flex-shrink: 0;
}

.gsearch-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #FFFDF8;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.gsearch-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 900;
}

.gsearch-row small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.gsearch-row > span:last-child {
  margin-left: auto;
  font-weight: 900;
  color: var(--ink-soft);
}

@keyframes memoryFocusPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9), var(--shadow); border-color: #FF542E; }
  45% { box-shadow: 0 0 0 8px rgba(255, 210, 63, 0.35), var(--shadow); border-color: #FF542E; }
  100% { box-shadow: var(--shadow); border-color: var(--ink); }
}

.memory-focus-flash {
  animation: memoryFocusPulse 1.1s ease-in-out 2;
}

.orphan-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 12px;
  background: #FAF6EE;
  border: 1.8px solid var(--ink);
  border-radius: 10px;
  font-size: 13px;
}

/* Disciplined secondary card shadows & calmer visual hierarchy */
.bro-card,
.memory-card,
.gallery-photo-card,
.place-card,
.quote-card,
.map-stat-card {
  border-width: 2px;
  box-shadow: 3px 3px 0 rgba(23, 24, 28, 0.88);
}

.bro-card .bar-fill {
  background: var(--ink) !important;
}

.card-sticker-tag {
  background: #17181C;
  color: #FFD23F;
  border-width: 1.8px;
  font-size: 11px;
}

@media (max-width: 680px) {
  .topbar-search-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* ==================== Version History / Changelog ==================== */
.footer-version-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F4EFE3;
  border: 1.5px solid rgba(23, 24, 28, 0.32);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.footer-version-link:hover {
  background: #FFD23F;
  border-color: var(--ink);
}

.changelog-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #FAF6EE;
  border: 2px solid var(--ink);
  border-radius: 12px;
  margin-bottom: 12px;
}

.changelog-hero-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.changelog-current-ver {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFD23F;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.changelog-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.changelog-rule-item {
  padding: 8px 10px;
  background: #FFFDF8;
  border: 1.5px solid rgba(23, 24, 28, 0.22);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.changelog-rule-item strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  margin-bottom: 2px;
}

.changelog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-entry {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 3px 3px 0 rgba(23, 24, 28, 0.85);
}

.changelog-entry.level-major {
  border-left: 6px solid #FFD23F;
}

.changelog-entry.level-minor {
  border-left: 6px solid #17181C;
}

.changelog-entry.level-patch {
  border-left: 6px solid #9AA0A6;
}

.changelog-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.changelog-entry-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.changelog-ver-badge {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  background: #F4EFE3;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 2px 8px;
}

.changelog-level-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
}

.changelog-level-tag.major {
  background: #FFD23F;
  color: var(--ink);
}

.changelog-level-tag.minor {
  background: #FAF6EE;
  color: var(--ink);
}

.changelog-level-tag.patch {
  background: #F3F4F6;
  color: var(--ink-soft);
  border-color: rgba(23, 24, 28, 0.35);
}

.changelog-latest-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFDF8;
}

.changelog-entry-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 900;
  color: var(--ink);
}

.changelog-entry-summary {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.changelog-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.changelog-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.changelog-change-tag {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1.4px solid var(--ink);
  background: #FAF6EE;
  color: var(--ink);
}

.changelog-change-tag.feat {
  background: #FFF3C4;
}

.changelog-change-tag.perf {
  background: #EEF2FF;
}

.changelog-change-tag.fix {
  background: #FFE8E2;
}

.changelog-admin-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: #FAF6EE;
  border: 2px dashed rgba(23, 24, 28, 0.45);
  border-radius: 12px;
}

.changelog-admin-box > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
}

.changelog-bump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

@media (max-width: 600px) {
  .changelog-rules {
    grid-template-columns: 1fr;
  }
}

/* ==================== v1.1.0 Pre-Upload Crop, Prefill Edit & Sync Polish ==================== */
.sync-hint-banner {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #FAF6EE;
  border: 1.8px solid rgba(23, 24, 28, 0.45);
  border-left: 4px solid #FFD23F;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.edit-prefill-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #FFFDF8;
  border: 1.8px solid var(--ink);
  border-radius: 10px;
}

.edit-prefill-thumb {
  width: 64px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.8px solid var(--ink);
  flex-shrink: 0;
}

.edit-orig-snapshot {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #FAF6EE;
  border: 1.5px dashed rgba(23, 24, 28, 0.35);
  border-radius: 10px;
  font-size: 12.5px;
}

.edit-orig-snapshot > summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.edit-orig-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.edit-orig-story {
  margin-top: 4px;
  padding: 8px 10px;
  background: #FFFDF8;
  border: 1px solid rgba(23, 24, 28, 0.16);
  border-radius: 8px;
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
  color: var(--ink);
}

.preview-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: 1.8px solid var(--ink);
  background: #F4EFE3;
}

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

.preview-framed-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.85);
  color: #FFD23F;
  font-size: 10px;
  font-weight: 800;
}

.preview-item-tools {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: flex;
  gap: 4px;
}

.preview-tool-btn {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFDF8;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  cursor: pointer;
}

.preview-tool-btn:hover {
  background: #FFD23F;
}

.preview-tool-btn.rm {
  background: #17181C;
  color: #FFFDF8;
}

.preview-tool-btn.rm:hover {
  background: #FF542E;
}

.pending-single-preview {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #FFFDF8;
  border: 1.8px solid var(--ink);
  border-radius: 10px;
}

.pending-single-preview img {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.gsearch-row.is-kbd-active {
  background: #FFF3C4;
  border-color: var(--ink);
}

/* ==================== v1.2.0 Strict Login-Only Gate ==================== */
body.auth-gate-mode #topbar,
body.auth-gate-mode #siteFooter,
body.auth-gate-mode #mobileBottomNav,
body.auth-gate-mode #mobileMoreSheet,
body.auth-gate-mode #mobileMoreBackdrop,
body.auth-gate-mode #chatWidgetRoot,
body.auth-gate-mode #backToTopBtn {
  display: none !important;
}

body.auth-gate-mode .main-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-gate-wrap {
  width: min(440px, 100%);
}

.auth-gate-card {
  background: #FFFDF8;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 24px 22px 22px;
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-gate-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #FFD23F;
  border: 2.2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.auth-gate-title {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}

.auth-gate-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 700;
}

.auth-gate-notice {
  padding: 10px 12px;
  margin-bottom: 16px;
  background: #FAF6EE;
  border: 1.8px solid rgba(23, 24, 28, 0.35);
  border-left: 4px solid var(--ink);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.auth-gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-gate-tab {
  padding: 9px 10px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #FAF6EE;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.12s ease, color 0.12s ease;
}

.auth-gate-tab.active {
  background: var(--ink);
  color: #FFD23F;
}

.gate-pwd-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gate-pwd-row .input {
  flex: 1;
}

/* ==================== v1.3.0 Unarchived Photo Pool ==================== */
.gallery-view-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 12px;
  background: #FAF6EE;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.gallery-view-tab {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1.8px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.gallery-view-tab.active {
  background: var(--ink);
  color: #FFD23F;
  border-color: var(--ink);
}

.pool-intro-card {
  padding: 11px 14px;
  margin-bottom: 14px;
  background: #FAF6EE;
  border: 1.8px solid rgba(23, 24, 28, 0.35);
  border-left: 5px solid #FFD23F;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.pool-filter-toolbar {
  flex-direction: column;
  align-items: stretch !important;
  gap: 10px !important;
}

.pool-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pool-filter-lbl {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
  flex-shrink: 0;
}

.pool-batch-bar {
  position: sticky;
  top: 66px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: #FFF3C4;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

.pool-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pool-photo-card.pool-card-selected {
  border-color: #FF542E;
  box-shadow: 0 0 0 2px #FFD23F, 4px 4px 0 var(--ink);
}

.pool-check-btn {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pool-check-btn.is-checked {
  background: #FFD23F;
  border-color: var(--ink);
}

.pool-type-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.84);
  color: #FFFDF8;
  font-size: 11px;
  font-weight: 800;
}

.pool-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.pool-person-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: #FAF6EE;
  border: 1.2px solid rgba(23, 24, 28, 0.3);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.pool-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(23, 24, 28, 0.2);
}

.pool-card-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 5px 8px;
  font-size: 12px;
}

.pool-modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1.5px dashed rgba(23, 24, 28, 0.22);
}

.pool-modal-thumb-item {
  width: 78px;
  flex-shrink: 0;
  text-align: center;
}

.pool-modal-thumb-item img {
  width: 78px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.8px solid var(--ink);
  display: block;
}

.pool-modal-thumb-item span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pool-modal-tab {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: #FAF6EE;
  color: var(--ink);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}

.pool-modal-tab.active {
  background: var(--ink);
  color: #FFD23F;
}

@media (max-width: 680px) {
  .gallery-view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .gallery-view-tab {
    text-align: center;
    padding: 7px 8px;
    font-size: 13px;
  }
  .pool-batch-bar {
    top: 56px;
  }
}

/* ==========================================================================
   v2.0.0 Streamlined Interaction & Functional Zoning (Lively Tactile Zine Style)
   ========================================================================== */
:root {
  --bg: #F6F1E6;
  --bg-card: #FFFDF8;
  --ink: #17181C;
  --ink-soft: #4F5462;
  --muted: #767C8C;
  --line: #17181C;
  --line-soft: rgba(23, 24, 28, 0.14);
  --accent: #FF542E;
  --accent-2: #2B59FF;
  --mint: #00A87E;
  --gold: #FFD23F;
  --amber-bg: #FFF3BF;
  --shadow: 3px 3px 0 rgba(23, 24, 28, 0.90);
  --shadow-lg: 5px 5px 0 rgba(23, 24, 28, 0.90);
  --shadow-sm: 2px 2px 0 rgba(23, 24, 28, 0.88);
  --radius: 14px;
  --radius-sm: 10px;
}

/* Warm handcrafted paper texture (subtle, tactile, never flat gray) */
html, body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(23, 24, 28, 0.065) 1.15px, transparent 1.15px);
  background-size: 22px 22px;
}

/* Topbar: Clear separation of Browsing (center) & Actions (right), crisp zine warmth */
.topbar {
  background: #F8F4EA;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 2px 0 rgba(23, 24, 28, 0.06);
}

.topbar-inner {
  max-width: 1240px;
  padding: 9px 18px;
  gap: 12px;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: #FFD23F;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 17px;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.nav-links {
  gap: 3px;
}

.nav-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.8px solid transparent;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.nav-pill:hover {
  background: rgba(255, 210, 63, 0.30);
  color: var(--ink);
}

.nav-pill.active {
  background: var(--ink);
  color: #FFD23F;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 rgba(23, 24, 28, 0.28);
}

.topbar-studio-btn {
  background: #FFD23F;
  border: 1.8px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
}

.topbar-studio-btn:hover {
  background: #FFCA1F;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.topbar-studio-btn.active {
  background: var(--accent);
  color: #FFFDF8;
  border-color: var(--ink);
}

/* Tactile zine buttons with purposeful color hierarchy */
.btn {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 15px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-accent {
  background: var(--accent);
  color: #FFFDF8;
}

.btn-dark {
  background: var(--ink);
  color: #FFD23F;
}

.btn-gold {
  background: #FFD23F;
  color: var(--ink);
}

.btn-mint {
  background: #00A87E;
  color: #FFFDF8;
}

.btn-ghost {
  background: #FFFDF8;
  color: var(--ink);
}

.btn-ghost:hover {
  background: #FAF3E0;
}

.btn-danger {
  background: #E11D48;
  color: #FFFDF8;
}

/* Disciplined Tactile Cards (rich warmth + crisp ink edges, zero visual bloat) */
.panel-card,
.hero-panel,
.cinema-card,
.activity-card,
.home-fun-card,
.dialog-card,
.auth-gate-card,
.today-calendar-bar {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(23, 24, 28, 0.90);
}

/* Rich Dark Console Cartridge on Hero for strong visual anchor & lively contrast */
.hero-panel {
  padding: 24px 26px;
  gap: 22px;
  background: linear-gradient(135deg, #FFFDF8 0%, #FFF9EB 100%);
}

.hero-badge {
  background: #FFD23F;
  border: 1.8px solid var(--ink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
}

.cartridge-stats {
  background: #1B1D24;
  color: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 rgba(23, 24, 28, 0.35);
}

.cartridge-head {
  background: rgba(255, 255, 255, 0.06);
  color: #FFD23F;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
}

.stat-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.stat-tile .num {
  color: #FFD23F;
  font-weight: 900;
}

.stat-tile .lbl {
  color: rgba(255, 253, 248, 0.86);
  font-weight: 700;
}

.stat-tile.clickable:hover {
  background: rgba(255, 210, 63, 0.16);
  border-color: #FFD23F;
  transform: translateY(-2px);
}

/* Clear Home Functional Zone Headers */
.home-zone-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(23, 24, 28, 0.18);
}

.home-zone-kicker {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: #FFD23F;
  border: 1.8px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 2px 8px;
  border-radius: 7px;
}

.home-zone-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.home-zone-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* Cinema & Activity Feed: Rich contrast + lively highlights */
.cinema-head {
  background: #1B1D24;
  color: #FFFDF8;
  border-bottom: 2px solid var(--ink);
}

.cinema-head .mono {
  color: #FFD23F !important;
  font-weight: 800;
}

.activity-head {
  background: #FAF3E0;
  border-bottom: 2px solid var(--ink);
}

.activity-spotlight {
  background: #FFF3C4;
  color: var(--ink);
  border: 1.8px solid var(--ink);
  border-radius: 10px;
}

.activity-spotlight-tag {
  background: var(--ink);
  color: #FFD23F;
  border: none;
}

.activity-spotlight-text {
  color: var(--ink);
  font-weight: 800;
}

/* Zone 02: 2x2 Quick Shortcuts + Unified Roulette/Ledger Card */
.home-bottom-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.home-quick-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-strip-item {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 rgba(23, 24, 28, 0.88);
  padding: 13px 14px;
}

.quick-strip-item:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: 4.5px 4.5px 0 var(--ink);
  background: #FFF9EB;
}

.quick-strip-item .qs-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1.8px solid var(--ink);
  font-size: 18px;
  flex-shrink: 0;
  background: #FFF3C4;
}

.quick-strip-item:nth-child(1) .qs-ic { background: #DBEAFE; }
.quick-strip-item:nth-child(2) .qs-ic { background: #FEF3C7; }
.quick-strip-item:nth-child(3) .qs-ic { background: #D1FAE5; }
.quick-strip-item:nth-child(4) .qs-ic { background: #FFE4DE; }

.home-fun-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF9EC 100%);
}

.home-fun-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.8px dashed rgba(23, 24, 28, 0.22);
}

.home-fun-tabs {
  display: inline-flex;
  gap: 5px;
  background: #F2EBD9;
  padding: 3px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
}

.home-fun-tab {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1.5px solid transparent;
  background: transparent;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
}

.home-fun-tab.active {
  background: var(--ink);
  color: #FFD23F;
  border-color: var(--ink);
}

.home-fun-card .roulette-result {
  background: #FFFDF8;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

/* Restore Member Personal Accent Colors on Codex Stat Bars & Fun Sticker Personality */
.bro-card .bar-fill {
  background: var(--card-accent, var(--ink)) !important;
}

.card-sticker-tag {
  background: var(--ink);
  color: #FFD23F;
  border: 1.8px solid #FFFDF8;
  font-size: 11px;
  font-weight: 800;
  transform: rotate(-2deg);
}

/* Warm Sunny-Ivory Modal Headers (lively & clean, never harsh neon or sterile gray) */
.minimal-dialog-head {
  background: #FFF3C4;
  padding: 12px 18px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
}

@media (max-width: 900px) {
  .home-bottom-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    padding: 8px 12px;
  }
  .topbar-studio-btn {
    display: none;
  }
  .hero-panel {
    padding: 18px 16px;
  }
  .home-zone-desc {
    display: none;
  }
}


/* ==================== v2.6.0 Six New Interactive Community Features ==================== */

/* Shared crisp 2-tab switcher (Timeline/Capsules & Quotes/Playlist) */
.subpage-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #EFE7D5;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2.5px 2.5px 0 var(--ink);
  margin: 2px 0 14px;
  flex-wrap: wrap;
}

.subpage-tab {
  border: 1.8px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.subpage-tab:hover {
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
}

.subpage-tab.active {
  background: var(--ink);
  color: #FFD23F;
  border-color: var(--ink);
}

/* Feature 1: Topbar Bell & Notifications Center */
.topbar-notif-btn {
  position: relative;
  padding: 5px 9px !important;
  min-width: 34px;
  background: #FFFDF8;
  border: 1.8px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.topbar-notif-btn.has-unread {
  background: #FFF3C4;
}

.topbar-notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #FF542E;
  color: #FFFDF8;
  border: 1.6px solid var(--ink);
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
  line-height: 1;
}

.notif-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.notif-list {
  display: grid;
  gap: 8px;
}

.notif-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.8px solid var(--ink);
  background: #FFFDF8;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s ease, background 0.14s ease;
}

.notif-row.is-unread {
  background: #FFF7DF;
  box-shadow: 2.5px 2.5px 0 var(--ink);
}

.notif-row:hover {
  transform: translate(-1px, -1px);
  background: #FFF3C4;
}

.notif-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.6px solid var(--ink);
  background: #FFFDF8;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-msg {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.notif-time {
  font-size: 11px;
  color: var(--muted);
}

.notif-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #FF542E;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Feature 2: Polls & Gathering Voting */
.home-poll-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.home-poll-top strong {
  font-size: 14px;
}

.home-poll-sub {
  font-size: 12px;
  margin-bottom: 8px;
}

.poll-status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.poll-status-pill.open {
  background: #D1FAE5;
  color: #065F46;
}

.poll-status-pill.closed {
  background: #E5E7EB;
  color: #4B5563;
}

.poll-opt-list {
  display: grid;
  gap: 7px;
}

.poll-opt-list.compact {
  gap: 6px;
}

.poll-opt-btn {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1.8px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease, border-color 0.12s ease;
}

.poll-opt-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #FFF9EB;
}

.poll-opt-btn.picked {
  border-color: #17181C;
  box-shadow: 2px 2px 0 var(--ink);
}

.poll-opt-btn:disabled {
  cursor: default;
  opacity: 0.88;
}

.poll-opt-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 210, 63, 0.36);
  pointer-events: none;
  transition: width 0.25s ease;
}

.poll-opt-btn.picked .poll-opt-fill {
  background: rgba(0, 168, 126, 0.26);
}

.poll-opt-label,
.poll-opt-meta {
  position: relative;
  z-index: 1;
}

.poll-opt-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.polls-modal-list {
  display: grid;
  gap: 14px;
}

.poll-card {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 13px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}

.poll-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.poll-card-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 900;
}

.poll-card-desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.poll-opt-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.poll-voters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding-left: 4px;
}

.poll-voters-row span {
  background: #F4EDE0;
  border: 1px solid rgba(23, 24, 28, 0.22);
  border-radius: 999px;
  padding: 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.poll-card-actions {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px dashed rgba(23, 24, 28, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* Feature 3: Annual Report & Achievements Leaderboard */
.report-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.report-kpi {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 11px;
  padding: 9px 10px;
  text-align: center;
  box-shadow: 2.5px 2.5px 0 var(--ink);
}

.report-kpi:nth-child(odd) {
  background: #FFF7DF;
}

.rk-num {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.rk-lbl {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.report-awards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.award-card {
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 13px;
  box-shadow: 3px 3px 0 var(--ink);
}

.award-card:nth-child(1) { background: #FFFBEB; }
.award-card:nth-child(2) { background: #EFF6FF; }
.award-card:nth-child(3) { background: #FDF2F8; }
.award-card:nth-child(4) { background: #ECFDF5; }
.award-card:nth-child(5) { background: #FFF7ED; }
.award-card:nth-child(6) { background: #F5F3FF; }

.award-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.award-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.8px solid var(--ink);
  background: #FFFDF8;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.award-head h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 900;
}

.award-head small {
  font-size: 11.5px;
  color: var(--muted);
}

.award-rank-list {
  display: grid;
  gap: 6px;
}

.award-rank-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1.6px solid var(--ink);
  background: #FFFDF8;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.1s ease;
}

.award-rank-row.rank-1 {
  background: #FFD23F;
}

.award-rank-row:hover {
  transform: translate(-1px, -1px);
}

.award-rank-row img {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  border: 1.5px solid var(--ink);
}

.award-who {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.award-score {
  font-size: 12px;
  font-weight: 900;
}

/* Feature 4: Time Capsules */
.capsule-today-banner {
  margin: 12px 0 4px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: linear-gradient(90deg, #FFD23F 0%, #FFE88A 100%);
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
}

.capsule-banner-go {
  background: var(--ink);
  color: #FFD23F;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.capsule-group-head {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--ink);
}

.capsule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.capsule-card {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 3.5px 3.5px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capsule-card.unlocked {
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF7DF 100%);
}

.capsule-card.sealed {
  background: linear-gradient(160deg, #1E2028 0%, #2B2D3A 100%);
  color: #FFFDF8;
}

.capsule-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.capsule-status-tag {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-size: 11.5px;
  font-weight: 900;
}

.capsule-status-tag.unlocked {
  background: #D1FAE5;
  color: #065F46;
}

.capsule-status-tag.sealed {
  background: #FFD23F;
  color: #17181C;
}

.capsule-countdown-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.14);
  border: 1.4px solid rgba(255, 210, 63, 0.65);
  color: #FFD23F;
  font-size: 12px;
  font-weight: 800;
}

.capsule-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.capsule-meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  opacity: 0.9;
}

.capsule-letter-body {
  margin: 0;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1.6px dashed rgba(23, 24, 28, 0.28);
  background: #FFFDF8;
  font-size: 13.8px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.capsule-photo-wrap {
  border-radius: 11px;
  overflow: hidden;
  border: 1.8px solid var(--ink);
  cursor: zoom-in;
  max-height: 220px;
}

.capsule-photo-wrap img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.capsule-wax-seal {
  padding: 14px;
  border-radius: 12px;
  border: 1.6px dashed rgba(255, 210, 63, 0.48);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.wax-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FF542E;
  color: #FFFDF8;
  border: 1.6px solid #17181C;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.capsule-wax-seal p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 253, 248, 0.82);
}

.capsule-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Feature 5: 3-Column Calendar Strip & Countdown Manager */
.calendar-strip.calendar-strip-3 {
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
}

.cal-countdown-box {
  background: #ECFDF5 !important;
}

.cal-box-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cal-manage-btn {
  border: 1.4px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.cal-manage-btn:hover {
  background: #FFD23F;
}

.countdown-manage-list {
  display: grid;
  gap: 8px;
}

.countdown-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.8px solid var(--ink);
  background: #FFFDF8;
}

/* Feature 6: Shared Youth Playlist & Memory BGM Chips */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.song-card {
  background: linear-gradient(180deg, #FFFDF8 0%, #FAF5FF 100%);
  border: 2px solid var(--ink);
  border-radius: 15px;
  padding: 15px;
  box-shadow: 3.5px 3.5px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.song-disc {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #17181C;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 #FFD23F;
}

.song-title-wrap {
  flex: 1;
  min-width: 0;
}

.song-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

.song-story {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.song-memory-link {
  align-self: flex-start;
  border: 1.5px solid var(--ink);
  background: #FFF3C4;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.song-memory-link:hover {
  background: #FFD23F;
}

.song-card-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1.5px dashed rgba(23, 24, 28, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.memory-bgm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.memory-bgm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.6px solid var(--ink);
  background: #F3E8FF;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

.memory-bgm-chip:hover {
  background: #E9D5FF;
  transform: translateY(-1px);
}

@media (max-width: 1024px) {
  .calendar-strip.calendar-strip-3 {
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 720px) {
  .calendar-strip.calendar-strip-3 {
    grid-template-columns: 1fr;
  }
  .report-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-awards-grid {
    grid-template-columns: 1fr;
  }
  .home-fun-head {
    flex-wrap: wrap;
  }
  .home-fun-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .home-fun-tab {
    flex: 1;
    padding: 5px 6px;
    font-size: 12px;
    text-align: center;
  }
}


/* ==================== v2.2.0 UX Polish, High Contrast & Mobile Refinements ==================== */

/* Guarantee crisp dark ink contrast on every gold button across all pages */
.btn-gold {
  background: #FFD23F !important;
  color: #17181C !important;
}

/* Clearer closed vs open state on Topbar Group Chat button */
.topbar-chat-btn {
  background: #FFFDF8;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.topbar-chat-btn:hover {
  background: #FFF3C4;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.topbar-chat-btn .topbar-chat-count {
  color: #047857;
}

.topbar-chat-btn.is-open {
  background: #17181C;
  color: #FFD23F;
  box-shadow: 2px 2px 0 #FFD23F;
}

.topbar-chat-btn.is-open .topbar-chat-count {
  color: #FFD23F;
}

/* Slim Member Detail Toolbar + Collapsible More Menu */
.profile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-more-menu {
  position: relative;
}

.profile-more-menu summary {
  list-style: none;
  cursor: pointer;
}

.profile-more-menu summary::-webkit-details-marker {
  display: none;
}

.profile-more-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 6px;
  z-index: 60;
  display: grid;
  gap: 4px;
}

.profile-more-item {
  width: 100%;
  text-align: left;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.profile-more-item:hover {
  background: #FFF3C4;
  border-color: var(--ink);
}

.auth-gate-tip {
  margin-top: 4px;
  padding: 9px 12px;
  background: #FFF8E3;
  border: 1.6px dashed rgba(23, 24, 28, 0.35);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}

@media (max-width: 680px) {
  /* Make ALL 4 Studio tabs immediately visible in a neat 2x2 grid on mobile */
  .studio-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: visible !important;
    padding-bottom: 0;
  }

  .studio-tab {
    width: 100%;
    text-align: center;
    padding: 8px 6px;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Compact Hero on mobile so Today Calendar peeks into first viewport */
  .hero-panel {
    padding: 15px 14px;
    gap: 12px;
  }

  .hero-badge {
    font-size: 10.5px;
    padding: 3px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-desc {
    font-size: 13px;
    margin: 6px 0 10px;
  }

  .stat-grid {
    gap: 7px;
  }

  .stat-tile {
    padding: 8px 9px;
  }

  .stat-tile .num {
    font-size: 20px;
  }

  .profile-topbar {
    gap: 8px;
  }

  .profile-topbar-actions {
    gap: 6px;
  }

  .treat-hero-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}
