/* styles.css · client-side-hypothesis-like · 1000HW
 * Cache-bust: ?v=3 (V29+V30 polish-v2: desc + WCAG --text-dim)
 * Vanilla CSS · mobile-first · paleta 1000HW (void/acid/concrete/softgray/text-light)
 * WCAG 2.1 AA compliant · prefers-reduced-motion respetado
 *
 * Diseño: dropzone central → editor 2 columnas (visor PDF + sidebar) →
 * toolbar superior con modos/colores/navegación/export. Vanilla, sin frameworks.
 */

/* ============================================================
 * 0. CUSTOM PROPERTIES (design tokens)
 * ============================================================ */
:root {
  /* Paleta canónica 1000HW */
  --void:        #050505;
  --concrete:    #1A1A1E;
  --structure:   #2A2A30;
  --acid:        #CCFF00;
  --acid-dim:    #A8CC00;
  --softgray:    #9CA3AF;
  --text-light:  #E5E7EB;
  --text-mid:    #B5B7C0;
  --text-dim:    #8B8E98; /* V30 P2-WCAG: ratio 6.23:1 sobre #050505, AA PASS (antes #6B6E78 4.01:1) */
  --danger:      #FF6B6B;
  --warn:        #FFB74D;
  --success:     #4ADE80;
  --info:        #60A5FA;

  /* Colores highlight (UI controls) */
  --hl-yellow: #FFEB3B;
  --hl-green:  #4ADE80;
  --hl-blue:   #60A5FA;
  --hl-pink:   #F472B6;
  --hl-orange: #FB923C;
  --hl-gray:   #9CA3AF;

  /* Tipografía — P1.1 FIX 2026-07-01: Google Fonts CDN eliminado.
     Stack 100% system fonts, sin carga de red externa. Cae al primer
     sans-serif/monospace disponible en el SO del usuario. */
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Espaciado */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Otros */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-md: 0 6px 22px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 50px rgba(0,0,0,0.55);

  /* Transiciones */
  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-mid:  300ms cubic-bezier(.4,0,.2,1);
  --t-slow: 600ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
 * 1. RESET + BASE
 * ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--void);
  color: var(--text-light);
  line-height: 1.55;
  font-size: 16px;
  background-image: radial-gradient(circle at 20% 0%, rgba(204, 255, 0, 0.05) 0%, transparent 40%),
                    radial-gradient(circle at 100% 100%, rgba(204, 255, 0, 0.03) 0%, transparent 40%);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  line-height: 1.2;
}

p { margin: 0 0 var(--space-4); }

a {
  color: var(--acid);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
a:hover { color: var(--text-light); }
a:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--acid);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--acid);
  color: var(--void);
  padding: var(--space-2) var(--space-4);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

/* ============================================================
 * 2. CONTAINER
 * ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }
}

/* ============================================================
 * 3. NAV
 * ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--structure);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-back {
  color: var(--softgray);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--t-fast);
}
.nav-back:hover { color: var(--acid); }

.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}
.brand-acid { color: var(--acid); }

.lang-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: 0;
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--softgray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--t-fast);
}
.lang-btn:hover { color: var(--text-light); background: var(--concrete); }
.lang-btn.active {
  background: var(--acid);
  color: var(--void);
}

/* ============================================================
 * 4. HERO
 * ============================================================ */
.hero {
  padding: var(--space-7) 0 var(--space-6);
  text-align: left;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-acid {
  background: var(--acid);
  color: var(--void);
  border: 1px solid var(--acid);
}
.tag-priv {
  background: transparent;
  color: var(--acid);
  border: 1px solid var(--acid);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 800;
  margin-bottom: var(--space-5);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero h1 .accent {
  display: block;
  color: var(--acid);
  font-style: italic;
}

.hero-lede {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--text-mid);
  max-width: 64ch;
  margin-bottom: var(--space-5);
}
.hero-lede strong { color: var(--text-light); font-weight: 700; }
.hero-lede code { background: var(--concrete); }

.hero-disclaimer {
  background: var(--concrete);
  border-left: 3px solid var(--acid);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  color: var(--text-mid);
  max-width: 64ch;
}
.hero-disclaimer strong { color: var(--text-light); }
.hero-disclaimer a { font-weight: 600; }

/* ============================================================
 * 5. TOOL SECTION + CARD
 * ============================================================ */
.tool-section {
  padding: var(--space-5) 0 var(--space-7);
}

.tool-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .tool-card { padding: var(--space-6); }
}

