/* ============================================================
   Component styles — light, minimal, one accent (PLAN §4.2).
   Color tokens live in tokens.css. No neon, no glow, no mesh.
   ============================================================ */

* { font-family: var(--font-sans); }
.mono { font-family: var(--font-mono); }

html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  /* Sticky footer: lay the page out as a column and let <main> grow, so the
     footer is pushed to the bottom even when a page is shorter than the screen.
     Use dvh (dynamic viewport height) so mobile browser toolbars can't leave
     the footer stranded behind them — 100vh is the *large* viewport on phones
     and pushed the footer off-screen behind the address/tool bar. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;   /* fallback for browsers without dvh */
  min-height: 100dvh;
}

/* ── Typography ─────────────────────────────────────────── */
h1 { letter-spacing: -0.03em; }
.brand-gradient {
  background: linear-gradient(100deg, var(--accent) 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Panels / cards ─────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

/* Trust row — restrained line-icon reassurance under the hero text.
   Intentionally not a pill/badge (avoids the AI-template look). */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px 16px;
  margin-top: 22px;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--txt-3);
  letter-spacing: -0.01em;
}
.trust-item svg {
  width: 15px; height: 15px;
  color: var(--accent);
  opacity: 0.85;
  flex: none;
}
.trust-sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--border);
}
@media (max-width: 480px) { .trust-sep { display: none; } }

/* ── Primary button ─────────────────────────────────────── */
.btn-primary {
  white-space: nowrap;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--txt-2);
  border-radius: 12px;
  font-weight: 500;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--border-strong); color: var(--txt); }

/* ── Language select ────────────────────────────────────── */
.lang-select {
  background-color: var(--panel);
  border: 1px solid var(--border);
  color: var(--txt-2);
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  appearance: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .16s, background .16s;
}
.lang-select:hover { background-color: var(--panel-2); }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.lang-select option { background-color: #fff; color: var(--txt); }

/* ── Feature cards ──────────────────────────────────────── */
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}
.feat-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 18px;
  margin-bottom: 14px;
}

/* ── Dropzone ───────────────────────────────────────────── */
#dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 22px;
  background: var(--panel);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
#dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
#dropzone.dropzone-active {
  border-color: var(--accent) !important;
  border-style: solid;
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-ring);
  transform: translateY(-2px);
}
.drop-icon {
  width: 76px; height: 76px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  font-size: 34px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  transition: transform .2s ease;
}
#dropzone:hover .drop-icon { transform: translateY(-3px); }

/* ── Trim / cut timeline (trim-video, cut-audio) ─────────── */
.trim-track {
  position: relative; height: 46px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border);
  margin: 0 11px; touch-action: none; user-select: none;
}
.trim-range {
  position: absolute; top: -1px; bottom: -1px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 12px;
}
.trim-handle {
  position: absolute; top: 50%; width: 22px; height: 58px;
  transform: translate(-50%, -50%); border-radius: 8px;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: var(--shadow-sm); cursor: ew-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
}
.trim-handle::after { content: ""; width: 2px; height: 18px; background: rgba(255,255,255,.85); border-radius: 2px; }

/* Playhead — current playback position, draggable to seek precisely.
   The stem rises well above the track and carries a wide grab pad + knob,
   so the playhead can be grabbed by its top even when the line sits exactly
   on a trim boundary handle (the handles live down in the track body). */
.trim-playhead {
  position: absolute; top: -18px; bottom: -5px; left: 0; width: 3px;
  background: var(--txt); border-radius: 3px;
  transform: translateX(-50%); cursor: ew-resize;
  touch-action: none; z-index: 3;
}
/* Wide transparent grab pad over the raised stem (sits above the handles). */
.trim-playhead::before {
  content: ""; position: absolute; left: 50%; top: -4px;
  width: 26px; height: 28px; transform: translateX(-50%);
}
/* Knob at the top of the raised stem. */
.trim-playhead::after {
  content: ""; position: absolute; top: -3px; left: 50%;
  width: 15px; height: 15px; transform: translateX(-50%);
  border-radius: 50%; background: var(--txt); border: 2.5px solid #fff;
  box-shadow: var(--shadow-sm);
  transition: background .12s, box-shadow .12s, transform .12s;
}
/* Aligned: playhead sits exactly on a trim boundary — a bright accent
   "point line" so the user knows the cut edge and playhead coincide. */
