/* ==========================================================================
   English Reading Platform - Main Design System & Layout
   Philosophy: Modern Minimalist, Editorial, Distraction-Free.
   Strict rules: NO gradients, NO stroked card backgrounds, NO AI-glow styling.
   ========================================================================== */

:root {
  /* Colors - Light Theme (Default: Clean Warm Off-White / Slate) */
  --bg-primary: #f8f8f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0ec;
  --bg-hover: #e8e8e3;
  
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #888888;
  
  --accent: #1e3a8a; /* Refined deep navy */
  --accent-light: #e0e7ff;
  --accent-text: #ffffff;
  
  --badge-bg: #eaeaea;
  --badge-text: #333333;

  --success-bg: #edf7ed;
  --success-text: #1e4620;
  --error-bg: #fde8e8;
  --error-text: #9b1c1c;

  /* Typography */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Merriweather", "Georgia", "Cambria", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-dyslexic: "Comic Sans MS", "Chalkboard SE", sans-serif;

  /* Spacing & Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  --max-width: 1540px;
  --reader-width: 740px;
}

/* Sepia Theme (Warm Paper) */
[data-theme="sepia"] {
  --bg-primary: #f4ecd8;
  --bg-secondary: #faf4e6;
  --bg-tertiary: #ece2cb;
  --bg-hover: #e2d7be;
  
  --text-primary: #2d261e;
  --text-secondary: #5e5243;
  --text-muted: #8c7d6b;
  
  --accent: #6d4c41;
  --accent-light: #ded0c3;
  --accent-text: #ffffff;
  
  --badge-bg: #e6dac2;
  --badge-text: #3c3226;

  --success-bg: #e2eed6;
  --success-text: #2c4a1e;
  --error-bg: #fae1dd;
  --error-text: #782a22;
}

/* Dark Theme (Minimal Zinc) */
[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-hover: #2e2e2e;
  
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  
  --accent: #3b82f6;
  --accent-light: #1e293b;
  --accent-text: #ffffff;
  
  --badge-bg: #282828;
  --badge-text: #cccccc;

  --success-bg: #14331a;
  --success-text: #86efac;
  --error-bg: #3c1618;
  --error-text: #fca5a5;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
.site-header {
  background-color: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.brand-icon svg {
  display: block;
  vertical-align: middle;
}

.brand-name {
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

.nav-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
}



/* Header Daily Streak Pill */
.header-streak-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .header-streak-pill {
  border-color: rgba(255, 255, 255, 0.08);
}

.header-streak-pill:hover {
  transform: translateY(-1px);
  background-color: var(--bg-secondary);
  border-color: #f97316;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.18);
}

.header-streak-pill.active-today .streak-icon {
  animation: flamePulse 2.2s infinite ease-in-out;
}

.header-streak-pill.pending-today {
  border-color: rgba(217, 119, 6, 0.35);
  background-color: rgba(217, 119, 6, 0.08);
}

.header-streak-pill.pending-today .streak-icon {
  animation: flamePulse 2.4s infinite ease-in-out;
}

.header-streak-pill.pending-today .streak-value {
  color: #d97706;
}

@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.header-streak-pill .streak-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.header-streak-pill .streak-value {
  font-weight: 800;
  color: #ea580c;
}

[data-theme="dark"] .header-streak-pill .streak-value {
  color: #fb923c;
}

/* Header Search Bar */
.header-search-wrapper {
  position: relative;
  width: 220px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-search-wrapper:focus-within {
  width: 280px;
}

.header-search-input {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.42rem 0.85rem 0.42rem 2.1rem;
  border-radius: var(--radius-full);
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search-input::placeholder {
  color: var(--text-muted);
}

.header-search-input:focus {
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-search-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Theme Switcher Header Buttons */
.theme-switch-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-full);
}

.theme-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.theme-btn:hover {
  color: var(--text-primary);
  transform: scale(1.06);
}

.theme-btn.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* View Sections */
.view-section {
  display: none;
}

.view-section.active-view {
  display: block;
}

/* Generic View Headers & Subtitles */
.view-header {
  margin-bottom: 2.25rem;
}

.view-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

.view-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.stats-container,
.vocab-hub-container,
.wordbank-container,
.practice-hub-container,
.practice-session-container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

/* Search Bar in Toolbar */
.search-wrapper {
  position: relative;
  min-width: 260px;
}

.search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  border-radius: var(--radius-full);
  outline: none;
}

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

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ==========================================================================
   Catalog 3-Column Editorial Layout & Side Navigation Menus
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 205px 1fr 270px;
  gap: 1.75rem;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.75rem 0.25rem;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: left;
}

.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

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

.sidebar-item:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-item.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sidebar-item.active .sidebar-icon {
  color: var(--text-primary);
}

.sidebar-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  background-color: var(--bg-tertiary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.sidebar-item.active .sidebar-count {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cat-biography { background-color: #3b82f6; }
.cat-history { background-color: #eab308; }
.cat-science { background-color: #10b981; }
.cat-technology { background-color: #8b5cf6; }
.cat-business { background-color: #06b6d4; }
.cat-sports { background-color: #f97316; }
.cat-art { background-color: #ec4899; }
.cat-culture { background-color: #14b8a6; }

.catalog-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.catalog-heading-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.catalog-active-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.catalog-results-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Full-Image Hero Spotlight Carousel
   ========================================================================== */
.hero-spotlight-wrapper {
  margin-bottom: 2rem;
}

.hero-carousel-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-color: #0b0f19;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.25);
  isolation: isolate;
  transform: translateZ(0);
}

.hero-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1);
  transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-slide.active .hero-bg-image {
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.92) 100%),
              linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 50%, transparent 100%);
  pointer-events: none;
}

.hero-slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 2.25rem 2.5rem;
  max-width: 650px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #ffffff;
}

.hero-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hero-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.hero-category-tag {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 500;
}

.hero-category-tag strong {
  color: #ffffff;
  font-weight: 600;
}

.hero-slide-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin: 0;
}

.hero-slide-summary {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.55;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-slide-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.hero-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.hero-read-btn:hover {
  transform: translateY(-1px);
  background-color: #f1f5f9;
}

.hero-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-save-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-save-btn.active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(0, 0, 0, 0.75);
}

.hero-nav-arrow {
  position: absolute;
  top: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  opacity: 0.85;
}

.hero-nav-arrow.prev {
  right: 3.85rem;
  left: auto;
}

.hero-nav-arrow.next {
  right: 1.25rem;
}

.hero-nav-arrow:hover {
  opacity: 1;
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-dots-indicator {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  z-index: 5;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hero-dot.active {
  width: 22px;
  background: #ffffff;
}

/* ==========================================================================
   Right Sidebar: Recently Added Stories
   ========================================================================== */
.catalog-aside {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.aside-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.aside-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.aside-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.aside-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
}

.recent-stories-list {
  display: flex;
  flex-direction: column;
}

.recent-story-item {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 0.75rem;
  align-items: center;
  cursor: pointer;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--bg-tertiary);
  transition: opacity 0.15s ease;
}

.recent-story-item:last-child {
  border-bottom: none;
  padding-bottom: 0.15rem;
}

.recent-story-item:hover {
  opacity: 0.82;
}

.recent-story-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.recent-story-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.recent-story-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-story-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.recent-story-thumb {
  width: 58px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: var(--bg-tertiary);
}

@media (max-width: 1240px) {
  .catalog-layout {
    grid-template-columns: 210px 1fr;
    gap: 1.75rem;
  }
  .catalog-aside {
    display: none;
  }
}

@media (max-width: 960px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .catalog-aside {
    display: none;
  }
  .catalog-sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    gap: 1rem;
  }
  .sidebar-section {
    flex-direction: row;
    align-items: center;
  }
  .sidebar-heading {
    display: none;
  }
  .sidebar-menu {
    flex-direction: row;
  }
  .sidebar-item {
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    background-color: var(--bg-secondary);
  }
  .hero-carousel-container {
    height: 320px;
  }
  .hero-slide-content {
    padding: 1.5rem;
    max-width: 100%;
  }
  .hero-slide-title {
    font-size: 1.4rem;
  }
  .hero-dots-indicator {
    display: none;
  }
}

/* ==========================================================================
   Articles Grid & Cards
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1380px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  background-color: var(--bg-secondary);
}

.card-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Card Floating Bookmark Button */
.card-bookmark-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  z-index: 4;
}

.card-bookmark-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.8);
}

.card-bookmark-btn.active {
  color: #f59e0b;
  background: rgba(0, 0, 0, 0.8);
}

.card-body {
  padding: 1rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.card-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.card-category-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.card-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
}

.card-progress-dots {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}

.card-pdot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background-color: #cbd5e1;
}

[data-theme="dark"] .card-pdot {
  background-color: #4b5563;
}

.card-pdot.done {
  background-color: #10b981;
}

.card-mastery-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .card-mastery-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.card-category-label strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0;
}

