/* fotorestaura.com design system (P5.1; design direction "B · Estudio claro" chosen by Ivan 2026-11-08; documented
   in docs/DESIGN.md).
   Rules (BUILD-SPEC §4, DEV-PLAN §1): body 19 px, buttons >= 52 px with words, one main action per screen (the only
   filled element in the accent colour), WCAG AA contrast (ratios next to the tokens, measured against --paper unless
   noted), nothing depends on hover, the same layout on a phone and a computer. No inline styles anywhere (CSP 'self'). */

/* ---------- Fonts (self-hosted, OFL; subsets of Source Sans 3 and Manrope ExtraBold, renamed for the modified
   versions; licences in assets/fonts/) ---------- */

@font-face {
  font-family: "FR Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/fr-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "FR Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/fr-sans-700.woff2") format("woff2");
}
@font-face {
  font-family: "FR Head"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/fr-head-800.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --font-body: "FR Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "FR Head", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-base: 19px;
  --fs-small: 0.9rem;            /* 17.1 px: the smallest text on the site */
  --fs-lead: 1.15rem;
  --fs-h1: clamp(1.79rem, 1.45rem + 1.4vw, 2.35rem);   /* 34 px on a phone, 44.6 px on a computer */
  --fs-h2: 1.35rem;              /* 25.7 px */
  --fs-h3: 1.15rem;
  --lh: 1.6;
  --lh-head: 1.2;

  --paper: #ffffff;              /* page background (white) */
  --surface: #ffffff;            /* cards, fields, boxes */
  --sunk: #f3f5f9;               /* quiet panels (Cómo funciona, FAQ rows, table heads), image placeholders */
  --info: #eef4ff;               /* light blue information panel ("Sus fotos", calm notes, content notices) */
  --info-line: #c7d7fe;          /* its border (decorative) */
  --ink: #111827;                /* text: 17.7:1 on white, 16.3:1 on --sunk, 16.1:1 on --info */
  --ink-soft: #374151;           /* lead and captions: 10.3:1 on white, 9.4:1 on --sunk */
  --ink-muted: #4b5563;          /* secondary text: 7.6:1 on white, 6.9:1 on --sunk, 6.8:1 on --info */
  --link: #1d4ed8;               /* links and secondary buttons (royal blue): 6.7:1 on white, 6.1:1 on --sunk and --info */
  --accent: #1d4ed8;             /* the ONE main action (filled): white on it 6.7:1 */
  --accent-strong: #1e40af;      /* pressed/hover state: white on it 8.7:1 */
  --accent-tint: #eaf1ff;        /* selected card background: ink on it 15.7:1, --link on it 5.9:1 */
  --accent-fg: #ffffff;
  --check: #15803d;              /* decorative check marks: 5.0:1 on white */
  --save: #166534;               /* the saving line of the pack cards (text): 7.1:1 on white, 6.3:1 on --accent-tint */
  --danger: #b91c1c;             /* destructive buttons and error text: white on it 6.5:1; on white 6.5:1, on --notice 6.2:1 */
  --danger-strong: #991b1b;      /* pressed/hover destructive: white on it 8.3:1 */
  --notice: #fffbeb;             /* calm error box background: ink 17.1:1, --ink-soft 9.9:1 */
  --notice-line: #b45309;        /* its border (non-text): 5.0:1 on white */
  --line: #e5e7eb;               /* decorative rules and card outlines */
  --border: #7b8494;             /* borders of controls (fields, choice cards, outlined buttons): 3.8:1 on white,
                                    3.5:1 on --sunk (WCAG 1.4.11) */
  --focus: #111827;
  --footer-bg: #0f172a;          /* dark navy footer */
  --footer-ink: #e5e7eb;         /* 14.4:1 on --footer-bg */
  --footer-muted: #cbd5e1;       /* 12.0:1 on --footer-bg */
  --footer-link: #93c5fd;        /* 9.9:1 on --footer-bg */

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --radius: 14px;                /* buttons, fields, rows */
  --radius-large: 18px;          /* cards, panels, the hero picture */
  --radius-small: 10px;
  --measure: 38em;               /* longest line of running text */
  --page: 760px;                 /* page column */
  --tap: 52px;                   /* minimum height of anything pressed */
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 14px rgba(17, 24, 39, 0.06);
  --shadow-accent: 0 6px 18px rgba(29, 78, 216, 0.24);

  /* Names used by older blocks (kept so their rules keep working). */
  --font: var(--font-body);
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--ink-muted);
  --space: var(--space-2);
  --max: var(--page);
}

/* ---------- Base ---------- */

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

html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--lh);
  background: var(--paper);
  color: var(--ink);
  overflow-wrap: break-word;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }   /* .button sets display, which would beat the hidden attribute */

h1, h2, h3 { color: var(--ink); text-wrap: balance; font-family: var(--font-head); font-weight: 800; }
h1 { font-size: var(--fs-h1); line-height: 1.12; margin: 0 0 12px; letter-spacing: -0.8px; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-head); margin: 0 0 12px; letter-spacing: -0.4px; }
h3 { font-size: var(--fs-h3); line-height: 1.3; margin: 0 0 var(--space-1); letter-spacing: -0.2px; }
p, ul, ol, dl, table, figure, details { margin: 0 0 var(--space-2); }
ul, ol { padding-left: 1.3em; }
li { margin: 0 0 6px; }
strong, b { font-weight: 700; }
small { font-size: var(--fs-small); }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; color: var(--accent-strong); }

/* Focus: always visible, never only a colour change. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a:focus-visible, .button:focus-visible, .link-button:focus-visible, [tabindex="-1"]:focus-visible,
summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}

.lead { font-size: var(--fs-lead); max-width: var(--measure); color: var(--ink-soft); }
.note { color: var(--ink-muted); }
.small { font-size: var(--fs-small); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-5); }
.prose h3 { margin-top: var(--space-4); }
.section { margin: var(--space-5) 0 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* P6.1: visitors who ask their system for less motion get none (today only the 1 px press of .button moves; this
   also covers anything added later, and the scroll of in-page jumps). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .button:active { transform: none; }
}

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--space-2); top: var(--space-2); z-index: 10; padding: 10px 16px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-small); }

/* ---------- Page shell: header, main column, footer ---------- */

.wrap, .page { width: 100%; max-width: var(--page); margin: 0 auto; padding-left: var(--space-2); padding-right: var(--space-2); }
@media (min-width: 600px) { .wrap, .page { padding-left: var(--space-3); padding-right: var(--space-3); } }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: 0 0 auto; width: 30px; height: 30px; }
.brand-text { display: inline-flex; flex-direction: column; justify-content: center; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; line-height: 1.1; letter-spacing: -0.3px; }
.brand-tag { font-size: var(--fs-small); line-height: 1.3; color: var(--ink-muted); margin-top: 2px; }   /* P6.1: was 15 px; 17 px is the smallest text */
.header-nav { flex: 0 0 auto; }
/* Design B: an outlined pill; still 52 px tall (DEV-PLAN §1) and the border passes 3:1 (WCAG 1.4.11). */
.header-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 8px 20px;
  font-weight: 700; color: var(--ink); background: var(--surface); text-decoration: none;
  border: 2px solid var(--border); border-radius: 999px;
}
.header-link:hover { color: var(--ink); background: var(--sunk); }
.header-link[aria-current="page"] { background: var(--sunk); }
/* Design B: below 600 px the header shows the mark and the name only (the tagline wrapped to three lines next to
   the mark and "Entrar"; the h1 says the same right below). Was: below 380 px. */
