/* Calculadora de huella · [eco_performance_snapshot] (rehecha el 7/11/2026).
 * Con los tokens del sitio: --hx-* (sistema SaaS del tema) y --rpl-* (roles de color, claro y oscuro). Los valores de
 * respaldo solo cuentan fuera del tema. Sin antetítulos en mayúscula ni mono: la mono queda para lo que se copia. */
.tew-calc, .tew-report {
    --c-ink: var(--rpl-text, #111615);
    --c-muted: var(--rpl-muted, #5D6862);
    --c-bg: var(--rpl-bg, #F6F6F2);
    --c-surface: var(--rpl-surface, #FFFFFF);
    --c-soft: var(--rpl-soft, #EEF0EA);
    --c-border: var(--rpl-border, #11161522);
    --c-focus: var(--rpl-focus, #1F7A55);
    --c-mint: var(--hx-mint, #93F1C9);
    --c-mint-soft: var(--hx-mint-soft, #D6FAEA);
    --c-mint-deep: var(--hx-mint-deep, #1F7A55);
    --c-gold: var(--hx-gold, #E8CD62);
    --c-coral: var(--hx-coral, #FFAB8F);
    --c-ease: var(--hx-ease, cubic-bezier(.22, 1, .36, 1));
    --c-spring: var(--hx-spring, cubic-bezier(.2, .9, .25, 1.25));
    --c-shadow: var(--hx-card-shadow, 0 1px 2px #1116150d, 0 18px 40px -12px #11161529);
    display: grid;
    gap: 16px;
    max-width: 820px;
    color: var(--c-ink);
    font-family: Inter, "Inter Fallback", Arial, sans-serif;
}
.tew-calc *, .tew-calc *::before, .tew-calc *::after { box-sizing: border-box; }
.tew-calc [hidden] { display: none !important; }
.tew-calc :is(h2, h3, p, ul, ol) { margin: 0; }

/* ── Formulario ─────────────────────────────────────────── */
.tew-calc-form { display: grid; gap: 10px; }
.tew-calc-label { font: 600 15px/1.4 inherit; color: var(--c-ink); }
.tew-calc-field {
    display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px;
    border-radius: 999px; background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border), var(--c-shadow);
    transition: box-shadow .2s var(--c-ease);
}
.tew-calc-field:focus-within { box-shadow: inset 0 0 0 2px var(--c-mint-deep), 0 0 0 4px color-mix(in srgb, var(--c-mint) 40%, transparent); }
.tew-calc-field-icon {
    flex: none; width: 20px; height: 20px; background: var(--c-muted);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M128 24a104 104 0 1 0 104 104A104.12 104.12 0 0 0 128 24Zm87.6 96h-39.8c-1.4-28.5-10.3-55.6-25.4-77.6A88.2 88.2 0 0 1 215.6 120ZM128 215c-18.7-20.4-30-50-31.7-79h63.4c-1.7 29-13 58.6-31.7 79Zm-31.7-95c1.7-29 13-58.6 31.7-79 18.7 20.4 30 50 31.7 79Zm4.2-77.6c-15.1 22-24 49.1-25.4 77.6H40.4a88.2 88.2 0 0 1 60.1-77.6ZM40.4 136h39.7c1.4 28.5 10.3 55.6 25.4 77.6A88.2 88.2 0 0 1 40.4 136Zm115.1 77.6c15.1-22 24-49.1 25.4-77.6h39.7a88.2 88.2 0 0 1-65.1 77.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M128 24a104 104 0 1 0 104 104A104.12 104.12 0 0 0 128 24Zm87.6 96h-39.8c-1.4-28.5-10.3-55.6-25.4-77.6A88.2 88.2 0 0 1 215.6 120ZM128 215c-18.7-20.4-30-50-31.7-79h63.4c-1.7 29-13 58.6-31.7 79Zm-31.7-95c1.7-29 13-58.6 31.7-79 18.7 20.4 30 50 31.7 79Zm4.2-77.6c-15.1 22-24 49.1-25.4 77.6H40.4a88.2 88.2 0 0 1 60.1-77.6ZM40.4 136h39.7c1.4 28.5 10.3 55.6 25.4 77.6A88.2 88.2 0 0 1 40.4 136Zm115.1 77.6c15.1-22 24-49.1 25.4-77.6h39.7a88.2 88.2 0 0 1-65.1 77.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tew-calc #tew-calc-url {
    flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none;
    color: var(--c-ink); font: 400 17px/1.3 Inter, "Inter Fallback", Arial, sans-serif;
}
.tew-calc #tew-calc-url::placeholder { color: var(--c-muted); opacity: .8; }
.tew-calc-go, .tew-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 0;
    border-radius: 999px; background: var(--c-mint); color: #102C20; font: 600 15px/1 Inter, "Inter Fallback", Arial, sans-serif;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    box-shadow: inset 0 -2px 0 #0b3a2522, 0 10px 24px -10px #1f7a5577;
    transition: transform .35s var(--c-spring), box-shadow .35s var(--c-ease), background .2s;
}
.tew-calc-go:hover, .tew-btn:hover { background: #B9F8DC; transform: translateY(-2px); }
.tew-calc-go:disabled { opacity: .6; cursor: progress; transform: none; }
.tew-calc :is(a, button, input):focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; }
.tew-btn--ghost { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-border); }
.tew-btn--ghost:hover { background: var(--c-soft); }
/* El tema da color a los enlaces del sitio: los botones de la calculadora fijan el suyo. */
.tew-calc a.tew-btn, .tew-calc a.tew-btn:hover { color: #102C20; }
.tew-calc a.tew-btn--soft, .tew-calc a.tew-btn--soft:hover { color: var(--c-bg) !important; }
.tew-calc .tew-method a { color: var(--c-ink) !important; }
.tew-btn--soft { background: var(--c-ink); color: var(--c-bg); box-shadow: none; }
.tew-btn--soft:hover { background: var(--c-ink); opacity: .9; }
.tew-calc-captcha:empty { display: none; }
.tew-calc-note { color: var(--c-muted); font-size: 14px; line-height: 1.5; }
.tew-calc-invalid { color: #B3261E; font-size: 14px; font-weight: 600; }

/* ── Mientras analiza ───────────────────────────────────── */
.tew-calc-progress, .tew-calc-error {
    display: grid; gap: 14px; padding: 22px 24px; border-radius: 26px; background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border), var(--c-shadow);
}
.tew-calc-progress-title { font-size: 17px; }
.tew-calc-steps { display: grid; gap: 10px; padding: 0; list-style: none; counter-reset: s; }
.tew-calc-steps li { position: relative; display: flex; align-items: center; gap: 12px; color: var(--c-muted); font-size: 15px; counter-increment: s; transition: color .3s; }
.tew-calc-steps li::before {
    content: counter(s); display: inline-grid; flex: none; width: 28px; height: 28px; place-items: center; border-radius: 50%;
    background: var(--c-soft); color: var(--c-muted); font: 600 13px/1 inherit;
}
.tew-calc-steps li.is-now { color: var(--c-ink); font-weight: 600; }
.tew-calc-steps li.is-now::before { content: ""; background: conic-gradient(var(--c-mint-deep) 0 25%, var(--c-mint-soft) 0); animation: tew-spin 1s linear infinite; -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); mask: radial-gradient(circle, transparent 8px, #000 9px); }
.tew-calc-steps li.is-done { color: var(--c-ink); }
.tew-calc-steps li.is-done::before { content: "✓"; background: var(--c-mint); color: #102C20; }
.tew-calc-progress-note { color: var(--c-muted); font-size: 14px; }
@keyframes tew-spin { to { transform: rotate(1turn); } }

.tew-calc-error { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-coral) 70%, transparent), var(--c-shadow); }
.tew-calc-error-title { font-size: 17px; font-weight: 650; }
.tew-calc-error-text { color: var(--c-muted); line-height: 1.55; }
.tew-calc-again { justify-self: start; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--c-ink); color: var(--c-bg); font: 600 15px/1 inherit; cursor: pointer; }

/* ── Resultado ──────────────────────────────────────────── */
.tew-calc-result { display: grid; gap: 16px; padding: 24px; border-radius: 30px; background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border), var(--c-shadow); outline: 0; animation: tew-rise .6s var(--c-ease); scroll-margin-top: 96px; }
@keyframes tew-rise { from { opacity: 0; transform: translateY(18px); } }
.tew-result-head { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.tew-result-kicker { color: var(--c-mint-deep); font-weight: 600; font-size: 15px; }
.tew-result-title { margin-top: 4px !important; font: 650 clamp(26px, 3vw, 36px)/1.1 Inter, "Inter Fallback", Arial, sans-serif !important; letter-spacing: -.035em !important; color: var(--c-ink) !important; overflow-wrap: break-word; }
.tew-result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tew-result-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; }
.tew-co2 { display: grid; align-content: center; gap: 8px; padding: 22px 24px; border-radius: 24px; background: var(--c-mint-soft); color: #102C20; }
.tew-co2-label { font-weight: 600; font-size: 15px; }
.tew-co2-value { font: 700 clamp(44px, 6vw, 68px)/1 Inter, "Inter Fallback", Arial, sans-serif; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.tew-co2-value small { font-size: .3em; letter-spacing: 0; font-weight: 600; }
.tew-co2-note { font-size: 14px; line-height: 1.5; opacity: .85; }
.tew-co2-missing { padding: 22px 24px; border-radius: 24px; background: var(--c-soft); color: var(--c-muted); }
.tew-facts { display: grid; gap: 10px; }
.tew-stat { display: grid; gap: 2px; padding: 14px 18px; border-radius: 20px; background: var(--c-soft); }
.tew-stat-label { color: var(--c-muted); font-size: 13.5px; font-weight: 600; }
.tew-stat-value { font: 650 22px/1.2 Inter, "Inter Fallback", Arial, sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tew-stat-value small { font-size: 15px; font-weight: 600; color: var(--c-muted); }
.tew-stat-note { color: var(--c-muted); font-size: 13px; }
.tew-stat.is-good .tew-stat-value { color: var(--c-mint-deep); }

.tew-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tew-ring { --tone: var(--c-muted); display: grid; justify-items: center; gap: 8px; padding: 18px 12px; border-radius: 22px; background: var(--c-soft); text-align: center; }
.tew-ring.is-good { --tone: #2fbf85; }
.tew-ring.is-fair { --tone: var(--c-gold); }
.tew-ring.is-poor { --tone: var(--c-coral); }
.tew-ring-value {
    display: grid; width: 84px; height: 84px; place-items: center; border-radius: 50%;
    background: radial-gradient(closest-side, var(--c-soft) 78%, transparent 79% 100%), conic-gradient(var(--tone) calc(var(--p) * 1%), color-mix(in srgb, var(--c-muted) 18%, transparent) 0);
    font: 700 24px/1 Inter, "Inter Fallback", Arial, sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.tew-ring-label { color: var(--c-muted); font-size: 13.5px; font-weight: 600; line-height: 1.3; }

.tew-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tew-result-grid > :only-child { grid-column: 1 / -1; }
.tew-card { display: grid; align-content: start; gap: 12px; padding: 20px 22px; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--c-border); }
.tew-card-title { font: 650 17px/1.3 Inter, "Inter Fallback", Arial, sans-serif !important; color: var(--c-ink) !important; letter-spacing: -.01em; }
.tew-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.tew-list li { position: relative; padding-left: 22px; color: var(--c-ink); font-size: 15px; line-height: 1.5; }
.tew-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--c-mint-deep); }
.tew-list--steps { counter-reset: n; }
.tew-list--steps li { counter-increment: n; padding-left: 34px; display: grid; gap: 2px; }
.tew-list--steps li::before { content: counter(n); top: .05em; width: 24px; height: 24px; display: grid; place-items: center; background: var(--c-mint); color: #102C20; font: 700 12px/1 inherit; }
.tew-list--steps span { color: var(--c-muted); font-size: 14px; }

.tew-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--c-soft); }
.tew-next-text { flex: 1 1 320px; font-size: 15px; line-height: 1.55; }
.tew-method { color: var(--c-muted); font-size: 13.5px; line-height: 1.55; }
.tew-method a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 720px) {
    .tew-calc-field { flex-wrap: wrap; padding: 6px; border-radius: 26px; }
    .tew-calc-field-icon { margin-left: 12px; }
    .tew-calc #tew-calc-url { flex: 1 1 calc(100% - 48px); }
    .tew-calc-go { flex: 1 1 100%; }
    .tew-calc-result { padding: 18px; border-radius: 26px; }
    .tew-result-hero, .tew-result-grid { grid-template-columns: minmax(0, 1fr); }
    .tew-result-actions, .tew-result-actions .tew-btn { width: 100%; }
    .tew-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .tew-calc-result, .tew-calc-steps li.is-now::before { animation: none; }
    .tew-calc-go, .tew-btn { transition: none; }
}

/* ── Página del informe (/eco-report/…) ─────────────────── */
.tew-report-page { padding: 56px var(--hx-pad, 20px) 96px; }
.tew-report { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.tew-report > *, .tew-report-hero > *, .tew-result-head > * { min-width: 0; }
.tew-report * { box-sizing: border-box; }
.tew-report :is(h1, h2, h3, p, ul, ol) { margin: 0; }
.tew-report-hero { display: grid; gap: 12px; padding-bottom: 12px; }
.tew-report-title { font: 650 clamp(38px, 5vw, 72px)/1 Inter, "Inter Fallback", Arial, sans-serif !important; letter-spacing: -.055em !important; color: var(--c-ink) !important; overflow-wrap: break-word; }
.tew-report-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--c-muted); font-size: 15px; overflow-wrap: anywhere; }
.tew-report-hero .tew-result-actions { margin-top: 8px; }
.tew-report-section { display: grid; gap: 16px; }
.tew-report-card { padding: 24px; border-radius: 28px; background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border), var(--c-shadow); }
.tew-report-h2 { font: 650 clamp(22px, 2.2vw, 28px)/1.15 Inter, "Inter Fallback", Arial, sans-serif !important; letter-spacing: -.03em !important; color: var(--c-ink) !important; }
.tew-report .tew-card { padding: 22px 24px; }
.tew-report .tew-card-title { font-size: 19px !important; }
.tew-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c-gold) 35%, transparent); color: var(--c-ink); font: 600 12px/1 Inter, "Inter Fallback", Arial, sans-serif; vertical-align: middle; }
.tew-tag--measured { background: color-mix(in srgb, var(--c-mint) 45%, transparent); }
.tew-co2 .tew-tag { color: #102C20; background: #ffffff8c; }
.tew-table-wrap { overflow-x: auto; }
.tew-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tew-table :is(th, td) { padding: 12px 10px; border-bottom: 1px solid var(--c-border); text-align: left; color: var(--c-ink); }
.tew-table thead th { color: var(--c-muted); font-size: 13.5px; font-weight: 600; }
.tew-table tbody th { font-weight: 600; }
.tew-table td { font-variant-numeric: tabular-nums; }
.tew-dims { display: grid; gap: 14px; padding: 0; list-style: none; }
.tew-dims li { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 110px; align-items: center; gap: 6px 16px; }
.tew-dim-name { font-weight: 600; }
.tew-dim-bar { height: 10px; border-radius: 999px; background: var(--c-soft); overflow: hidden; }
.tew-dim-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c-muted); }
.tew-dims .is-good .tew-dim-bar i { background: #2fbf85; }
.tew-dims .is-fair .tew-dim-bar i { background: var(--c-gold); }
.tew-dims .is-poor .tew-dim-bar i { background: var(--c-coral); }
.tew-dim-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-ink); }
.tew-dims .is-none .tew-dim-value { color: var(--c-muted); }
.tew-dim-note { grid-column: 1 / -1; color: var(--c-muted); font-size: 13.5px; }
.tew-report-method .tew-list li::before { background: var(--c-muted); }
.tew-report .tew-next { display: flex; }
.tew-empty { display: grid; justify-items: start; gap: 10px; padding: 26px; border-radius: 28px; border: 1px dashed var(--c-border); }
.tew-report a.tew-btn, .tew-report a.tew-btn:hover { color: #102C20; }
.tew-report a.tew-btn--soft, .tew-report a.tew-btn--soft:hover { color: var(--c-bg) !important; }
.tew-report .tew-method a { color: var(--c-ink) !important; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) {
    .tew-report-page { padding-top: 36px; }
    .tew-report-card { padding: 18px; border-radius: 24px; }
    .tew-dims li { grid-template-columns: minmax(0, 1fr) auto; }
    .tew-dim-bar { grid-column: 1 / -1; grid-row: 2; }
    .tew-report .tew-result-actions .tew-btn { flex: 1 1 100%; }
}
@media print {
    .tew-report-hero .tew-result-actions, .tew-next { display: none !important; }
    .tew-report-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .tew-report-page { padding: 0; }
}


/* Informe: señales del rastreo (hechos, sin nota) */
.tew-report-lead{margin:0 0 14px;color:var(--c-muted);font-size:.95rem}
.tew-signals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tew-signals .tew-stat{gap:8px}
.tew-chips{display:flex;flex-wrap:wrap;gap:6px}
.tew-chip{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;background:var(--c-bg);border:1px solid var(--c-border);font-size:.82rem;font-weight:600;color:var(--c-ink)}
@media (max-width:720px){.tew-signals{grid-template-columns:1fr}}

/* Tabla de Core Web Vitals sin desbordar en el móvil */
@media (max-width: 480px) {
    .tew-table { font-size: 13.5px; }
    .tew-table :is(th, td) { padding: 10px 6px; }
    .tew-table td { white-space: nowrap; }
}

/* Dominios largos: letra a la medida del móvil; solo se parten por los puntos (o, si no cabe, por donde haga falta). */
@media (max-width: 720px) {
    .tew-report-title { font-size: clamp(28px, 7.5vw, 44px) !important; }
    .tew-result-title { font-size: clamp(22px, 6.5vw, 30px) !important; }
}

/* Informe: «¿Te ayudamos a mejorarla?» (email opcional) */
.tew-help-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px 28px; align-items: start; }
.tew-help-fields { display: grid; gap: 10px; }
.tew-help-label { font-size: 14px; font-weight: 600; color: var(--c-ink); }
.tew-help-row { display: flex; gap: 8px; }
.tew-help-row input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-ink); font: inherit; }
.tew-help-row input:focus-visible, .tew-help-consent input:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.tew-help-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--c-muted); }
.tew-help-consent input { margin-top: 3px; accent-color: var(--c-mint-deep); }
.tew-help-consent a { color: var(--c-ink) !important; text-decoration: underline; text-underline-offset: 3px; }
.tew-help-status { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--c-muted); }
.tew-help-status:empty { display: none; }
.tew-help-status.is-ok { color: var(--c-mint-deep); font-weight: 600; }
.tew-help-status.is-error { color: var(--c-coral); }
.tew-help-copy { display: grid; gap: 8px; }
.tew-help .tew-btn, .tew-help .tew-btn:hover { color: #102C20 !important; }
@media (max-width: 720px) { .tew-help-form { grid-template-columns: minmax(0, 1fr); } .tew-help-row { flex-direction: column; } .tew-help-row input { flex: none; width: 100%; } }
@media print { .tew-help { display: none !important; } }