.card-summary {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.35rem;
}

/* Common Button Styles */
.btn {
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

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

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
}

.btn-mastered {
  background-color: var(--success-bg);
  color: var(--success-text);
}

/* Empty States */
.empty-results-box,
.empty-flashcards-box {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  grid-column: 1 / -1;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.empty-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* Production-Ready Site Footer (Minimal Editorial, NO gradients, NO strokes) */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--bg-tertiary);
  padding: 3.5rem 1.5rem 2rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col-brand {
  padding-right: 1.5rem;
}

.footer-brand {
  margin-bottom: 0.85rem;
  display: inline-flex;
}

.footer-description {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.footer-privacy-note {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-static-item {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-bottom-bar {
  padding-top: 1.5rem;
  border-top: 1px solid var(--bg-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-badge-clean {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 680px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .catalog-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrapper {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   Standalone Informational Pages (About, Cookies, Privacy, Terms, Contact)
   ========================================================================== */

.page-doc-view {
  max-width: var(--reader-width);
  margin: 0 auto;
}

.doc-container {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.doc-top-bar {
  margin-bottom: 1.5rem;
}

.doc-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.doc-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.doc-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.doc-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.doc-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.doc-body ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.doc-body li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

.doc-body code {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* Contact Page Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

.contact-info-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.contact-info-panel p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

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

.contact-point {
  background-color: var(--bg-tertiary);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-point strong {
  color: var(--text-primary);
}

.contact-point span {
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background-color: var(--bg-primary);
  border-color: var(--text-primary);
}

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

.form-submit-btn {
  align-self: flex-start;
  padding: 0.75rem 1.75rem;
}

.contact-success-box {
  background-color: var(--success-bg);
  color: var(--success-text);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  animation: fadeInPop 0.2s ease;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .doc-container {
    padding: 1.75rem 1.25rem;
  }
}

/* ==========================================================================
   Full-Screen Profile & Settings Views
   ========================================================================== */
.profile-page-container {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.settings-page-container {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.page-top-nav {
  margin-bottom: 1.5rem;
}

/* Profile Screen Content */
.profile-screen-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--bg-tertiary);
  box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.04);
}

.profile-user-card {
  padding: 1.75rem 2rem;
}

.profile-user-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.profile-avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: inline-flex;
}

.profile-avatar-large {
  width: 76px;
  height: 76px;
  min-width: 76px;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--accent-text);
  font-size: 1.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--bg-tertiary);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.profile-avatar-large:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.profile-avatar-initial {
  line-height: 1;
}

.profile-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Always-visible camera badge */
.profile-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 2px solid var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.profile-avatar-wrapper:hover .profile-avatar-badge,
.profile-avatar-badge:hover {
  transform: scale(1.1);
  background-color: var(--accent);
  color: var(--accent-text);
}

.profile-avatar-remove-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.profile-avatar-remove-btn:hover {
  color: #ef4444;
  text-decoration: underline;
}

.profile-user-info {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.profile-user-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.profile-edit-name-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.profile-edit-name-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Name Edit Form */
.profile-name-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.profile-name-input {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  max-width: 220px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.profile-name-form-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.profile-auth-actions {
  flex-shrink: 0;
}

/* Metrics Section */
.profile-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.profile-stat-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

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

/* Settings Screen Card */
.settings-screen-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  border: 1px solid var(--bg-tertiary);
  box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.settings-group:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.settings-group-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-select {
  cursor: pointer;
  height: 34px;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

/* Settings Multi-Column Grids */
.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: flex-start;
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}

.settings-field .settings-segmented-row {
  width: 100%;
}

.settings-field .settings-segmented-row button {
  height: 28px;
  font-size: 0.75rem;
}

/* Settings Page Theme Selector - Fills equal column with matching height */
#settings-page-theme-row {
  width: 100%;
  max-width: 100%;
}

#settings-page-theme-row .theme-btn {
  height: 28px;
  font-size: 0.75rem;
}

/* Settings Toggle Switch */
.settings-toggle-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.settings-field-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
  line-height: 1.4;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-tertiary);
  transition: all 0.2s ease;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.settings-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  transition: all 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.settings-switch input:checked + .settings-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.settings-switch input:checked + .settings-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Settings Danger Box */
.settings-danger-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background-color: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  gap: 1.25rem;
}

.danger-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ef4444;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 0.55rem 1rem;
  font-size: 0.86rem;
  white-space: nowrap;
}

.btn-outline-danger:hover:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.08);
}

/* Reset Confirmation Modal */
.reset-modal-box {
  max-width: 420px;
  text-align: center;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reset-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.reset-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.reset-modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.reset-modal-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.reset-modal-actions .btn {
  flex: 1;
}

.settings-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.settings-saved-indicator {
  font-size: 0.88rem;
  font-weight: 600;
  color: #10b981;
}

@media (max-width: 768px) {
  .profile-user-card {
    padding: 1.5rem 1.25rem;
  }
  .profile-user-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1rem;
  }
  .profile-name-row,
  .profile-name-form {
    justify-content: center;
  }
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-screen-card {
    padding: 1.5rem 1.25rem;
  }
  .settings-grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .settings-grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Photo Crop Modal (X / Twitter Style) */
#modal-crop-photo {
  z-index: 2000;
}

.crop-modal-box {
  max-width: 440px;
  width: 92%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  border: 1px solid var(--bg-tertiary);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  user-select: none;
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.crop-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.crop-modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.crop-modal-close-btn:hover {
  color: var(--text-primary);
}

.crop-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.crop-stage {
  position: relative;
  width: 320px;
  height: 320px;
  background-color: #0b0f19;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crop-stage:active {
  cursor: grabbing;
}

#crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}

/* Circular Cutout Mask: dark backdrop with 250px clear circular hole */
.crop-mask-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.crop-controls-row {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.crop-zoom-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

#crop-zoom-slider {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  accent-color: var(--accent);
  cursor: pointer;
}

.crop-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-tertiary);
  width: 100%;
}

@media (max-width: 480px) {
  .crop-stage {
    width: 270px;
    height: 270px;
  }
  .crop-mask-circle {
    width: 210px;
    height: 210px;
  }
}

/* Share Button in Reader Bar */
.reader-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--bg-tertiary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reader-share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Profile Placement & Danger Cards */
.profile-placement-card {
  margin-top: 1rem;
  border-left: 4px solid var(--accent);
}

.profile-placement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-placement-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.profile-danger-card {
  margin-top: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.02);
}