@media (max-width: 599.98px) { .brand-tag { display: none; } }

.page { padding-top: var(--space-4); padding-bottom: var(--space-5); }

/* Design B: dark navy footer with light text (contrast next to the --footer-* tokens). */
.site-footer {
  --focus: #ffffff;
  margin-top: var(--space-4); background: var(--footer-bg); color: var(--footer-ink);
}
.site-footer .wrap { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: #bfdbfe; }
.footer-links { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-report a { display: inline-flex; align-items: center; min-height: 44px; }   /* UX audit p3: same weight as the links */
.footer-meta { font-size: var(--fs-small); color: var(--footer-muted); margin: 0 0 6px; max-width: var(--measure); }
.footer-meta:last-child { margin-bottom: 0; }

/* ---------- Buttons and links that act ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 24px;
  border-radius: var(--radius); border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-fg);
  font: inherit; font-weight: 700; line-height: 1.3; text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* UX audit p4: hover styles only where a pointer can hover; on a touch screen the last tapped button (e.g. "Girar a
   la izquierda") kept its hover colour and looked pressed. */
@media (hover: hover) {
  .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-fg); text-decoration: none; }
}
.button:active { transform: translateY(1px); }
.button-big { min-height: 64px; font-size: 1.15rem; padding: 14px 32px; box-shadow: var(--shadow-accent); }
.button-icon { flex: 0 0 auto; width: 24px; height: 24px; }
.button-secondary { background: var(--surface); color: var(--link); border-color: var(--link); box-shadow: none; }
.button-danger { background: var(--danger); border-color: var(--danger); color: #ffffff; box-shadow: none; }
@media (hover: hover) {           /* p4 */
  .button-secondary:hover { background: var(--accent-tint); border-color: var(--accent-strong); color: var(--accent-strong); }
  .button-danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); color: #ffffff; }
}
.button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.button-block { width: 100%; }

.link-button {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 8px 0; border: 0; background: none;
  color: var(--link); font: inherit; text-align: left;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer;
}
@media (hover: hover) { .link-button:hover { text-decoration-thickness: 2px; color: var(--accent-strong); } }   /* p4 */

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 var(--space-2); }
.button-row .button { flex: 1 1 220px; }

/* ---------- Boxes: calm note, notice, error ---------- */

/* Design B: information (calm note, content notice) sits in the light blue panel; the accent stays for the action. */
.calm-note {
  padding: 16px 20px; background: var(--info);
  border: 1px solid var(--info-line); border-radius: var(--radius-large);
}
.calm-note > :last-child { margin-bottom: 0; }
.notice {
  padding: 16px 20px; margin: 0 0 var(--space-2); background: var(--info);
  border: 1px solid var(--info-line); border-radius: var(--radius-large);
}
.notice > :last-child { margin-bottom: 0; }
.error-box {
  margin: 0 0 var(--space-2); padding: 20px; background: var(--notice);
  border: 2px solid var(--notice-line); border-left-width: 8px; border-radius: var(--radius-large);
}
.error-box p { font-size: 1.05rem; }
.error-box > :last-child { margin-bottom: 0; }
.error-text { color: var(--danger); font-weight: 700; }

/* ---------- Cards ---------- */

.card {
  padding: 20px; margin: 0 0 var(--space-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-large); box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-2); margin: 0 0 var(--space-2); }
@media (min-width: 600px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.card-grid .card { margin: 0; }

/* ---------- Before/after figure for content pages (partials/before_after.php; P5.4 with examples.json) ---------- */

/* Design B: one card with a 1 px outline, the two pictures side by side (no gap), "Antes"/"Después" as pills on the
   pictures, the caption in a row below. */
.ba { margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-large); overflow: hidden; background: var(--surface); }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.ba-item { position: relative; margin: 0; background: var(--sunk); }
.ba-item img { display: block; width: 100%; height: auto; }
.ba-item figcaption {
  position: absolute; left: 10px; bottom: 10px; margin: 0; padding: 2px 12px; border-radius: 999px;
  font-size: var(--fs-small); font-weight: 700; line-height: 1.5; color: #ffffff; background: rgba(17, 24, 39, 0.82);
}
.ba-item + .ba-item figcaption { color: var(--ink); background: #ffffff; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.3); }
.ba > figcaption { margin: 0; padding: 12px 16px; color: var(--ink-soft); font-size: var(--fs-small); }

/* ---------- Home hero: a big before/after slider above the h1 (templates/partials/hero_compare.php, assets/compare.js)
   Full width on a phone (the negative margins undo the page padding), inside the page column with round corners from
   600 px. The restored picture lies below, the original on top, clipped to the left part (--split, set by compare.js
   from the range input). The range input covers the picture without catching the pointer (the box handles drags with
   touch-action: pan-y, so a vertical swipe still scrolls the page); its focus ring is the frame of the picture. */

.hero-compare {
  --split: 37%;                  /* start position (Ivan 08.11): the damaged left part and both restored faces show */
  position: relative; overflow: hidden; height: clamp(300px, 77vw, 480px);
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-2)) var(--space-4);
  background: var(--footer-bg);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
@media (min-width: 600px) {
  .hero-compare { margin: 0 0 var(--space-4); border-radius: var(--radius-large); }
}
.hero-compare img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 33%; }
.hero-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
/* D30 ad angles with 'top' (a slider whose faces are near the top edge; unused since ADS-S5b): cropped near the top,
   so the heads stay in the frame. */
.hero-compare-top img { object-position: 50% 12%; }
/* 09.11 'pair' angle (soldado-1915, Ivan: the slider crop hid the plate's damage on its edges): "antes" left and
   "después" right in the same box, a white line between; each half shows the photo's full width from the top. */
.hero-compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #ffffff; cursor: auto; touch-action: auto; }
.hero-compare-pair img { position: static; object-position: 50% 6%; }
.hero-compare-pair > img { grid-column: 2; grid-row: 1; }
.hero-compare-pair .hero-before { position: relative; inset: auto; clip-path: none; grid-column: 1; grid-row: 1; overflow: hidden; }
/* ADS-S5b: a 'pair' of a landscape photo (familia-bebe, pareja-placa-rota: faces spread over the photo's width). The
   box is never higher than its own width / 1.95 (full width on a phone, the page column from 600 px), so each half
   stays about square and shows the middle two thirds of the photo with every face. Only a cap: the height rules
   above and below stay, so the box is as high as any other hero or lower, never higher (390×844: 200 px either way). */
.hero-compare-wide { max-height: calc(100vw / 1.95); }
.hero-compare-wide img { object-position: 50% 50%; }
@media (min-width: 600px) {
  .hero-compare-wide { max-height: calc((min(100vw, var(--page)) - 2 * var(--space-3)) / 1.95); }
}
.hero-line {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 3px; margin-left: -1.5px;
  background: #ffffff; box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.25); pointer-events: none;
}
.hero-handle {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #ffffff; color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.hero-handle svg { width: 24px; height: 24px; }
.hero-range {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; cursor: ew-resize;
}
.hero-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.hero-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1px; height: 1px; background: transparent; border: 0; }
.hero-range::-moz-range-track { background: transparent; border: 0; }
.hero-range::-moz-range-thumb { width: 1px; height: 1px; background: transparent; border: 0; }
.hero-range:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; box-shadow: inset 0 0 0 6px #ffffff; }
@media (min-width: 600px) { .hero-range { border-radius: var(--radius-large); } }
/* The "Después: resultado hecho con IA" note of the hero pair, tucked under the picture (pulls up into its margin). */
.hero-note { margin: calc(10px - var(--space-4)) 0 var(--space-3); color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.4; }

