/* =========================================================
   FotoMejorIA — sistema visual diseñado con ChatGPT
   Azul tinta + coral fotográfico + marfil.
   Plus Jakarta Sans para la interfaz, Space Grotesk para cifras.
   ========================================================= */

:root {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --surface-2: #F0EEEB;
  --surface-3: #E8E6E2;
  --text: #18191B;
  --text-2: #686A70;
  --text-3: #8A8C92;
  --primary: #3157E8;
  --primary-dark: #2442B5;
  --primary-soft: #E9EDFF;
  --on-primary: #FFFFFF;
  --coral: #F0645A;
  --coral-soft: #FFF0EE;
  --amber: #9A6B12;
  --amber-soft: #FFF4D8;
  --success: #269B72;
  --success-soft: #E8F7F1;
  --danger: #C8372D;
  --border: #DEDCD8;
  --stage: #E4E1DC;
  --checker-a: #FFFFFF;
  --checker-b: #E6E3DE;
  --shadow-sm: 0 2px 8px rgba(24, 25, 27, .06);
  --shadow-md: 0 8px 28px rgba(24, 25, 27, .09);
  --shadow-lg: 0 18px 55px rgba(24, 25, 27, .13);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-width: 250px;
  --font-main: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-number: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101114;
  --surface: #181A1F;
  --surface-2: #20232A;
  --surface-3: #292C34;
  --text: #F5F4F1;
  --text-2: #A6A8AE;
  --text-3: #85888F;
  --primary: #6D86FF;
  --primary-dark: #8EA0FF;
  --primary-soft: #202A55;
  --on-primary: #0D1230;
  --coral: #FF766C;
  --coral-soft: #3A2423;
  --amber: #E8B350;
  --amber-soft: #3A2F18;
  --success: #45C89A;
  --success-soft: #19392F;
  --danger: #FF7A70;
  --border: #30333B;
  --stage: #0B0C0E;
  --checker-a: #2A2D34;
  --checker-b: #22252B;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .18);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .25);
  --shadow-lg: 0 18px 55px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font-main); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-number); font-variant-numeric: tabular-nums; }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-lg { width: 28px; height: 28px; }
.icon-sm { width: 16px; height: 16px; }

/* ---------------- Barra lateral ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 7px 10px 24px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.brand-name span, .coral { color: var(--coral); }
.nav-label { padding: 0 11px; margin: 4px 0 8px; color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; margin-bottom: 3px;
  border-radius: 12px; color: var(--text-2); text-align: left; font-size: 14px; font-weight: 600; transition: .18s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-bottom { margin-top: auto; padding-top: 12px; }
.local-chip { display: flex; gap: 9px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 600; line-height: 1.4; margin-bottom: 10px; }

/* ---------------- Principal ---------------- */
.main { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 34px; }
.topbar .spacer { flex: 1; }
.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: .18s ease;
}
.icon-button:hover { color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.content { width: min(1180px, calc(100% - 68px)); margin: 0 auto; padding: 8px 0 70px; }
.content.wide { width: min(1400px, calc(100% - 48px)); }

.page { display: none; }
.page.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-header { margin-bottom: 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 9px; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -1.8px; text-wrap: balance; }
h2 { text-wrap: balance; }
.page-description { margin: 12px 0 0; max-width: 650px; color: var(--text-2); font-size: 16px; line-height: 1.7; }

/* ---------------- Zona para arrastrar ---------------- */
.dropzone {
  position: relative; min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 45px; border: 2px dashed var(--border); border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 20%, var(--primary-soft), transparent 42%), var(--surface);
  transition: .2s ease; text-align: center;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); box-shadow: var(--shadow-md); }