/* ============================================================
 * 6. DROPZONE
 * ============================================================ */
.dropzone {
  border: 2px dashed var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-mid);
  background: rgba(204, 255, 0, 0.02);
}
.dropzone:hover, .dropzone:focus, .dropzone.dragover {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.06);
  outline: none;
}

.dropzone-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  color: var(--acid);
  opacity: 0.85;
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.dropzone-hint {
  font-size: 0.95rem;
  color: var(--text-mid);
  margin: 0;
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-3);
}

.dropzone-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: var(--space-3);
  max-width: 480px;
}

/* ============================================================
 * 7. EDITOR (toolbar + workspace + props)
 * ============================================================ */
.editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* TOOLBAR */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  align-items: center;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toolbar-actions {
  margin-left: auto;
  flex-wrap: wrap;
}

.toolbar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mode-group, .color-group {
  display: flex;
  gap: 2px;
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mode-btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  color: var(--softgray);
  transition: all var(--t-fast);
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-btn:hover { background: var(--concrete); color: var(--text-light); }
.mode-btn.active { background: var(--acid); color: var(--void); }

.color-btn {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  transition: all var(--t-fast);
  position: relative;
}
.color-btn:hover { transform: scale(1.1); }
.color-btn.active {
  border-color: var(--text-light);
  box-shadow: 0 0 0 2px var(--void), 0 0 0 4px var(--acid);
}

.page-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mid);
}
.page-input {
  width: 48px;
  padding: 4px 6px;
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  text-align: center;
}
.page-input:focus { border-color: var(--acid); outline: none; }
.page-sep { color: var(--text-dim); }

.zoom-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mid);
  min-width: 44px;
  text-align: center;
}

/* WORKSPACE — visor + sidebar */
.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  min-height: 600px;
}
@media (min-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr 340px;
  }
}

.viewer-wrap {
  position: relative;
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 600px;
}

.viewer-scroll {
  width: 100%;
  height: 600px;
  overflow: auto;
  background: #2a2a2a;
  background-image: linear-gradient(45deg, #2f2f2f 25%, transparent 25%),
                    linear-gradient(-45deg, #2f2f2f 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #2f2f2f 75%),
                    linear-gradient(-45deg, transparent 75%, #2f2f2f 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.page-container {
  position: relative;
  margin: var(--space-4) auto;
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.pdf-canvas {
  display: block;
  background: white;
}

/* Text layer (PDF.js renderTextLayer): lets user drag-select text */
.textLayer {
  /* --scale-factor is REQUIRED by pdfjsLib.renderTextLayer and must match viewport.scale.
     Default to 1; renderPage() sets it inline on the text-layer element. */
  --scale-factor: 1;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 1;
  line-height: 1;
  /* text layer must be OVER canvas but UNDER annotation overlay */
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
}
.textLayer > span,
.textLayer > span > span,
.textLayer > br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  /* scale-factor is set inline by renderPage() to viewport.scale so spans
     stay correctly positioned at the current zoom. Without this rule the
     text layer would always render at 1:1 even if scale !== 1. */
  transform: scale(var(--scale-factor));
}
.textLayer::selection,
.textLayer > span::selection,
.textLayer > span > span::selection {
  background: rgba(204, 255, 0, 0.35);
  color: transparent;
}
.textLayer *::-moz-selection,
.textLayer *::selection {
  background: rgba(204, 255, 0, 0.35);
  color: transparent;
}

/* Annotation overlay sits ABOVE textLayer — annotation-layer children catch clicks,
   but annotation-layer itself does NOT block text selection through transparent gaps
   because it has pointer-events:none by default. Individual children (.annotation-rect,
   .annotation-note-marker) opt back into pointer events so they remain clickable. */
.annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.textLayer {
  z-index: 1;
}

/* In note mode we DO want the empty area of annotation-layer to capture clicks
   (to place sticky notes), so re-enable pointer events only for that mode.
   In highlight and select modes we keep pointer-events:none on the layer so the
   text-layer below receives mouseup events for text-selection (and the children
   .annotation-rect / .annotation-note-marker remain individually clickable). */
.annotation-layer.mode-note {
  pointer-events: auto;
  cursor: crosshair;
}

.annotation-rect {
  position: absolute;
  mix-blend-mode: multiply;
  opacity: 0.45;
  cursor: pointer;
  pointer-events: auto;
  border: 1px solid transparent;
  transition: border-color var(--t-fast);
}
.annotation-rect:hover, .annotation-rect.selected {
  border-color: var(--text-light);
  opacity: 0.7;
}
.annotation-rect.selected {
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}

.annotation-note-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--acid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--void);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform var(--t-fast);
}
.annotation-note-marker:hover { transform: scale(1.15); }
.annotation-note-marker.selected {
  outline: 2px solid var(--text-light);
  outline-offset: 2px;
}

/* SIDEBAR */
.sidebar {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  max-height: 700px;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-light);
}