/* ---------- FAQ (<details> list) ---------- */

/* Design B: every question is a grey rounded row with a blue "+" in a white circle (the sign is decoration: the
   alternative text after "/" is empty, so screen readers read only the question). */
.faq { margin: var(--space-5) 0 0; max-width: var(--measure); }
.faq-item { margin: 0 0 10px; background: var(--sunk); border-radius: var(--radius); }
.faq-item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: 60px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 700; border-radius: var(--radius);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; content: "+" / "";
  flex: 0 0 auto; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface); font-family: var(--font-head); font-size: 1.3rem; line-height: 1;
  color: var(--link);
}
.faq-item[open] > summary::after { content: "\2212"; content: "\2212" / ""; }
.faq-answer { padding: 0 16px 16px; }
.faq-answer > :last-child { margin-bottom: 0; }

/* ---------- Content sections with a look of their own (partials/content_blocks.php: an h2 block with a style) ---------- */

/* 'steps' ("Cómo funciona"): a grey rounded panel; the steps get big blue numerals. */
.panel-steps { margin: var(--space-4) 0; padding: 22px 20px; background: var(--sunk); border-radius: var(--radius-large); }
.panel-steps > :last-child { margin-bottom: 0; }
.steps { list-style: none; margin: 0 0 var(--space-2); padding: 0; counter-reset: step; display: grid; gap: 14px; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; margin: 0; }
.steps > li::before {
  content: counter(step); font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; line-height: 1.1;
  color: var(--link);
}
/* 'links' ("Qué necesita su foto"): full-width rounded rows; the whole row opens the link, a blue arrow on the right. */
.link-rows { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: 10px; }
.link-rows > li {
  position: relative; margin: 0; min-height: 60px; padding: 14px 52px 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft);
}
.link-rows > li::after {
  content: "\2192"; content: "\2192" / "";
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--link);
}
.link-rows a { font-weight: 700; text-decoration: none; }
.link-rows a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }   /* the whole row */
.link-rows > li:has(a:hover) { border-color: var(--border); }
/* 'privacy' ("Sus fotos"): the light blue panel with a shield (decorative SVG, aria-hidden). */
.panel-privacy {
  position: relative; margin: var(--space-4) 0; padding: 18px 20px 18px 64px;
  background: var(--info); border-radius: var(--radius-large);
}
.panel-privacy > :last-child { margin-bottom: 0; }
.panel-privacy > h2 { font-size: 1.15rem; margin-bottom: 4px; }
.panel-icon { position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; color: var(--link); }

/* ---------- Small parts of content pages ---------- */

.updated { color: var(--ink-muted); font-size: var(--fs-small); margin: 0 0 var(--space-3); }
.breadcrumbs { margin: 0 0 var(--space-2); font-size: var(--fs-small); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { margin: 0; display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "\203A"; margin: 0 10px; color: var(--ink-muted); }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumbs [aria-current="page"] { color: var(--ink-muted); }

/* Table (prices): scrolls inside its box on a narrow screen, never the page. */
.table-wrap { overflow-x: auto; margin: 0 0 var(--space-2); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.data-table caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--sunk); font-weight: 700; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
/*
 * P6.2 walkthrough R1: a table with more than 3 columns or long texts in its cells (class data-table-stack, set by
 * templates/partials/content_blocks.php) becomes one card per row on a phone: the row header as the card's title,
 * then "Column: value" lines. The label comes from data-label (the column header) and is read with the value when a
 * screen reader goes through the page line by line; in table navigation the header stays associated through the
 * explicit table roles of the markup (display: block would otherwise drop the table semantics).
 */
@media (max-width: 599.98px) {
  .data-table-stack, .data-table-stack tbody, .data-table-stack tr, .data-table-stack th,
  .data-table-stack td { display: block; width: 100%; }
  .data-table-stack { border: 0; background: transparent; }
  .data-table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .data-table-stack tr {
    margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small);
  }
  .data-table-stack tbody th { background: var(--sunk); border-radius: var(--radius-small) var(--radius-small) 0 0; }
  .data-table-stack td { border-bottom: 1px solid var(--line); }
  .data-table-stack td:last-child { border-bottom: 0; }
  .data-table-stack td.num { text-align: left; white-space: normal; }
  .data-table-stack td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }
}

/* ---------- Form fields ---------- */

