/*
Theme Name: Photovoid
Theme URI: https://photovoid.com
Author: Vladimir
Description: Тема для photovoid.com с приоритетом приватности — набор браузерных инструментов для работы с изображениями. Без внешних запросов, без телеметрии, без шрифтов с CDN.
Version: 0.36.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: photovoid
Tags: translation-ready, custom-colors, custom-menu, threaded-comments
*/

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

/* ============================================================
   Theme tokens — light by default, dark via [data-theme="dark"]
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --text: #0a0a0a;
  --muted: #6e6e6e; /* WCAG AA на белом: 5.05:1. Было #777 → 4.486:1, не проходило 4.5:1. */
  --border: #e5e5e5;
  --accent: var(--text);
  --selection: #0a0a0a;
  --selection-text: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-soft: #131313;
  --text: #e8e8e8;
  --muted: #888888;
  --border: #1f1f1f;
  --accent: var(--text);
  --selection: #e8e8e8;
  --selection-text: #0a0a0a;
}

/* ============================================================
   Typography
   ============================================================ */
body {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--selection); color: var(--selection-text); }

/* ============================================================
   Skip link (a11y) — hidden until focused
   ============================================================ */
.pv-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 8px 16px;
  border: 1px solid var(--text);
  text-decoration: none;
  z-index: 1000;
}
.pv-skip-link:focus {
  left: 16px;
  top: 16px;
}
[dir="rtl"] .pv-skip-link { left: auto; right: -9999px; }
[dir="rtl"] .pv-skip-link:focus { left: auto; right: 16px; }

/* ============================================================
   Layout
   ============================================================ */
.pv-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.pv-narrow    { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.pv-page-narrow { margin-top: 48px; margin-bottom: 48px; }

main { padding: 48px 0 96px; }
main:focus { outline: none; } /* tabindex="-1" on main is for skip-link target only */

/* ============================================================
   Header
   ============================================================ */
.pv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  position: relative;
}

/* Логотип — единый SVG с текстом «photo · void», цвет наследуется через
   currentColor. Без отдельного <span> с текстом — всё внутри SVG. */
.pv-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  line-height: 0; /* убирает базовый отступ снизу SVG */
}
.pv-logo:hover { text-decoration: none; }
.pv-logo-svg {
  display: block;
  width: auto;
  height: 32px; /* высота логотипа в шапке */
}
@media (max-width: 540px) {
  .pv-logo-svg { height: 28px; }
}

/* Бургер — виден только на узких экранах. */
.pv-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
}
.pv-menu-toggle:hover { border-color: var(--text); }
.pv-menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.pv-menu-toggle[aria-expanded="true"] .pv-menu-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.pv-menu-toggle[aria-expanded="true"] .pv-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}
.pv-menu-toggle[aria-expanded="true"] .pv-menu-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Навигация — flex с пунктами и блоком действий. */
.pv-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
}
.pv-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pv-menu-item { display: inline-block; }
.pv-menu-item a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  font-size: 15px;
}
.pv-menu-item a:hover {
  border-bottom-color: var(--border);
}
.pv-menu-item-current a {
  border-bottom-color: var(--text);
}

.pv-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Мобильные экраны: бургер показываем, меню превращаем в выпадающее. */
@media (max-width: 720px) {
  .pv-menu-toggle { display: inline-flex; }

  .pv-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px;
    /* Скрыто по умолчанию; показывается по data-open="true". */
    display: none;
    z-index: 50;
  }
  .pv-nav[data-open="true"] { display: flex; }

  .pv-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .pv-menu-item a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
  }
  .pv-menu-item:last-child a { border-bottom: 0; }
  .pv-menu-item-current a {
    /* На мобиле подсвечиваем не нижней рамкой, а левой полоской. */
    border-bottom-color: var(--border);
    padding-left: 12px;
    border-left: 3px solid var(--text);
  }

  .pv-nav-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* ============================================================
   Language switcher (translation plugin) — minimal <select>
   Works with Polylang's pll_the_languages dropdown and with the
   <select>-based switchers most auto-translation plugins render.
   ============================================================ */