.sidebar-count {
  background: var(--acid);
  color: var(--void);
  border-radius: 10px;
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.sidebar-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}

.annotation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.annotation-item {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.annotation-item:hover {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.04);
}
.annotation-item.selected {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.08);
}

.annotation-item-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.2);
}

.annotation-item-body {
  flex: 1;
  min-width: 0;
}

.annotation-item-meta {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.annotation-item-type {
  background: var(--structure);
  color: var(--text-mid);
  padding: 1px 6px;
  border-radius: 3px;
}

.annotation-item-page {
  color: var(--acid);
  font-weight: 600;
}

.annotation-item-text {
  font-size: 0.85rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.annotation-item-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.sidebar-empty {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  color: var(--text-dim);
}
.sidebar-empty p { margin: 0 0 var(--space-2); font-size: 0.9rem; }
.sidebar-empty-hint { font-size: 0.8rem !important; }

/* PROPS PANEL */
.props-panel {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--acid);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.props-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.props-head h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--acid);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
  font-weight: 700;
}

.props-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.props-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.props-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================================================
 * 8. BUTTONS + FORM
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  background: var(--concrete);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  min-height: 36px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--acid); }
.btn:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--acid);
  color: var(--void);
  border-color: var(--acid);
}
.btn-primary:hover { background: var(--acid-dim); border-color: var(--acid-dim); }

.btn-secondary {
  background: transparent;
  color: var(--acid);
  border-color: var(--acid);
}
.btn-secondary:hover { background: rgba(204, 255, 0, 0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--structure);
}
.btn-ghost:hover { color: var(--text-light); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); }

.btn-icon {
  padding: 0;
  width: 36px;
  min-height: 36px;
  font-size: 1.1rem;
}

.form-select, .form-input, .form-textarea {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-light);
  min-height: 36px;
  width: 100%;
}
.form-select { cursor: pointer; }
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--acid);
  outline: none;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ============================================================
 * 9. ADSENSE placeholder
 * ============================================================ */
.ad-section {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--structure);
  border-bottom: 1px solid var(--structure);
  margin: var(--space-6) 0;
}
.ad-section .adsbygoogle {
  display: block;
  width: 100%;
  min-width: 250px;
  min-height: 100px;
}

/* ============================================================
 * 10. CONTENT SECTIONS
 * ============================================================ */
.content-section {
  padding: var(--space-7) 0;
}

.content-section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--text-light);
  border-left: 3px solid var(--acid);
  padding-left: var(--space-3);
}