.field-label { display: block; font-weight: 700; margin: 0 0 6px; }
.field-hint { display: block; color: var(--ink-muted); margin: -2px 0 8px; }
.field {
  display: block; width: 100%; min-height: var(--tap); margin: 0 0 var(--space-2); padding: 10px 14px;
  font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
}
.field:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--ink); }
.field[aria-invalid="true"] { border-color: var(--danger); }
.field-code { max-width: 260px; font-size: 1.6rem; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

/* ---------- Root language chooser / (templates/root_chooser.php) ---------- */

.lang-chooser { max-width: 30em; margin: var(--space-3) 0 0; }
.lang-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 12px; }
.lang-list li { margin: 0; }
.lang-choice {
  display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: 14px 20px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  border: 2px solid var(--border); border-radius: var(--radius-large); box-shadow: var(--shadow);
}
.lang-choice:hover { border-color: var(--link); color: var(--ink); }
.lang-name { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.3px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lang-text { color: var(--ink-muted); }

/* ---------- Upload tool on /es/ (P1.4, assets/upload.js) ---------- */

.upload { margin: var(--space-3) 0 var(--space-4); }
.upload-step > h2:focus, .error-box > h2:focus { outline: none; }
.upload-step > h2:focus-visible, .error-box > h2:focus-visible, legend h2:focus-visible { outline: 3px solid var(--focus); }

/* Design B: the big blue "Subir una foto" button over the full width, then the free note as green check items. With a
   mouse (pointer: fine) the box gets a dashed frame, because the drop hint ("arrastrar la foto hasta este recuadro")
   refers to it; on a touch screen there is nothing to drop and the box has no frame. */
.dropzone { border: 2px dashed transparent; border-radius: var(--radius-large); padding: 0; text-align: left; }
@media (pointer: fine) {
  .dropzone { border-color: var(--border); padding: 24px; background: var(--surface); }
}
.dropzone.is-over { border-style: solid; border-color: var(--accent); background: var(--accent-tint); }
.dropzone .button-big { width: 100%; }
.free-note {
  list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 8px; padding: 0;
  font-weight: 700; color: var(--ink-soft);
}
.free-note li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
/* 12.11.2026: the paper-photo line under the upload button with its camera link, phones and tablets only (shown by
   upload.js; hidden with a mouse) */
.paper-hint { margin: 4px 0 0; font-size: .9rem; }
.paper-hint .link-button { font-size: inherit; }   /* keeps the 52 px tap height of .link-button (older users) */
@media (hover: hover) and (pointer: fine) { .paper-hint { display: none; } }
.free-check { flex: 0 0 auto; width: 20px; height: 20px; color: var(--check); }
/* D30 ad angle 'precio': one price line right under "Subir una foto" (the free-note checks follow it). */
.price-line { margin: 10px 0 0; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.4; }
/* WhatsApp channel D6 (migration 037): one quiet line under the button on /pt-br/, off by default */
.wa-line { margin: 10px 0 0; font-size: .9rem; }
.drop-hint { margin-bottom: 0; }
#choose-status:empty { display: none; }

.crop-area { height: min(60vh, 520px); margin: 0 0 var(--space-2); background: var(--sunk); border-radius: var(--radius-large); overflow: hidden; }
/* Conversion audit 09.11 #15: "Continuar" right under the picture (full width), then the two rotate buttons side by
   side, smaller (half width, small type; still the 52 px tap height of DESIGN.md), then the links. Phones: the crop
   area at most 55 % of the screen. */
#crop-continue { width: 100%; }
.rotate-row { display: flex; gap: 12px; margin: 0 0 8px; }
.rotate-row .button { flex: 1 1 0; min-width: 0; padding: 6px 10px; font-size: var(--fs-small); }
.crop-links { margin: 0; }
@media (max-width: 599.98px) { .crop-area { height: min(55vh, 520px); } }
.crop-area img { display: block; max-width: 100%; }
/* Cropper.js: four big corner handles set just inside the box (so the frame never clips them), no side handles
   (the sides can still be dragged by their lines). */
.crop-area .cropper-point { width: 24px; height: 24px; opacity: 1; background: #ffffff; border: 3px solid var(--accent); border-radius: 50%; }
.crop-area .cropper-point.point-nw { left: -4px; top: -4px; }
.crop-area .cropper-point.point-ne { right: -4px; top: -4px; }
.crop-area .cropper-point.point-sw { left: -4px; bottom: -4px; }
.crop-area .cropper-point.point-se { right: -4px; bottom: -4px; width: 24px; height: 24px; opacity: 1; }
.crop-area .cropper-point.point-se::before { display: none; }
/* P6.2: a finger needs more than the 24 px dot: an invisible 48 px touch area around each corner (the pseudo-element
   belongs to the handle, so Cropper.js reads the handle's action from it). */
.crop-area .cropper-point::after { content: ""; position: absolute; left: -12px; top: -12px; right: -12px; bottom: -12px; }
.crop-area .cropper-point.point-n, .crop-area .cropper-point.point-s,
.crop-area .cropper-point.point-e, .crop-area .cropper-point.point-w { display: none; }
.crop-area .cropper-view-box { outline: 2px solid rgba(255, 255, 255, 0.9); }
.crop-area .cropper-line { background-color: transparent; }

/* Choice cards (mode, pack, attempt): a radio with the whole card as its label; the chosen one gets the accent. */
.mode-cards { border: 0; margin: 0 0 var(--space-2); padding: 0; min-width: 0; }
.mode-cards legend { padding: 0; margin: 0 0 12px; }
.mode-card {
  position: relative; margin: 0 0 12px; padding: 16px 16px 16px 64px;
  border: 2px solid var(--border); border-radius: var(--radius-large); background: var(--surface);
}
.mode-card input { position: absolute; z-index: 1; left: 20px; top: 20px; width: 28px; height: 28px; margin: 0; accent-color: var(--accent); }
.mode-card input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.mode-card label { display: block; font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.mode-card label::after { content: ""; position: absolute; inset: 0; }   /* the whole card selects */
.mode-card p { margin: 4px 0 0; color: var(--ink-muted); }
.mode-card:has(input:checked) { border: 3px solid var(--accent); padding: 15px 15px 15px 63px; background: var(--accent-tint); }
/* P6.2 walkthrough R7: a small example result at the right of each card (the whole card still selects). */
.mode-card .mode-example {
  float: right; width: 72px; height: auto; margin: 0 0 4px 12px;
  border-radius: var(--radius-small); background: var(--sunk);
}
.mode-card::after { content: ""; display: block; clear: both; }
.mode-example-note { margin: 0; }
#mode-send { width: 100%; }

.progress-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--space-2); padding: 0; }
.progress-steps li { margin: 0; padding: 6px 12px; font-size: var(--fs-small); border: 2px solid var(--line); border-radius: 999px; color: var(--ink-muted); background: var(--surface); }
.progress-steps li.is-done { color: var(--ink); }
.progress-steps li.is-done::before { content: "\2713\00a0"; }
.progress-steps li[aria-current="step"] { border-color: var(--accent); color: var(--ink); font-weight: 700; }
#progress-bar, #wait-bar { display: block; width: 100%; height: 22px; margin: 0 0 12px; accent-color: var(--accent); }

/* ---------- Photo page /es/foto/<id>/ (P1.9, assets/result.js) ---------- */

.photo { margin: var(--space-1) 0 var(--space-4); }
/* P6.2: the script moves the focus to the heading of each new view (screen readers announce it). Chrome counts a focus
   set by script on a page nobody has touched yet as "focus-visible", so every visitor saw a black frame around
   "Su foto restaurada". A heading is not a control: no ring on these script-focused headings. */
.photo-view > h2:focus, .photo-view .error-box > h2:focus { outline: none; }
/* privacy (G1): "Borrar esta foto ahora" and the "Su foto se borró" box (templates/photo_es.php) */
.photo-delete { margin: var(--space-3) 0 0; }
.photo-view .calm-note > h2 { margin-top: 0; }
.photo-view .calm-note > h2:focus { outline: none; }
/* end privacy */
#wait-status:empty { display: none; }

.attempt-choice { border: 0; padding: 0; margin: 0 0 var(--space-2); min-width: 0; }
.attempt-choice legend { font-weight: 700; padding: 0; margin: 0 0 8px; }
.attempt-option {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap);
  margin: 0 12px 8px 0; padding: 4px 16px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.attempt-option:has(input:checked) { border: 3px solid var(--accent); padding: 3px 15px; background: var(--accent-tint); }
.attempt-option input { position: relative; z-index: 1; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.attempt-option input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.attempt-option label { font-weight: 700; cursor: pointer; }
.attempt-option label::after { content: ""; position: absolute; inset: 0; }   /* the whole box selects */

/* Before/after slider: the restored picture sets the size; the before picture lies on top, clipped to the left part
   (--split, set by result.js from the range input). */
.compare {
  --split: 50%;
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto 12px; overflow: hidden;
  border-radius: var(--radius-large); background: var(--sunk); box-shadow: var(--shadow);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.compare-after { display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.compare-before img { display: block; width: 100%; height: 100%; object-fit: fill; }
.compare-line {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 4px; margin-left: -2px;
  background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none;
}
/* Design B: "Antes" / "Después" as pills at the bottom corners (dark and white), here and on the home hero. */
.compare-tag {
  position: absolute; bottom: 12px; padding: 2px 12px; font-size: var(--fs-small); font-weight: 700; line-height: 1.5;
  color: #ffffff; background: rgba(17, 24, 39, 0.82); border-radius: 999px; pointer-events: none;
}
.compare-tag-before { left: 12px; }
.compare-tag-after { right: 12px; color: var(--ink); background: #ffffff; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.3); }

.compare-control { margin: 0 0 var(--space-2); }
.compare-control label { display: block; font-weight: 700; margin: 0 0 4px; }
#compare-range {
  display: block; width: 100%; height: var(--tap); margin: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent;
}
#compare-range:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#compare-range::-webkit-slider-runnable-track { height: 10px; background: var(--line); border-radius: 999px; }
#compare-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 40px; height: 40px; margin-top: -15px;
  border-radius: 50%; background: var(--accent); border: 4px solid #ffffff; box-shadow: 0 0 0 2px var(--accent);
}
#compare-range::-moz-range-track { height: 10px; background: var(--line); border-radius: 999px; }
#compare-range::-moz-range-thumb {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: 4px solid #ffffff;
  box-shadow: 0 0 0 2px var(--accent);
}
.compare-ends { display: flex; justify-content: space-between; color: var(--ink-muted); font-weight: 700; }

/* Conversion audit 09.11 #5, #13: no second small pair on phones (it pushed the download below the first screen); the
   honest note is the slider's caption in normal weight (templates/photo_es.php #result-honest). */
.compare-caption { margin: 6px 0 0; }
.result-actions { display: flex; flex-direction: column; gap: 8px; margin: 0 0 var(--space-2); }
.result-actions .button { width: 100%; }
.result-actions .note { margin: 0 0 12px; }
.delete-date { color: var(--ink-muted); }

/* ---------- Staging outbox viewer /admin/outbox (P2.3; internal, the admin design is P4.4) ---------- */

.admin-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: #ffffff; }
.admin-table th, .admin-table td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.mail-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 var(--space); }
.mail-meta dt { font-weight: 700; }
.mail-meta dd { margin: 0; word-break: break-all; }
.mail-text { white-space: pre-wrap; word-break: break-word; padding: 12px; background: #ffffff; border: 1px solid var(--line); border-radius: 6px; font-size: 0.85rem; }
.mail-html { display: block; width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; }

/* ---------- Sign-in /es/entrar/ (P2.2, assets/login.js) ---------- */

.login { max-width: 30em; }
#step-code > h2:focus { outline: none; }
#login-error:empty { display: none; }
.logout-form { margin: 0 0 var(--space-2); }

/* P2.4: "Continuar con Google" (assets/google.js; Google draws the button in its own iframe) */
.google-signin { margin: 0 0 var(--space); }
.google-button { max-width: 400px; min-height: 44px; margin: 0 0 var(--space); }
.or-line { color: var(--muted); font-weight: 700; margin: 0 0 8px; }
/* end P2.4 */
/* P3.2–P3.3 (begin) */
/* ---------- Pack chooser on the photo page (P3.2, templates/packs_es.php, assets/packs.js) ---------- */
.packs { margin: 8px 0 var(--space); padding: 20px var(--space); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-large); box-shadow: var(--shadow); }
.packs > h2:focus { outline: none; }
.packs > h2:focus-visible { outline: 3px solid var(--focus); }
.packs-reason { font-weight: 700; }
.pack-cards { border: 0; margin: 0 0 var(--space); padding: 0; min-width: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .pack-cards { grid-template-columns: 1fr 1fr; } }
/* Conversion audit #3 (lead 09.11): compact cards, two rows each: "10 fotos [Recomendado] … 9,99 USD" and
   "1,00 USD por foto … ≈ 8,66 euros" (the badge on the top edge), so the heading, the 4 cards and the pay button fit
   about one phone screen. */
.pack-card {
  position: relative; padding: 10px 14px 10px 54px; border: 2px solid var(--border); border-radius: var(--radius-large); background: var(--surface);
}
.pack-card input { position: absolute; z-index: 1; left: 16px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; margin: 0; accent-color: var(--accent); }
.pack-card input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.pack-card label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; cursor: pointer; }
.pack-card label::before { content: ""; order: 4; flex-basis: 100%; height: 0; }   /* the line break between the rows */
.pack-card label::after { content: ""; position: absolute; inset: 0; }   /* the whole card selects */
.pack-card:has(input:checked) { border: 3px solid var(--accent); padding: 9px 13px 9px 53px; background: var(--accent-tint); }
.pack-count { order: 1; font-weight: 700; font-size: 1.15rem; }
.pack-card.is-recommended { margin-top: 10px; }
.pack-badge {                       /* on the card's top edge, so the price stays on the first row */
  position: absolute; top: -13px; left: 50px; padding: 1px 10px; border-radius: 999px;
  background: var(--ink); color: #ffffff; font-size: var(--fs-small); font-weight: 700; line-height: 1.4;
}
.pack-price { order: 3; margin-left: auto; font-weight: 700; font-size: 1.2rem; font-variant-numeric: lining-nums; white-space: nowrap; }
.pack-per { order: 5; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; }
/* Review 10.11: the saving per photo against the smallest pack, right after the per-photo price (--save: AA on
   white and on the selected card's tint) */
