/* TuValor — adarga.org/tuvalor. Se apoya en /css/style.css (tipos, colores y barra de navegación del sitio). */
:root {
    --tv-ink: #111827;
    --tv-mute: #8b8680;
    --tv-line: #e5e7eb;
    --tv-red: #be2a2e;
    --tv-bg: #f8fafc;
}

.tv-main { padding: 96px 0 56px; min-height: 70vh; overflow-x: clip; }
.tv-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.tv-kicker { font-family: var(--font-heading); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); font-weight: 600; }
.tv-h1 { font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.15; color: var(--featured); margin: 6px 0 8px; }
.tv-h2 { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; color: var(--featured); margin: 0 0 10px; }
.tv-lead { font-size: 1.12rem; color: #334155; max-width: 46rem; }
.tv-note { font-family: var(--font-heading); font-size: 0.85rem; color: var(--mono-2); }
.tv-section { margin-top: 36px; }
.tv-card { background: #fff; border: 1px solid var(--tv-line); border-radius: 10px; padding: 20px; }
.tv-muted { color: var(--mono-2); }
.tv-hide { display: none !important; }
a.tv-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* botones */
.tv-btn { font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; border-radius: 8px; padding: 10px 18px; border: 1px solid var(--featured); background: var(--featured); color: #fff; cursor: pointer; transition: background .15s, color .15s; text-decoration: none; display: inline-block; }
.tv-btn:hover { background: var(--mono-1); }
.tv-btn:disabled { opacity: .55; cursor: default; }
.tv-btn.ghost { background: #fff; color: var(--featured); }
.tv-btn.ghost:hover { background: var(--tv-bg); }
.tv-btn.small { padding: 6px 12px; font-size: 0.85rem; }
.tv-btn:focus-visible, .tv-input:focus-visible, .tv-slider input:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* cuenta en la barra */
.tv-account { display: flex; align-items: center; gap: 10px; }
.tv-account .tv-user { font-family: var(--font-heading); font-size: 0.85rem; color: #fff; opacity: .85; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-links .tv-nav-btn { font-family: var(--font-heading); font-size: 0.9rem; font-weight: 600; color: var(--featured); background: #fff; border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; }

/* buscador */
.tv-search { position: relative; max-width: 520px; margin-top: 18px; }
.tv-input { width: 100%; font-family: var(--font-heading); font-size: 1rem; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 8px; color: var(--tv-ink); background: #fff; }
.tv-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--tv-line); border-radius: 8px; box-shadow: 0 10px 30px rgba(10, 40, 75, .12); max-height: 320px; overflow: auto; }
.tv-suggest a { display: flex; gap: 10px; padding: 9px 14px; text-decoration: none; color: var(--tv-ink); font-family: var(--font-heading); font-size: 0.95rem; }
.tv-suggest a:hover, .tv-suggest a.on { background: var(--tv-bg); }
.tv-suggest b { min-width: 58px; color: var(--featured); }
.tv-suggest span.off { color: var(--mono-2); font-size: 0.8rem; margin-left: auto; }

/* pasos */
.tv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.tv-steps .tv-card b { font-family: var(--font-heading); color: var(--featured); display: block; margin-bottom: 4px; }
.tv-steps .n { font-family: var(--font-heading); font-weight: 700; color: var(--primary); font-size: 0.85rem; letter-spacing: .1em; }

/* calendario */
.tv-day { margin-top: 18px; }
.tv-day h3 { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600; color: var(--featured); text-transform: capitalize; border-bottom: 2px solid var(--featured); padding-bottom: 4px; margin-bottom: 2px; }
.tv-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--tv-line); text-decoration: none; color: var(--tv-ink); font-family: var(--font-heading); font-size: 0.95rem; }
.tv-row:hover { background: var(--tv-bg); }
.tv-row b { color: var(--featured); }
.tv-row .when { font-size: 0.8rem; color: var(--mono-2); white-space: nowrap; }
.tv-row .go { font-size: 0.85rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.tv-chip { display: inline-block; font-family: var(--font-heading); font-size: 0.72rem; font-weight: 600; letter-spacing: .04em; border-radius: 999px; padding: 2px 9px; background: #eef2ff; color: #3730a3; }
.tv-chip.red { background: #fde8e8; color: #9b1c1c; }
.tv-chip.grey { background: #f1f5f9; color: #475569; }
.tv-weeks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }

/* empresa */
.tv-head { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.tv-ticker { font-family: var(--font-heading); font-weight: 600; color: var(--mono-2); font-size: 1.1rem; }
.tv-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tv-guide .v { font-family: var(--font-heading); font-weight: 700; font-size: 0.8rem; letter-spacing: .08em; }
.tv-guide .v.SUBE { color: #166534; } .tv-guide .v.BAJA { color: #9b1c1c; } .tv-guide .v.IGUAL { color: #475569; }
.tv-charts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.tv-chart h4 { font-family: var(--font-heading); font-size: 0.82rem; font-weight: 600; color: var(--tv-ink); margin-bottom: 2px; line-height: 1.25; min-height: 2.5em; }
.tv-chart .u { font-family: var(--font-heading); font-size: 0.72rem; color: var(--tv-mute); }
.tv-chart svg { width: 100%; height: auto; display: block; }
.tv-chart text { font-family: 'Jost', sans-serif; font-size: 10px; fill: var(--tv-mute); }
.tv-chart text.val { fill: var(--tv-ink); font-weight: 600; }

.tv-model { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.tv-slider { padding: 12px 0; border-bottom: 1px solid var(--tv-line); }
.tv-slider:last-of-type { border-bottom: 0; }
.tv-slider .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--font-heading); }
.tv-slider label { font-weight: 600; color: var(--tv-ink); font-size: 0.98rem; }
.tv-slider output { font-weight: 700; color: var(--featured); font-size: 1.05rem; white-space: nowrap; }
.tv-slider input[type=range] { width: 100%; margin: 8px 0 4px; accent-color: var(--featured); }
.tv-slider .hint { font-family: var(--font-heading); font-size: 0.8rem; color: var(--mono-2); }
.tv-result { position: sticky; top: 84px; }
.tv-result .big { font-family: var(--font-heading); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.1rem); color: var(--featured); line-height: 1.05; }
.tv-result .lbl { font-family: var(--font-heading); font-size: 0.8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mono-2); }
.tv-price { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.tv-price input { width: 120px; font-family: var(--font-heading); font-size: 1rem; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.tv-gap { font-family: var(--font-heading); font-size: 1rem; margin-top: 10px; color: var(--tv-ink); }
.tv-gap b { color: var(--featured); }
.tv-quote { margin-top: 12px; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px; font-family: var(--font-heading); font-size: 0.85rem; color: var(--mono-2); }
.tv-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tv-saved { font-family: var(--font-heading); font-size: 0.85rem; color: #166534; margin-top: 8px; min-height: 1.2em; }
.tv-saved.err { color: #9b1c1c; }

.tv-strip svg { width: 100%; height: auto; display: block; }
.tv-strip text { font-family: 'Jost', sans-serif; font-size: 11px; fill: var(--mono-2); }
.tv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-heading); font-size: 0.8rem; color: var(--mono-2); margin-top: 6px; }
.tv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.tv-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.tv-profile { border: 1px solid var(--tv-line); border-radius: 10px; padding: 14px; background: #fff; }
.tv-profile .n { font-family: var(--font-heading); font-weight: 600; color: var(--tv-ink); display: flex; justify-content: space-between; gap: 8px; }
.tv-profile .n b { color: var(--featured); white-space: nowrap; }
.tv-profile p { font-size: 0.92rem; color: #475569; margin: 6px 0 10px; line-height: 1.45; }

details.tv-details { margin-top: 14px; font-family: var(--font-heading); font-size: 0.9rem; }
details.tv-details summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.tv-table { width: 100%; border-collapse: collapse; font-family: var(--font-heading); font-size: 0.85rem; margin-top: 10px; }
.tv-table th, .tv-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--tv-line); white-space: nowrap; }
.tv-table th:first-child, .tv-table td:first-child { text-align: left; }
.tv-table th { color: var(--mono-2); font-weight: 600; }
.tv-scroll { overflow-x: auto; }
.tv-disclaimer { margin-top: 40px; padding: 16px 18px; background: var(--tv-bg); border-left: 3px solid var(--featured); font-family: var(--font-heading); font-size: 0.85rem; color: #475569; border-radius: 0 8px 8px 0; }

/* ventana de entrada */
.tv-modal-back { position: fixed; inset: 0; background: rgba(10, 20, 40, .55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tv-modal { background: #fff; border-radius: 12px; max-width: 420px; width: 100%; padding: 26px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.tv-modal h2 { font-family: var(--font-heading); font-weight: 600; color: var(--featured); font-size: 1.3rem; margin-bottom: 6px; }
.tv-modal p { font-size: 0.98rem; color: #475569; margin-bottom: 14px; }
.tv-modal .x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--mono-2); }
.tv-modal .or { text-align: center; font-family: var(--font-heading); font-size: 0.8rem; color: var(--mono-2); margin: 12px 0; }
.tv-modal label.chk { display: flex; gap: 8px; align-items: flex-start; font-family: var(--font-heading); font-size: 0.85rem; color: #334155; margin: 12px 0; }
.tv-modal .msg { font-family: var(--font-heading); font-size: 0.88rem; min-height: 1.3em; margin-top: 10px; color: #166534; }
.tv-modal .msg.err { color: #9b1c1c; }
.tv-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: var(--tv-ink); border: 1px solid #cbd5e1; }
.tv-google:hover { background: var(--tv-bg); }

@media (max-width: 900px) {
    .tv-model { grid-template-columns: minmax(0, 1fr); }
    .tv-result { position: static; }
    .tv-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tv-steps, .tv-guide, .tv-weeks { grid-template-columns: minmax(0, 1fr); }
    .tv-row { grid-template-columns: 62px minmax(0, 1fr) auto; }
    .tv-row .go { display: none; }
}

/* historia y proyección debajo de cada mando */
.tv-proy { margin-top: 10px; }
.tv-proy .t { font-family: var(--font-heading); font-size: 0.78rem; color: var(--mono-2); margin-bottom: 2px; }

/* nada se sale de la pantalla: textos largos que parten y tablas que se desplazan dentro de su caja */
.tv-wrap, .tv-card, .tv-row span, .tv-lead, .tv-note, .tv-h1 { overflow-wrap: anywhere; }
.tv-card { min-width: 0; }
.tv-puente { max-width: 520px; }
.tv-puente td:first-child { white-space: normal; }
.tv-fijo .lab { font-weight: 600; color: var(--tv-ink); font-size: 0.98rem; }
.tv-fijo { background: var(--tv-bg); margin: 8px -20px -20px; padding: 14px 20px 16px; border-radius: 0 0 10px 10px; border-bottom: 0; }

@media (max-width: 640px) {
    /* las tablas caben en el móvil: letra más pequeña en la cuenta, fichas en el panel */
    .tv-table { font-size: 0.72rem; }
    .tv-table th, .tv-table td { padding: 5px 3px; }
    .tv-table th { white-space: normal; vertical-align: bottom; }
    .tv-fichas thead { display: none; }
    .tv-fichas, .tv-fichas tbody, .tv-fichas tr, .tv-fichas td { display: block; width: 100%; }
    .tv-fichas tr { border: 1px solid var(--tv-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
    .tv-fichas td { text-align: left; white-space: normal; border: 0; padding: 3px 0; font-size: 0.9rem; }
    .tv-fichas td[data-l] { display: flex; justify-content: space-between; gap: 12px; }
    .tv-fichas td[data-l]::before { content: attr(data-l); color: var(--mono-2); }
}