.trim-playhead.aligned {
  width: 4px; background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 9px 1px var(--accent-ring);
}
.trim-playhead.aligned::after {
  background: var(--accent); border-color: #fff;
  transform: translateX(-50%) scale(1.18);
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-sm);
}
.trim-handle.snapped {
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-sm);
}

/* Oversized-input guidance shown under the dropzone (core/size-limit.js). */
.size-notice {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.30);
  color: var(--warn);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
}
.size-notice strong { color: var(--warn); font-weight: 700; }

/* Play / pause pill for media previews. */
.play-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 40px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--txt);
  cursor: pointer; transition: border-color .16s, background .16s, color .16s;
}
.play-btn:hover { border-color: var(--accent-border); background: var(--panel-2); }
.play-btn.is-playing { border-color: var(--accent-border); color: var(--accent-2); }
.play-btn .play-ico { font-size: 15px; line-height: 1; }

/* ── Crop editor ────────────────────────────────────────── */
#video-container { position: relative; display: inline-block; line-height: 0; border-radius: 14px; overflow: hidden; }
#preview-video, #crop-media { display: block; max-width: 100%; border-radius: 14px; }
#crop-media { max-height: 60vh; width: auto; }

#crop-box {
  position: absolute;
  top: unset;
  cursor: grab;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(17,24,39,0.55);
  user-select: none;
  border-radius: 4px;
  z-index: 2;
}
#crop-box:active { cursor: grabbing; }
#crop-box .thirds {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, transparent 33.33%, rgba(255,255,255,0.5) 33.33%, rgba(255,255,255,0.5) calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(to right, transparent 66.66%, rgba(255,255,255,0.5) 66.66%, rgba(255,255,255,0.5) calc(66.66% + 1px), transparent calc(66.66% + 1px)),
    linear-gradient(to bottom, transparent 33.33%, rgba(255,255,255,0.5) 33.33%, rgba(255,255,255,0.5) calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(to bottom, transparent 66.66%, rgba(255,255,255,0.5) 66.66%, rgba(255,255,255,0.5) calc(66.66% + 1px), transparent calc(66.66% + 1px));
}
#crop-box .corner {
  position: absolute; width: 18px; height: 18px;
  border: 2.5px solid #fff; pointer-events: none;
}
#crop-box .corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
#crop-box .corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
#crop-box .corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
#crop-box .corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }
#crop-box .grip {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex; gap: 3px;
  padding: 7px 8px;
  background: rgba(17,24,39,0.6);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  pointer-events: none;
}
#crop-box .grip i { width: 2px; height: 13px; border-radius: 2px; background: #fff; display: block; }
#crop-box .ratio-chip {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);
  padding: 3px 9px; border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

/* Resize handles */
.crop-handle { position: absolute; z-index: 10; }
.crop-handle.tl { top: 0; left: 0; width: 18px; height: 18px; cursor: nw-resize; }
.crop-handle.tr { top: 0; right: 0; width: 18px; height: 18px; cursor: ne-resize; }
.crop-handle.bl { bottom: 0; left: 0; width: 18px; height: 18px; cursor: sw-resize; }
.crop-handle.br { bottom: 0; right: 0; width: 18px; height: 18px; cursor: se-resize; }
.crop-handle.t  { top: 0;    left: 18px; right: 18px; height: 8px; cursor: n-resize; }
.crop-handle.b  { bottom: 0; left: 18px; right: 18px; height: 8px; cursor: s-resize; }
.crop-handle.l  { left: 0;   top: 18px; bottom: 18px; width: 8px;  cursor: w-resize; }
.crop-handle.r  { right: 0;  top: 18px; bottom: 18px; width: 8px;  cursor: e-resize; }
.crop-handle.t::after, .crop-handle.b::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 4px; border-radius: 3px; background: rgba(255,255,255,0.85);
}
.crop-handle.l::after, .crop-handle.r::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 26px; border-radius: 3px; background: rgba(255,255,255,0.85);
}

/* ── Ratio selector ─────────────────────────────────────── */
#ratio-bar { width: 100%; }
.ratio-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 62px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--txt-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
  letter-spacing: -0.01em;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.ratio-btn:hover { border-color: var(--accent-border); background: var(--panel-2); color: var(--txt); }