.pack-save { order: 5; color: var(--save); font-size: var(--fs-small); font-weight: 700; white-space: nowrap; }
.pack-local { order: 6; margin-left: auto; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; }
.packs { scroll-margin-top: 8px; }
.pack-currency { margin: 8px 0 0; font-size: var(--fs-small); }
#packs-pay { width: 100%; }
#packs-status:empty { display: none; }
.pack-notes { margin: 12px 0 var(--space); padding-left: 1.2em; }
.pack-notes li { margin: 0 0 6px; }
.pack-fx-source { font-size: var(--fs-small); }
.pack-sign-in { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
#packs-loading:empty { display: none; }
/* P3.2–P3.3 (end) */
/* Local currency (Ivan, 09.11.2026): "≈ … euros" next to USD amounts, added by assets/localprice.js and money.js */
.fx-approx { color: var(--muted); }
.fx-approx-line { display: block; font-weight: 400; font-size: var(--fs-small); }
.fx-note { font-size: var(--fs-small); }
/* Lead 09.11 (conversion audit #1, #11): while the pack chooser or the free-trial box is open, it is the one main
   action: every other action of the page (data-focus-hide, and the note of a hidden line) goes away and "Descargar sin
   marca de agua" looks secondary. assets/packs.js (packs-open) and result.js (trial-open) set the class on <html>. */
.packs-open [data-focus-hide], .trial-open [data-focus-hide],
.packs-open [data-focus-hide] + .fx-note, .trial-open [data-focus-hide] + .fx-note { display: none !important; }
.packs-open #download-button, .trial-open #download-button {
  background: var(--surface); color: var(--link); border-color: var(--link); box-shadow: none;
}
.pack-close { margin: 12px 0 0; text-align: center; }
/* Conversion audit 09.11 #19: the header's "Mis fotos" pill is not a second target while the chooser or the e-mail
   box is the one main action (the chooser has its own "¿Ya compró un paquete? Entre aquí"). */
.packs-open .header-nav, .trial-open .header-nav { visibility: hidden; }
/* Conversion audit 09.11 #6: a payment that failed or could not be confirmed here (assets/payreturn.js sets pay-hold):
   no price line and no free retry under the photo, and "Descargar" is secondary (it scrolls to the payment box). */
.pay-hold #price-hint, .pay-hold #price-hint + .fx-note, .pay-hold #retry-box, .pay-hold #retry-tips { display: none !important; }
.pay-hold #download-button { background: var(--surface); color: var(--link); border-color: var(--link); box-shadow: none; }
/* Conversion audit 09.11 #18: "Subir otra foto" is a link at the end of the result view */
.result-other { margin: var(--space-2) 0 0; }
/* Owner 12.11.2026: "Enviar a la familia por WhatsApp", a secondary link-button under the buy and download area */
.result-share { margin: var(--space-3) 0 0; }
.result-share .button { width: 100%; }
/* Conversion audit 09.11 #7: the clean result as a plain picture in Instagram / Facebook in-app browsers */
.inapp-save { margin: 0 0 12px; }
.inapp-save img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 0 auto; border-radius: var(--radius); }
/* P2.6–P2.8 (begin) */
/* ---------- Unlock, download, "devolver la foto" on the photo page (P2.6, assets/result.js) ---------- */