.pv-lang-switcher {
  display: inline-block;
}
.pv-lang-switcher select,
.pv-lang-switcher .lang_choice {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 24px 4px 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) center, calc(100% - 7px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
[dir="rtl"] .pv-lang-switcher select,
[dir="rtl"] .pv-lang-switcher .lang_choice {
  padding: 4px 8px 4px 24px;
  background-position: 12px center, 7px center;
  background-image: linear-gradient(135deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(45deg, var(--muted) 50%, transparent 50%);
}
.pv-lang-switcher select:hover,
.pv-lang-switcher .lang_choice:hover {
  border-color: var(--text);
}
.pv-lang-switcher select option {
  background: var(--bg);
  color: var(--text);
}

/* ============================================================
   Language switch (ru/en) — отдельная компактная кнопка
   ============================================================ */
.pv-lang-switch {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  letter-spacing: 0.5px;
}
.pv-lang-switch:hover { border-color: var(--text); }
.pv-lang-switch .pv-lang-cur { color: var(--text); font-weight: 500; }
.pv-lang-switch .pv-lang-sep { color: var(--muted); }
.pv-lang-switch .pv-lang-alt { color: var(--muted); }
.pv-lang-switch:hover .pv-lang-alt { color: var(--text); }

/* ============================================================
   Theme toggle (SVG icons — sun shown in light, moon in dark)
   ============================================================ */
.pv-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pv-theme-toggle:hover { border-color: var(--text); }

.pv-theme-toggle .pv-icon { display: none; }
:root[data-theme="light"] .pv-theme-toggle .pv-icon-moon { display: block; }
:root[data-theme="dark"]  .pv-theme-toggle .pv-icon-sun  { display: block; }
:root:not([data-theme]) .pv-theme-toggle .pv-icon-moon { display: block; }

/* ============================================================
   Content typography
   ============================================================ */
h1, h2, h3 { font-weight: 700; line-height: 1.3; margin: 0 0 16px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; margin-top: 48px; }
h3 { font-size: 17px; margin-top: 32px; }
p { margin: 0 0 16px; }
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 0 0 6px; }
[dir="rtl"] ul, [dir="rtl"] ol { padding-left: 0; padding-right: 24px; }

/* ============================================================
   Hero on front page
   ============================================================ */
.pv-hero { padding: 64px 0 48px; }
.pv-hero h1 { font-size: 32px; margin-bottom: 12px; }
.pv-hero p { color: var(--muted); margin: 0; max-width: 640px; }
.pv-hero-cta { margin-top: 24px; display: flex; gap: 16px; flex-wrap: wrap; }
.pv-btn {
  display: inline-block;
  border: 1px solid var(--text);
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text);
}
.pv-btn:hover { background: var(--text); color: var(--bg); text-decoration: none; }
.pv-btn-ghost { border-color: var(--border); }
.pv-btn-ghost:hover { background: transparent; color: var(--text); border-color: var(--text); }

/* ============================================================
   Page hero (inner pages: about, faq, contact, privacy)
   ============================================================ */
.pv-page-hero { margin-bottom: 16px; }
.pv-page-hero h1 { font-size: 28px; margin-bottom: 8px; }
.pv-page-hero p { color: var(--muted); margin: 0; }

/* ============================================================
   Section primitives
   ============================================================ */
.pv-section { margin-top: 64px; }
.pv-section:first-of-type { margin-top: 0; }
.pv-section-title { margin-top: 0; }
.pv-section-intro { color: var(--muted); max-width: 640px; margin-top: -8px; }
.pv-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}

/* ============================================================
   Services grid (home) — tools grouped by category
   ============================================================ */
.pv-cat { margin-top: 56px; }
.pv-cat:first-child { margin-top: 0; }
.pv-cat-head { margin-bottom: 8px; }
.pv-cat-head h3 { margin: 0; font-size: 18px; }
.pv-cat-desc { color: var(--muted); margin: 0 0 20px; }

