/* ==========================================================================
   Game Marketing Folder — v3 Unified Dark Kinetic Folder UI
   - Overall Dark Obsidian Theme (#090B11)
   - Rating-based Folder Covers:
       S = Prismatic Holographic Foil + Deep Violet-Black Flap
       A = Deep Indigo Flap + Electric Violet-Blue Gloss (Ref Image 2)
       B = Carbon Obsidian Flap + Frosted Ice-Silver Metallic (Ref Image 3)
   - Rating Tags:
       S = Prismatic Violet · A = Vivid Red · B = Vivid Blue
   - Reader & Masthead fully unified with Dark Folder glass grammar & spring motion
   ========================================================================== */

:root {
  --bg: #090b11;
  --bg-elevated: #111520;
  --bg-panel: #151a28;
  --bg-glass: rgba(13, 16, 25, 0.84);
  --surface-subtle: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --ink: #f3f5fa;
  --ink-soft: #b8c0d4;
  --ink-muted: #78829c;
  --border: rgba(255, 255, 255, 0.09);
  --border-bright: rgba(255, 255, 255, 0.18);

  /* Rating Folder Flap Surfaces */
  --flap-s: #120e24;
  --flap-s-deep: #090714;
  --flap-a: #111047;
  --flap-a-deep: #0a0930;
  --flap-b: #12151b;
  --flap-b-deep: #090b0f;
  --flap-x: #210d12;
  --flap-x-deep: #110709;

  /* Dark-mode-tuned Highlighters */
  --hl-yellow-bg: rgba(250, 204, 21, 0.22);
  --hl-yellow-ink: #fde047;
  --hl-yellow-border: rgba(250, 204, 21, 0.36);
  --hl-blue-bg: rgba(56, 189, 248, 0.18);
  --hl-blue-ink: #7dd3fc;
  --hl-blue-border: rgba(56, 189, 248, 0.36);
  --hl-red-bg: rgba(244, 63, 94, 0.22);
  --hl-red-ink: #fda4af;
  --hl-red-border: rgba(244, 63, 94, 0.4);
  --hl-search-bg: #facc15;
  --hl-search-ink: #090b11;

  --radius-card: 26px;
  --radius-md: 18px;
  --radius-sm: 11px;
  --shadow-folder: 0 18px 44px rgba(0, 0, 0, 0.48), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-folder-hover: 0 28px 64px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(168, 85, 247, 0.3);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter", "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.no-scroll { overflow: hidden; }
button, input, select { font-family: inherit; }
a { color: #60a5fa; text-decoration: none; }

/* Ambient subtle dark glow */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 68% 42% at 18% -6%, rgba(124, 58, 237, 0.16) 0%, transparent 65%),
    radial-gradient(ellipse 55% 38% at 84% 4%, rgba(56, 189, 248, 0.11) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 50% 105%, rgba(236, 72, 153, 0.08) 0%, transparent 70%);
}

/* ==========================================================================
   Keyframes (Prismatic Shimmer + Folder Spring Motion)
   ========================================================================== */
@keyframes prismFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes readerPop {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Dark Glass Masthead (Unified with Folder Aesthetic)
   ========================================================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 22px 12px;
  position: relative;
  z-index: 2;
}

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

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

.brand-index {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(56, 189, 248, 0.22));
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 4px 9px;
  border-radius: 9px;
  letter-spacing: 0.04em;
}

.brand-titles {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-dash { color: var(--ink-muted); font-weight: 400; }

.brand-sub {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover, .icon-btn.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.55);
  color: #fde047;
}

.icon-btn .star-icon { color: #fbbf24; }

.count-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}

/* ---------------- Search & Filter Row ---------------- */
.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 11px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 0 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(168, 85, 247, 0.72);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.search-ico { width: 18px; height: 18px; color: var(--ink-muted); flex-shrink: 0; }

.search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: #ffffff;
  padding: 10px 10px;
}
.search-input::placeholder { color: #6c7690; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 4px;
}

.search-clear {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { background: #ef4444; color: #fff; }

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border-bright);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.filter-toggle-btn:hover,
.filter-toggle-btn[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(59, 130, 246, 0.28));
  border-color: rgba(192, 132, 252, 0.6);
  color: #fff;
}