#download-note:empty { display: none; }
.unlock-help { margin: 0 0 12px; }
.unlock-help .button { margin: 0 0 12px; }
.unlock-help p:last-child { margin-bottom: 0; }
.credit-back { margin: 0 0 var(--space); }
.credit-back .calm-note p { margin-bottom: 12px; }
.credit-back .button-row { margin-bottom: 0; align-items: center; }

/* free_trial B/C (P4a.2): the e-mail and code step inside the result actions */
.free-trial { margin: 0 0 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-large); box-shadow: var(--shadow); }
.free-trial h3 { font-size: var(--fs-h3); }
.free-trial h3:focus { outline: none; }
.free-trial h3:focus-visible { outline: 3px solid var(--focus); }

/* ---------- "Mis fotos" /es/cuenta/ (P2.7, templates/account_es.php) ---------- */

.photos-left { font-size: 1.1rem; font-weight: 700; }
.account-section { margin: var(--space-4) 0 0; }
.photo-list, .purchase-list { list-style: none; margin: 0; padding: 0; }
.photo-item {
  display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-large);
}
.photo-thumb { flex: 0 0 auto; width: 160px; height: auto; max-width: 100%; border-radius: var(--radius); background: var(--sunk); }
.photo-info { flex: 1 1 260px; min-width: 0; }
.photo-info p { margin: 0 0 6px; }
.photo-date { font-weight: 700; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.photo-actions .button { flex: 1 1 140px; }
.purchase-list li { padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); }
.confirm > summary { display: inline-flex; align-items: center; list-style: none; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm-box {
  margin: 8px 0 0; padding: 14px 18px; background: var(--notice);
  border: 2px solid var(--notice-line); border-left: 6px solid var(--danger); border-radius: var(--radius);
}
.confirm-box p { margin: 0 0 12px; }
.confirm-box .button-row { margin: 0; }          /* P6.2 R6: "Sí, borrar…" and "No, volver" */
/* P2.6–P2.8 (end) */

/* P4.1–P4.2: "Guardar 30 días más" / "Descargar todas" in Mis fotos (templates/account_es.php) */
.all-photos { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 16px; }
.all-photos form, .all-photos .zip-box { flex: 1 1 260px; }
.all-photos p { margin: 0 0 8px; }
.all-photos .button { width: 100%; }
/* end P4.1–P4.2 */
/* P3.5 (begin) */
/* ---------- Return from the payment page (P3.5, templates/pay_return_es.php, assets/payreturn.js) ---------- */

.pay-return { margin: 0 0 24px; }
.pay-return h2 { margin-bottom: 8px; }
.pay-return h2:focus { outline: none; }
.pay-return h2:focus-visible { outline: 3px solid var(--fg); }
#pay-return-status { font-size: 1.1rem; font-weight: 600; }
.pay-return-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 4px; }
.pay-return-actions .button { flex: 1 1 220px; }
/* P3.5 (end) */