.ratio-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}
.ratio-btn .r-box { display: block; border: 1.5px solid currentColor; border-radius: 2px; opacity: 0.7; }
.ratio-btn .r-box-dashed { border-style: dashed; }

/* ── Corner-preset pills (remove-logo-video) ────────────────
   Distinct class from .ratio-btn so crop-box.js does not bind
   them as ratio buttons; purely moves the box to a corner. */
.pos-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--txt-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.pos-btn:hover { border-color: var(--accent-border); background: var(--panel-2); color: var(--txt); }
.pos-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* ── Size inputs ────────────────────────────────────────── */
.size-inputs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  transition: border-color .16s, box-shadow .16s;
}
.size-inputs:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.size-label { font-size: 12px; color: var(--txt-3); font-weight: 500; white-space: nowrap; }
.size-field { display: inline-flex; align-items: baseline; gap: 2px; }
.size-input {
  width: 52px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: right;
  padding: 0;
  -moz-appearance: textfield;
}
.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.size-unit { font-size: 10px; color: var(--txt-3); font-weight: 500; }
.size-sep { font-size: 13px; color: var(--txt-3); font-weight: 500; flex-shrink: 0; }

/* Standalone number inputs (image tools) — separate from crop's inline .size-input */
.num-input {
  width: 100px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--txt);
  font-size: 14px;
  outline: none;
  -moz-appearance: textfield;
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* ── Range slider (image compressor quality) ────────────── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff;
}

/* ── Progress ───────────────────────────────────────────── */
.progress-track {
  width: 100%; height: 10px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar-inner {
  background: var(--accent);
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
}

/* ── Step cards (JS swaps inline styles for active/done) ──── */
#step1, #step2, #step3 {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border-radius: 14px !important;
  padding: 16px 10px !important;
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.step-emoji { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 17px; }

.step-num {
  margin: 0 auto 12px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-family: var(--font-mono);
  font-weight: 700; font-size: 13px; color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

/* ── Ad card (wraps a rendered AdSense unit) ────────────── */
.ad-card {
  min-height: 120px;
  overflow: hidden;
}
.ad-card .adsbygoogle { display: block; width: 100%; }
/* Hide an ad unit AdSense couldn't fill (the card is collapsed via JS too). */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ── PDF thumbnail grid (split / delete / rotate) ───────────
   Clickable page previews rendered by core/pdf-thumbs.js. */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 4px;
}
.pdf-thumb {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s, transform .12s, opacity .12s;
}
.pdf-thumb:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pdf-thumb-canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: #fff;
  overflow: hidden;
}
.pdf-thumb-canvas canvas { max-width: 100%; max-height: 100%; height: auto; transition: transform .18s ease; }
.pdf-thumb-skel {
  width: 60%; height: 74%;
  border-radius: 4px;
  background: linear-gradient(100deg, var(--panel-2) 30%, var(--border) 50%, var(--panel-2) 70%);
  background-size: 300% 100%;
  animation: pdf-shimmer 1.2s ease-in-out infinite;
}
@keyframes pdf-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pdf-thumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.pdf-thumb-num { font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-3); }
.pdf-thumb-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 999px;
  font-size: 11px; line-height: 1;
}
.pdf-thumb-check { border: 1.5px solid var(--border-strong); background: var(--panel); }

