/* ShareKodigo — sitio público. Tema claro/oscuro: según el sistema o elegido por la persona. */
:root {
  --bg: #ffffff; --surface: #f7f7f9; --surface-2: #efeff3; --border: #e5e5ec; --border-strong: #d4d4dd;
  --fg: #0b0b0f; --fg-2: #3f3f4a; --muted: #6b6b78; --accent: #5a03dc; --accent-2: #4a02b6; --accent-soft: #5a03dc14; --on-accent: #ffffff;
  --ok: #15803d; --low: #4d7c0f; --mid: #b45309; --high: #c2410c; --crit: #be123c;
  --code-bg: #0b0b0f; --code-fg: #e6e6ee;
  --radius: 12px; --shadow: 0 1px 2px #0b0b0f0d, 0 8px 24px #0b0b0f0f;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --head-h: 64px; --tab-h: 64px;
  color-scheme: light;
}
/* Tema: "Sistema" sigue al dispositivo; "Claro" u "Oscuro" (data-theme en <html>) mandan sobre él */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0f; --surface: #121218; --surface-2: #1a1a22; --border: #23232d; --border-strong: #30303c;
    --fg: #ececf1; --fg-2: #c4c4cf; --muted: #8b8b98; --accent: #8a5cff; --accent-2: #a77bff; --accent-soft: #8a5cff1f; --on-accent: #ffffff;
    --ok: #4ade80; --low: #a3e635; --mid: #fbbf24; --high: #fb923c; --crit: #fb7185;
    --code-bg: #121218; --shadow: 0 1px 2px #0006, 0 12px 32px #0007;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b0b0f; --surface: #121218; --surface-2: #1a1a22; --border: #23232d; --border-strong: #30303c;
    --fg: #ececf1; --fg-2: #c4c4cf; --muted: #8b8b98; --accent: #8a5cff; --accent-2: #a77bff; --accent-soft: #8a5cff1f; --on-accent: #ffffff;
    --ok: #4ade80; --low: #a3e635; --mid: #fbbf24; --high: #fb923c; --crit: #fb7185;
    --code-bg: #121218; --shadow: 0 1px 2px #0006, 0 12px 32px #0007;
    color-scheme: dark;
}
/* Logo claro u oscuro según el tema activo */
.on-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-dark { display: block !important; }
  :root:not([data-theme="light"]) .on-light { display: none !important; }
}
:root[data-theme="dark"] .on-dark { display: block !important; }
:root[data-theme="dark"] .on-light { display: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.6 var(--ui); min-height: 100dvh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3 { font-family: var(--display); color: var(--fg); letter-spacing: -.02em; }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.12; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 6px; font-weight: 650; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--fg); font-weight: 550; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s; }
.btn:hover:not(:disabled) { background: var(--surface); color: var(--fg); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }

/* ---------- Cabecera ---------- */
.site-head { position: sticky; top: 0; z-index: 40; height: var(--head-h); display: flex; align-items: center; gap: 28px; padding: 0 max(20px, calc((100vw - 1200px) / 2)); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; }
.brand img { height: 23px; width: auto; display: block; }
.desk-nav { display: flex; gap: 2px; }
.desk-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.desk-nav a:hover { color: var(--fg); background: var(--surface); }
.desk-nav a[aria-current] { color: var(--fg); background: var(--surface-2); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.lang-switch:hover { color: var(--fg); background: var(--surface); }
.theme-pick { position: relative; }
.theme-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 9px; }
.theme-btn:hover, .theme-btn[aria-expanded="true"] { color: var(--fg); background: var(--surface); }
.theme-btn > span { display: none; }
:root[data-theme-choice="system"] .theme-btn [data-ic="system"], :root:not([data-theme-choice]) .theme-btn [data-ic="system"],
:root[data-theme-choice="light"] .theme-btn [data-ic="light"], :root[data-theme-choice="dark"] .theme-btn [data-ic="dark"] { display: inline-flex; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 172px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.theme-menu[hidden] { display: none; }
.theme-menu p { margin: 4px 10px 6px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: var(--fg-2); font-size: 14px; cursor: pointer; text-align: left; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--surface); color: var(--fg); }
.theme-menu button .check { margin-left: auto; color: var(--accent); visibility: hidden; }
.theme-menu button[aria-checked="true"] { color: var(--fg); font-weight: 600; }
.theme-menu button[aria-checked="true"] .check { visibility: visible; }

.site-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 36px 20px 56px; }