.profile-danger-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-danger-heading {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ef4444;
  margin: 0 0 0.35rem;
}

.profile-danger-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Placement Quiz Modal */
.placement-modal-box {
  max-width: 520px;
  width: 92%;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  background-color: var(--bg-secondary);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--bg-tertiary);
}

.placement-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.placement-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.placement-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.placement-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.placement-target-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  color: var(--accent);
}

.placement-progress-bar {
  height: 6px;
  background-color: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.placement-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.placement-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
}

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

.placement-option-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.placement-option-btn:hover {
  border-color: var(--accent);
  background-color: var(--bg-tertiary);
  transform: translateX(3px);
}

.placement-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* Placement Quiz Results */
.placement-results-card {
  text-align: center;
  padding: 0.5rem 0;
}

.placement-celebrate-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.placement-results-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.placement-results-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.placement-level-hero {
  background: var(--bg-primary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.placement-level-pill {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.35rem 1.25rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.placement-level-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.placement-level-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.placement-results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Share Article Modal */
.share-modal-box {
  max-width: 440px;
  width: 92%;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background-color: var(--bg-secondary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-tertiary);
}

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

.share-link-input-wrap {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.share-link-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.share-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.share-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-tertiary);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-social-btn:hover {
  background: var(--bg-tertiary);
}

