/* ══════════════════════════════════════════════════════════════
   SPPUVault — High-End Editorial Product UI
   Authoritative, High-Contrast, Professional Architecture
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Lexend';
  src: url('/fonts/Lexend-Variable.ttf') format('truetype-variations'),
       url('/fonts/Lexend-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  /* Editorial Deep Obsidian (Default) */
  --bg: #090a0d;
  --bg-subtle: #0f1117;
  --surface: #13151c;
  --surface-hover: #191c25;
  --surface2: #161922;
  --surface-subtle: #101218;
  
  --border: #222631;
  --border-light: #191c24;
  --border-hover: #373e4f;
  
  /* Restrained Engineering Accent: Architectural Royal Blue */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.28);
  --accent-text: #60a5fa;
  
  /* Crisp Typography */
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  
  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Geometry & Elevation */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  
  --nav-bg: rgba(9, 10, 13, 0.94);
  --mobile-nav-bg: #0f1117;
  --nav-height: 60px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-subtle: #f4f5f7;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface2: #f1f3f7;
  --surface-subtle: #fbfcfd;
  
  --border: #e2e8f0;
  --border-light: #edf0f5;
  --border-hover: #cbd5e1;
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.06);
  --accent-border: rgba(37, 99, 235, 0.22);
  --accent-text: #1d4ed8;
  
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.08);
  
  --nav-bg: rgba(250, 250, 250, 0.96);
  --mobile-nav-bg: #ffffff;
}

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

html {
  scroll-behavior: smooth;
  max-width: 100vw;
  overflow-x: hidden;
  font-size: 16px;
}

body {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lexend', -apple-system, sans-serif;
  color: var(--text);
  letter-spacing: -0.035em;
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ── BUTTON STYLES ── */
.btn-primary,
.btn-download,
.btn-premium,
.pwa-btn-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--accent);
  color: #ffffff !important;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Lexend', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-primary:hover,
.btn-download:hover,
.btn-premium:hover,
.pwa-btn-install:hover {
  background: var(--accent-hover);
}