.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.pv-grid-item {
  background: var(--bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 116px;
}
.pv-grid-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.pv-grid-item-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.pv-grid-item-title a { text-decoration: none; }
.pv-grid-item-title a:hover { text-decoration: underline; }
.pv-grid-item-title .pv-static { color: var(--muted); }
.pv-grid-item-desc { color: var(--muted); margin: 0; }

/* ============================================================
   Tool list (legacy flat list — still used as fallback)
   ============================================================ */
.pv-tool-list { list-style: none; padding: 0; margin: 0; }
.pv-tool-card { padding: 24px 0; border-bottom: 1px solid var(--border); }
.pv-tool-card:last-child { border-bottom: 0; }
.pv-tool-card-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.pv-tool-card-title a { text-decoration: none; }
.pv-tool-card-title a:hover { text-decoration: underline; }
.pv-tool-desc { color: var(--muted); margin: 0; }

/* Status badge — used on cards and grid items */
.pv-tool-status {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  vertical-align: middle;
  text-transform: lowercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   Feature row — privacy promises on the home page
   ============================================================ */
.pv-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 24px;
}
.pv-feature h3 { margin: 0 0 6px; font-size: 15px; }
.pv-feature p { color: var(--muted); margin: 0; font-size: 14px; }

/* ============================================================
   Single tool page
   ============================================================ */
.pv-tool-back { display: inline-block; margin-bottom: 32px; color: var(--muted); }
.pv-tool-lead { font-size: 17px; color: var(--muted); margin-bottom: 0; }
.pv-tool-mount {
  margin: 48px 0;
  padding: 32px;
  border: 1px solid var(--border);
  min-height: 200px;
}

/* ============================================================
   FAQ accordion
   ============================================================ */
.pv-faq { border-top: 1px solid var(--border); margin-top: 24px; }
.pv-faq-item { border-bottom: 1px solid var(--border); }
.pv-faq-q {
  width: 100%;
  background: none;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  padding: 20px 32px 20px 0;
  cursor: pointer;
  position: relative;
  line-height: 1.4;
}
[dir="rtl"] .pv-faq-q { text-align: right; padding: 20px 0 20px 32px; }
.pv-faq-q::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 18px;
  font-size: 20px;
  color: var(--muted);
}
[dir="rtl"] .pv-faq-q::after { right: auto; left: 4px; }
.pv-faq-q[aria-expanded="true"]::after { content: "\2212"; } /* minus */
.pv-faq-a { padding: 0 0 20px; color: var(--muted); }
.pv-faq-a[hidden] { display: none; }
.pv-faq-a p:last-child { margin-bottom: 0; }

/* ============================================================
   Contact page
   ============================================================ */
.pv-contact-methods { list-style: none; padding: 0; margin: 24px 0 0; }
.pv-contact-methods li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.pv-contact-methods li:first-child { border-top: 1px solid var(--border); }
.pv-contact-label { color: var(--muted); min-width: 120px; }

/* ============================================================
   404
   ============================================================ */
.pv-404 { margin: 96px auto; text-align: center; }
.pv-404-code { font-size: 48px; margin-bottom: 8px; }
.pv-404-text { color: var(--muted); }
.pv-404-back { margin-top: 32px; }

/* ============================================================
   Footer
   ============================================================ */
.pv-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.pv-footer a { color: var(--muted); }
.pv-footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
/* <ul>-обёртка нужна, чтобы <li> жили внутри родителя — Lighthouse флагает голые <li>
   как нарушение разметки списков. display: contents вытаскивает <li> наружу, и они
   участвуют во flex-разметке .pv-footer-nav как раньше, без визуальных изменений. */
.pv-footer-menu { list-style: none; margin: 0; padding: 0; display: contents; }
.pv-footer-nav a { text-decoration: none; }
.pv-footer-nav a:hover { text-decoration: underline; }

/* ============================================================
   Focus (a11y)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 540px) {
  .pv-container, .pv-narrow { padding: 0 16px; }
  .pv-breadcrumbs { padding: 0 16px; }
  .pv-nav { padding-left: 16px; padding-right: 16px; }
  .pv-hero { padding: 40px 0 32px; }
  .pv-hero h1 { font-size: 26px; }
  h1 { font-size: 24px; }
  .pv-tool-mount { padding: 20px; }
  .pv-404 { margin: 64px auto; }
  .pv-404-code { font-size: 40px; }
  .pv-grid { grid-template-columns: 1fr; }
  .pv-section, .pv-cat { margin-top: 48px; }
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.pv-breadcrumbs {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 24px;
  font-size: 13px;
  color: var(--muted);
}
.pv-breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.pv-breadcrumbs li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.pv-breadcrumbs li + li::before {
  content: "/";
  padding: 0 8px;
  color: var(--border);
}
[dir="rtl"] .pv-breadcrumbs li + li::before {
  content: "\\";
}
.pv-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.pv-breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.pv-breadcrumbs [aria-current="page"] { color: var(--text); }

/* ============================================================
   Related tools (single-tool page) и flat grid
   ============================================================ */