.active-dot {
  background: #f43f5e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}

/* ---------------- Quick Bar ---------------- */
.quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-tabs::-webkit-scrollbar { display: none; }

.q-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.q-tab:hover {
  background: var(--surface-hover);
  color: #fff;
}

.q-tab.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.16);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-s { background: linear-gradient(135deg, #c084fc, #38bdf8, #f472b6); box-shadow: 0 0 6px #c084fc; }
.dot-a { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.7); }

.hot-keywords {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hot-keywords::-webkit-scrollbar { display: none; }

.hot-label { font-size: 11.5px; color: var(--ink-muted); font-weight: 700; white-space: nowrap; }

.hot-chip {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.hot-chip:hover {
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.16);
}

/* ---------------- Advanced Dark Glass Filter Drawer ---------------- */
.adv-drawer {
  margin-top: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
  animation: cardEnter 0.22s ease;
}

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

.adv-group-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.adv-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.adv-group-head .adv-group-title { margin-bottom: 0; }
.adv-hint { font-size: 11.5px; color: var(--ink-muted); }

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

.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-soft);
}

.f-chip:hover { filter: brightness(1.18); transform: translateY(-1px); }
.f-chip.selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 14px rgba(255, 255, 255, 0.28);
  filter: brightness(1.15);
}
.f-chip .f-cnt { font-size: 11px; opacity: 0.78; }

.adv-tactics { padding-top: 12px; border-top: 1px solid var(--border); }

.adv-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-box { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.sort-box select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: var(--bg-panel);
  color: #fff;
  font-weight: 700;
}

.adv-actions { display: flex; gap: 8px; }

.btn-ghost {
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: #fff; color: #fff; }

.btn-solid {
  border: none;
  background: linear-gradient(135deg, #9333ea 0%, #4f46e5 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}
.btn-solid:hover { filter: brightness(1.12); }

/* ==========================================================================
   Main Container & Status Strip
   ========================================================================== */
.main-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 22px 64px;
  position: relative;
  z-index: 2;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--ink-soft);
}

.status-left strong { color: #ffffff; font-weight: 800; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.af-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #f3e8ff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* ==========================================================================
   DARK KINETIC CARD — FOLDER GRID
   S = Prismatic Holographic · A = Deep Indigo (Fig 2) · B = Carbon Ice (Fig 3)
   ========================================================================== */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.folder-card {
  position: relative;
  height: 418px;
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-folder);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.38s ease;
  user-select: none;
  background: #0d1018;
  animation: cardEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.folder-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-folder-hover);
}

/* Crisp Outer Specular Rim */
.folder-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  pointer-events: none;
  z-index: 6;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: border-color 0.3s ease;
}
.folder-card.theme-s::after { border-color: rgba(192, 132, 252, 0.45); }
.folder-card.theme-s:hover::after { border-color: rgba(232, 121, 249, 0.8); }
.folder-card.theme-a::after { border-color: rgba(129, 140, 248, 0.36); }
.folder-card.theme-b::after { border-color: rgba(186, 214, 236, 0.28); }

/* ---- Back Layer: Rating-Driven Glossy Peek Window ---- */
.folder-back {
  position: absolute;
  inset: 0 0 auto 0;
  height: 238px;
  z-index: 1;
  overflow: hidden;
}

/* Specular Diagonal Glass Sheen */
.folder-back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    114deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.05) 36%,
    rgba(255, 255, 255, 0.26) 52%,
    rgba(255, 255, 255, 0) 76%
  );
  pointer-events: none;
  z-index: 2;
}

/* S-Tier: Holographic Prismatic Iridescent Foil Cover */
.theme-s .folder-back,
.reader-hero-band.theme-s {
  background: linear-gradient(
    125deg,
    #7c3aed 0%,
    #a855f7 18%,
    #38bdf8 38%,
    #f472b6 58%,
    #c084fc 78%,
    #6366f1 100%
  );
  background-size: 220% 220%;
  animation: prismFlow 9s ease infinite;
}

