/* ==========================================================================
   NYSORA PAIN MEDICINE ASSISTANT - EXACT PIXEL-PERFECT CLONE STYLES
   Optimized for High-Contrast Light & Dark (Quirófano) Themes
   Full Text Selection & Copy-Paste Enabled
   ========================================================================== */

:root {
  /* DARK THEME (DEFAULT - Quirófano / Fluoroscopy Room) */
  --bg-app: #070c18;
  --bg-surface: #0e1526;
  --bg-card: #131c31;
  --bg-topbar: rgba(7, 12, 24, 0.94);
  --bg-bottombar: rgba(7, 12, 24, 0.96);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-focus: #38bdf8;

  --text-white: #ffffff;
  --text-title: #ffffff;
  --text-body: #cbd5e1;       /* Light silver-gray for dark mode */
  --text-dim: #94a3b8;
  --text-muted: #64748b;

  --nysora-accent: #38bdf8;
  --nysora-active-pink: #ff2d55;
  --carm-blue: #9bb7cf;

  --tabs-bg: #0d1527;
  --tab-active-bg: #1b2640;
  --tab-active-text: #38bdf8;
  --tab-inactive-text: #94a3b8;

  --figure-bg: #080d1a;
  --figure-border: rgba(255, 255, 255, 0.08);
  --figcaption-bg: #0d1527;
  --figcaption-text: #cbd5e1;

  --alert-harmful-bg: rgba(239, 68, 68, 0.12);
  --alert-harmful-border: #ef4444;
  --alert-harmful-text: #fca5a5;

  --alert-pearl-bg: rgba(16, 185, 129, 0.12);
  --alert-pearl-border: #10b981;
  --alert-pearl-text: #6ee7b7;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   LIGHT THEME MODE (Consulta / Bright Clinical Room) - High Contrast & Crisp
   ========================================================================== */
body.light-mode {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.96);
  --bg-bottombar: rgba(255, 255, 255, 0.97);
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;

  --text-white: #0f172a;      /* Dark slate headers in light mode */
  --text-title: #0f172a;      /* Deep black/slate headers */
  --text-body: #1e293b;       /* Crisp charcoal for paragraphs and lists */
  --text-dim: #475569;        /* Medium dark slate */
  --text-muted: #64748b;

  --nysora-accent: #0284c7;
  --nysora-active-pink: #e11d48;
  --carm-blue: #0284c7;

  --tabs-bg: #e2e8f0;
  --tab-active-bg: #ffffff;
  --tab-active-text: #0284c7;
  --tab-inactive-text: #475569;

  --figure-bg: #f8fafc;
  --figure-border: #cbd5e1;
  --figcaption-bg: #f1f5f9;
  --figcaption-text: #1e293b;

  --alert-harmful-bg: #fef2f2;
  --alert-harmful-border: #dc2626;
  --alert-harmful-text: #991b1b;

  --alert-pearl-bg: #ecfdf5;
  --alert-pearl-border: #059669;
  --alert-pearl-text: #065f46;
}

/* Base Reset & Text Selection */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Selection Highlight */
::selection {
  background: rgba(56, 189, 248, 0.35);
  color: inherit;
}
body.light-mode ::selection {
  background: rgba(2, 132, 199, 0.25);
  color: inherit;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-body);
  font-family: var(--font-family);
  user-select: text;
  -webkit-user-select: text;
}

/* Ensure mouse text selection is enabled across all medical documents */
.screen-content-wrapper,
.procedure-markdown-feed,
.med-section-card,
.med-section-card *,
p, li, span, h1, h2, h3, h4, h5, h6, figcaption, blockquote {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}

/* Buttons, tabs, and cards remain clickable without text cursor */
button,
.topbar-circle-btn,
.nysora-cat-card,
.proc-list-row,
.nav-tab-item,
.c-tab,
.fav-star-btn,
.proc-row-heart,
.module-banner-card,
.favorite-heart-btn,
.tool-btn,
.quick-jump-pill {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: pointer !important;
}