.pv-related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }
.pv-related .pv-section-title { font-size: 18px; margin-top: 0; }

/* «Плоская» сетка — без внешней рамки, для архива и related,
   где сетка живёт в более узком контейнере. */
.pv-grid-flat {
  border: 0;
  background: transparent;
  gap: 16px;
  margin-top: 16px;
}
.pv-grid-flat .pv-grid-item {
  border: 1px solid var(--border);
  background: var(--bg);
}

/* ============================================================
   Tool filter (страница «Все инструменты»)
   ============================================================ */
.pv-tool-filter { margin: 32px 0; }
.pv-filter-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.pv-filter-input:focus {
  outline: none;
  border-color: var(--text);
}
.pv-filter-input::placeholder { color: var(--muted); }
.pv-filter-status {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

/* Категория в архиве (используется и на странице «Все инструменты»):
   ссылка в заголовке — без подчёркивания, чтобы не казалась пунктом
   меню. */
.pv-cat .pv-cat-head h2 { margin: 0; font-size: 18px; }
.pv-cat .pv-cat-head h2 a { text-decoration: none; }
.pv-cat .pv-cat-head h2 a:hover { text-decoration: underline; }

/* Карточки, скрытые фильтром. */
[data-pv-search].pv-hidden { display: none; }
/* Блок категории, если все карточки в нём скрыты. */
[data-pv-cat-block].pv-hidden { display: none; }

/* ============================================================
   Visually hidden (a11y helper)
   ============================================================ */
.pv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Tool widgets — общий стиль для встроенных инструментов
   (для бандлов в /assets/tools/<slug>/)
   ============================================================ */
.pv-widget { display: flex; flex-direction: column; gap: 16px; }
.pv-widget-drop {
  border: 2px dashed var(--border);
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.pv-widget-drop.pv-drag-over {
  border-color: var(--text);
  color: var(--text);
}
.pv-widget-drop input[type="file"] { display: none; }
.pv-widget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.pv-widget-controls label { display: inline-flex; gap: 8px; align-items: center; }
.pv-widget-controls input[type="number"],
.pv-widget-controls select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 14px;
  width: auto;
}
.pv-widget-controls input[type="number"] { width: 80px; }
.pv-widget-controls input[type="checkbox"] { accent-color: var(--text); }
.pv-widget-btn {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.pv-widget-btn:hover { background: var(--text); color: var(--bg); }
.pv-widget-btn:disabled {
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  background: transparent;
}
.pv-widget-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.pv-widget-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}
.pv-widget-info {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   Crop tool — stage / overlay / handles
   ============================================================ */
.pv-crop-stage {
  position: relative;
  margin: 0 0 8px;
  background: #000;
  /* КРИТИЧНО: тёмная вуаль реализована через box-shadow с огромным
     spread на .pv-crop-rect. Без overflow:hidden эта тень растекается
     за границы stage и затемняет всю страницу. */
  overflow: hidden;
  /* Минимальная высота на случай, если картинка ещё не загрузилась —
     иначе stage схлопывается в 0 и происходит «прыжок». */
  min-height: 1px;
}
.pv-crop-overlay {
  /* Сам overlay прозрачный — затемнение делает box-shadow рамки. */
  pointer-events: none;
}
.pv-crop-rect {
  pointer-events: auto;
  /* Цвет рамки белый — задан inline в JS. Тут добавим лёгкую тень для
     контраста на белых картинках. */
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.6));
}
.pv-crop-handle {
  pointer-events: auto;
  touch-action: none;
}
@media (hover: none) {
  /* На тач-устройствах ручки крупнее — пальцем точно попасть. */
  .pv-crop-handle { width: 22px !important; height: 22px !important; }
}

