/* ==========================================================================
   EditorImagen — hoja de estilos principal
   Paleta suave índigo/azul cielo · Modo normal y modo oscuro · Responsive
   ========================================================================== */

/* ---------- Tokens de diseño ---------- */
:root {
  --bg: #f6f7fc;
  --bg-alt: #eef0fa;
  --surface: #ffffff;
  --surface-2: #f4f5fb;
  --surface-3: #e9ebf6;
  --text: #1b1e3a;
  --text-2: #444a6e;
  --muted: #666c90;
  --border: #e1e4f0;
  --border-strong: #cdd1e4;
  --brand: #5b4cf0;
  --brand-hover: #4a3ade;
  --brand-soft: #eceaff;
  --link: #4b3ce0;
  --on-brand: #ffffff;
  --accent: #ff6b8b;
  --success: #0f9465;
  --success-soft: #e2f6ee;
  --danger: #d32f45;
  --danger-soft: #fdecef;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --footer-bg: #eceefa;
  --header-bg: rgba(246, 247, 252, .82);
  --grad: linear-gradient(135deg, #6a5cff 0%, #3aa8ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(106, 92, 255, .10), rgba(58, 168, 255, .10));
  --checker: repeating-conic-gradient(#e7e9f2 0% 25%, #ffffff 0% 50%) 0 0 / 18px 18px;
  --shadow-sm: 0 1px 2px rgba(25, 27, 70, .06), 0 1px 3px rgba(25, 27, 70, .08);
  --shadow: 0 10px 30px -12px rgba(35, 30, 110, .22);
  --shadow-lg: 0 24px 60px -20px rgba(45, 30, 140, .35);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f1124;
  --bg-alt: #131630;
  --surface: #181b34;
  --surface-2: #1e2240;
  --surface-3: #282c4f;
  --text: #eceef9;
  --text-2: #c5c8e3;
  --muted: #9da2c6;
  --border: #2b3056;
  --border-strong: #3a4070;
  --brand: #6b5ffb;
  --brand-hover: #7f74ff;
  --brand-soft: #262850;
  --link: #a9a1ff;
  --on-brand: #ffffff;
  --success: #3fd29a;
  --success-soft: #11342a;
  --danger: #ff7085;
  --danger-soft: #3a1823;
  --warn: #ffc65c;
  --warn-soft: #3a2c10;
  --footer-bg: #0b0d1d;
  --header-bg: rgba(15, 17, 36, .82);
  --grad-soft: linear-gradient(135deg, rgba(106, 92, 255, .16), rgba(58, 168, 255, .12));
  --checker: repeating-conic-gradient(#2a2e4c 0% 25%, #1c1f38 0% 50%) 0 0 / 18px 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6em; color: var(--text); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand); color: #fff; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px;
  background: var(--brand); color: var(--on-brand); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

[data-theme="light"] .only-dark, [data-theme="dark"] .only-light { display: none !important; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.container-narrow { width: 100%; max-width: 840px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .container, .container-narrow { padding-inline: 24px; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: .55em 1.1em; border: 1px solid transparent; border-radius: 999px;
  font-weight: 650; font-size: .95rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px -8px rgba(91, 76, 240, .7); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand); color: var(--link); }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 36px; font-weight: 500; }
.btn-link:hover { color: var(--text); }
.btn-lg { min-height: 52px; padding: .7em 1.6em; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: .4em .85em; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .btn { white-space: normal; text-align: left; justify-content: flex-start; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  transition: background-color .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn .icon { width: 20px; height: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: .45em 1em; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: .92rem; font-weight: 600; transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--link); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: var(--header-bg); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-logo { width: 34px; height: 34px; }
.brand-name { font-size: 1.2rem; font-weight: 500; letter-spacing: -.02em; }
.brand-name strong { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { flex: 1; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .95rem; background: none; border: 0;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-link .chev { width: 16px; height: 16px; transition: transform .2s; }
.nav-dropdown[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-item--mega { position: static; }
.mega {
  position: absolute; left: 50%; top: calc(var(--header-h) - 6px); transform: translateX(-50%);
  width: min(1100px, calc(100vw - 32px)); padding: 20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.mega-title { margin: 0 0 8px; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .93rem; }
.mega a:hover, .mega a[aria-current="page"] { background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-menu { position: relative; }
.lang-code { font-size: .8rem; font-weight: 750; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 120;
}
.lang-list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 550; }
.lang-list a:hover { background: var(--surface-2); }
.lang-list a[aria-current="true"] { color: var(--link); font-weight: 750; }
.nav-toggle { display: none; }
.nav-toggle .when-open, .nav-toggle[aria-expanded="true"] .when-closed { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: block; }

@media (max-width: 1100px) { .nav-item--quick { display: none; } }
@media (max-width: 860px) {
  /* backdrop-filter convertiría la cabecera en el contenedor del menú fijo: se desactiva en móvil */
  .site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 0 0; display: none; padding: 12px 16px 32px;
    background: var(--bg); overflow-y: auto; border-top: 1px solid var(--border);
  }
  .main-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-item--quick { display: block; }
  .nav-link { width: 100%; justify-content: flex-start; padding: 12px; font-size: 1rem; }
  .mega {
    position: static; transform: none; width: auto; box-shadow: none; grid-template-columns: 1fr 1fr;
    padding: 12px 4px; border: 0; background: transparent;
  }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 520px) {
  .mega { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.05rem; }
}

/* ---------- Publicidad ---------- */
.ad-slot { max-width: 1200px; margin: 28px auto; padding-inline: 16px; text-align: center; overflow: hidden; }
.ad-label { display: block; margin-bottom: 4px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center; min-height: 90px; max-width: 1168px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); font-size: .85rem; font-family: var(--mono);
}

/* ---------- Portada ---------- */
.hero { padding: 48px 0 24px; text-align: center; background: radial-gradient(1200px 400px at 50% -100px, rgba(106, 92, 255, .14), transparent 70%); }
.hero h1 { max-width: 820px; margin-inline: auto; }
.lead { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: var(--text-2); max-width: 720px; margin-inline: auto; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 24px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; text-align: left; }
.tools-grid--compact { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tool-card.is-hidden { display: none; }
.tool-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tool-card-title { margin: 0; font-size: 1.04rem; font-weight: 750; }
.tool-card-desc { font-size: .9rem; color: var(--muted); line-height: 1.45; }

.tool-icon {
  --ic: #5b4cf0;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border-radius: 13px; color: var(--ic);
  background: var(--surface-2); background: color-mix(in srgb, var(--ic) 14%, transparent);
}
.tool-icon .icon { width: 24px; height: 24px; }
.tool-icon--sm { width: 30px; height: 30px; border-radius: 9px; }
.tool-icon--sm .icon { width: 17px; height: 17px; }
.tool-icon--lg { width: 64px; height: 64px; border-radius: 18px; }
.tool-icon--lg .icon { width: 32px; height: 32px; }
.c-blue { --ic: #2f7cf6; } .c-teal { --ic: #0e9f9a; } .c-green { --ic: #1a9b52; } .c-orange { --ic: #ea7a15; }
.c-violet { --ic: #8b4cf0; } .c-indigo { --ic: #4f50e6; } .c-pink { --ic: #e0459b; } .c-cyan { --ic: #0b93c2; }
.c-amber { --ic: #d08c00; } .c-lime { --ic: #5c9a0c; } .c-red { --ic: #e0434f; } .c-rose { --ic: #e5476d; }
[data-theme="dark"] .c-blue { --ic: #6ea6ff; } [data-theme="dark"] .c-teal { --ic: #3fd0c9; } [data-theme="dark"] .c-green { --ic: #4ed487; }
[data-theme="dark"] .c-orange { --ic: #ffa04d; } [data-theme="dark"] .c-violet { --ic: #b593ff; } [data-theme="dark"] .c-indigo { --ic: #9a9bff; }
[data-theme="dark"] .c-pink { --ic: #ff7cc0; } [data-theme="dark"] .c-cyan { --ic: #4fc8f0; } [data-theme="dark"] .c-amber { --ic: #ffc63d; }
[data-theme="dark"] .c-lime { --ic: #9bd64a; } [data-theme="dark"] .c-red { --ic: #ff7a84; } [data-theme="dark"] .c-rose { --ic: #ff7f9c; }

.features { padding: 56px 16px 16px; text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; text-align: left; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature h3 { margin: 12px 0 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: .95rem; }
.feature-icon { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 12px; background: var(--grad); color: #fff; }

/* ---------- Página de herramienta ---------- */
.breadcrumb { padding: 18px 0 6px; font-size: .88rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }
.tool-header { display: flex; align-items: center; gap: 18px; margin: 8px 0 22px; }
.tool-header h1 { margin-bottom: .2em; }
.tool-header .lead { margin: 0; max-width: 820px; }
@media (max-width: 600px) { .tool-header { align-items: flex-start; } .tool-header .tool-icon--lg { width: 48px; height: 48px; } }

.tool {
  position: relative; padding: 18px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 300px;
}
@media (min-width: 768px) { .tool { padding: 24px; } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 300px; padding: 36px 18px; border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--grad-soft); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); }
.dropzone.is-drag { background: var(--brand-soft); }
.dropzone-icon { display: inline-flex; width: 72px; height: 72px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.dropzone-icon .icon { width: 34px; height: 34px; }
.dropzone-text { margin: 0; font-weight: 600; color: var(--text-2); }
.dropzone-hint { margin: 0; font-size: .85rem; color: var(--muted); }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: .88rem; color: var(--success); text-align: center; }

/* Área de trabajo */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 920px) { .workspace { grid-template-columns: 1fr; } }
.work-main { min-width: 0; }
.work-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.file-count { font-weight: 700; color: var(--text-2); }
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.workspace--list .preview-stage + .file-list { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.file-card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.file-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.file-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--checker); overflow: hidden; }
.file-thumb img { max-width: 92%; max-height: 92%; object-fit: contain; transition: transform .25s; }
.file-info { padding: 8px 10px; font-size: .8rem; min-width: 0; }
.file-name { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.file-meta { color: var(--muted); }
.file-remove {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  display: inline-flex; align-items: center; justify-content: center; background: rgba(20, 22, 45, .7); color: #fff;
}
.file-remove:hover { background: var(--danger); }
.file-remove .icon { width: 16px; height: 16px; }
.file-actions { display: flex; justify-content: center; gap: 6px; padding: 0 8px 8px; }
.file-actions .icon-btn { width: 34px; min-width: 34px; height: 34px; background: var(--surface); }
.file-index { position: absolute; top: 6px; left: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--brand); color: #fff; font-size: .78rem; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; }

.preview-stage {
  display: flex; align-items: center; justify-content: center; min-height: 260px; padding: 12px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.preview-stage--checker { background: var(--checker); }
.preview-canvas { display: block; max-width: 100%; max-height: 68vh; height: auto; border-radius: 4px; box-shadow: var(--shadow-sm); touch-action: none; }
.preview-canvas--pick { cursor: crosshair; }
.preview-canvas--draw { cursor: crosshair; }
.hint-center { text-align: center; margin-top: 10px; }

.work-side {
  position: sticky; top: calc(var(--header-h) + 12px); padding: 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
@media (max-width: 920px) { .work-side { position: static; } }
.side-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0 0 14px; }
.side-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- Campos de formulario ---------- */
.field { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.field > label, .field legend, .field-head label { display: block; margin-bottom: 6px; font-weight: 650; font-size: .9rem; color: var(--text-2); padding: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-head output { font-family: var(--mono); font-size: .82rem; color: var(--link); font-weight: 700; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type="color"] { width: 100%; height: 42px; padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
input[type="range"] { width: 100%; height: 28px; margin: 0; background: transparent; accent-color: var(--brand); cursor: pointer; }
.form-row { display: grid; gap: 0 14px; }
.form-row--2 { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .contact-form .form-row { grid-template-columns: 1fr 1fr; } }
.hint { font-size: .84rem; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.hint .icon { width: 1.1em; height: 1.1em; }
.panel { margin-bottom: 4px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.quick-chips .chip { padding: .3em .8em; font-size: .82rem; }

.switch { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; cursor: pointer; font-size: .92rem; font-weight: 550; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--border-strong); transition: background-color .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--brand); outline-offset: 2px; }

.choice { display: grid; gap: 6px; }
.choice--segment { grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); padding: 4px; border-radius: 12px; }
.choice-item { position: relative; cursor: pointer; }
.choice-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.choice--segment .choice-body { align-items: center; padding: 7px 6px; border-radius: 9px; font-size: .86rem; font-weight: 650; color: var(--text-2); text-align: center; transition: all .15s; }
.choice--segment input:checked + .choice-body { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.choice--cards .choice-body { padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); transition: all .15s; }
.choice--cards .choice-title { font-weight: 700; font-size: .95rem; }
.choice-desc { font-size: .8rem; color: var(--muted); }
.choice--cards input:checked + .choice-body { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); background: var(--brand-soft); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--brand); outline-offset: 1px; }

.filter-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip--filter { padding: .35em .8em; font-size: .82rem; }

.pos-grid { display: grid; grid-template-columns: repeat(3, 42px); gap: 6px; }
.pos-cell { position: relative; display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.pos-cell input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pos-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.pos-cell:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pos-cell input:checked + .sr-only + .pos-dot { background: var(--brand); transform: scale(1.3); }
.pos-cell input:focus-visible ~ .pos-dot { outline: 3px solid var(--brand); outline-offset: 4px; }

/* ---------- Recorte ---------- */
.crop-stage { padding: 16px; }
.crop-area { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-img { display: block; max-width: 100%; max-height: 64vh; width: auto; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10, 12, 30, .55); cursor: move; outline: 1px solid rgba(0, 0, 0, .35); }
.crop-box.is-circle { border-radius: 50%; }
.crop-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 33.333% 33.333%; }
.crop-box.is-circle .crop-grid { border-radius: 50%; }
.crop-handle { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--brand); border-radius: 50%; }
.h-nw { left: -10px; top: -10px; cursor: nwse-resize; } .h-ne { right: -10px; top: -10px; cursor: nesw-resize; }
.h-sw { left: -10px; bottom: -10px; cursor: nesw-resize; } .h-se { right: -10px; bottom: -10px; cursor: nwse-resize; }
.h-n { left: calc(50% - 9px); top: -10px; cursor: ns-resize; } .h-s { left: calc(50% - 9px); bottom: -10px; cursor: ns-resize; }
.h-w { top: calc(50% - 9px); left: -10px; cursor: ew-resize; } .h-e { top: calc(50% - 9px); right: -10px; cursor: ew-resize; }

/* ---------- Resultados ---------- */
.result-head { text-align: center; padding: 8px 0 18px; }
.result-check { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--success-soft); color: var(--success); margin-bottom: 10px; }
.result-check .icon { width: 30px; height: 30px; stroke-width: 2.6; }
.result-title { margin-bottom: 6px; }
.result-title:focus { outline: none; }
.result-summary { color: var(--text-2); margin-bottom: 16px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; list-style: none; margin: 10px 0 0; padding: 0; }
.result-list--single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.result-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.result-card .file-thumb { aspect-ratio: 4 / 3; }
.result-list--single .file-thumb { aspect-ratio: auto; min-height: 220px; padding: 12px; }
.result-list--single .file-thumb img { max-height: 55vh; }
.result-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; font-size: .85rem; }
.result-sizes { color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 750; background: var(--success-soft); color: var(--success); }
.badge--neutral { background: var(--surface-3); color: var(--muted); }
.result-card .btn { margin-top: 6px; }
.result-card--error { border-color: var(--danger); }
.result-error { color: var(--danger); font-weight: 600; }
.result-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

.busy {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border-radius: var(--radius-lg); background: rgba(246, 247, 252, .82); backdrop-filter: blur(2px); font-weight: 650;
}
[data-theme="dark"] .busy { background: rgba(15, 17, 36, .82); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 550; pointer-events: auto; animation: toast-in .2s ease-out; }
.toast--error { background: var(--danger); color: #fff; }
.toast--success { background: var(--success); color: #fff; }
[data-theme="dark"] .toast--success { color: #08241a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin: 0 0 16px; }
.notice p { margin: 0; }
.notice .icon { margin-top: 2px; }
.notice-success { background: var(--success-soft); color: var(--success); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Compartir ---------- */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin: 22px 0 8px; text-align: center; }
.share-title { margin: 0; font-weight: 700; color: var(--text-2); }
.share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  color: #fff; font-weight: 650; font-size: .9rem; text-decoration: none; transition: filter .15s, transform .1s;
}
.share-btn:hover { filter: brightness(1.1); color: #fff; }
.share-btn .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.share-facebook { background: #1877f2; }
.share-whatsapp { background: #128c7e; }
.share-x { background: #0f1419; border-color: rgba(255, 255, 255, .2); }
.share-telegram { background: #0088cc; }
.share-copy { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.share-copy .icon { fill: none; stroke: currentColor; }
.share-copy:hover { color: var(--link); border-color: var(--brand); filter: none; }
.share-bar.is-result { padding: 14px; border-radius: var(--radius); background: var(--brand-soft); }

/* ---------- Contenido editorial ---------- */
.content { padding-top: 44px; padding-bottom: 12px; }
.content p { color: var(--text-2); font-size: 1.03rem; }
.content h2 { margin-top: 1.2em; }
.content h3 { margin-top: 1.4em; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.checklist .icon { color: var(--success); margin-top: 3px; stroke-width: 2.6; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.4em; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 62px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); min-height: 56px; display: flex; align-items: center; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.faq { padding-top: 36px; padding-bottom: 20px; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 1.02rem; }
.faq-item summary .chev { transition: transform .2s; color: var(--muted); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-answer { padding: 0 18px 16px; color: var(--text-2); }
.faq-answer p { margin: 0; }

.related { padding-top: 36px; padding-bottom: 48px; }

/* ---------- Páginas legales y contacto ---------- */
.legal, .contact-page { padding-bottom: 56px; }
.legal-updated { color: var(--muted); font-size: .9rem; }
.legal-body h2 { font-size: 1.3rem; margin-top: 1.8em; }
.legal-body h3 { font-size: 1.08rem; margin-top: 1.4em; }
.legal-body p, .legal-body li { color: var(--text-2); }
.legal-body ul { padding-left: 1.3em; }
.legal-body li { margin-bottom: .4em; }
.legal-body table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .92rem; display: block; overflow-x: auto; }
.legal-body th, .legal-body td { text-align: left; padding: 10px; border: 1px solid var(--border); vertical-align: top; }
.legal-body th { background: var(--surface-2); }
.legal-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.legal-body dt { font-weight: 700; }
.legal-body dd { margin: 0; color: var(--text-2); }
@media (max-width: 560px) { .legal-body dl { grid-template-columns: 1fr; } .legal-body dd { margin-bottom: 8px; } }
.email-img { display: inline-block; vertical-align: middle; height: 24px; width: auto; }

.card { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.contact-form { margin: 18px 0 24px; }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: .86rem; font-weight: 600; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.captcha-img { border-radius: 10px; border: 1px solid var(--border-strong); background: #f5f5f8; }
.check-field { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 8px; font-size: .93rem; color: var(--text-2); cursor: pointer; }
.check-field input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.pow-status { font-size: .88rem; color: var(--muted); }
.gdpr-box { padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; }
.gdpr-box h2 { font-size: 1rem; margin-bottom: 10px; }
.gdpr-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.gdpr-box dt { font-weight: 700; color: var(--text); }
.gdpr-box dd { margin: 0; color: var(--text-2); }
@media (max-width: 560px) { .gdpr-box dl { grid-template-columns: 1fr; } .gdpr-box dd { margin-bottom: 6px; } }
.contact-alt { margin-top: 22px; text-align: center; color: var(--text-2); }

.notfound { padding: 56px 16px 64px; text-align: center; }
.notfound-code { font-size: clamp(4rem, 3rem + 6vw, 8rem); font-weight: 900; line-height: 1; margin: 0 0 10px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound .tools-grid { margin-top: 34px; text-align: left; }

/* ---------- Pie de página ---------- */
.site-footer { margin-top: 32px; background: var(--footer-bg); border-top: 1px solid var(--border); padding-top: 44px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(6, 1fr); gap: 28px 20px; }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { color: var(--text-2); margin-top: 12px; max-width: 420px; }
.footer-privacy { display: flex; gap: 8px; align-items: center; color: var(--success) !important; font-weight: 600; }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-col a { color: var(--text-2); text-decoration: none; }
.footer-col a:hover { color: var(--link); text-decoration: underline; }
.footer-disclaimer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-disclaimer p { font-size: .82rem; color: var(--muted); margin: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; padding-bottom: 28px; color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; }
.footer-langs a { color: var(--muted); text-decoration: none; }
.footer-langs a:hover, .footer-langs a[aria-current="true"] { color: var(--link); }

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .share-bar, .ad-slot, .tool, .related { display: none !important; }
}