/* App Viewport Container */
.app-viewport {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.nysora-topbar {
  height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-left {
  width: 80px;
  display: flex;
  align-items: center;
}

.topbar-right {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.topbar-circle-btn:active {
  transform: scale(0.92);
}

.topbar-circle-btn.back-btn {
  background: #ffffff;
  color: #070c18;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

body.light-mode .topbar-circle-btn.back-btn {
  background: #0f172a;
  color: #ffffff;
}

.topbar-circle-btn.back-btn svg {
  width: 20px;
  height: 20px;
}

.topbar-circle-btn.settings-btn {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: var(--text-white);
}

body.light-mode .topbar-circle-btn.settings-btn {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #f1f5f9;
}

.topbar-circle-btn.settings-btn svg {
  width: 20px;
  height: 20px;
}

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

.nysora-logo-mark {
  width: 28px;
  height: 28px;
  color: var(--text-white);
  transition: color 0.2s ease;
}

body.light-mode .nysora-logo-mark {
  color: #0284c7;
}

.nysora-brand-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-white);
  transition: color 0.2s ease;
}

/* ==========================================================================
   SCROLLABLE CONTENT AREA
   ========================================================================== */
.app-scroll-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 84px;
}

.app-screen {
  display: none;
  min-height: 100%;
}

.app-screen.active {
  display: block;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.screen-content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ==========================================================================
   SCREEN 1: CATEGORIES HOME (2x2 CLONED GRID)
   ========================================================================== */
.categories-header-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.nysora-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 580px) {
  .nysora-categories-grid {
    grid-template-columns: 1fr;
  }
}

.nysora-cat-card {
  height: 240px;
  border-radius: 24px;
  background-color: #10192e;
  background-image: var(--cat-bg);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.nysora-cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.15) 0%, rgba(8, 14, 28, 0.45) 45%, rgba(6, 12, 24, 0.94) 100%);
  pointer-events: none;
}

.nysora-cat-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

.nysora-cat-card:active {
  transform: scale(0.98);
}

.cat-card-carm-badge {
  position: relative;
  z-index: 2;
  margin: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.carm-badge-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cat-card-bottom {
  position: relative;
  z-index: 2;
  padding: 18px 20px 22px 20px;
}

.cat-card-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
}

.cat-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.cat-progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
}

.cat-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

/* Secondary Modules (Case Studies & UpToDate) */
.secondary-modules-section {
  margin-top: 12px;
}

.sub-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

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

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

.module-banner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.module-banner-card:hover {
  background: var(--bg-card);
  border-color: var(--nysora-accent);
  transform: translateY(-2px);
}

.module-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-info {
  flex: 1;
}

.module-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 2px;
}

.module-info p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}

.module-arrow {
  color: var(--text-dim);
  font-size: 14px;
}

/* ==========================================================================
   SCREEN 2: CATEGORY PROCEDURES LIST
   ========================================================================== */
.category-list-header {
  margin-bottom: 24px;
}

.category-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nysora-accent);
  display: block;
  margin-bottom: 4px;
}

.category-main-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin-bottom: 4px;
}

.category-count-label {
  font-size: 13px;
  color: var(--text-dim);
}

.procedures-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proc-list-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.proc-list-row:hover {
  background: var(--bg-card);
  border-color: var(--nysora-accent);
  transform: translateX(4px);
}

.proc-list-index {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--nysora-accent);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.light-mode .proc-list-index {
  background: #e0f2fe;
  color: #0284c7;
}

.proc-list-content {
  flex: 1;
}

.proc-list-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.35;
  margin-bottom: 4px;
}

.proc-list-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.proc-row-heart {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  transition: color 0.15s ease;
}

.proc-row-heart.active {
  color: var(--nysora-active-pink);
}

.proc-row-chevron {
  color: var(--text-dim);
  font-size: 16px;
}

/* ==========================================================================
   SCREEN 3: PROCEDURE DETAIL VIEW (Full Medical Guide)
   ========================================================================== */
.procedure-wrapper {
  max-width: 900px;
}

.procedure-sticky-header {
  margin-bottom: 24px;
}

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

.proc-cat-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--nysora-accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4px 10px;
  border-radius: 99px;
}

body.light-mode .proc-cat-badge {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-proc-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-proc-btn:hover {
  color: var(--nysora-accent);
  border-color: var(--nysora-accent);
}

.favorite-heart-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.favorite-heart-btn svg {
  width: 18px;
  height: 18px;
}

.favorite-heart-btn.active {
  color: var(--nysora-active-pink);
  background: rgba(255, 45, 85, 0.15);
  border-color: var(--nysora-active-pink);
}

.favorite-heart-btn.active svg {
  fill: var(--nysora-active-pink);
}

.procedure-headline {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.3;
  margin-bottom: 20px;
}

/* Segmented Clinical Pills (Apple / iOS Native Bar) */
.clinical-tabs-scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 20px;
}