/* S-Tier subtle holographic micro-prism grid overlay */
.theme-s .folder-back::before,
.reader-hero-band.theme-s::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 30%, rgba(253, 224, 71, 0.32) 0%, transparent 48%),
    radial-gradient(circle at 82% 20%, rgba(34, 211, 238, 0.36) 0%, transparent 50%),
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 10px);
  pointer-events: none;
  z-index: 1;
}

/* A-Tier: Ref Image 2 (Electric Violet-Blue Gloss) */
.theme-a .folder-back,
.reader-hero-band.theme-a {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 36%, #7c3aed 72%, #a855f7 100%);
}

/* B-Tier: Ref Image 3 (Frosted Ice-Silver Metallic) */
.theme-b .folder-back,
.reader-hero-band.theme-b {
  background: linear-gradient(135deg, #5d7e99 0%, #9fc0d6 44%, #deecf6 76%, #799ab3 100%);
}

/* X-Tier: Crimson Warning Gloss */
.theme-x .folder-back,
.reader-hero-band.theme-x {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 50%, #fb7185 100%);
}

.folder-back-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.folder-card:hover .folder-back-img { transform: scale(1.06); }

.folder-back-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 11, 17, 0.52) 0%, rgba(9, 11, 17, 0.14) 50%, rgba(9, 11, 17, 0.65) 100%);
  z-index: 2;
}

.folder-back-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 14px 16px 8px;
}

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

.folder-reveal-preview {
  position: relative;
  z-index: 3;
  padding: 6px 18px 0;
  color: #ffffff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-b .folder-reveal-preview:not(.on-photo) { color: #0f172a; }

.folder-card:hover .folder-reveal-preview {
  opacity: 1;
  transform: translateY(0);
}

.reveal-game-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.88;
  margin-bottom: 3px;
}

.reveal-hook-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.theme-b .folder-reveal-preview:not(.on-photo) .reveal-hook-text { text-shadow: none; }

/* ---- Front Layer: Stepped Curved Dark Folder Flap (Slides Down on Hover!) ---- */
.folder-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  bottom: -92px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.folder-card:hover .folder-flap { transform: translateY(72px); }

.flap-tab-svg {
  display: block;
  width: 100%;
  height: 36px;
  flex-shrink: 0;
}

.theme-s .flap-tab-path { fill: var(--flap-s); }
.theme-a .flap-tab-path { fill: var(--flap-a); }
.theme-b .flap-tab-path { fill: var(--flap-b); }
.theme-x .flap-tab-path { fill: var(--flap-x); }

.flap-body {
  flex: 1;
  margin-top: -1px;
  padding: 0 22px 108px;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

.theme-s .flap-body { background: linear-gradient(180deg, var(--flap-s) 0%, var(--flap-s-deep) 100%); }
.theme-a .flap-body { background: linear-gradient(180deg, var(--flap-a) 0%, var(--flap-a-deep) 100%); }
.theme-b .flap-body { background: linear-gradient(180deg, var(--flap-b) 0%, var(--flap-b-deep) 100%); }
.theme-x .flap-body { background: linear-gradient(180deg, var(--flap-x) 0%, var(--flap-x-deep) 100%); }

.flap-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: -22px;
  margin-bottom: 11px;
}