.btn-ghost,
.btn-view,
.back-btn,
.pwa-btn-later {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Lexend', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ghost:hover,
.btn-view:hover,
.back-btn:hover,
.pwa-btn-later:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-primary:active,
.btn-download:active,
.btn-premium:active,
.btn-ghost:active,
.btn-view:active,
.back-btn:active,
.tag:active,
.year-card:active,
.branch-card:active,
.quick-tag-chip:active {
  transform: scale(0.98);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle {
  min-height: 36px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
}

/* ── HERO ── */
.hero {
  position: relative;
  padding: 64px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero-bg-grid {
  display: none;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 18px;
  color: var(--text);
}

.accent {
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: initial;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Pattern Notice */
.pattern-notice {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 28px;
  text-align: left;
  line-height: 1.5;
}

.pattern-notice strong {
  color: var(--text);
  font-weight: 600;
}

.pattern-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--warning);
  display: flex;
  align-items: center;
}

.pattern-badge {
  display: inline-block;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  vertical-align: middle;
  margin-left: 8px;
  text-transform: uppercase;
}

/* Global Search */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px 6px 5px 16px;
  box-shadow: var(--shadow-sm);
  min-height: 50px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.search-icon-wrap {
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-wrap input {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  min-height: 40px;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 7px;
  line-height: 1;
  margin-right: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.search-wrap:focus-within .search-kbd {
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.search-wrap button {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-wrap button:hover {
  background: var(--accent-hover);
}

/* Quick Tags */
.quick-tags-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.quick-tags-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.quick-tag-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.quick-tag-chip:hover {
  border-color: var(--accent-border);
  color: var(--accent-text);
  background: var(--accent-subtle);
}

/* Hero Stats Bar */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-family: 'Lexend', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.stat-div {
  width: 1px;
  height: 34px;
  background: var(--border);
  align-self: center;
  justify-self: center;
}

/* ── SECTIONS ── */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 32px;
}

.section-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.section-header h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── YEAR GRID ── */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.year-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-sm);
}

.year-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.year-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.year-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.year-arrow {
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
}

.year-card:hover .year-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.year-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.year-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
  flex: 1;
}

.year-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  width: fit-content;
  transition: all 0.15s ease;
}

.year-card:hover .year-count {
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ── BROWSER PANEL (BRANCH / SUBJECT / PAPERS) ── */
.browser-section {
  background: var(--bg-subtle);
}

.browser-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.browser-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step-hint {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

#branchStep,
#subjectStep,
#fileStep,
#browserPanel {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

/* Tag grid for branches/subjects */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tag:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.tag.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* File Listing */
.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.file-list-header input {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  min-width: 240px;
  min-height: 42px;
  transition: border-color 0.15s ease;
}

.file-list-header input:focus {
  border-color: var(--accent);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.file-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.file-badge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.file-pattern-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.file-card-share-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.file-card-share-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

.file-card-content {
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.file-meta-dot {
  opacity: 0.5;
}

.file-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.file-card-btn {
  width: 100%;
  min-height: 40px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 8px 14px !important;
  border-radius: var(--radius-xs) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.btn-solution {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-solution.has-solution {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.btn-solution.has-solution:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ── PREMIUM SECTION ── */
.premium-section {
  background: var(--bg);
}

.premium-header {
  margin-bottom: 28px;
}

.premium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
}

.premium-badge {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  vertical-align: middle;
  margin-left: 8px;
}

/* ── ABOUT ── */
.about-section {
  background: var(--bg-subtle);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.about-text h2 {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  min-width: 240px;
}

.about-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.about-card-text {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.about-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── FEEDBACK ── */
.feedback-section {
  background: var(--bg);
}

.feedback-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: flex-start;
}

.feedback-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.feedback-form-group {
  margin-bottom: 18px;
}

.feedback-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.feedback-form-group input,
.feedback-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.feedback-form-group input:focus,
.feedback-form-group textarea:focus {
  border-color: var(--accent);
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  background: var(--bg);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.footer-top a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-top a:hover {
  color: var(--text);
}

.footer-copyright {
  text-align: center;
  padding-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── HAMBURGER MENU ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: border-color 0.15s ease;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── SEARCH SUGGESTIONS ── */
.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--surface-hover);
  color: var(--accent);
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

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

.modal-header {
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: var(--text);
}

/* ── GATE MODAL ── */
.gate-modal {
  width: min(92vw, 440px);
}

.gate-step {
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* ── PDF IN-APP PREVIEW MODAL ── */
.pdf-preview-modal {
  width: min(94vw, 980px);
  height: min(88vh, 840px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  gap: 12px;
}

.pdf-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pdf-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.pdf-preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(50vw, 400px);
}

.pdf-preview-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.pdf-preview-body {
  flex: 1;
  position: relative;
  background: #090a0d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pdf-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #090a0d;
  color: var(--text-secondary);
  font-size: 0.85rem;
  z-index: 1;
}

.pdf-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.pdf-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  font-size: 0.75rem;
  color: var(--muted);
}

.kbd-mini {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* ── SHARE WITH BATCHMATES MODAL ── */
.share-modal {
  width: min(92vw, 440px);
  padding: 24px;
  text-align: left;
}

.share-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.share-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  flex-shrink: 0;
}

.share-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.share-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.share-channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  color: var(--text);
  font-family: inherit;
}

.share-channel-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.share-channel-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.whatsapp-icon {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25D366;
}

.telegram-icon {
  background: #2AABEE;
  color: #ffffff;
}

.share-channel-content {
  flex: 1;
  min-width: 0;
}

.share-channel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.share-channel-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.share-channel-arrow {
  color: var(--muted);
  font-size: 1.1rem;
}

.share-copy-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-copy-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.share-input-group {
  display: flex;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
}

.share-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  outline: none;
  padding: 4px 6px;
}

.share-input-group button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.share-input-group button:hover {
  background: var(--accent-hover);
}

/* ── SPPU TOAST NOTIFICATION ── */
.sppu-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  z-index: 3500;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sppu-toast.toast-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 800;
  font-size: 0.72rem;
}

/* ── FAQ SECTION ── */
.faq-section {
  background: var(--bg-subtle);
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s ease;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-item summary {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  user-select: none;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 16px 20px;
  margin: 0;
}

/* ── NOTICE BANNER ── */
.notice-banner {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.9rem;
  max-width: 620px;
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  margin: 20px auto 0;
  text-align: left;
}

.notice-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notice-banner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  flex-shrink: 0;
}

.notice-banner-text {
  flex: 1;
  color: var(--text-secondary);
}

.notice-banner-link {
  display: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── PWA POPUP ── */
#pwaPopup {
  position: fixed;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 400px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: bottom 0.3s ease;
}

#pwaPopup.pwa-show {
  bottom: 24px;
}

#pwaPopup.pwa-hide {
  bottom: -180px;
}

.pwa-popup-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pwa-popup-icon {
  width: 38px;
  height: 38px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.pwa-popup-info {
  flex: 1;
}

.pwa-popup-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.pwa-popup-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pwa-popup-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

.pwa-popup-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pwa-countdown-wrap {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

#pwaCountdownBar {
  height: 100%;
  width: 100%;
  background: var(--accent);
}

.pwa-ios-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  display: none;
}

/* ── SCROLL TO TOP ── */
#scrollTopBtn {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 990;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, color 0.15s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

/* Ensure scroll to top button NEVER overlaps with open chat widget */
.chat-widget.open ~ #scrollTopBtn,
body:has(.chat-widget.open) #scrollTopBtn {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--border-hover);
}

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-secondary);
  gap: 3px;
  min-height: 44px;
  transition: color 0.15s ease;
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-item span {
  font-size: 0.68rem;
  font-weight: 500;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--accent);
}

/* ── CHATBOT WIDGET ── */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.chat-launcher-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.chat-launcher-pill:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
}