/* keep-mode: selected = kept (highlighted); unselected = dropped (faded). */
.pdf-grid--keep .pdf-thumb { opacity: .5; }
.pdf-grid--keep .pdf-thumb.is-selected { opacity: 1; border-color: var(--accent); }
.pdf-grid--keep .pdf-thumb.is-selected .pdf-thumb-canvas { box-shadow: inset 0 0 0 2px var(--accent); }
.pdf-grid--keep .pdf-thumb.is-selected .pdf-thumb-check { background: var(--accent); border-color: var(--accent); }
.pdf-grid--keep .pdf-thumb.is-selected .pdf-thumb-check::after { content: "✓"; color: #fff; font-size: 11px; }

/* remove-mode: selected = marked for deletion (red). */
.pdf-grid--remove .pdf-thumb.is-selected { border-color: var(--err); opacity: 1; }
.pdf-grid--remove .pdf-thumb.is-selected .pdf-thumb-canvas { box-shadow: inset 0 0 0 2px var(--err); }
.pdf-grid--remove .pdf-thumb.is-selected .pdf-thumb-canvas::after {
  content: "✕"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--err);
  background: rgba(220,38,38,0.12);
}
.pdf-grid--remove .pdf-thumb.is-selected .pdf-thumb-check { background: var(--err); border-color: var(--err); }
.pdf-grid--remove .pdf-thumb.is-selected .pdf-thumb-check::after { content: "✕"; color: #fff; font-size: 10px; }

/* rotate-mode: badge hints the per-page action. */
.pdf-grid--rotate .pdf-thumb-badge { color: var(--txt-3); }
.pdf-grid--rotate .pdf-thumb:hover .pdf-thumb-badge { color: var(--accent); }

/* preview-mode: read-only page previews (no clicking). */
.pdf-grid--preview .pdf-thumb { cursor: default; }
.pdf-grid--preview .pdf-thumb:hover { transform: none; border-color: var(--border); box-shadow: none; }

/* merge-pdf: small first-page cover thumbnail in each file row. */
.merge-thumb {
  width: 40px; height: 54px; flex: none;
  border-radius: 5px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #fff;
}
.merge-thumb-skel { background: var(--panel-2); border-style: dashed; }

/* Small toolbar above a grid (select all / none / invert). */
.pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pdf-tool-btn {
  padding: 5px 11px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--txt-2);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.pdf-tool-btn:hover { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-2); }

/* ── Prose for info / legal pages (About, Contact, Privacy, Terms) ── */
.doc-prose { color: var(--txt-2); font-size: 15px; line-height: 1.75; }
.doc-prose > * + * { margin-top: 14px; }
.doc-prose h2 {
  color: var(--txt); font-weight: 700; font-size: 20px;
  letter-spacing: -0.01em; margin-top: 34px; margin-bottom: 4px;
  scroll-margin-top: 84px;
}
.doc-prose h3 { color: var(--txt); font-weight: 600; font-size: 15.5px; margin-top: 22px; }
.doc-prose p { color: var(--txt-2); }
.doc-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc-prose a:hover { color: var(--accent-2); }
.doc-prose strong { color: var(--txt); font-weight: 600; }
.doc-prose ul, .doc-prose ol { margin-left: 1.15rem; }
.doc-prose ul { list-style: disc; }
.doc-prose ol { list-style: decimal; }
.doc-prose li { margin-top: 7px; padding-left: 3px; }
.doc-prose li::marker { color: var(--txt-3); }
.doc-prose hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.doc-prose .doc-note {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; font-size: 14px;
}

/* ── FAQ accordion (tool pages) ─────────────────────────── */
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--txt);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-weight: 400; font-size: 20px; line-height: 1;
  color: var(--txt-3); flex: none; transition: transform .18s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent-2); }
.faq-a {
  padding: 0 18px 16px;
  color: var(--txt-2);
  font-size: 14px;
  line-height: 1.7;
}

/* ── Language switcher (SVG-flag dropdown) ──────────────── */
.flag-svg { width: 20px; height: 14px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.flag-fallback { font-size: 11px; font-weight: 700; color: var(--txt-2); }
.lang-dd { position: relative; }
.lang-dd > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 9px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel);
}
.lang-dd > summary::-webkit-details-marker { display: none; }
.lang-dd > summary::marker { content: ""; }
.lang-dd > summary:hover { background: var(--panel-2); border-color: var(--border-strong); }
.lang-dd-cur { font-size: 13px; font-weight: 500; color: var(--txt-2); }
.lang-dd-caret { font-size: 9px; color: var(--txt-3); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 150px; padding: 6px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md); z-index: 60;
  /* Cap the height and scroll internally so a long language list never runs
     off the bottom of the screen (16 locales overflow a phone viewport, and
     the last items were unreachable). dvh keeps it on-screen under the mobile
     browser toolbar; vh is the fallback for browsers without dvh. */
  max-height: 70vh;
  max-height: 70dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.lang-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--txt-2); text-decoration: none;
}
.lang-opt:hover { background: var(--panel-2); color: var(--txt); }
.lang-opt.is-current { color: var(--accent-2); font-weight: 600; }

.section-hidden { display: none !important; }

/* Horizontally-scrollable rows (mobile category nav) without a visible bar. */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Entrance */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