/* P4.4/P3.6 (begin) */
/* ---------- Admin (P4.4, templates/admin_*.php; English, internal, no scripts) ---------- */
.page:has(.admin-wide) { max-width: 1240px; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 var(--space); padding: 0 0 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.admin-nav form { margin: 0 0 0 auto; }
.admin-nav .link-button { min-height: 0; padding: 0; font-size: 0.9rem; }
.admin-notice { padding: 8px 12px; background: #eef6ee; border: 1px solid #9cc79c; border-radius: 6px; }
.admin-error { padding: 8px 12px; background: #fef2f2; border: 1px solid #fca5a5; border-radius: 6px; color: var(--danger); font-weight: 600; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0 0 var(--space); }
.admin-card { padding: 12px; background: #ffffff; border: 1px solid var(--line); border-radius: 6px; font-size: 0.9rem; }
.admin-card h2 { font-size: 1rem; margin: 0 0 6px; }
.admin-card p { margin: 0 0 4px; }
.admin-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 var(--space); font-size: 0.9rem; }
.admin-form label { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.admin-form input, .admin-form select { font: inherit; padding: 6px 8px; border: 1px solid var(--muted); border-radius: 6px; background: #ffffff; }
.admin-form .button { min-height: 40px; padding: 6px 16px; font-size: 0.9rem; }
.admin-table .admin-form { margin: 0; }
.admin-thumb { display: block; width: 120px; height: auto; border: 1px solid var(--line); }
.admin-bad { color: var(--danger); font-weight: 700; }
.admin-ok { color: #1f6b2a; font-weight: 700; }
.admin-details { margin: 0 0 var(--space); }
.admin-details summary { cursor: pointer; font-weight: 600; }
/* P4.4/P3.6 (end) */

/* UX audit 08.11, money slice (begin): pack chooser safety line (M4), Mis fotos upload button (M10) and purchases (M11) */
.pack-safety { margin: 12px 0 0; }
.account-upload { margin: 0 0 var(--space-2); }
.purchase-receipt { white-space: nowrap; }
#refund-hint { margin: 12px 0 0; }
/* UX audit 08.11, money slice (end) */
/* UX audit 08.11, upload fixes (begin) */
/* m4: with large text (200 %) the header wraps: the "Mis fotos" pill moves under the name instead of pushing the page
   sideways or being cut at the right edge. */
.header-inner { flex-wrap: wrap; row-gap: 8px; }
.brand { min-width: 0; }
.header-nav { flex: 0 1 auto; max-width: 100%; }
.header-link { max-width: 100%; text-align: center; }
/* M12: on a computer (>= 1000 px) the hero takes at most ~45 % of the screen height, so the h1, the lead and
   "Subir una foto" are in the first screen at 1280×800 (the hero was 480 px and the button ended at ~890 px).
   Phones and tablets keep clamp(300px, 77vw, 480px). */
@media (min-width: 1000px) {
  .hero-compare { height: clamp(300px, 45vh, 480px); }
  /* D30 ad angles: their h1 takes two lines, so the hero gives up ~70 px (the plain home is unchanged). */
  .hero-compare.hero-compare-angle { height: clamp(280px, 36vh, 480px); }
}
/* M8: "Elegir otra foto" under "Intentar otra vez" in the error box */
#error-choose-row { margin: 8px 0 0; }
/* UX audit 08.11, upload fixes (end) */
/* ---------- UX audit 2026-11-08, result slice (begin): photo page and the home's line for a returning browser ---------- */
/* M5: "¿Busca la foto que ya subió? Ver su foto" (only for a browser with a photo; templates/home_es.php). Since
   09.11 a card between the lead and the upload box: above the hero the phone hero's negative top margin covered it. */
.latest-photo { margin: 0 0 var(--space-3); padding: 12px 16px; background: var(--accent-tint); border-radius: var(--radius); line-height: 1.4; }
.latest-photo a { font-weight: 600; white-space: nowrap; }
/* p5: the second line of "Descargar sin marca de agua" says what the watermark is */
#download-button { flex-direction: column; gap: 2px; }
.button-sub { display: block; font-size: var(--fs-small); font-weight: 400; }
/* m7 + conversion audit 09.11 #5: the result picture leaves room for the price line and "Descargar sin marca de agua"
   in the first screen (phone 390×844 and computer 1280×800, landscape and portrait photos): the height of what sits
   between the top of the page and the button is taken off the screen height; never under 220 / 300 px, never over
   70 % of the screen. svh: the in-app browsers' toolbars (see the hero below). */
.compare-after { max-height: max(220px, min(70vh, calc(100vh - 560px))); max-height: max(220px, min(70svh, calc(100svh - 560px))); }
@media (min-width: 600px) {
  .compare-after { max-height: max(300px, min(70vh, calc(100vh - 500px))); }
}
/* UX audit 2026-11-08, result slice (end) */
/* ---------- Batch upload (begin): several photos at once (partials/upload_box.php #step-batch, assets/upload.js) and
   "Sus últimas fotos" (templates/recent_photos_es.php, which reuses the Mis fotos rows) ---------- */
.batch-link { margin: 4px 0 0; }
.batch-limit { margin: 0 0 12px; }
.batch-limit p { margin: 0 0 6px; }
.batch-limit p:last-child { margin: 0; }
.batch-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.batch-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-large);
}
.batch-thumb {
  display: block; flex: 0 0 auto; width: 96px; height: auto; max-height: 128px; object-fit: contain;
  border-radius: var(--radius-small); background: var(--sunk);
}
.batch-thumb-none { height: 72px; }
.batch-info { flex: 1 1 150px; min-width: 0; }
.batch-info p { margin: 0 0 4px; }
.batch-file { color: var(--ink-muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.batch-state { font-weight: 700; }
.batch-view { margin: 6px 0 0; }
.batch-remove { flex: 0 0 auto; }
/* not sent today, not sent after a stop: quiet; a photo that cannot be used or was refused: the calm amber of the
   error box (never a red alarm); a finished result: the green of the free-note checks (5.0:1) */
.batch-item[data-state="later"] .batch-state, .batch-item[data-state="not_sent"] .batch-state { color: var(--ink-muted); font-weight: 400; }
.batch-item[data-state="problem"], .batch-item[data-state="refused"], .batch-item[data-state="send_failed"],
.batch-item[data-state="sent-problem"], .batch-item[data-state="sent-missing"] {
  background: var(--notice); border-color: var(--notice-line); border-left-width: 6px;
}
.batch-item[data-state="sent-done"] .batch-state { color: var(--check); }
.batch-legend { padding: 0; margin: 0 0 12px; font-weight: 700; font-size: 1.15rem; }
#batch-send { width: 100%; }
#batch-bar { display: block; width: 100%; height: 22px; margin: 0 0 12px; accent-color: var(--accent); }
#batch-status:empty { display: none; }
#batch-ok-row, #batch-other-row, #batch-more-row { margin: 8px 0 0; }
/* m11: the output size under the 30 and 100 packs */
/* Batch upload (end) */

/* ---------- Meta consent banner (app/src/meta.php, templates/partials/consent_banner.php; only while Meta tracking
   is on, and only for visitors who must answer first). Not a modal and not a pop-up over the content: a compact bar
   fixed at the bottom of the window, the approved text (LEGAL-CLAIMS §8a, unchanged) in small type, then the two
   buttons of the SAME weight and size on one row ("Rechazar" as easy as "Aceptar"; both outlined, so the page's one
   filled accent action stays the only one). Conversion audit 09.11 #4: the bar was ~205 px on a phone and covered
   "Subir una foto"; now ~168 px on a 390 px phone (text 4 lines + buttons; 3 lines from ~420 px), ~74 px on a
   computer (text 2 lines, buttons at the right). The server renders it open with <html class="consent-open">, so its height is reserved from the first
   paint: page bottom padding and scroll padding (focus and scrollIntoView keep things above the bar), with the
   estimate --consent-reserve until meta.js measures the real height (--consent-h). ---------- */
:root { --consent-reserve: 168px; }                   /* phone: 4 text lines + 52 px buttons */
@media (min-width: 600px) { :root { --consent-reserve: 100px; } }
@media (min-width: 900px) { :root { --consent-reserve: 76px; } }
html.consent-open { scroll-padding-bottom: calc(var(--consent-h, var(--consent-reserve)) + 8px); }
html.consent-open body { padding-bottom: var(--consent-h, var(--consent-reserve)); }
.consent-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 2px solid var(--border); box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
}
.consent-inner {
  max-width: 1120px; margin: 0 auto; padding: 8px var(--space-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3);
}
.consent-text { margin: 0; flex: 1 1 300px; font-size: var(--fs-small); line-height: 1.35; }
.consent-text a { white-space: nowrap; }
.consent-actions { display: flex; gap: 12px; flex: 1 1 100%; }
.consent-actions .button { flex: 1 1 0; min-width: 0; padding: 8px 16px; }
@media (min-width: 600px) { .consent-inner { padding: 10px var(--space-3); } }
@media (min-width: 900px) {
  .consent-actions { flex: 0 0 auto; }
  .consent-actions .button { flex: 0 0 150px; }
}
/* The footer's "Cookies" button reopens the bar: footer colours (9.9:1 on the navy footer). */
.site-footer .footer-consent { color: var(--footer-link); }
@media (hover: hover) { .site-footer .footer-consent:hover { color: #bfdbfe; } }
/* Meta tracking (end) */

/* ---------- Conversion audit 09.11, first screen (begin): #16 the phone hero and #4 the hero under an open consent
   bar. "Subir una foto" (and the h1 and lead above it) must be whole in the first screen with air below, for the
   normal home and every ?angle= variant (pages.php HOME_ANGLES; angles.spec.js, meta.spec.js). ---------- */
/* #16 phone: the hero gives back the screen height it does not need (it was 300 px; "Subir una foto" ended at
   742–777 px of 844, with the free note below the fold). 100svh - 644px = 200 px at 390×844: the longest angle lead
   (4 lines) ends its button at ~670 px and the free note is visible. #4: with the consent bar open (~168 px, top at
   ~676 px) the hero gives 20 px more: 180 px, the button ends at ~650 px. Taller phones get up to 300 px back; short
   ones keep 180 / 160 px. svh: the in-app browsers of Instagram and Facebook show toolbars, the smallest viewport is
   the one that counts (vh: fallback for older browsers). */
@media (max-width: 599.98px) {
  .hero-compare { height: clamp(180px, calc(100vh - 644px), 300px); height: clamp(180px, calc(100svh - 644px), 300px); }
  html.consent-open .hero-compare { height: clamp(160px, calc(100vh - 664px), 300px); height: clamp(160px, calc(100svh - 664px), 300px); }
  .hero-note { margin-bottom: var(--space-2); }
}
/* #4 computer (M12 cap above): an open consent bar takes ~74 px at the bottom, the hero gives them up, so the button
   (and the 'precio' price line) stay above the bar. The fixed estimate, not the measured height: no jump after load. */
@media (min-width: 1000px) {
  html.consent-open .hero-compare { height: clamp(240px, calc(45vh - var(--consent-reserve)), 480px); }
  html.consent-open .hero-compare.hero-compare-angle { height: clamp(200px, calc(36vh - var(--consent-reserve)), 480px); }
}
/* #4 crop step: upload.js puts the step heading at the top of the screen; under it the crop area (60 vh) and the
   rotate pair pushed "Continuar" under the open bar (phone: button at 775 px, bar from 676 px). With the bar open the
   crop area gives up the bar's height, so "Continuar" ends above it (phone ~660 px). Set before cropper.js starts
   (the class comes from the server). */
html.consent-open .crop-area { height: max(220px, min(calc(60vh - var(--consent-reserve)), 520px)); }
@media (max-width: 599.98px) {
  html.consent-open .crop-area { height: max(220px, min(calc(55vh - var(--consent-reserve)), 520px)); }
}
/* Conversion audit 09.11, first screen (end) */

/* ---------- Preview mail (begin): the optional box "send me the link to this photo" under the deletion date of the
   photo page (templates/photo_es.php #mail-link, assets/result.js; only while the setting preview_mail is on). A
   quiet block below the main actions: a rule above it, one field, a SECONDARY button, no colour of its own. Hidden
   with the other secondary actions while the pack chooser or the free-photo box is open (data-focus-hide). ---------- */
.mail-link { margin: var(--space-3) 0 var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.mail-link form { max-width: 34rem; }
.mail-link .button-row { margin-bottom: 12px; }
.mail-link .calm-note:focus { outline: none; }
.mail-link .calm-note:focus-visible { outline: 3px solid var(--focus); }
/* Preview mail (end) */

/* Review 10.11, Brazil funnel walk (begin) */
/* #16: on a 360 px phone (the commonest cheap Android width) the header wrapped: "Minhas fotos" dropped under the
   name, the header was 129 px instead of 77 and pushed "Enviar uma foto" off the first screen of the in-app
   browser. Below 380 px: a tighter pill and gap, the name one step smaller; still 52 px tall, same colours. */
@media (max-width: 379px) {
  .header-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 1rem; }
  .header-link { padding: 8px 12px; font-size: var(--fs-small); }
}
/* #20: the page heading gets the focus by script when the view changes (screen readers); it is not a control, and
   the thick frame around "Sua foto restaurada" read like an error box. */
#photo-title:focus { outline: none; }
/* #17 */
#wait-stay { margin: 8px 0 0; }
/* Review 10.11, Brazil funnel walk (end) */

/* ---------- ADS-S1 (10.11, the owner's choice: a larger photo and the download button fixed to the bottom of the
   screen; funnel audit #3, #4) (begin) ---------- */
/* #3 the photo: on a phone a portrait result was 180x284 px (142x220 on 360x672), because the rule above kept
   "Descargar sin marca de agua" on the first screen. The restored face is what is sold: the picture now takes about
   half of the screen (52 %; 439 px at 390x844, 349 px at 360x672), and the download action stays on the screen in
   the bar below while the page's own button is under the fold. From 600 px the rule above is unchanged. */
@media (max-width: 599.98px) {
  .compare-after { max-height: max(52vh, min(70vh, calc(100vh - 560px))); max-height: max(52svh, min(70svh, calc(100svh - 560px))); }
  /* With the Meta consent bar open (consent countries, until answered) the download bar stacks on top of it: the
     picture gives up that height, so the two bars do not cover its lower part (header and heading 159 px, download
     bar ~105 px, 8 px of air; 404 px at 390x844, 232 px at 360x672; never under the old 220 px). */
  html.consent-open .compare-after { max-height: max(220px, min(52vh, calc(100vh - 272px - var(--consent-reserve)))); max-height: max(220px, min(52svh, calc(100svh - 272px - var(--consent-reserve)))); }
}
/* "Antes" / "Después" on a narrow picture (assets/result.js sets the classes from the picture's width): under 190 px
   the two pills touched and covered the lower fifth of the photo: smaller pills closer to the corners; under 140 px
   none (the row under the slider says "Antes … Después" anyway; the pills are aria-hidden). */
.compare-narrow .compare-tag { bottom: 6px; padding: 1px 8px; font-size: 0.74rem; }
.compare-narrow .compare-tag-before { left: 6px; }
.compare-narrow .compare-tag-after { right: 6px; }
.compare-tiny .compare-tag { display: none; }
/* #4 the two results after a free retry: one row on a phone (two rows took ~175 px above the photo). Two equal
   cards, the label may take two lines; still 52 px tall, the whole card selects. */
@media (max-width: 599.98px) {
  .attempt-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
  .attempt-option { display: flex; gap: 8px; margin: 0; padding: 4px 10px; min-width: 0; }
  .attempt-option:has(input:checked) { padding: 3px 9px; }
  .attempt-option input { flex: 0 0 auto; }
  .attempt-option label { min-width: 0; font-size: var(--fs-small); line-height: 1.2; }
}
/* The download bar (templates/photo_es.php #download-bar; assets/result.js shows it only for a locked result whose
   own button is outside the screen, and sets download-bar-on on <html> with the measured height --download-bar-h).
   Fixed to the bottom, the page's one filled action while it shows; the page reserves its height (bottom padding and
   scroll padding), so the end of the page and anything focused or scrolled into view stay above it. In a consent
   country it sits on top of the Meta consent bar (z-index below it, bottom = that bar's height). Never while the pack
   chooser or the free-photo box is open or a payment came back unconfirmed (the script hides it; these rules make it
   immediate). */
.download-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 8px var(--space-2) calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
}
.download-bar .button {
  display: flex; flex-direction: column; gap: 0; width: 100%; max-width: calc(var(--page) - 2 * var(--space-2));
  min-height: 56px; margin: 0 auto; padding: 6px 16px; font-size: 1.05rem;
}
.packs-open .download-bar, .trial-open .download-bar, .pay-hold .download-bar { display: none !important; }
html.download-bar-on { scroll-padding-bottom: calc(var(--download-bar-h, 82px) + 8px); }
html.download-bar-on body { padding-bottom: var(--download-bar-h, 82px); }
html.consent-open .download-bar { bottom: var(--consent-h, var(--consent-reserve)); padding-bottom: 8px; }
html.consent-open.download-bar-on { scroll-padding-bottom: calc(var(--consent-h, var(--consent-reserve)) + var(--download-bar-h, 82px) + 8px); }
html.consent-open.download-bar-on body { padding-bottom: calc(var(--consent-h, var(--consent-reserve)) + var(--download-bar-h, 82px)); }

/* The upload bar (partials/upload_box.php #upload-bar; assets/upload.js shows it only on the start step of the tool
   while its own "Subir una foto" button is outside the screen, and sets upload-bar-on on <html> with the measured
   height --upload-bar-h). Same rules as the download bar above: fixed to the bottom, the page reserves its height,
   and in a consent country it sits on top of the Meta consent bar. The two bars never meet (the photo page has no
   upload box). */
.upload-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 8px var(--space-2) calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
}
.upload-bar .button {
  display: flex; width: 100%; max-width: calc(var(--page) - 2 * var(--space-2));
  min-height: 56px; margin: 0 auto; padding: 6px 16px; font-size: 1.05rem;
}
html.upload-bar-on { scroll-padding-bottom: calc(var(--upload-bar-h, 73px) + 8px); }
html.upload-bar-on body { padding-bottom: var(--upload-bar-h, 73px); }
html.consent-open .upload-bar { bottom: var(--consent-h, var(--consent-reserve)); padding-bottom: 8px; }
html.consent-open.upload-bar-on { scroll-padding-bottom: calc(var(--consent-h, var(--consent-reserve)) + var(--upload-bar-h, 73px) + 8px); }
html.consent-open.upload-bar-on body { padding-bottom: calc(var(--consent-h, var(--consent-reserve)) + var(--upload-bar-h, 73px)); }
/* ADS-S1 (end) */