/* ============================================================
   EXIF Viewer
   ============================================================ */
.pv-exif-output {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}
.pv-exif-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.pv-exif-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pv-exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pv-exif-table td {
  padding: 4px 8px 4px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.pv-exif-table td:first-child {
  color: var(--muted);
  width: 40%;
  white-space: nowrap;
}
.pv-exif-table td:last-child {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-word;
}
/* Секция, помеченная как «чувствительные данные» (GPS) — рамка-акцент. */
.pv-exif-sensitive {
  border-top-color: var(--text);
}
.pv-exif-sensitive h4 {
  color: var(--text);
}

/* ============================================================
   Batch list (EXIF Remover)
   ============================================================ */
.pv-batch-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  border: 1px solid var(--border);
}
.pv-batch-list:empty { display: none; }
.pv-batch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pv-batch-item:last-child { border-bottom: 0; }
.pv-batch-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
  flex: 1;
}
.pv-batch-status {
  color: var(--muted);
  white-space: nowrap;
}
.pv-batch-item-ok           { background: rgba(0,128,0,0.04); }
.pv-batch-item-ok .pv-batch-status   { color: #2a7a2a; }
.pv-batch-item-err          { background: rgba(200,0,0,0.05); }
.pv-batch-item-err .pv-batch-status  { color: #b03030; }
.pv-batch-item-unsupported  { background: rgba(0,0,0,0.03); }
.pv-batch-item-processing .pv-batch-status { color: var(--text); }

.pv-widget-btn-ghost {
  border-color: var(--border);
  color: var(--muted);
}
.pv-widget-btn-ghost:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

/* ============================================================
   Before/After compare slider
   ============================================================ */
.pv-compare-box {
  max-width: 100%;
}
.pv-compare {
  width: 100%;
}
.pv-compare-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  user-select: none;
  touch-action: none;
}
.pv-compare-inner img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pv-compare-before {
  position: relative;
  z-index: 1;
}
.pv-compare-after {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.pv-compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 3;
  cursor: ew-resize;
  /* Ручка-кружок по центру высоты. */
}
.pv-compare-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.pv-compare-divider::after {
  content: "⇆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 14px;
  font-weight: bold;
  z-index: 4;
  pointer-events: none;
}
.pv-compare-divider:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}
.pv-compare-label {
  position: absolute;
  top: 12px;
  z-index: 4;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 4px 10px;
  border-radius: 2px;
  pointer-events: none;
}
.pv-compare-label-before { left: 12px; }
.pv-compare-label-after  { right: 12px; }

/* ============================================================
   Eyedropper — color swatches + history
   ============================================================ */
.pv-eyedrop-stage {
  margin: 0 0 16px;
  background: #000;
  overflow: hidden;
}
.pv-eyedrop-readout {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin: 16px 0;
  border: 1px solid var(--border);
}
.pv-eyedrop-swatch {
  width: 96px;
  flex-shrink: 0;
  background: #ccc;
  border-right: 1px solid var(--border);
}
.pv-eyedrop-info {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.pv-eyedrop-info code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  font-size: 12px;
}
.pv-eyedrop-history {
  margin: 16px 0;
}
.pv-eyedrop-history-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pv-eyedrop-chip {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
}
.pv-eyedrop-chip:hover { border-color: var(--text); }
.pv-eyedrop-chip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ============================================================
   Palette — swatches grid
   ============================================================ */
.pv-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.pv-palette-swatch {
  border: 0;
  padding: 0;
  aspect-ratio: 1.4 / 1;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.pv-palette-swatch:hover { transform: scale(1.02); transition: transform 0.1s; }
.pv-palette-swatch:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.pv-palette-swatch-label {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-shadow: 0 0 4px rgba(0,0,0,0.2);
}
.pv-palette-share { opacity: 0.85; font-size: 11px; }

/* ============================================================
   Split-grid stage
   ============================================================ */
.pv-splitgrid-stage {
  margin: 0 0 16px;
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .pv-header, .pv-footer, .pv-theme-toggle, .pv-lang-switch, .pv-lang-switcher, .pv-tool-back, .pv-breadcrumbs, .pv-tool-filter { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; }
  .pv-faq-a[hidden] { display: block !important; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