.chat-launcher-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-launcher-text {
  letter-spacing: -0.01em;
}

.chat-widget.open .chat-launcher-pill {
  display: none;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.chat-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.chat-body {
  display: none;
  width: 360px;
  height: 500px;
  max-height: calc(100vh - 100px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  position: absolute;
  bottom: 0;
  right: 0;
  overflow: hidden;
  animation: chatPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-widget.open .chat-body {
  display: flex;
}

.chat-header {
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.chat-input-area button {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: var(--surface2);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xs);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── RESPONSIVE & MOBILE-FIRST RULES ── */
@media (max-width: 768px) {
  .nav {
    padding: 0 16px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--mobile-nav-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 8px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .hero {
    padding: 44px 0 32px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    padding: 14px 16px;
  }

  .stat-num {
    font-size: 1.45rem;
  }

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

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

  .file-card {
    padding: 14px 16px;
  }

  .about-inner,
  .feedback-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  #scrollTopBtn {
    bottom: calc(130px + env(safe-area-inset-bottom));
    right: 16px;
  }

  .chat-widget {
    bottom: calc(72px + env(safe-area-inset-bottom));
    right: 16px;
  }

  #pwaPopup.pwa-show {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .chat-body {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    border: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   RICH PRODUCT SECTIONS: BRANCHES, HOW IT WORKS, FEATURED, WHY
   ══════════════════════════════════════════════════════════════ */

/* ── HERO ENHANCEMENTS (Linear/Notion Feel) ── */
.hero {
  position: relative;
  padding: 80px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 70% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent 70%), var(--bg);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.accent-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ── BROWSE BY BRANCH ── */
.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.branch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-sm);
  position: relative;
}

.branch-card:hover {
  background: var(--surface-hover);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.branch-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.branch-card:hover .branch-card-icon {
  background: var(--accent-subtle);
  transform: scale(1.05);
}

.branch-card-content {
  flex: 1;
  min-width: 0;
}

.branch-card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.branch-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-card-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.branch-card-arrow {
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.branch-card:hover .branch-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ── HOW IT WORKS (3 STEPS) ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s ease;
}

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

.step-card-num {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 16px;
  line-height: 1;
}

.step-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.step-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── FEATURED PAPERS SPOTLIGHT ── */
.featured-papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.featured-paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-sm);
}

.featured-paper-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

.paper-year-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.paper-session-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.paper-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.35;
}

.paper-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.paper-dl-btn {
  margin-top: auto;
  width: 100%;
}

/* ── WHY SPPUVAULT (4 PILLARS) ── */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

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

.why-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  margin-bottom: 16px;
}

.why-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.why-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── YEAR CARDS ENHANCED (Linear Style) ── */
.year-card {
  position: relative;
  overflow: hidden;
}

.year-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.year-card:hover::before {
  opacity: 1;
}

.year-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(59, 130, 246, 0.15);
}