.content-section h2:first-child { margin-top: 0; }

.content-list {
  padding-left: var(--space-5);
  margin: 0 0 var(--space-4);
}
.content-list li {
  margin-bottom: var(--space-2);
  color: var(--text-mid);
  line-height: 1.55;
}
.content-list li strong { color: var(--text-light); }

.content-section p {
  color: var(--text-mid);
  line-height: 1.65;
}
.content-section p strong { color: var(--text-light); }

.funcs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
@media (min-width: 768px) {
  .funcs-grid { grid-template-columns: repeat(3, 1fr); }
}

.func-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.func-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
  color: var(--acid);
}
.func-card p {
  font-size: 0.92rem;
  margin-bottom: var(--space-3);
}
.func-syntax {
  display: block;
  font-size: 0.8rem;
  background: var(--void);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  word-break: break-all;
}

.callout {
  background: var(--concrete);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}
.callout-warn h3 {
  color: var(--warn);
  margin-bottom: var(--space-3);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.faq-item {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--text-light);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  transition: background var(--t-fast);
}
.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--acid);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: rgba(204, 255, 0, 0.04); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--text-mid);
  margin: 0;
}
.faq-item p code { background: var(--void); }

.footer-disclaimer {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--structure);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================
 * 11. FOOTER
 * ============================================================ */
.site-footer {
  border-top: 1px solid var(--structure);
  padding: var(--space-6) 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.site-footer p { margin: var(--space-2) 0; }
.site-footer a { color: var(--acid); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

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

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ============================================================
 * 12. ALERT / ERROR BOX
 * ============================================================ */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.alert {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  color: var(--text-light);
  font-size: 0.9rem;
}
.alert-error {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
}
.alert-info {
  border-color: var(--info);
  background: rgba(96, 165, 250, 0.08);
}
.alert-success {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.08);
}

/* ============================================================
 * 13. OFFLINE BANNER + DONATION TOAST
 * ============================================================ */
.offline-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--concrete);
  border: 1px solid var(--acid);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 90;
  max-width: 90vw;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
}
.offline-banner[hidden] { display: none; }

.offline-banner-icon {
  background: var(--acid);
  color: var(--void);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.offline-banner-text {
  color: var(--text-light);
  flex: 1;
}

.offline-banner-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.offline-banner-close:hover { color: var(--text-light); }

.donation-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 95;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.4s cubic-bezier(.4,0,.2,1);
}
.donation-toast[hidden] { display: none; }

@keyframes toast-in {
  from { transform: translateY(120%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.donation-toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.donation-toast-content { flex: 1; min-width: 0; }
.donation-toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}
.donation-toast-subtitle {
  font-size: 0.78rem;
  color: var(--text-mid);
  margin: 0;
  line-height: 1.3;
}

.donation-toast-btn {
  background: var(--acid);
  color: var(--void);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--t-fast);
}
.donation-toast-btn:hover { background: var(--acid-dim); color: var(--void); }

.donation-toast-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.donation-toast-close:hover { color: var(--text-light); }

@media (min-width: 768px) {
  .donation-toast { bottom: 24px; right: 24px; max-width: 380px; }
}

/* ============================================================
 * 14. RESPONSIVE — mobile adjustments
 * ============================================================ */
@media (max-width: 640px) {
  .nav-inner { padding: var(--space-3); }
  .nav-back span[data-i18n="nav-back"] { display: none; }

  .hero { padding: var(--space-5) 0 var(--space-4); }
  .tool-section { padding: var(--space-3) 0 var(--space-5); }
  .tool-card { padding: var(--space-3); }

  .toolbar {
    gap: var(--space-2);
    padding: var(--space-2);
  }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; font-size: 0.82rem; padding: 6px 10px; }

  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar { max-height: 400px; }

  .content-section { padding: var(--space-5) 0; }
  .container { padding: 0 var(--space-3); }

  .donation-toast { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}

/* ============================================================
 * 15. A11Y MOTION
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}