.clinical-tabs-pill {
  display: inline-flex;
  background: var(--tabs-bg);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.c-tab {
  background: transparent;
  border: none;
  color: var(--tab-inactive-text);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.c-tab:hover {
  color: var(--text-title);
}

.c-tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Quick Jump Pills */
.quick-jump-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.quick-jump-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-jump-pill:hover {
  color: var(--nysora-accent);
  border-color: var(--nysora-accent);
}

/* Medical Markdown Feed */
.procedure-markdown-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.med-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  color: var(--text-body);
}

.med-section-card h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.med-section-card p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 16px;
  font-weight: 450;
}

.med-section-card ul, .med-section-card ol {
  margin: 12px 0 20px 24px;
}

.med-section-card li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 10px;
  font-weight: 450;
}

.med-section-card strong, .med-section-card b {
  color: var(--text-title);
  font-weight: 700;
}

.med-section-card h5 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--nysora-accent);
  margin: 22px 0 10px 0;
}

/* Harmful & Warning Needle Placement Callout */
.med-section-card.warning-box {
  background: var(--alert-harmful-bg);
  border-left: 4px solid var(--alert-harmful-border);
}

.med-section-card.warning-box p,
.med-section-card.warning-box li {
  color: var(--alert-harmful-text);
}

.med-section-card.pearls-box {
  background: var(--alert-pearl-bg);
  border-left: 4px solid var(--alert-pearl-border);
}

.med-section-card.pearls-box p,
.med-section-card.pearls-box li {
  color: var(--alert-pearl-text);
}

/* Medical Fluoroscopy Figures */
figure {
  margin: 24px 0;
  border: 1px solid var(--figure-border);
  border-radius: 16px;
  background: var(--figure-bg);
  overflow: hidden;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

figure img:hover {
  opacity: 0.94;
}

figcaption {
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--figcaption-text);
  line-height: 1.55;
  background: var(--figcaption-bg);
  border-top: 1px solid var(--border-subtle);
  text-align: left;
}

/* ==========================================================================
   SCREEN 4 & 5: SEARCH & FAVORITES
   ========================================================================== */
.section-lead-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
}

.search-bar-inline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.search-bar-inline:focus-within {
  border-color: var(--nysora-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.search-inline-icon {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
}

.search-bar-inline input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-title);
  outline: none;
  font-family: var(--font-family);
}

.search-clear-inline {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-search-state {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR
   ========================================================================== */
.nysora-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--bg-bottombar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-tab-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 56px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 14px;
}

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

.nav-tab-item .tab-icon {
  width: 26px;
  height: 26px;
}

.nav-tab-item.active {
  color: var(--nysora-active-pink);
}

.nav-tab-item.active .tab-icon {
  filter: drop-shadow(0 2px 8px rgba(255, 45, 85, 0.4));
}

/* ==========================================================================
   IMAGE LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  z-index: 10;
  width: 95vw;
  height: 92vh;
  display: flex;
  flex-direction: column;
  background: #090e1c;
  border: 1px solid #1e293b;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.lightbox-header {
  height: 52px;
  padding: 0 20px;
  background: #0d1527;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-counter {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.lightbox-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.tool-btn.close-btn {
  background: #ef4444;
  border-color: #ef4444;
}

.lightbox-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04070f;
  cursor: grab;
}

.lightbox-viewport img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.1s ease-out;
}

.lightbox-footer {
  min-height: 56px;
  padding: 10px 20px;
  background: #0d1527;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-caption {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  max-height: 48px;
  overflow-y: auto;
  flex: 1;
  text-align: center;
  user-select: text !important;
  cursor: text !important;
}

.lightbox-nav-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   SETTINGS MODAL
   ========================================================================== */
.settings-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.settings-modal.active {
  display: flex;
}

.settings-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.settings-dialog {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.settings-header h3 {
  color: var(--text-title);
}

.settings-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-row h4 {
  font-size: 15px;
  color: var(--text-title);
  margin-bottom: 2px;
}

.setting-row p {
  font-size: 12px;
  color: var(--text-dim);
}

.toggle-theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-title);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.toggle-theme-btn:hover {
  border-color: var(--nysora-accent);
}

.settings-app-info {
  margin-top: 24px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.settings-app-info h4 {
  font-size: 14px;
  color: var(--text-title);
  margin-bottom: 4px;
}

.settings-app-info p {
  font-size: 12px;
  color: var(--text-dim);
}

.version-tag {
  color: var(--nysora-accent) !important;
  font-weight: 700;
  margin-top: 4px;
}
