/* ComexChile — CSS propio, móvil primero, sin dependencias. */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --ink: #0b1220;
  --ink-2: #29364a;
  --muted: #5b6b80;
  --line: #e2e8f1;
  --brand: #2f6bff;
  --brand-ink: #1f4fd6;
  --brand-soft: #e8efff;
  --accent: #10b39a;
  --accent-soft: #e2f7f2;
  --warn: #b25e00;
  --warn-soft: #fff4e5;
  --danger: #b42318;
  --ok: #0a7a4f;
  --navy: #0b1f3a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a; --surface: #111827; --surface-2: #172033; --ink: #e8edf6; --ink-2: #c9d3e3; --muted: #93a1b7;
    --line: #243049; --brand: #5b8cff; --brand-ink: #8fb0ff; --brand-soft: #18264a; --accent: #2fd1b5; --accent-soft: #0f2e2b;
    --warn: #ffb35c; --warn-soft: #2d2210; --danger: #ff8a80; --ok: #4ade9f; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 700; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 1.12rem; letter-spacing: -.02em; }
.logo strong { color: var(--brand); font-weight: 800; }
.nav { display: none; gap: 2px; margin-left: 8px; flex: 1; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .94rem; font-weight: 520; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.cta-agent { display: none; }
.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 42px; height: 42px; display: grid; place-content: center; gap: 5px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.menu nav { position: absolute; right: 0; top: 50px; width: min(86vw, 320px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: grid; }
.menu nav a { padding: 11px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.menu nav a.btn { color: #fff; margin-top: 6px; text-align: center; }
@media (min-width: 1140px) {
  .nav { display: flex; }
  .cta-agent { display: inline-flex; margin-left: auto; }
  .menu { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 620; padding: 11px 18px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s ease, box-shadow .15s ease; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), #4b55ff 60%, #6a4dff); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 255, .28); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(47, 107, 255, .36); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-sm { padding: 8px 13px; font-size: .9rem; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 1.04rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 44px 0 36px; background:
  radial-gradient(900px 420px at 85% -10%, rgba(47,107,255,.18), transparent 60%),
  radial-gradient(700px 360px at -10% 10%, rgba(16,179,154,.16), transparent 60%), var(--bg); }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .76rem; font-weight: 700; color: var(--brand-ink); margin-bottom: .6em; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.trust { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .92rem; }
.trust li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 6px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.calc-demo { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.calc-demo div, .breakdown div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.calc-demo .total, .breakdown .total { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 750; }
@media (min-width: 900px) { .hero { padding: 72px 0 60px; } .hero-grid { grid-template-columns: 1.25fr .9fr; gap: 48px; } }

/* Layout blocks */
.section { padding: 26px 16px; }
.section-title { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-head { padding-top: 26px; padding-bottom: 8px; }
.crumbs { padding-top: 14px; font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); }
.grid { display: grid; gap: 16px; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.split { display: grid; gap: 18px; }
@media (min-width: 960px) { .split { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.row-2 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; display: block; }
.card-link:hover { border-color: var(--brand); transform: translateY(-2px); color: inherit; }
.card-link p { color: var(--muted); margin: 0; }
.card-link h2, .card-link h3 { font-size: 1.08rem; margin: .3em 0; }
.quick .ico { display: inline-grid; place-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 1.1rem; }
.flow { padding-left: 1.2em; } .flow li { margin: .25em 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats strong, .stat strong { display: block; font-size: 2rem; letter-spacing: -.03em; color: var(--brand-ink); }
.stats span, .stat span { color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font: inherit; font-size: .92rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.dev-band { display: grid; gap: 18px; background: linear-gradient(135deg, var(--navy), #13306b); color: #e8eefc; border: 0; }
.dev-band h2, .dev-band .eyebrow { color: #fff; } .dev-band a { color: #9fc0ff; }
@media (min-width: 900px) { .dev-band { grid-template-columns: 1fr 1fr; align-items: center; padding: 30px; } }
.code { background: #0b1324; color: #d7e3ff; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .84rem; line-height: 1.55; margin: 0 0 1em; }
.dev-band .code { background: rgba(0,0,0,.28); }

/* Forms */
.form, .wizard { display: block; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 750; font-size: 1.15rem; margin-bottom: 12px; padding: 0; }
.field { margin-bottom: 14px; }
label { display: block; font-weight: 580; font-size: .94rem; margin-bottom: 5px; color: var(--ink-2); }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.help { color: var(--muted); font-size: .85rem; margin: 5px 0 0; }
.error { color: var(--danger); font-size: .86rem; margin: 4px 0 0; font-weight: 560; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 8px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--brand); }
.check.small { font-size: .84rem; margin: 0; align-items: center; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.seg label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 9px 12px; border-radius: 10px; font-weight: 520; cursor: pointer; margin: 0; }
.seg input { width: auto; min-height: 0; accent-color: var(--brand); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.h-sub { font-size: 1rem; margin: 18px 0 8px; }
.log-rows { display: grid; gap: 10px; margin-bottom: 8px; }
.log-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.log-row > input:first-child, .log-row .cost-label { grid-column: 1 / -1; }
.cost-label { font-weight: 600; font-size: .92rem; }
@media (min-width: 720px) { .log-row { grid-template-columns: 2fr 1.1fr .8fr 1.1fr auto; align-items: center; } .log-row > input:first-child { grid-column: auto; } .cost-row { grid-template-columns: 1.6fr 1.1fr .8fr 1.1fr; } .cost-row .cost-label { grid-column: auto; } .alt-row { grid-template-columns: 1.2fr 1.2fr 1fr 1fr; } }
details.alt { margin-top: 10px; } details.alt summary { cursor: pointer; font-weight: 600; color: var(--brand-ink); margin-bottom: 10px; }

/* Wizard */
.calc-layout { display: grid; gap: 18px; padding-bottom: 30px; }
@media (min-width: 1080px) { .calc-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } .wizard { position: sticky; top: 76px; } }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; counter-reset: s; }
.steps li { flex: 1 0 auto; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 8px 10px 8px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.steps li::before { counter-increment: s; content: counter(s); display: inline-grid; place-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: .75rem; }
.steps li.is-current { background: var(--brand-soft); color: var(--brand-ink); }
.steps li.is-current::before, .steps li.is-done::before { background: var(--brand); color: #fff; border-color: var(--brand); }
.js .wizard .step { display: none; }
.js .wizard .step.is-active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step-nav { display: flex; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; flex-wrap: wrap; }
.step-nav [data-submit] { margin-left: auto; }
.agreements-live { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; }
.agreements-live ul { margin: 6px 0 0; padding-left: 1.1em; }

/* Result */
.result-col { min-width: 0; }
.result-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kpi { background: linear-gradient(135deg, var(--navy), #163a86 70%, #1b5bd6); color: #fff; border-radius: var(--radius); padding: 22px; margin: 6px 0 16px; }
.kpi-label { font-size: .78rem; letter-spacing: .12em; font-weight: 800; opacity: .85; margin: 0 0 4px; }
.kpi-value { font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; margin: 0; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .9rem; font-weight: 600; opacity: .85; margin-left: 6px; letter-spacing: 0; }
.kpi-sub { margin: 6px 0 0; opacity: .92; }
.kpi .muted { color: #c9d6f5; }
.breakdown { font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.breakdown .net { color: var(--ok); }
.placeholder { border-style: dashed; }
.formula-visual { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0; }
.formula-visual span { background: var(--surface-2); padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.formula-visual b { color: var(--muted); }
.formula-visual .eq { background: var(--brand); color: #fff; }
.scenarios { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 560px) { .scenarios { grid-template-columns: 1fr 1fr; } }
.scenario { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.scenario.is-applied { border-color: var(--brand); background: var(--brand-soft); }
.scenario.muted-box { background: var(--surface-2); border-style: dashed; }
.sc-title { font-weight: 700; margin-bottom: 8px; }
.scenario dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-variant-numeric: tabular-nums; font-size: .93rem; }
.scenario dt { color: var(--muted); } .scenario dd { margin: 0; text-align: right; }
.big { font-size: 1.6rem; font-weight: 800; margin: 0; }
.savings { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px; }
.savings p { margin: 0; font-weight: 600; } .savings strong { font-size: 1.7rem; color: var(--ok); margin-right: 10px; letter-spacing: -.02em; } .savings .small { font-weight: 400; margin-top: 6px; }
.conf { font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.conf-high { color: var(--ok); } .conf-medium { color: var(--warn); } .conf-low { color: var(--danger); }
.kv { display: grid; grid-template-columns: minmax(110px, .7fr) 1.3fr; gap: 8px 14px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: .92rem; } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* Badges */
.badge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; vertical-align: middle; white-space: nowrap; }
.b-off { background: #e3f6ec; color: #08643f; }
.b-calc { background: var(--brand-soft); color: var(--brand-ink); }
.b-est { background: var(--warn-soft); color: var(--warn); }
.b-user { background: #f1eaff; color: #5b34b8; }
.b-na { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .b-off { background: #0f3324; color: #6ee7b0; } .b-user { background: #2a1f4a; color: #c4b0ff; } }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1em; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 650; font-size: .84rem; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
.ta-r { text-align: right; } .ta-c { text-align: center; }
.lines td.ta-r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-total td { font-weight: 750; background: var(--surface-2); }

/* Notices & lists */
.notice { border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; border: 1px solid var(--line); background: var(--surface-2); }
.notice ul { margin: 6px 0 0; padding-left: 1.1em; }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.notice-ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { padding: 5px 0 5px 28px; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 5px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-content: center; font-size: .78rem; font-weight: 800; }
.checklist li.ok::before { content: "✓"; background: #e3f6ec; color: #08643f; }
.checklist li.pending::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.checklist li.fail::before { content: "✕"; background: #fdecea; color: var(--danger); }
.warn-list { padding-left: 1.1em; color: var(--ink-2); } .warn-list li { margin: 4px 0; }
.opps { padding-left: 1.1em; } .opps li { margin: 8px 0; }
.docs { list-style: none; padding: 0; margin: 10px 0; } .docs li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.req { display: inline-block; font-size: .7rem; font-weight: 750; padding: 2px 7px; border-radius: 6px; margin-right: 6px; background: var(--surface-2); color: var(--muted); }
.req-always { background: var(--brand-soft); color: var(--brand-ink); }
.req-required_for_preference { background: #f1eaff; color: #5b34b8; }
.plain { list-style: none; padding: 0; } .plain li { margin: 6px 0; }
.cols { columns: 2 180px; }
.sources li { margin: 6px 0; }
details.source { margin-top: 6px; font-size: .84rem; }
details.source summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; display: inline; }
details.source > div { margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.disclaimer { margin: 12px 0 0; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* Agents */
.filters { display: grid; gap: 0 12px; align-items: end; }
@media (min-width: 760px) { .filters { grid-template-columns: 1.4fr 1fr 1fr 1fr auto; } .filters .btn { margin-bottom: 14px; } }
.agent-card h2 { font-size: 1.04rem; margin: 8px 0 2px; } .agent-card h2 a { color: var(--ink); text-decoration: none; } .agent-card h2 a:hover { color: var(--brand-ink); }
.agent-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 22px 0; }

/* Countries & guides */
.region { margin-top: 26px; font-size: 1.1rem; color: var(--ink-2); }
.country-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.country-card.is-pending { opacity: .8; box-shadow: none; }
.facts { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 8px; }
.facts .card { margin: 0; } .facts .card p:last-child { margin-bottom: 0; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.guide-layout { display: grid; gap: 20px; padding-top: 12px; padding-bottom: 40px; }
@media (min-width: 1080px) { .guide-layout { grid-template-columns: 270px minmax(0, 1fr); } .toc-col .toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; } }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { padding-left: 1.1em; margin: 10px 0 0; } .toc li { margin: 5px 0; } .toc a { text-decoration: none; color: var(--ink-2); } .toc a:hover { color: var(--brand-ink); }
.prose { min-width: 0; max-width: 80ch; }
.prose h2 { margin-top: 1.8em; padding-top: .4em; scroll-margin-top: 80px; font-size: 1.45rem; }
.prose h3 { margin-top: 1.4em; scroll-margin-top: 80px; }
.prose blockquote { margin: 1em 0; padding: 12px 16px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose pre { background: var(--surface-2); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin: .3em 0; }
.prose ul.tasks { list-style: none; padding-left: 0; }
.task { display: inline-grid; place-content: center; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 5px; margin-right: 8px; font-size: .7rem; vertical-align: -3px; }
.task.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a { overflow-wrap: anywhere; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 10px 0 0; }
.feature h2 { font-size: 1.3rem; }

/* Chat */
.chat-wrap { display: grid; gap: 18px; padding-bottom: 30px; }
@media (min-width: 980px) { .chat-wrap { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; min-height: 260px; overflow-y: auto; padding: 4px; }
.msg { max-width: 92%; padding: 12px 15px; border-radius: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.msg p:last-child { margin-bottom: 0; }
.msg-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg-bot p { white-space: pre-line; }
.msg-error { background: var(--warn-soft); }
.msg.is-loading::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { min-height: 52px; }
.small-chips .chip { font-size: .84rem; }
.mode-pill { display: inline-block; font-size: .84rem; background: var(--surface-2); padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.side-note h2 { font-size: 1.05rem; }

/* Admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.admin-nav a { padding: 7px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.stat { text-align: left; }

/* Footer */
.site-footer { margin-top: 40px; background: var(--navy); color: #c7d3ea; padding: 36px 0 18px; }
.site-footer a { color: #e3ebfb; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.site-footer .muted { color: #9fb0cf; }
.logo-foot { color: #fff; font-size: 1.2rem; } .logo-foot strong { color: #7fa6ff; }
.foot-grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.foot-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } .foot-grid > div:first-child { grid-column: auto; } }
.legal-strip { border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 14px; font-size: .86rem; }
.legal-strip a { display: inline; }
.error-page { padding: 60px 16px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .wizard, .chat-form { display: none !important; } .card { box-shadow: none; } }
.js .steps li { cursor: pointer; }

/* Fase 2: líneas de factura y logística */
.item-row { grid-template-columns: 1fr 1fr; }
.item-row > input:first-child { grid-column: 1 / -1; }
.log-row-6 { grid-template-columns: 1fr 1fr; }
.log-row-6 > input:first-child { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .item-row { grid-template-columns: 2.2fr 1.2fr .8fr 1fr .9fr .9fr; }
  .item-row > input:first-child { grid-column: auto; }
  .log-row-6 { grid-template-columns: 1.8fr 1.4fr 1fr 1fr .7fr 1fr; }
  .log-row-6 > input:first-child { grid-column: auto; }
}
.rule-list { padding-left: 1.1em; font-size: .9rem; color: var(--ink-2); } .rule-list li { margin: 4px 0; }
.fx-box { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 12px; }
.fx-box strong { font-size: 1.15rem; }
.refund { border-left: 4px solid var(--accent); }
.refund.is-highlight { background: var(--accent-soft); }
.balance-pos { color: var(--ok); } .balance-neg { color: var(--danger); }

/* Cotizador de fletes */
.pkg-head { display: none; }
.pkg-rows { display: grid; gap: 10px; margin: 8px 0; }
.pkg-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pkg-row input { min-width: 0; }
.pkg-del { min-height: 46px; }
@media (min-width: 720px) {
  .pkg-head, .pkg-row { grid-template-columns: .7fr 1fr 1fr 1fr 1fr 44px; }
  .pkg-head { display: grid; gap: 8px; padding: 0 11px; font-size: .8rem; font-weight: 650; color: var(--muted); }
}
.est-list { display: grid; gap: 12px; margin-bottom: 14px; }
.est { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.est-na { background: var(--surface-2); border-style: dashed; }
.est-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; margin-bottom: 8px; }
.est-head h4 { margin: 0; font-size: 1rem; }
.est-provider { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); }
.est-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.est-total strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.label-legend { font-weight: 580; font-size: .94rem; margin-bottom: 6px; color: var(--ink-2); }
.freight-band { margin-bottom: 0; border-left: 4px solid var(--accent); }
.freight-band h2 { margin: .2em 0; }