/* ---------- Inicio ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; padding: 28px 0 56px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--mono); color: var(--muted); margin: 0 0 18px; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 20px; }
.lead { font-size: 19px; color: var(--muted); max-width: 540px; margin: 0 0 30px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.note { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.mock { background: var(--code-bg); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; color: var(--code-fg); }
.mock-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #ffffff12; }
.mock-url { display: inline-flex; gap: 6px; align-items: center; font: 12.5px var(--mono); color: #9a9aa8; background: #ffffff0d; padding: 5px 10px; border-radius: 7px; }
.mock-users { display: flex; }
.mock-users img { width: 26px; height: 26px; border-radius: 50%; margin-left: -7px; border: 2px solid var(--code-bg); display: block; }
.mock-tabs { display: flex; font: 12.5px var(--mono); color: #8b8b98; border-bottom: 1px solid #ffffff12; }
.mock-tabs span { padding: 9px 16px; border-right: 1px solid #ffffff0d; }
.mock-tabs .on { color: #ececf1; box-shadow: inset 0 -2px 0 #a77bff; }
.mock-code { margin: 0; padding: 18px 18px 24px 0; font: 14px/1.85 var(--mono); white-space: pre; overflow: hidden; }
.mock-code .ln { display: inline-block; width: 44px; text-align: right; padding-right: 18px; color: #4b4b57; user-select: none; }
.mock-code .k { color: #c792ea; } .mock-code .f { color: #82aaff; } .mock-code .s { color: #c3e88d; }
.cur { position: relative; display: inline-block; width: 2px; height: 1.2em; vertical-align: -3px; margin-left: 1px; }
.cur.a { background: #22c55e; } .cur.b { background: #f59e0b; }
.cur::after { content: attr(data-n); position: absolute; left: 0; top: -17px; font: 600 10px/1.4 var(--ui); color: #0b0b0f; padding: 0 5px; border-radius: 3px 3px 3px 0; white-space: nowrap; }
.cur.a::after { background: #22c55e; } .cur.b::after { background: #f59e0b; }
@media (prefers-reduced-motion: no-preference) { .cur { animation: blink 1.1s steps(2) infinite; } @keyframes blink { 50% { opacity: .2; } } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { padding: 24px; border-right: 1px solid var(--border); }
.step:last-child { border-right: 0; }
.step .num { font: 600 13px var(--mono); color: var(--accent); display: block; margin-bottom: 14px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.block { padding-top: 72px; }
.block .sub { color: var(--muted); margin: -2px 0 24px; }
.block > h2 { margin-bottom: 24px; }
.block > h2 + .sub { margin-top: -16px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.feature .ic { color: var(--fg-2); margin-bottom: 12px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.tool-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tool-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; color: var(--fg); border-bottom: 1px solid var(--border); transition: background .15s; }
.tool-row:last-child { border-bottom: 0; }
.tool-row:hover { background: var(--surface); color: var(--fg); }
.tool-row .tool-ic { color: var(--fg-2); align-self: flex-start; margin-top: 3px; }
.tool-row:hover .tool-ic { color: var(--accent); }
.tool-txt { display: flex; flex-direction: column; min-width: 0; }
.tool-txt b { font-weight: 600; }
.tool-txt span { color: var(--muted); font-size: 14.5px; }
.chev { margin-left: auto; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 2px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--muted); transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 760px; }
.final-cta { margin-top: 72px; padding: 48px 32px; border-radius: 20px; background: var(--code-bg); color: #ececf1; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border: 1px solid var(--border); }
.final-cta h2 { color: #ececf1; margin: 0; max-width: 620px; }

/* ---------- Herramientas ---------- */
.tool-head { margin-bottom: 24px; }
.tool-head h1 { margin-bottom: 4px; }
.tool-head p { color: var(--muted); margin: 0; max-width: 720px; }
.tool-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pane-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 52px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.pane-title { font-weight: 600; font-size: 14px; margin-right: auto; }
.ed { height: 500px; background: var(--code-bg); position: relative; }
.ed.short { height: 240px; }
.ed.tall { height: 580px; }
select { height: 34px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 30px 0 10px; font-size: 14px; max-width: 190px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b8b98' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; }
.check, .range { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--fg-2); }
input[type=checkbox], input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; }
.privacy, .disclaimer { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.privacy { justify-content: center; text-align: center; }
.privacy .ic, .disclaimer .ic { margin-top: 3px; }

/* Resultados del escáner */
.results { padding: 0; max-height: 552px; overflow: auto; }
.verdict { padding: 20px; border-bottom: 1px solid var(--border); }
.v-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.v-label { font: 650 20px var(--display); color: var(--fg); letter-spacing: -.01em; }
.v-score { font: 600 13px var(--mono); color: var(--muted); }
.v-score b { font-size: 22px; color: var(--fg); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0 12px; }
.meter i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.lv1 .meter i:nth-child(-n+1) { background: var(--low); }
.lv2 .meter i:nth-child(-n+2) { background: var(--mid); }
.lv3 .meter i:nth-child(-n+3) { background: var(--high); }
.lv4 .meter i { background: var(--crit); }
.lv0 .v-label { color: var(--ok); }
.v-sub { margin: 0; color: var(--muted); font-size: 14px; }
.findings { list-style: none; margin: 0; padding: 0; }
.finding { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.finding:hover, .finding:focus-visible { background: var(--surface-2); outline: none; }
.f-line { grid-row: span 3; font: 600 12px var(--mono); color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; height: fit-content; margin-top: 2px; min-width: 42px; text-align: center; }
.f-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.tag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tag.s1 { --c: var(--low); } .tag.s2 { --c: var(--mid); } .tag.s3 { --c: var(--high); } .tag.s4 { --c: var(--crit); }
.finding p { margin: 0; color: var(--fg-2); font-size: 14px; }
.finding code { display: block; margin-top: 6px; font: 12.5px/1.5 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-all; }
.deco-1 { background: #a3e6351a; } .deco-2 { background: #fbbf2422; } .deco-3 { background: #fb923c26; } .deco-4 { background: #fb71852b; }
.glyph-1, .glyph-2, .glyph-3, .glyph-4 { border-radius: 50%; margin-left: 7px; width: 7px !important; height: 7px !important; margin-top: 7px; }
.glyph-1 { background: #a3e635; } .glyph-2 { background: #fbbf24; } .glyph-3 { background: #fb923c; } .glyph-4 { background: #fb7185; }

/* Código a imagen */
.img-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.grow { flex: 1; }
.img-stage { overflow: auto; border: 1px solid var(--border); background: repeating-conic-gradient(var(--surface) 0 25%, var(--bg) 0 50%) 0 0 / 22px 22px; border-radius: var(--radius); padding: 28px; margin-bottom: 16px; display: flex; justify-content: center; }
.shot { display: inline-flex; flex-direction: column; align-items: stretch; min-width: 380px; max-width: 100%; }
.window { background: var(--win-bg); color: var(--win-fg); border-radius: 12px; box-shadow: 0 24px 60px #0006, 0 0 0 1px #ffffff14; overflow: hidden; }
.win-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: var(--win-bar); }
.win-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; } .win-bar i:nth-child(3) { background: #28c840; }
.win-bar span { flex: 1; text-align: center; font: 13px var(--ui); opacity: .65; margin-right: 50px; outline: none; }
.shot-code { font: 15px/1.6 var(--mono); padding: 16px 24px 22px 18px; white-space: pre; counter-reset: ln; }
.shot-code > span, .shot-code > div { display: block; min-height: 1.6em; }
.shot-code.nums > span, .shot-code.nums > div { counter-increment: ln; }
.shot-code.nums > span::before, .shot-code.nums > div::before { content: counter(ln); display: inline-block; width: 2em; margin-right: 16px; text-align: right; opacity: .32; }
.shot-code br { display: none; }
.wm { display: flex; justify-content: center; margin-top: 14px; opacity: .9; }
.wm img { height: 15px; width: auto; }

/* Comparar / navaja */
.stats { color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.stats.ok { color: var(--ok); } .stats.bad { color: var(--crit); }
.stats .add { color: var(--ok); font-weight: 600; } .stats .del { color: var(--crit); font-weight: 600; }
.pane-bar .stats { margin-right: auto; }
.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.seg button { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 14px; white-space: nowrap; }
.seg button.on { background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }
.sub { display: none; } .sub.on { display: block; }
.ta { width: 100%; min-height: 170px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font: 13.5px/1.55 var(--mono); resize: vertical; outline: none; color: var(--fg); }
.ta:focus { border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.two h3 { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.out { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font: 13.5px/1.55 var(--mono); min-height: 130px; margin: 0; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.hl mark { background: var(--accent-soft); color: inherit; border-radius: 3px; box-shadow: inset 0 -2px 0 var(--accent); }
.rx-row { display: flex; align-items: center; gap: 6px; font: 20px var(--mono); color: var(--muted); }
.rx-row input { flex: 1; min-width: 0; height: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font: 15px var(--mono); outline: none; color: var(--fg); }
.rx-row input#rx-flags { flex: 0 0 76px; }
.rx-row input:focus { border-color: var(--accent); }
.grp { font: 12.5px var(--mono); color: var(--muted); margin-top: 6px; }

/* ---------- Legal ---------- */
.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
.legal-nav { position: sticky; top: calc(var(--head-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 2px; }
.legal-nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14.5px; }
.legal-nav a:hover { color: var(--fg); background: var(--surface); }
.legal-nav a[aria-current] { color: var(--fg); background: var(--surface-2); font-weight: 600; }
.legal-body { max-width: 760px; }
.legal-body .updated { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.legal-body h2 { font-size: 21px; margin: 36px 0 10px; }
.legal-body h3 { font-size: 17px; margin: 24px 0 8px; }
.legal-body p, .legal-body li { color: var(--fg-2); }
.legal-body ul { padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }

/* ---------- Pie ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 48px max(20px, calc((100vw - 1200px) / 2)) 28px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.foot-grid h4 { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.foot-grid a { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 14.5px; padding: 4px 0; }
.foot-grid a:hover { color: var(--accent); }
.foot-brand img { height: 21px; width: auto; }
.foot-brand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 260px; }
.copy { color: var(--muted); font-size: 13px; margin: 40px 0 0; }
.copy a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Barra inferior (móvil) y hoja ---------- */
.tabbar { display: none; }
.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; background: var(--bg); color: var(--fg); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -10px 40px #0005; }
.sheet::backdrop { background: #0008; }
.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 10px auto 6px; }
.sheet-list { display: flex; flex-direction: column; padding: 6px 12px 14px; }
.sheet-list a { display: flex; align-items: center; gap: 14px; padding: 15px 10px; color: var(--fg); border-bottom: 1px solid var(--border); font-weight: 500; }
.sheet-list a:last-child { border-bottom: 0; color: var(--muted); }
.sheet-list a .ic:first-child { color: var(--fg-2); }

.toast { position: fixed; bottom: calc(28px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; animation: pop .2s ease; font-size: 14.5px; font-weight: 500; max-width: calc(100vw - 32px); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .desk-nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .features { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .legal { grid-template-columns: 1fr; gap: 20px; }
  .legal-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
  .legal-nav a { white-space: nowrap; background: var(--surface); }
}

/* ---------- Móvil: estilo app ---------- */
@media (max-width: 720px) {
  :root { --head-h: 56px; }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .site-head { padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--head-h) + env(safe-area-inset-top)); gap: 12px; }
  .brand img { height: 20px; }
  .head-actions .btn { display: none; }
  .site-main { padding: 20px 16px 32px; }
  .hero { padding: 8px 0 32px; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 17px; }
  .cta .btn { flex: 1; }
  .mock-code { font-size: 12.5px; }
  .mock-tabs span:nth-child(3) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--border); padding: 18px; }
  .step:last-child { border-bottom: 0; }
  .block { padding-top: 48px; }
  .features { grid-template-columns: 1fr; gap: 24px; }
  .feature { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; }
  .feature .ic { grid-row: span 2; margin: 2px 0 0; }
  .final-cta { padding: 28px 22px; border-radius: 16px; }
  .final-cta .btn { width: 100%; }
  .tool-head { margin-bottom: 18px; }
  .tool-head p { font-size: 15px; }
  .tool-split, .two { grid-template-columns: 1fr; }
  .ed { height: 340px; } .ed.tall { height: 460px; }
  .results { max-height: none; }
  .pane { border-radius: 14px; }
  .pane-bar .pane-title { flex-basis: 100%; }
  .pane-bar select { flex: 1; max-width: none; }
  .img-controls select { flex: 1 1 40%; max-width: none; }
  .img-controls .grow { display: none; }
  .img-controls .btn { flex: 1; }
  .img-stage { padding: 14px; }
  .shot { min-width: 0; }
  .shot-code { font-size: 12px; }
  .seg { display: flex; }
  .seg button { flex: 1; justify-content: center; padding: 8px 10px; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-foot { padding: 32px 16px 20px; }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--border); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 550; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab.on { color: var(--accent); }
  .tab.new { color: var(--accent); }
  .tab:active { transform: scale(.94); }
  .toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
}
@media (min-width: 721px) { .sheet { display: none; } }

/* ---------- Páginas de error (404, 500, sin conexión) ---------- */
.err { max-width: 680px; margin: 24px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.err-term { width: 100%; max-width: 520px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-align: left; margin-bottom: 36px; box-shadow: var(--shadow); }
.err-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #ffffff12; }
.err-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a46; }
.err-term pre { margin: 0; padding: 18px 20px 22px; font: 14px/1.8 var(--mono); color: #c4c4cf; white-space: pre-wrap; word-break: break-all; }
.err-term .c { color: #8a5cff; } .err-term .w { color: #fbbf24; } .err-term .r { color: #fb7185; } .err-term .m { color: #6b6b78; }
.err-code { font: 600 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; display: inline-flex; gap: 8px; align-items: center; }
.err h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 14px; }
.err .lead { margin: 0 auto 28px; }
.err .cta { justify-content: center; }
.err-tools { color: var(--muted); font-size: 14px; margin: 44px 0 12px; }
.err-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.err-links a { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-2); font-size: 14.5px; }
.err-links a:hover { color: var(--accent); }
@media (max-width: 720px) { .err { margin-top: 8px; } .err-term pre { font-size: 12.5px; padding: 14px 16px 16px; } .err .cta .btn { flex: 1 1 100%; } }