.dropzone.dragging { transform: scale(1.01); }
.drop-icon { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 23px; background: var(--primary); color: var(--on-primary); box-shadow: 0 12px 28px rgba(49, 87, 232, .25); }
.dropzone h2 { margin: 0; font-size: 24px; letter-spacing: -.6px; }
.dropzone p { margin: 9px 0 23px; color: var(--text-2); font-size: 15px; }
.privacy-note { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.formats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.formats span { font-family: var(--font-number); font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }

/* ---------------- Botones ---------------- */
.primary-button {
  min-height: 52px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: var(--radius-md); background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 15px;
  box-shadow: 0 7px 18px rgba(49, 87, 232, .22); transition: .18s ease;
}
.primary-button:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.secondary-button {
  min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; transition: .18s ease;
}
.secondary-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.ghost-button { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; font-weight: 700; border-radius: 12px; }
.ghost-button:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.danger-link { color: var(--danger); font-weight: 700; font-size: 14px; padding: 8px 0; }
.full { width: 100%; }

/* ---------------- Accesos rápidos ---------------- */
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 36px 0 15px; gap: 12px; }
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.4px; }
.section-title span { color: var(--text-3); font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-card {
  display: flex; align-items: center; gap: 13px; min-height: 80px; padding: 13px 15px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow-sm); transition: .18s ease;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.quick-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.tone-coral .quick-icon, .tone-coral.quick-icon { color: var(--coral); background: var(--coral-soft); }
.tone-amber .quick-icon, .tone-amber.quick-icon { color: var(--amber); background: var(--amber-soft); }
.tone-green .quick-icon, .tone-green.quick-icon { color: var(--success); background: var(--success-soft); }
.quick-card strong { display: block; font-size: 14px; }
.quick-card small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.5px; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how div { padding: 18px; border-radius: 16px; background: var(--surface-2); }
.how b { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 4px; }
.how b span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-family: var(--font-number); font-size: 13px; color: var(--primary); }
.how p { margin: 0; color: var(--text-2); font-size: 14px; }