.flap-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.theme-s .flap-num {
  background: linear-gradient(135deg, #ffffff 30%, #e9d5ff 70%, #bae6fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.flap-arrow {
  width: 30px;
  height: 30px;
  margin-top: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  transition: transform 0.25s ease, color 0.25s ease;
}

.folder-card:hover .flap-arrow { transform: translate(3px, -3px); color: #fff; }

.flap-game-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.flap-title {
  margin: 0 0 9px;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.42;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flap-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.58;
  color: rgba(226, 232, 240, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
}

.search-snippet {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 9px;
  margin-bottom: 8px;
  line-height: 1.45;
  background: rgba(250, 204, 21, 0.12);
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.32);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-star-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(9, 11, 17, 0.45);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.14s ease;
}
.card-star-btn:hover { transform: scale(1.1); background: rgba(9, 11, 17, 0.85); }
.card-star-btn.saved { color: #fde047; border-color: #fde047; background: #141024; }

.peek-date, .photo-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(9, 11, 17, 0.54);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ==========================================================================
   UNIFIED DARK LUMINOUS PILLS (Rating Tags + Vivid Semantic Metadata Tags)
   ========================================================================== */
.v-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.38;
  white-space: nowrap;
  border: 1px solid transparent;
}

.v-pill.sm {
  font-size: 11px;
  padding: 2px 8px;
}

/* Strict Rating Tag Colors per User Spec:
   S = Prismatic Violet · A = Red · B = Blue */
.c-s {
  background: linear-gradient(125deg, #9333ea 0%, #6366f1 38%, #38bdf8 72%, #ec4899 100%);
  background-size: 180% 180%;
  animation: prismFlow 6s ease infinite;
  color: #ffffff;
  border-color: rgba(233, 213, 255, 0.65);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.c-a {
  background: linear-gradient(135deg, #f43f5e 0%, #dc2626 100%);
  color: #ffffff;
  border-color: rgba(254, 205, 211, 0.45);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.c-b {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: rgba(191, 219, 254, 0.45);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.c-x {
  background: linear-gradient(135deg, #991b1b 0%, #ea580c 100%);
  color: #ffffff;
  border-color: rgba(254, 215, 170, 0.4);
}

/* Luminous Dark-Glass Semantic Pills (High Clarity & Vibrant on Dark UI) */
.c-red    { background: rgba(239, 68, 68, 0.22);   color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }
.c-rose   { background: rgba(244, 63, 94, 0.2);    color: #fda4af; border-color: rgba(244, 63, 94, 0.42); }
.c-coral  { background: rgba(251, 113, 133, 0.22); color: #fecdd3; border-color: rgba(251, 113, 133, 0.48); }
.c-orange { background: rgba(249, 115, 22, 0.2);   color: #fdba74; border-color: rgba(249, 115, 22, 0.44); }
.c-amber  { background: rgba(245, 158, 11, 0.2);   color: #fcd34d; border-color: rgba(245, 158, 11, 0.44); }
.c-lime   { background: rgba(132, 204, 22, 0.18);  color: #bef264; border-color: rgba(132, 204, 22, 0.4); }
.c-green  { background: rgba(34, 197, 94, 0.2);    color: #86efac; border-color: rgba(34, 197, 94, 0.44); }
.c-mint   { background: rgba(16, 185, 129, 0.2);   color: #6ee7b7; border-color: rgba(16, 185, 129, 0.42); }
.c-teal   { background: rgba(20, 184, 166, 0.2);   color: #5eead4; border-color: rgba(20, 184, 166, 0.44); }
.c-cyan   { background: rgba(6, 182, 212, 0.2);    color: #67e8f9; border-color: rgba(6, 182, 212, 0.44); }
.c-sky    { background: rgba(56, 189, 248, 0.18);  color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); }
.c-blue   { background: rgba(59, 130, 246, 0.22);  color: #93c5fd; border-color: rgba(59, 130, 246, 0.45); }
.c-indigo { background: rgba(99, 102, 241, 0.22);  color: #a5b4fc; border-color: rgba(99, 102, 241, 0.45); }
.c-violet { background: rgba(139, 92, 246, 0.24);  color: #c4b5fd; border-color: rgba(139, 92, 246, 0.48); }
.c-purple { background: rgba(168, 85, 247, 0.22);  color: #d8b4fe; border-color: rgba(168, 85, 247, 0.45); }
.c-pink   { background: rgba(236, 72, 153, 0.22);  color: #f9a8d4; border-color: rgba(236, 72, 153, 0.45); }
.c-slate  { background: rgba(255, 255, 255, 0.08); color: #cbd5e1; border-color: rgba(255, 255, 255, 0.16); }

/* ==========================================================================
   Empty State & Footer
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-card);
}
.empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; color: #fff; }
.empty-state p { margin: 0 0 18px; font-size: 14px; color: var(--ink-muted); }

.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  font-size: 12px;
  color: var(--ink-muted);
  position: relative;
  z-index: 2;
}
.site-footer code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  color: #cbd5e1;
}

/* ==========================================================================
   DARK FOLDER READER OVERLAY (100% Unified with Card — Folder Style)
   ========================================================================== */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 8, 13, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.reader-overlay[hidden] { display: none; }

.reader-topbar {
  height: 58px;
  background: rgba(13, 16, 25, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-bright);
  background: var(--surface-subtle);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 6px 14px 6px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.reader-back:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); }

.reader-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tool-btn:hover { border-color: var(--border-bright); color: #fff; background: var(--surface-hover); }
.tool-btn.active { background: rgba(250, 204, 21, 0.16); border-color: rgba(250, 204, 21, 0.45); color: #fde047; }
.tool-btn.saved { background: rgba(250, 204, 21, 0.22); border-color: #fde047; color: #fde047; }

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 80px;
}

.reader-layout {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 28px;
  align-items: start;
}

/* Opened Folder Article Container */
.reader-article {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.65);
  animation: readerPop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Stepped Dark Folder Hero (ZERO badge overlap!) ---- */
.reader-hero-band {
  height: 86px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 28px 0;
  overflow: hidden;
}

.reader-hero-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.18) 56%, rgba(255, 255, 255, 0) 78%);
  pointer-events: none;
  z-index: 1;
}

.reader-hero-band > * { position: relative; z-index: 2; }

.reader-hero-step {
  display: block;
  width: 100%;
  height: 26px;
  margin-top: -25px;
  position: relative;
  z-index: 3;
}
.reader-hero-step path { fill: var(--bg-elevated); }

.reader-hero-content {
  padding: 4px 30px 26px;
  border-bottom: 1px solid var(--border);
}

.hero-top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-index-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  line-height: 1;
}

.reader-h1 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: #ffffff;
}

/* ---- Dark Glass Property Board (Vivid Semantic Tags) ---- */
.prop-board {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
}

.prop-row {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.prop-row:last-child { border-bottom: none; }

.prop-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}

.prop-val {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.prop-text { font-weight: 700; color: #f8fafc; }

.prop-intro {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.65;
  color: #cbd5e1;
}

.tactic-btn {
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}
.tactic-btn:hover { transform: translateY(-1px); filter: brightness(1.18); }
.tactic-btn.spot {
  background: #10b981 !important;
  color: #03221a !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.55);
}

.tactic-tip {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  width: 100%;
  margin-top: 2px;
}

/* ==========================================================================
   Reader Body Sections (Dark Modular Panels + Sub-Bullet Hierarchy)
   ========================================================================== */
.reader-body {
  padding: 26px 30px 38px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.r-sec { scroll-margin-top: 20px; }

.sec-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
}

.sec-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 2px 8px;
  border-radius: 7px;
}

.sec-sub-note {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* 01 Pain Points */
.pain-box {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.26);
  border-left: 4px solid #f43f5e;
  border-radius: 14px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.75;
  color: #e2e8f0;
}

.pain-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.pain-lead {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.38);
  padding: 2px 9px;
  border-radius: 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.pain-desc {
  flex: 1;
  min-width: 220px;
  color: #e2e8f0;
}

/* 02 Marketing Content Details (Stage Block -> Subheading Card -> Bullet Rows) */
.detail-blocks {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
}

.detail-block-title {
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 900;
  color: #ffffff;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 9px;
}

.detail-block-title::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a855f7 0%, #38bdf8 100%);
  flex-shrink: 0;
}

.detail-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-item {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 15px 18px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.detail-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.detail-item.tactic-spotlit {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

.item-subhead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.42;
}

.item-step-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #e9d5ff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.item-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: #cbd5e1;
}

/* Sub-Bullet List inside each Subheading Card */
.item-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.item-bullet {
  position: relative;
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.82;
  color: #cbd5e1;
}

.item-bullet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c084fc, #38bdf8);
}

.bullet-lead {
  color: #f8fafc;
  font-weight: 800;
}

/* 03 Results & Sentiment */
.results-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-left: 4px solid #38bdf8;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 1.84;
  color: #e2e8f0;
  white-space: pre-line;
}

/* 04 Takeaways & Boundaries */
.takeaway-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
}

.tk-card {
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.8;
  color: #e2e8f0;
  white-space: pre-line;
}
.tk-card h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 800; }

.tk-good { background: rgba(16, 185, 129, 0.09); border: 1px solid rgba(16, 185, 129, 0.3); }
.tk-good h4 { color: #6ee7b7; }

.tk-warn { background: rgba(249, 115, 22, 0.09); border: 1px solid rgba(249, 115, 22, 0.3); }
.tk-warn h4 { color: #fdba74; }

/* 05 Screenshots (Positioned right before Related Links) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gallery-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  cursor: zoom-in;
  background: #090b11;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.gallery-thumb:hover {
  transform: translateY(-3px);
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

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

/* 06 Related Links Grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  transition: all 0.16s ease;
}

.link-card:hover {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.link-source-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  flex-shrink: 0;
}
.link-source-badge.src-x  { background: #000000; border: 1px solid rgba(255, 255, 255, 0.22); }
.link-source-badge.src-yt { background: #dc2626; }
.link-source-badge.src-4g { background: #2563eb; }
.link-source-badge.src-df { background: #ea580c; }
.link-source-badge.src-fm { background: #e11d48; }
.link-source-badge.src-au { background: #0d9488; }

.link-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
  color: #e2e8f0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Inline Links & Dark-Mode Highlighters */
.inline-link {
  color: #60a5fa;
  font-weight: 700;
  border-bottom: 1.5px solid rgba(96, 165, 250, 0.42);
  padding: 0 2px 1px;
  border-radius: 3px;
  transition: background 0.14s ease, color 0.14s ease;
}
.inline-link:hover { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
.inline-link::after { content: "↗"; font-size: 0.78em; margin-left: 2px; opacity: 0.8; }

mark.hl-yellow {
  background: var(--hl-yellow-bg);
  color: var(--hl-yellow-ink);
  border: 1px solid var(--hl-yellow-border);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

mark.hl-blue {
  background: var(--hl-blue-bg);
  color: var(--hl-blue-ink);
  border: 1px solid var(--hl-blue-border);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

mark.hl-red {
  background: var(--hl-red-bg);
  color: var(--hl-red-ink);
  border: 1px solid var(--hl-red-border);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

mark.hl-search {
  background: var(--hl-search-bg);
  color: var(--hl-search-ink);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 800;
}

.hl-hash {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.35);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.93em;
}

.no-auto-hl mark.hl-yellow,
.no-auto-hl mark.hl-blue,
.no-auto-hl mark.hl-red,
.no-auto-hl .hl-hash {
  background: transparent !important;
  color: inherit !important;
  border: none !important;
  padding: 0 !important;
  font-weight: inherit !important;
}

/* ==========================================================================
   Rich Inline Visual Components: Tables, Inline Figures, Causal Flows, Compare
   ========================================================================== */
.md-table-wrap {
  margin: 12px 0 4px;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(9, 11, 17, 0.55);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.65;
  text-align: left;
}

.md-table th {
  background: rgba(124, 58, 237, 0.16);
  color: #e9d5ff;
  font-weight: 800;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(192, 132, 252, 0.25);
  white-space: nowrap;
}

.md-table td {
  padding: 10px 13px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.md-table tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* Inline Embedded Screenshot Figure */
.inline-figure {
  margin: 14px 0 4px;
  background: rgba(9, 11, 17, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.inline-figure:hover {
  border-color: rgba(192, 132, 252, 0.65);
  transform: translateY(-1px);
}

.inline-figure img {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  background: #090b11;
}

.inline-figure figcaption {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inline-figure figcaption span.fig-zoom {
  font-size: 11px;
  color: #93c5fd;
  white-space: nowrap;
}

/* Visual Causal Flow Diagram (:::flow) */
.causal-flow {
  margin: 14px 0 6px;
  background: rgba(9, 11, 17, 0.55);
  border: 1px solid rgba(192, 132, 252, 0.24);
  border-radius: 14px;
  padding: 14px 16px;
}

.visual-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #e9d5ff;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.flow-node {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.025) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-step-idx {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #a5b4fc;
  letter-spacing: 0.04em;
}

.flow-node-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.38;
}

.flow-node-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.55;
  flex: 1;
}

.flow-node-metric {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  color: #7dd3fc;
}

/* Visual Cultural / Strategy Comparison Card (:::compare) */
.compare-box {
  margin: 14px 0 6px;
  background: rgba(9, 11, 17, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 14px;
  padding: 14px 16px;
}

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

.compare-col {
  border-radius: 12px;
  padding: 13px 15px;
}

.compare-col.col-left {
  background: rgba(244, 63, 94, 0.09);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.compare-col.col-right {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.32);
}

.compare-col-head {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 8px;
}
.col-left .compare-col-head  { color: #fda4af; }
.col-right .compare-col-head { color: #93c5fd; }

.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #dbe3f0;
}

.compare-list li {
  position: relative;
  padding-left: 12px;
}
.compare-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  opacity: 0.7;
}

.compare-solution {
  margin-top: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.36);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #d1fae5;
}

.compare-solution-head {
  font-size: 12.5px;
  font-weight: 800;
  color: #6ee7b7;
  margin-bottom: 4px;
}

/* Structured Takeaway Numbered Items */
.tk-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.tk-item {
  background: rgba(9, 11, 17, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13.8px;
  line-height: 1.75;
  color: #e2e8f0;
}

.tk-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.tk-num-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  flex-shrink: 0;
}

.tk-warn .tk-num-pill {
  background: rgba(249, 115, 22, 0.25);
  color: #fdba74;
}

@media (max-width: 700px) {
  .compare-cols { grid-template-columns: 1fr; }
}

/* ---------------- Desktop Floating Dark Glass TOC ---------------- */
.reader-toc { position: sticky; top: 0; }

.toc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-folder);
}

.toc-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.toc-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.toc-links button {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.toc-links button:hover { background: var(--surface-hover); color: #ffffff; font-weight: 800; }

.toc-legend {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

/* ---------------- Mobile Sticky Dark Bottom Dock ---------------- */
.mobile-dock {
  display: none;
  background: rgba(13, 16, 25, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.mobile-dock::-webkit-scrollbar { display: none; }

.mobile-dock button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.mobile-dock button:active { background: #7c3aed; color: #fff; border-color: #a855f7; }

/* ---------------- Lightbox & Toast ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 6, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }

.lb-stage { margin: 0; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-stage img { max-width: 90vw; max-height: 78vh; border-radius: 12px; object-fit: contain; border: 1px solid var(--border); }
.lb-stage figcaption { color: rgba(255, 255, 255, 0.78); font-size: 13px; }

.lb-close, .lb-nav {
  position: fixed;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lb-close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 28px; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: rgba(21, 26, 40, 0.96);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1080px) {
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .reader-layout { grid-template-columns: minmax(0, 1fr); }
  .reader-toc { display: none; }
  .mobile-dock { display: flex; }
}

@media (max-width: 700px) {
  .masthead-inner { padding: 10px 14px 8px; }
  .brand-title { font-size: 16px; }
  .brand-sub, .sync-pill, .icon-btn .btn-label, .search-kbd { display: none; }
  .search-input { font-size: 14px; padding: 9px 6px; }
  .filter-toggle-btn { padding: 0 12px; font-size: 13px; }
  .adv-grid { grid-template-columns: 1fr; }
  .main-wrap { padding: 14px 12px 48px; }

  .folder-grid { grid-template-columns: 1fr; gap: 18px; }
  .folder-card { height: 398px; }
  .folder-card:hover .folder-flap { transform: translateY(58px); }

  .reader-scroll { padding: 12px 10px 26px; }
  .reader-hero-band { height: 76px; padding: 12px 16px 0; }
  .reader-hero-content { padding: 4px 16px 18px; }
  .reader-h1 { font-size: 19px; }
  .prop-board { padding: 4px 12px; }
  .prop-row { grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 8px 0; }
  .prop-label { font-size: 12px; }

  .reader-body { padding: 18px 16px 26px; gap: 20px; }
  .detail-block { padding: 14px; }
  .detail-item { padding: 12px 13px; }
  .takeaway-grid, .links-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .reader-back span { display: none; }
  .reader-back { padding: 6px 8px; }
  .tool-btn { font-size: 12px; padding: 5px 8px; }
}
