/* TuValor — tuvalor.grinboss.com. Se apoya en /base.css (tipos, colores, barra de navegación y pie). */
: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); 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(3, minmax(0, 1fr)); gap: 16px; }
.tv-chart h4 { font-family: var(--font-heading); font-size: 0.98rem; font-weight: 600; color: var(--tv-ink); margin-bottom: 2px; line-height: 1.25; }
.tv-chart .u { font-family: var(--font-heading); font-size: 0.82rem; color: #475569; margin-bottom: 6px; }
.tv-chart svg { width: 100%; height: auto; display: block; }
.tv-chart text { font-family: 'Jost', sans-serif; font-size: 13px; fill: #475569; }
.tv-chart text.val { fill: var(--tv-ink); font-weight: 600; }
.tv-chart text.val.ult { fill: #be2a2e; font-weight: 700; }
.tv-hist { background: #fff; border: 1px solid var(--tv-line); border-radius: 10px; padding: 14px 14px 8px; }
.tv-proy .t { font-size: 0.85rem !important; color: #334155 !important; }

.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 { max-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)); }
}
@media (max-width: 560px) {
    .tv-charts { grid-template-columns: 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); }
}

/* «Mi panel» siempre a la vista: botón en la barra con aviso de lo que toca revisar */
.nav-links .tv-account { display: flex; align-items: center; gap: 10px; }
.tv-pill { font-family: var(--font-heading); font-size: 0.92rem; font-weight: 600; color: var(--featured) !important; background: #fff; border-radius: 999px; padding: 6px 14px; display: inline-flex; align-items: center; gap: 6px; }
.tv-pill.ghost { background: transparent; color: #fff !important; border: 1px solid rgba(255, 255, 255, .55); }
.tv-pill.on { box-shadow: 0 0 0 2px #93c5fd; }
.tv-badge { background: #be2a2e; color: #fff; font-size: 0.72rem; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 768px) {
    .navbar .nav-toggle { display: none; }
    .navbar .nav-links { display: flex; position: static; flex-direction: row; align-items: center; background: none; padding: 0; gap: 12px; }
}
@media (max-width: 520px) {
    .navbar .nav-links .tv-cal { display: none; }
    .tv-pill { font-size: 0.85rem; padding: 5px 11px; }
    .nav-links .tv-nav-btn { padding: 6px 10px; }
}

/* el panel: resumen y una tarjeta por valoración */
.tv-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 10px; }
.tv-resumen > div { background: var(--tv-bg); border: 1px solid var(--tv-line); border-radius: 10px; padding: 12px 14px; }
.tv-resumen .v { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; color: var(--featured); line-height: 1.1; }
.tv-resumen .k { font-family: var(--font-heading); font-size: 0.82rem; color: #475569; }
.tv-resumen .aviso { background: #fde8e8; border-color: #f5b5b5; }
.tv-resumen .aviso .v { color: #9b1c1c; }
.tv-leyenda { margin: 6px 0 4px; }
.tv-vcards { display: grid; gap: 16px; margin-top: 10px; }
.tv-vcard { background: #fff; border: 1px solid var(--tv-line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(10, 40, 75, .05); }
.tv-vcard.revisar { border-color: #f0a3a3; box-shadow: 0 0 0 2px #fde8e8; }
.tv-vcard header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.tv-vt { font-family: var(--font-heading); font-size: 1.15rem; color: var(--tv-ink); }
.tv-vt b { color: var(--featured); margin-right: 4px; }
.tv-vt span { color: #475569; font-size: 1rem; }
.tv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 10px; }
.tv-kpis > div { display: grid; grid-template-rows: 2.6em auto auto; align-content: start; background: var(--tv-bg); border-radius: 10px; padding: 10px 12px; }
.tv-kpis .k { display: flex; align-items: flex-end; font-family: var(--font-heading); font-size: 0.82rem; line-height: 1.25; color: #475569; }
.tv-kpis .v { font-family: var(--font-heading); font-weight: 700; font-size: 1.45rem; line-height: 1.25; color: var(--featured); white-space: nowrap; }
.tv-kpis .s { font-family: var(--font-heading); font-size: 0.78rem; color: #64748b; line-height: 1.3; }
.tv-kpis .v.arriba { color: #166534; }
.tv-kpis .v.abajo { color: #9b1c1c; }
.tv-comp { list-style: none; margin: 8px 0 4px; display: grid; gap: 4px; font-size: 1rem; color: #1f2937; }
.tv-comp .lab { font-family: var(--font-heading); color: var(--featured); }
.tv-vcard footer { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--tv-line); }

/* portada: «Tus valoraciones» */
.tv-mias-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tv-mias { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tv-mia { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--tv-line); border-radius: 10px; padding: 12px 14px; background: #fff; font-family: var(--font-heading); color: var(--tv-ink); }
.tv-mia:hover { border-color: #93c5fd; }
.tv-mia.revisar { border-color: #f0a3a3; }
.tv-mia b { color: var(--featured); font-size: 1.05rem; }
.tv-mia .n { color: #475569; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-mia .v { font-weight: 600; margin-top: 4px; }
.tv-mia .d { font-size: 0.85rem; }
.tv-mia .d.arriba { color: #166534; } .tv-mia .d.abajo { color: #9b1c1c; }
.tv-mia .tv-chip { align-self: flex-start; margin-top: 4px; }
.tv-mia.mas { justify-content: center; color: var(--primary); font-weight: 600; }
@media (max-width: 560px) {
    .tv-resumen { grid-template-columns: minmax(0, 1fr); }
    .tv-kpis .v { font-size: 1.25rem; }
}

@media (max-width: 760px) {
    .tv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tv-vcard .tv-strip { margin-top: 6px; }

.tv-hist .tv-media { font-family: var(--font-heading); font-size: 0.9rem; color: var(--tv-ink); margin: -2px 0 4px; }
.tv-hist .tv-media b { color: #be2a2e; }
.tv-hist { display: flex; flex-direction: column; }
.tv-hist svg { margin-top: auto; }

/* cartera simulada */
.tv-resumen4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tv-resumen .v.arriba, .tv-comp .arriba { color: #166534; }
.tv-resumen .v.abajo, .tv-comp .abajo { color: #9b1c1c; }
@media (max-width: 760px) { .tv-resumen4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tv-orden { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0 4px; }
.tv-orden label { font-family: var(--font-heading); font-size: 0.92rem; color: #1f2937; display: inline-flex; align-items: center; gap: 6px; }
.tv-orden .tv-input { width: 140px; max-width: 100%; margin: 0; }
.tv-orden .tv-saved { flex-basis: 100%; margin: 0; }
.tv-vcard .tv-orden { border-top: 1px dashed var(--tv-line); padding-top: 10px; }
.tv-ordenes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tv-ordenes li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; border: 1px solid var(--tv-line); border-radius: 8px; padding: 8px 12px; font-family: var(--font-heading); font-size: 0.92rem; background: #fff; }
.tv-cartera-mini { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; border: 1px solid #93c5fd; background: #eff6ff; border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-family: var(--font-heading); color: var(--tv-ink); }
.tv-cartera-mini .k { font-weight: 700; color: var(--featured); }
.tv-cartera-mini .v { font-size: 0.95rem; }