.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.recent button { display: grid; gap: 6px; text-align: left; padding: 0; border-radius: 14px; }
.recent img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.recent span { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Herramientas: estructura ---------------- */
.tool-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tool-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool-title h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -1px; }
.tool-title .file { color: var(--text-3); font-size: 13px; font-family: var(--font-number); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tool-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 18px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel-group { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; gap: 12px; }
.panel-group:last-child { border-bottom: 0; }
.panel-group h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-group h3 small { font-weight: 600; color: var(--text-3); font-size: 12px; font-family: var(--font-number); }
.hint { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.hint.warn { color: var(--amber); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.row .value { font-family: var(--font-number); color: var(--text-2); font-size: 13px; }

/* ---------------- Comparador antes/después ---------------- */
.comparison {
  position: relative; width: 100%; height: min(66vh, 640px); min-height: 320px; overflow: hidden;
  border-radius: var(--radius-xl); background: var(--stage); box-shadow: var(--shadow-lg); user-select: none; touch-action: none;
}
.comparison.checker { background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 22px 22px; }
.comp-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.comp-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.comp-frame .before { clip-path: inset(0 calc(100% - var(--x, 50%)) 0 0); }
.comp-frame .paint { cursor: crosshair; touch-action: none; }
.photo-label { position: absolute; z-index: 4; top: 16px; padding: 7px 10px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.before-label { left: 16px; }
.after-label { right: 16px; }
.slider-handle { position: absolute; z-index: 6; top: 0; bottom: 0; left: var(--x, 50%); cursor: ew-resize; width: 2px; background: #fff; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 10px rgba(0, 0, 0, .3); }
.slider-knob { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #18191B; box-shadow: 0 5px 20px rgba(0, 0, 0, .25); transform: translate(-50%, -50%); }
.comparison-input { position: absolute; z-index: 7; left: 0; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0; margin: 0; padding: 0; pointer-events: none; }
.comparison:not(.single):not(.painting) .comp-frame { cursor: ew-resize; }
.comparison.dragging .slider-knob { transform: translate(-50%, -50%) scale(1.08); }
.comparison:has(.comparison-input:focus-visible) .slider-knob { outline: 3px solid var(--primary); outline-offset: 2px; }
.comparison.single .after-label { display: none; }
.comparison.single .slider-handle, .comparison.single .comparison-input, .comparison.single .before, .comparison.single .before-label { display: none; }
.comparison.painting .comparison-input, .comparison.painting .slider-handle { display: none; }
.comp-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-2); }
.comp-empty .primary-button { margin-top: 14px; }
.comp-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--text-3); font-size: 13px; font-family: var(--font-number); flex-wrap: wrap; }

/* ---------------- Modo fácil ---------------- */
.easy-actions { margin-top: 22px; display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 10px; }
.easy-main-button {
  min-height: 68px; border-radius: 16px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center;
  gap: 10px; font-size: 17px; font-weight: 800; box-shadow: 0 9px 25px rgba(49, 87, 232, .22); transition: .18s ease;
}
.easy-main-button:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.easy-secondary { min-height: 68px; padding: 0 15px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 700; transition: .18s ease; }
.easy-secondary:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.easy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.easy-tool { min-height: 64px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; transition: .18s ease; text-align: left; }
.easy-tool:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.easy-tool .icon { color: var(--primary); }
.easy-tool small { display: block; font-weight: 500; font-size: 12.5px; color: var(--text-2); }
.local-banner { margin-top: 22px; padding: 16px 18px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.local-banner-icon { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--success-soft); color: var(--success); }
.local-banner strong { display: block; font-size: 14px; }
.local-banner span { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.5; }

/* ---------------- Controles ---------------- */
.slider { display: grid; gap: 4px; }
.slider label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.slider output { font-family: var(--font-number); font-size: 13px; color: var(--primary); background: var(--primary-soft); padding: 0 8px; border-radius: 6px; min-width: 38px; text-align: center; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--primary) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--primary) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: var(--shadow-sm); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 40px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 700; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 36px; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; cursor: pointer; transition: .18s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .18s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { left: 21px; }
.switch small { display: block; font-weight: 500; color: var(--text-2); font-size: 12.5px; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chips button { min-height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 6px; }
.chips button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches button { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--border); }
.swatches button.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.swatches .transparent { background: repeating-conic-gradient(#fff 0 25%, #d8d6d2 0 50%) 0 0 / 10px 10px; }
.swatches input[type=color] { width: 36px; height: 36px; border: 2px solid var(--border); border-radius: 10px; padding: 0; background: none; cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.info { background: var(--primary-soft); color: var(--primary); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.coral { background: var(--coral-soft); color: var(--coral); }

/* tira de filtros / pasos */
.strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; margin-top: 12px; }
.strip button { flex: none; display: grid; gap: 5px; width: 92px; padding: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.strip canvas, .strip img { width: 92px; height: 70px; object-fit: cover; border-radius: 12px; border: 2px solid transparent; display: block; background: var(--surface-2); }
.strip button.on canvas, .strip button.on img { border-color: var(--primary); }
.strip button.on { color: var(--primary); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.step { display: grid; gap: 6px; font-size: 13px; }
.step .thumb { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; display: grid; place-items: center; color: var(--text-3); }
.step .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.step b { font-size: 13.5px; }
.step span { color: var(--text-2); font-size: 12.5px; }
.step.done .thumb { border-color: var(--success); }

.hist { width: 100%; height: 90px; display: block; border-radius: 10px; background: var(--surface-2); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* ---------------- Lote ---------------- */
.batch-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-number); font-size: 26px; letter-spacing: -.5px; }
.stat span { color: var(--text-2); font-size: 13px; }
.batch-list { display: grid; gap: 8px; }
.batch-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) 180px auto; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; }
.batch-item img { width: 64px; height: 48px; border-radius: 9px; object-fit: cover; display: block; background: var(--surface-2); }
.batch-item .name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-item .meta { color: var(--text-3); font-size: 12.5px; font-family: var(--font-number); }
.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.batch-item.done .bar i { background: var(--success); }
.batch-item.error .bar i { background: var(--danger); }

/* ---------------- Ajustes ---------------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); display: grid; gap: 12px; align-content: start; min-width: 0; }
.card h2 { margin: 0; font-size: 18px; }
.spec { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec:last-child { border-bottom: 0; }
.spec span:first-child { color: var(--text-2); }
.model-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.model-row small { color: var(--text-3); font-size: 12.5px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { text-align: left; border: 2px solid var(--border); border-radius: 16px; padding: 14px; display: grid; gap: 4px; background: var(--surface); }
.mode-card.on { border-color: var(--primary); background: var(--primary-soft); }
.mode-card b { font-size: 15px; }
.mode-card span { font-size: 13px; color: var(--text-2); }

/* ---------------- Diálogo, progreso y avisos ---------------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 11, 14, .5); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.dialog header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 8px; gap: 12px; }
.dialog header h2 { margin: 0; font-size: 21px; }
.dialog .body { padding: 8px 22px 16px; display: grid; gap: 14px; }
.dialog footer { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input[type=text], .field select { min-height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 12px; font-weight: 500; }
.estimate { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.estimate b { font-family: var(--font-number); font-size: 18px; }

.progress-card { width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; text-align: center; border: 1px solid var(--border); }
.progress-card .spinner { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card h3 { margin: 0; font-size: 18px; }
.progress-card p { margin: 0; color: var(--text-2); font-size: 14px; min-height: 42px; }
.progress-card .bar { height: 10px; }
.progress-card small { color: var(--text-3); font-size: 12.5px; }

.toasts { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: min(420px, calc(100% - 40px)); }
.toast { background: var(--text); color: var(--bg); padding: 13px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: fadeIn .2s ease; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------------- Móvil ---------------- */
.mobile-header, .mobile-nav, .sheet { display: none; }

@media (max-width: 1100px) {
  .tool-layout { grid-template-columns: 1fr; }
  .comparison { height: min(58vh, 560px); }
}
@media (max-width: 950px) {
  :root { --sidebar-width: 220px; }
  .content, .content.wide { width: min(100% - 40px, 900px); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .easy-actions { grid-template-columns: 1fr 1fr; }
  .easy-main-button { grid-column: 1 / -1; }
  .batch-summary { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  .sidebar, .topbar { display: none; }
  .main { margin-left: 0; padding-bottom: 92px; }
  .mobile-header { height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .content, .content.wide { width: calc(100% - 32px); padding-top: 22px; }
  h1 { font-size: 30px; letter-spacing: -1.1px; }
  .page-description { font-size: 15px; line-height: 1.6; }
  .dropzone { min-height: 300px; padding: 28px 18px; border-radius: 22px; }
  .drop-icon { width: 64px; height: 64px; margin-bottom: 18px; }
  .dropzone h2 { font-size: 21px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .quick-card { min-height: 84px; padding: 11px; gap: 10px; }
  .quick-icon { flex-basis: 38px; width: 38px; height: 38px; }
  .quick-card small { display: none; }
  .how { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed; z-index: 40; left: 10px; right: 10px; bottom: 10px; height: 66px; padding: 5px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; border: 1px solid var(--border); border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); box-shadow: var(--shadow-lg);
  }
  .mobile-nav button { border-radius: 13px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; }
  .mobile-nav button.active { background: var(--primary-soft); color: var(--primary); }
  .sheet.open { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(10, 11, 14, .45); }
  .sheet .sheet-body { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; padding: 14px 16px 24px; max-height: 80vh; overflow: auto; }
  .sheet .grip { width: 44px; height: 5px; border-radius: 5px; background: var(--surface-3); margin: 0 auto 12px; }
  .comparison { height: 52vh; min-height: 300px; border-radius: 20px; }
  .slider-knob { width: 46px; height: 46px; }
  .easy-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .easy-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .easy-tool { min-height: 60px; padding: 0 12px; font-size: 14px; }
  .easy-tool small { display: none; }
  .tool-title .file { display: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .batch-item { grid-template-columns: 52px minmax(0, 1fr); }
  .batch-item .bar, .batch-item .item-actions { grid-column: 1 / -1; }
  .mode-cards { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; bottom: 88px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------- Idiomas ---------------- */
:root { --font-main: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Arabic", "Noto Sans SC", "Noto Sans JP", "Noto Sans Devanagari", sans-serif; }
.how b em { font-style: normal; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.lang-select { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.lang-select select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 700; font-size: 14px; color: var(--text); padding: 0 16px 0 0; cursor: pointer; height: 100%;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 2px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.site-footer { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.site-footer .brand-name { font-size: 16px; }
.lang-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.lang-links a { color: var(--text-2); text-decoration: none; }
.lang-links a:hover, .lang-links a[aria-current] { color: var(--primary); text-decoration: underline; }
@media (max-width: 700px) { .mobile-header .lang-select { height: 40px; padding: 0 8px; } .mobile-header .lang-select select { max-width: 92px; } }

/* Árabe: de derecha a izquierda */
[dir="rtl"] .sidebar { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid var(--border); }
[dir="rtl"] .main { margin-left: 0; margin-right: var(--sidebar-width); }
[dir="rtl"] .nav-item, [dir="rtl"] .quick-card, [dir="rtl"] .easy-tool, [dir="rtl"] .mode-card, [dir="rtl"] .recent button { text-align: right; }
[dir="rtl"] .comparison { direction: ltr; }
[dir="rtl"] .toasts { right: auto; left: 20px; }
[dir="rtl"] .h1, [dir="rtl"] h1 { letter-spacing: 0; }
[dir="rtl"] .eyebrow, [dir="rtl"] .nav-label { letter-spacing: 0; }
@media (max-width: 700px) { [dir="rtl"] .main { margin-right: 0; } [dir="rtl"] .toasts { left: 16px; right: 16px; } }
/* Letras sin mayúsculas ni espaciado latino */
:lang(zh) h1, :lang(ja) h1, :lang(hi) h1, :lang(ar) h1 { letter-spacing: 0; }
