/* Tagus Value — market page (modèle landing premium « Escolha a sua avaliação »)
 *
 * Layout aligné sur la palette du site visible dans tagus-value-public.css
 * (turquoise #1ABC9C, navy #2C3E50, navy pill #303d4e, cream #F8FAFB).
 * Variables réelles injectées par enqueue_front_assets() via inline-style.
 */

.tv-market-page-main {
    --tv-mp-primary: #1ABC9C;
    --tv-mp-primary-dark: #16A085;
    --tv-mp-primary-darker: #0E8C72;
    --tv-mp-secondary: #48C9B0;
    --tv-mp-accent: #1ABC9C;
    --tv-mp-ink: #2C3E50;
    --tv-mp-ink-soft: #5D6D7E;
    --tv-mp-mist: #95A5A6;
    --tv-mp-pill-bg: #303d4e;
    --tv-mp-header-text: #FFFFFF;
    --tv-mp-line: #e0e6ed;
    --tv-mp-line-soft: #ECF0F1;
    --tv-mp-row-alt: #F8FAFB;
    --tv-mp-up: #16A085;
    --tv-mp-warn: #E0B14A;
    --tv-mp-down: #E74C3C;
    --tv-mp-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --tv-mp-shadow-md: 0 8px 18px rgba(0,0,0,0.07);
    --tv-mp-shadow-lg: 0 18px 40px rgba(0,0,0,0.12);
    --tv-mp-shadow-card: 0 4px 12px rgba(44,62,80,0.06), 0 1px 3px rgba(44,62,80,0.04);

    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    color: var(--tv-mp-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background: transparent;
}
.tv-market-container { width: 100%; }

/* Breadcrumb */
.tv-breadcrumb { font-size: 13px; color: var(--tv-mp-mist); margin-bottom: 24px; }
.tv-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tv-breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #cfd4cd; }
.tv-breadcrumb a { color: var(--tv-mp-ink-soft); text-decoration: none; transition: color .15s; }
.tv-breadcrumb a:hover { color: var(--tv-mp-primary-dark); }
.tv-breadcrumb [aria-current="page"] { color: var(--tv-mp-ink); font-weight: 600; }

.tv-market-article { background: transparent; }

/* ============================================================
 * 1. HERO — copy gauche + image full-bleed à droite
 * ============================================================ */
.tv-hero-image-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: 28px 0 36px;
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0 0 56px;
    text-align: left;
    min-height: 380px;
    position: relative;
}
.tv-hero-image-right.no-image {
    grid-template-columns: 1fr;
    text-align: left;
}
.tv-hero-copy { max-width: 580px; }

.tv-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tv-mp-primary-dark);
    font-weight: 700;
    margin-bottom: 20px;
    padding: 7px 14px 7px 12px;
    background: rgba(26, 188, 156, 0.10);
    border: 1px solid rgba(26, 188, 156, 0.25);
    border-radius: 999px;
}
.tv-hero-kicker-leaf { display: inline-flex; align-items: center; color: var(--tv-mp-primary-dark); }
/* Backwards compat for the older dot variant (kept harmless if still used) */
.tv-hero-kicker-dot { width: 6px; height: 6px; background: var(--tv-mp-primary-dark); border-radius: 50%; flex: 0 0 auto; }

.tv-hero-title {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.08;
    font-weight: 800;
    color: var(--tv-mp-ink);
    margin: 0 0 20px;
    letter-spacing: -0.022em;
}
.tv-hero-lead {
    font-size: 17px;
    color: var(--tv-mp-ink);
    margin: 0 0 18px;
    line-height: 1.55;
    max-width: 560px;
    font-weight: 500;
}
.tv-hero-subtle {
    font-size: 14.5px;
    color: var(--tv-mp-ink-soft);
    margin: 0 0 28px;
    line-height: 1.6;
    max-width: 560px;
}

.tv-hero-ctas {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.tv-hero-ctas .tv-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.tv-cta-icon { display: inline-flex; align-items: center; }

.tv-hero-badges {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    font-weight: 500;
}
.tv-hero-badges li { display: inline-flex; align-items: center; gap: 7px; }
.tv-badge-icon {
    color: var(--tv-mp-primary-dark);
    display: inline-flex;
    align-items: center;
}

/* Right column — image cadrée à l'intérieur du grid (pas de débordement
 * dans le viewport). Elle remplit sa colonne et s'arrête au bord du
 * container, ce qui évite le scroll horizontal sur petits écrans et
 * garde le rendu propre sur grandes largeurs. */
.tv-hero-image {
    position: relative;
    background-image: var(--tv-hero-image);
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    align-self: stretch;
    min-height: 380px;
    box-shadow: var(--tv-mp-shadow-md);
}

/* ============================================================
 * « Porque a avaliação profissional é paga? »
 * Bloc pédagogique inséré entre comparáveis et plans. Light bg sans
 * bordure forte — l'objectif est de présenter le « pourquoi » comme
 * un complément éditorial, pas comme une bannière commerciale.
 * ============================================================ */
.tv-whypaid {
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line-soft);
    border-radius: 16px;
    padding: 36px 32px 28px;
    margin: 48px 0;
}
.tv-whypaid h2 {
    font-size: 2rem;
    color: var(--tv-mp-ink);
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.005em;
    text-align: center;
}
.tv-whypaid-lead {
    max-width: 760px;
    margin: 0 auto 28px;
    color: var(--tv-mp-ink-soft);
    font-size: 15.5px;
    line-height: 1.6;
    text-align: center;
}
.tv-whypaid-lead p { margin: 0 0 12px; }
.tv-whypaid-lead p:last-child { margin-bottom: 0; }
.tv-whypaid-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.tv-whypaid-grid li {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tv-whypaid-grid li:hover {
    transform: translateY(-2px);
    box-shadow: var(--tv-mp-shadow-md);
    border-color: var(--tv-mp-primary);
}
.tv-whypaid-icon {
    color: var(--tv-mp-primary-dark);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(26, 188, 156, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.tv-whypaid-grid strong {
    color: var(--tv-mp-ink);
    font-size: 15px;
    font-weight: 700;
}
.tv-whypaid-grid li > span:last-child {
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
}
.tv-whypaid-cta {
    text-align: center;
    margin-top: 24px;
}
.tv-whypaid-cta .tv-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}

/* ============================================================
 * 2. COMO FUNCIONA O REEMBOLSO?
 * ============================================================ */
.tv-howitworks {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px 32px;
    margin-bottom: 56px;
    text-align: center;
    border: 1px solid var(--tv-mp-line-soft);
    box-shadow: var(--tv-mp-shadow-sm);
}
.tv-howitworks h2 {
    font-size: 1.75rem;
    color: var(--tv-mp-ink);
    font-weight: 700;
    margin: 0 0 8px;
    position: relative;
    display: inline-block;
}
.tv-howitworks h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--tv-mp-primary);
    border-radius: 3px;
    margin: 12px auto 0;
}
.tv-steps {
    list-style: none;
    padding: 0;
    margin: 36px 0 24px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tv-step {
    background: transparent;
    padding: 8px 14px 0;
    flex: 1 1 220px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}
.tv-step-icon {
    /* Position relative pour ancrer le badge numéro à l'intérieur de l'icône
       — évite le clipping du numéro qui se faisait quand il était positionné
       par rapport à .tv-step (avec une bottom: -6px qui sortait du flow). */
    position: relative;
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 8px 0 18px;
    color: var(--tv-mp-primary-dark);
}
.tv-step-num {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--tv-mp-primary-dark);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tv-step h3 {
    font-size: 17px;
    color: var(--tv-mp-ink);
    margin: 0 0 6px;
    font-weight: 700;
}
.tv-step p {
    color: var(--tv-mp-ink-soft);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}
.tv-step-arrow {
    flex: 0 0 auto;
    max-width: 40px;
    color: var(--tv-mp-mist);
    font-size: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tv-howitworks-footer {
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    margin: 8px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* ============================================================
 * 3. PLANS TARIFÉS
 * ============================================================ */
.tv-plans {
    margin-bottom: 56px;
    text-align: center;
    overflow: visible;
}
.tv-plans h2 {
    font-size: 2rem;
    color: var(--tv-mp-ink);
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.005em;
}
.tv-plans-lead {
    color: var(--tv-mp-ink-soft);
    font-size: 15px;
    margin: 0 auto 32px;
    max-width: 640px;
}
.tv-plans-grid {
    /* auto-fit + minmax permet d'occuper toute la largeur du container quel
       que soit le nombre de plans visibles : 1 plan = card pleine largeur,
       2 plans = 2 colonnes 50/50, 3 plans = 3 colonnes 33/33/33. Sur les
       petits écrans (< minmax × 2 + gap) ça wrap naturellement. */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: stretch;
    /* Les badges flottants « MAIS POPULAR » sont positionnés absolute
       top:-14px ; on réserve l'espace au-dessus pour qu'ils ne dépassent
       pas dans la section précédente. */
    padding-top: 26px;
    overflow: visible;
}
.tv-plan-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 36px 26px 28px;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: var(--tv-mp-shadow-card);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    /* Explicit visible — empêche toute règle thème parente de cropper le
       badge qui dépasse au-dessus de la card. */
    overflow: visible;
}
.tv-plan-card:hover { transform: translateY(-4px); box-shadow: var(--tv-mp-shadow-md); }
.tv-plan-recommended { border-color: var(--tv-mp-primary); }
.tv-plan-highlight {
    border: 2px solid var(--tv-mp-primary);
    box-shadow: 0 12px 28px rgba(26, 188, 156, 0.18);
}
.tv-plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tv-mp-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    /* Padding plus généreux + line-height contrôlée pour que le texte ne
       soit jamais coupé en haut/bas même avec des fonts à hauteur étendue
       (Roboto / Segoe UI varient selon OS). */
    padding: 9px 16px;
    line-height: 1.1;
    border-radius: 999px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(26, 188, 156, 0.35);
    z-index: 2;
}
.tv-plan-highlight .tv-plan-badge { background: var(--tv-mp-pill-bg); box-shadow: 0 4px 10px rgba(48, 61, 78, 0.35); }
.tv-plan-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.tv-plan-name {
    font-size: 18px;
    color: var(--tv-mp-ink);
    font-weight: 700;
    margin: 0 0 10px;
    min-height: 44px;
}
.tv-plan-price {
    font-size: 44px;
    font-weight: 800;
    color: var(--tv-mp-primary-dark);
    line-height: 1;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}
.tv-plan-tagline {
    color: var(--tv-mp-ink-soft);
    font-size: 14px;
    margin: 0 0 22px;
    min-height: 42px;
    line-height: 1.5;
}
.tv-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    text-align: left;
    flex: 1 1 auto;
}
.tv-plan-features li {
    padding: 6px 0;
    color: var(--tv-mp-ink-soft);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.tv-plan-check {
    color: var(--tv-mp-primary);
    font-weight: 800;
    flex: 0 0 auto;
}
.tv-plan-delivery {
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.tv-plan-refund {
    color: var(--tv-mp-ink-soft);
    font-size: 12.5px;
    margin: 12px 0 0;
    line-height: 1.5;
    text-align: center;
}

/* ============================================================
 * CTAs
 * ============================================================ */
.tv-cta-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background .2s, transform .08s, box-shadow .2s, border-color .15s, color .15s;
    border: 1.5px solid transparent;
    line-height: 1.2;
    font-family: inherit;
}
.tv-cta-btn:active { transform: translateY(1px); }
.tv-cta-primary {
    background: var(--tv-mp-primary);
    color: #fff !important;
    border-color: var(--tv-mp-primary);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.30);
}
.tv-cta-primary:hover {
    background: var(--tv-mp-primary-dark);
    border-color: var(--tv-mp-primary-dark);
    box-shadow: 0 6px 18px rgba(22, 160, 133, 0.40);
    transform: translateY(-1px);
}
.tv-cta-secondary {
    background: transparent;
    color: var(--tv-mp-ink) !important;
    border-color: var(--tv-mp-line);
}
.tv-cta-secondary:hover {
    border-color: var(--tv-mp-primary);
    color: var(--tv-mp-primary-dark) !important;
    background: rgba(26, 188, 156, 0.06);
}
.tv-cta-xl { padding: 15px 28px; font-size: 16px; font-weight: 700; border-radius: 999px; }
.tv-cta-on-dark {
    background: transparent;
    color: #fff !important;
    border-color: rgba(255,255,255,0.4);
}
.tv-cta-on-dark:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.7);
}
.tv-cta-whatsapp {
    border-color: rgba(255,255,255,0.4);
}
button.tv-cta-btn { font-family: inherit; }

/* ============================================================
 * KPIs
 * ============================================================ */
.tv-section-block,
.tv-market-prices,
.tv-market-history,
.tv-market-comparables {
    margin: 56px 0;
}
.tv-section-block > h2,
.tv-market-prices > h2,
.tv-market-history > h2 {
    font-size: 1.875rem;
    color: var(--tv-mp-ink);
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
}
.tv-section-lead {
    color: var(--tv-mp-ink-soft);
    font-size: 15px;
    margin: 0 0 24px;
    /* Pleine largeur du container par défaut (les leads sont courts et
       valent mieux full-width que dans une colonne 760px qui isole le
       texte du contenu en dessous). Pour les leads CENTRÉS, on garde un
       max-width via .tv-section-lead.tv-center pour ne pas étirer la
       phrase sur tout l'écran. */
    max-width: 100%;
}
.tv-section-lead.tv-center {
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
    text-align: center;
}
div.tv-section-lead > p { margin: 0 0 12px; line-height: 1.6; }
div.tv-section-lead > p:last-child { margin-bottom: 0; }

.tv-market-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.tv-kpi {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.tv-kpi:hover { transform: translateY(-2px); box-shadow: var(--tv-mp-shadow-md); }
.tv-kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--tv-mp-mist);
    font-weight: 700;
}
.tv-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--tv-mp-primary-dark);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.tv-kpi-value.tv-up { color: var(--tv-mp-up); }
.tv-kpi-value.tv-down { color: var(--tv-mp-down); }
.tv-kpi-sub { font-size: 12.5px; color: var(--tv-mp-mist); }

/* Intro IA — encadré « insight éditorial » entre les KPIs et le bloc
 * tipologia. Visuel : carte blanche avec border 1px subtle tout autour,
 * accent turquoise à gauche, guillemet décoratif en filigrane bas-droite.
 * Plus premium qu'un simple callout cream. */
.tv-market-intro {
    position: relative;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-left: 4px solid var(--tv-mp-primary);
    border-radius: 16px;
    padding: 32px 40px 32px 36px;
    margin: 32px 0 40px;
    color: var(--tv-mp-ink);
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.04);
    font-size: 16px;
    line-height: 1.75;
    overflow: hidden;
}
/* Guillemet décoratif en filigrane derrière le texte — apporte un côté
 * « citation d'expert » sans alourdir l'attention. */
.tv-market-intro::before {
    content: "\201D";
    position: absolute;
    bottom: -28px;
    right: 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 140px;
    line-height: 1;
    font-weight: 700;
    color: var(--tv-mp-primary);
    opacity: 0.08;
    pointer-events: none;
}
.tv-market-intro p {
    margin: 0 0 14px;
    position: relative; /* passe au-dessus du guillemet en filigrane */
}
.tv-market-intro p:last-child { margin-bottom: 0; }
.tv-market-intro strong { color: var(--tv-mp-primary-dark); font-weight: 700; }
.tv-market-intro a {
    color: var(--tv-mp-primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}
@media (max-width: 640px) {
    .tv-market-intro { padding: 24px 22px; font-size: 15.5px; }
    .tv-market-intro::before { font-size: 100px; bottom: -20px; right: 8px; }
}

/* ============================================================
 * PRICE GRID
 * ============================================================ */
.tv-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.tv-price-card {
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    /* Padding bottom plus grand que top pour donner de l'air sous la
       dernière ligne du tableau (qui n'a pas de border-bottom). Évite
       l'effet « coupé » au bord inférieur du card. */
    padding: 22px 28px 28px;
    background: #fff;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.tv-price-card:hover { transform: translateY(-2px); box-shadow: var(--tv-mp-shadow-md); }
.tv-price-card-title {
    font-size: 12px;
    color: var(--tv-mp-primary-dark);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tv-price-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(26, 188, 156, 0.10);
    color: var(--tv-mp-primary-dark);
    flex: 0 0 auto;
}
.tv-price-card-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}
.tv-price-card-table th,
.tv-price-card-table td {
    /* Lignes plus aérées qu'avant (8 → 12). Padding latéral 4px évite
       que T0/T1/… collent au bord intérieur du card. La border-bottom
       est gardée même sur la dernière ligne pour « fermer » visuellement
       le tableau (sinon le card a l'air ouvert en bas). */
    padding: 12px 4px;
    font-size: 14.5px;
    border-bottom: 1px solid var(--tv-mp-line-soft);
}
.tv-price-card-table th {
    font-weight: 600;
    color: var(--tv-mp-ink-soft);
    text-align: left;
    width: 90px;
}
.tv-price-card-table td.num {
    text-align: right;
    color: var(--tv-mp-ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Footer caption sous les deux tableaux tipologia */
.tv-prices-footer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    margin: 18px 0 0;
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line-soft);
    border-radius: 8px;
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
}
.tv-prices-footer-icon {
    color: var(--tv-mp-primary-dark);
    flex: 0 0 auto;
    margin-top: 2px;
}

/* ============================================================
 * Quem está a comprar — 3 cartes profil acheteur
 * ============================================================ */
.tv-buyers { margin: 48px 0; }
.tv-buyers h2 {
    font-size: 1.875rem;
    color: var(--tv-mp-ink);
    margin: 0 0 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
}
.tv-buyers-grid {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.tv-buyer-card {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tv-buyer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tv-mp-shadow-md);
    border-color: var(--tv-mp-primary);
}
.tv-buyer-icon {
    color: var(--tv-mp-primary-dark);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(26, 188, 156, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.tv-buyer-card strong {
    color: var(--tv-mp-ink);
    font-size: 15px;
    font-weight: 700;
}
.tv-buyer-card > span:last-child {
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
}
.tv-buyers-footer {
    color: var(--tv-mp-mist);
    font-size: 12.5px;
    margin: 14px 0 0;
    font-style: italic;
}

/* ============================================================
 * HISTORY CHART + TABLE
 * ============================================================ */
.tv-history-chart-wrap {
    height: 340px;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 28px;
    box-shadow: var(--tv-mp-shadow-sm);
}
#tv-history-chart { width: 100% !important; height: 100% !important; }
.tv-market-history h3 { font-size: 18px; color: var(--tv-mp-ink); margin: 0 0 14px; font-weight: 700; }
.tv-table-wrap { overflow-x: auto; }
.tv-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    overflow: hidden;
    font-size: 14.5px;
    box-shadow: var(--tv-mp-shadow-sm);
}
.tv-data-table thead { background: var(--tv-mp-row-alt); }
.tv-data-table th,
.tv-data-table td { padding: 12px 16px; border-bottom: 1px solid var(--tv-mp-line-soft); text-align: left; }
.tv-data-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tv-mp-mist); font-weight: 700; }
.tv-data-table tr:last-child th,
.tv-data-table tr:last-child td { border-bottom: 0; }
.tv-data-table th[scope="row"] { font-weight: 700; color: var(--tv-mp-ink); }
.tv-data-table td.num,
.tv-data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tv-data-table tbody tr:nth-child(even) { background: var(--tv-mp-row-alt); }
.tv-data-table tbody tr:hover { background: rgba(26, 188, 156, 0.06); }
.tv-data-table .tv-up { color: var(--tv-mp-up); font-weight: 700; }
.tv-data-table .tv-down { color: var(--tv-mp-down); font-weight: 700; }

/* ============================================================
 * COMPARÁVEIS — cards existantes du partial, légères surcharges
 * ============================================================ */
.tv-market-comparables .estimates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.tv-market-comparables .estimate-item {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.tv-market-comparables .estimate-item:hover { transform: translateY(-2px); box-shadow: var(--tv-mp-shadow-md); }
.tv-market-comparables .estimate-total-price { color: var(--tv-mp-primary-dark); }
.tv-market-comparables .latest-estimates-title { color: var(--tv-mp-ink); font-size: 1.875rem; }

/* ============================================================
 * 8. TRUST BADGES ROW (4 colonnes)
 * ============================================================ */
.tv-trust-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    background: var(--tv-mp-row-alt);
    border-top: 1px solid var(--tv-mp-line);
    border-bottom: 1px solid var(--tv-mp-line);
    padding: 36px 24px;
    margin: 64px -24px 24px;
    text-align: center;
}
.tv-trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}
.tv-trust-badge-icon {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--tv-mp-primary-dark);
    margin-bottom: 6px;
    box-shadow: var(--tv-mp-shadow-sm);
}
.tv-trust-badge strong {
    color: var(--tv-mp-ink);
    font-weight: 700;
    font-size: 15px;
}
.tv-trust-badge span {
    color: var(--tv-mp-ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 220px;
}

/* ============================================================
 * Témoignages — alimentés par le CPT tagus_testimonial
 * ============================================================ */
.tv-testimonials { margin: 48px 0; }
.tv-testimonials h2 {
    font-size: 1.875rem;
    color: var(--tv-mp-ink);
    margin: 0 0 8px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
}
.tv-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.tv-testimonial {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 28px 22px 20px;
    margin: 12px 0 0;
    position: relative;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.tv-testimonial:hover { transform: translateY(-2px); box-shadow: var(--tv-mp-shadow-md); }
.tv-testimonial::before {
    content: '\201C';
    position: absolute;
    top: -14px;
    left: 22px;
    background: var(--tv-mp-primary);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    padding-top: 4px;
    box-shadow: var(--tv-mp-shadow-sm);
}
.tv-testimonial blockquote {
    margin: 0 0 14px;
    color: var(--tv-mp-ink);
    font-size: 15px;
    line-height: 1.6;
    font-style: italic;
}
.tv-testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--tv-mp-line-soft);
    font-style: normal;
}
.tv-testimonial-author strong {
    color: var(--tv-mp-ink);
    font-size: 14px;
    font-weight: 700;
}
.tv-testimonial-author span {
    color: var(--tv-mp-ink-soft);
    font-size: 13px;
}

/* ============================================================
 * FAQ
 * ============================================================ */
.tv-faq { margin: 48px 0; }
.tv-faq h2 {
    font-size: 1.875rem;
    color: var(--tv-mp-ink);
    margin: 0 0 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
}
.tv-faq-item {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 10px;
    margin-bottom: 10px;
    /* overflow:visible volontaire — certains thèmes mettent overflow:hidden
       en combo avec une polyfill height:0 pour animer les <details>, ce qui
       cache le contenu au lieu de l'afficher. On force visible ici. */
    overflow: visible;
    box-shadow: var(--tv-mp-shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
.tv-faq-item:hover { border-color: var(--tv-mp-primary); }
.tv-faq-item[open] {
    border-color: var(--tv-mp-primary);
    box-shadow: 0 4px 14px rgba(26, 188, 156, 0.12);
}
.tv-faq-item summary {
    padding: 16px 20px;
    cursor: pointer;
    /* `list-style: none` tue le triangle Firefox, ::marker idem mais avec
       moins de support — on cumule pour fiabilité cross-browser. */
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    user-select: none;
}
.tv-faq-item summary::-webkit-details-marker { display: none; } /* Safari/Chrome historique */
.tv-faq-item summary::marker { content: ''; }                    /* Firefox récent */
.tv-faq-q {
    flex: 1 1 auto;
    color: var(--tv-mp-ink);
    font-weight: 700;
    font-size: 15.5px;
    line-height: 1.4;
}
.tv-faq-toggle {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.10);
    color: var(--tv-mp-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, background .15s, color .15s;
}
.tv-faq-item[open] .tv-faq-toggle {
    transform: rotate(180deg);
    background: var(--tv-mp-primary);
    color: #fff;
}
/* La réponse — règles défensives contre les thèmes qui ajoutent des
 * polyfills <details>/<summary> à coups de display:none, max-height:0,
 * visibility:hidden ou opacity:0 sur details > :not(summary). On override
 * tout avec !important pour rester maître du rendu. */
.tv-faq-answer {
    display: block !important;
    visibility: visible !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    padding: 14px 20px 18px;
    color: var(--tv-mp-ink-soft);
    font-size: 15px;
    line-height: 1.65;
    border-top: 1px solid var(--tv-mp-line-soft);
    background: #fff;
    /* Match les coins arrondis bas du parent .tv-faq-item (qui a
       border-radius:10px) sinon le fond blanc carré dépasse de la
       bordure arrondie quand overflow est visible. */
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
.tv-faq-item:not([open]) > .tv-faq-answer {
    /* Quand l'item est fermé, on respecte le comportement natif <details> —
     * sinon les réponses seraient toutes visibles en permanence. */
    display: none !important;
}
.tv-faq-answer p {
    margin: 0 0 12px !important;
    color: var(--tv-mp-ink-soft) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
}
.tv-faq-answer p:last-child { margin-bottom: 0 !important; }

/* ============================================================
 * 9. CTA FINAL DARK
 * ============================================================ */
.tv-market-cta.tv-cta-final {
    background: linear-gradient(180deg, var(--tv-mp-primary-dark) 0%, var(--tv-mp-primary-darker, #0E8C72) 100%);
    border: 0;
    border-radius: 16px;
    padding: 48px 32px 36px;
    text-align: center;
    color: #fff;
    box-shadow: var(--tv-mp-shadow-lg);
    margin-top: 24px;
}
.tv-market-cta.tv-cta-final h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.005em;
}
.tv-cta-final-lead {
    color: rgba(255,255,255,0.92);
    font-size: 15.5px;
    max-width: 640px;
    margin: 0 auto 24px;
    line-height: 1.55;
}
.tv-cta-final-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.tv-cta-final-buttons .tv-cta-primary {
    background: #fff;
    color: var(--tv-mp-primary-dark) !important;
    border-color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.tv-cta-final-buttons .tv-cta-primary:hover {
    background: var(--tv-mp-row-alt);
    border-color: var(--tv-mp-row-alt);
}
.tv-cta-microcopy {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
}
.tv-cta-microcopy-sep { opacity: .5; }

/* ============================================================
 * STICKY MOBILE
 * ============================================================ */
.tv-sticky-mobile-cta {
    display: none;
    position: fixed;
    bottom: 14px;
    left: 14px;
    right: 14px;
    background: var(--tv-mp-primary);
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(26, 188, 156, 0.5);
    z-index: 9999;
    line-height: 1.2;
}
.tv-sticky-mobile-cta .tv-sticky-main { display: block; font-weight: 700; font-size: 15.5px; }
.tv-sticky-mobile-cta .tv-sticky-sub { display: block; font-size: 11.5px; opacity: .92; margin-top: 2px; font-weight: 500; }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 980px) {
    .tv-hero-image-right {
        grid-template-columns: 1fr;
        gap: 28px;
        min-height: 0;
        padding: 20px 0 28px;
    }
    .tv-hero-image {
        min-height: 240px;
        margin-right: 0;
        border-radius: 16px;
        order: 2;
    }
    .tv-hero-copy { order: 1; max-width: none; }
    .tv-plans-grid { grid-template-columns: 1fr; gap: 24px; }
    .tv-trust-badges { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
    .tv-steps { flex-direction: column; align-items: stretch; }
    .tv-step { max-width: none; }
    .tv-step-arrow { transform: rotate(90deg); padding: 4px 0; }
}
@media (max-width: 768px) {
    .tv-sticky-mobile-cta { display: block; }
    body.tv-market-page { padding-bottom: 92px; }
}
@media (max-width: 640px) {
    .tv-market-page-main { padding: 22px 16px 56px; }
    .tv-hero-title { font-size: clamp(26px, 8.5vw, 36px); }
    .tv-hero-lead { font-size: 15.5px; }
    .tv-hero-subtle { font-size: 14px; }
    .tv-hero-image { min-height: 200px; }
    .tv-hero-ctas .tv-cta-btn { width: 100%; justify-content: center; }
    .tv-howitworks,
    .tv-plan-card { padding: 28px 22px; }
    .tv-trust-badges { grid-template-columns: 1fr 1fr; padding: 28px 16px; margin: 48px -16px 24px; gap: 24px 10px; }
    .tv-data-table { font-size: 13px; }
    .tv-data-table th, .tv-data-table td { padding: 10px 12px; }
    .tv-cta-final-buttons { flex-direction: column; }
    .tv-cta-final-buttons .tv-cta-btn { width: 100%; }
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    word-wrap: normal !important;
}

/* ------------------------------------------------------------------
 * Internal mesh (single page) + zone directory / hub
 * ------------------------------------------------------------------ */
.tv-related-zones {
    margin: 2.5rem 0;
    padding: 1.75rem;
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
}
.tv-related-zones > h2 {
    margin: 0 0 1.25rem;
    color: var(--tv-mp-ink);
    font-size: 1.25rem;
}
.tv-related-block { margin-bottom: 1.25rem; }
.tv-related-block:last-child { margin-bottom: 0; }
.tv-related-block h3 {
    margin: 0 0 .6rem;
    color: var(--tv-mp-ink-soft);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tv-zone-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .65rem;
}
.tv-zone-links li { margin: 0; }
.tv-zone-links a {
    display: inline-block;
    padding: .35rem .8rem;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 999px;
    color: var(--tv-mp-ink);
    text-decoration: none;
    font-size: .9rem;
    transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.tv-zone-links a:hover,
.tv-zone-links a:focus {
    border-color: var(--tv-mp-primary);
    color: var(--tv-mp-primary-dark);
    box-shadow: var(--tv-mp-shadow-sm);
}

/* ============================================================
 * Hub / zone directory (/avaliar-imovel/)
 * ============================================================ */
.tv-hub-hero {
    text-align: center;
    max-width: 720px;
    margin: 8px auto 40px;
}
.tv-hub-kicker {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tv-mp-primary-dark);
    font-weight: 700;
    margin-bottom: 16px;
    padding: 7px 14px;
    background: rgba(26, 188, 156, 0.10);
    border: 1px solid rgba(26, 188, 156, 0.25);
    border-radius: 999px;
}
.tv-hub-title {
    font-size: clamp(30px, 4.5vw, 46px);
    line-height: 1.1;
    font-weight: 800;
    color: var(--tv-mp-ink);
    letter-spacing: -0.022em;
    margin: 0 0 16px;
}
.tv-hub-lead {
    font-size: 17px;
    color: var(--tv-mp-ink-soft);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 620px;
}
.tv-hub-intro {
    margin: 18px auto 0;
    max-width: 620px;
    color: var(--tv-mp-ink-soft);
    font-size: 15px;
    line-height: 1.65;
}
.tv-hub-intro p { margin: 0 0 12px; }
.tv-hub-intro p:last-child { margin-bottom: 0; }
.tv-hub-empty {
    text-align: center;
    color: var(--tv-mp-ink-soft);
    background: var(--tv-mp-row-alt);
    border: 1px solid var(--tv-mp-line-soft);
    border-radius: 16px;
    padding: 28px 24px;
    margin: 0 auto 40px;
    max-width: 560px;
}

.tv-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 0 0 56px;
}
.tv-hub-district {
    position: relative;
    padding: 22px 22px 20px;
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    box-shadow: var(--tv-mp-shadow-card);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    overflow: hidden;
}
/* Accent bar on the left edge — anchors each district visually. */
.tv-hub-district::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tv-mp-primary);
    opacity: 0;
    transition: opacity .15s ease;
}
.tv-hub-district:hover {
    transform: translateY(-3px);
    box-shadow: var(--tv-mp-shadow-md);
    border-color: var(--tv-mp-primary);
}
.tv-hub-district:hover::before { opacity: 1; }
.tv-hub-district-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tv-mp-line-soft);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tv-mp-ink);
}
.tv-hub-district-title a {
    color: var(--tv-mp-ink);
    text-decoration: none;
    transition: color .15s ease;
}
.tv-hub-district-title a:hover { color: var(--tv-mp-primary-dark); }
/* Count badge — number of zones listed under the district. */
.tv-hub-count {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(26, 188, 156, 0.12);
    color: var(--tv-mp-primary-dark);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tv-hub-district-cta {
    margin: 0;
    font-size: 14px;
}
.tv-hub-district-cta a {
    color: var(--tv-mp-primary-dark);
    text-decoration: none;
    font-weight: 600;
}
.tv-hub-district-cta a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .tv-hub-hero { margin-bottom: 28px; }
    .tv-hub-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* National price index: dynamic stat lead under the H1 */
.tv-hub-stat-lead {
    max-width: 760px;
    margin: 0 auto 14px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--tv-mp-ink);
}
.tv-hub-stat-lead strong { color: var(--tv-mp-primary-dark); }

/* vs.-national delta badge (red = above national, green = below) */
.tv-vs {
    display: inline-block;
    min-width: 48px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--tv-mp-line-soft);
    color: var(--tv-mp-ink-soft);
}
.tv-vs-up   { background: rgba(231, 76, 60, 0.12);  color: #C0392B; }
.tv-vs-down { background: rgba(22, 160, 133, 0.14); color: var(--tv-mp-primary-dark); }

/* Rankings — "mais caros" / "mais acessíveis" */
.tv-rank-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin: 8px 0 8px;
}
.tv-rank-card {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 20px 22px 14px;
    box-shadow: var(--tv-mp-shadow-sm);
}
.tv-rank-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tv-mp-ink);
}
.tv-rank-title::before {
    font-size: 14px;
    line-height: 1;
}
.tv-rank-up::before   { content: "\2191"; color: #C0392B; }
.tv-rank-down::before { content: "\2193"; color: var(--tv-mp-primary-dark); }
.tv-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: rank;
}
.tv-rank-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tv-mp-line-soft);
}
.tv-rank-list li:last-child { border-bottom: 0; }
.tv-rank-name {
    counter-increment: rank;
    color: var(--tv-mp-ink);
    font-weight: 600;
    font-size: 14.5px;
}
.tv-rank-name::before {
    content: counter(rank) ".";
    color: var(--tv-mp-mist);
    font-weight: 700;
    margin-right: 8px;
}
.tv-rank-name a { color: inherit; text-decoration: none; }
.tv-rank-name a:hover { color: var(--tv-mp-primary-dark); }
.tv-rank-val {
    font-weight: 700;
    color: var(--tv-mp-ink);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    white-space: nowrap;
}

/* Schematic cartogram — district tiles laid out north→south, coloured by €/m² */
.tv-hub-map { margin-top: 40px; }
.tv-cartogram {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 8px;
    max-width: 560px;
    margin: 8px 0 6px;
    aspect-ratio: var(--cols, 4) / var(--rows, 8);
}
.tv-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 10px;
    background: var(--tile-bg, var(--tv-mp-row-alt));
    color: var(--tile-fg, var(--tv-mp-ink));
    text-decoration: none;
    line-height: 1.15;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
    transition: transform .12s ease, box-shadow .12s ease, outline-color .12s ease;
    outline: 2px solid transparent;
    outline-offset: 2px;
}
a.tv-tile:hover,
a.tv-tile:focus-visible {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--tv-mp-shadow-md);
    outline-color: var(--tv-mp-primary-dark);
}
.tv-tile-static { cursor: default; }
.tv-tile-name  { font-size: 12px; font-weight: 700; }
.tv-tile-price { font-size: 11px; font-weight: 600; opacity: 0.92; font-variant-numeric: tabular-nums; }
.tv-cartogram-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--tv-mp-ink-soft);
    max-width: 560px;
}
.tv-legend-bar {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, hsl(168,52%,87%), hsl(168,52%,42%));
}

/* Geographic choropleth map of mainland Portugal (real SVG district polygons) */
.tv-ptmap-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin: 8px 0 12px;
}
.tv-ptmap {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 6px 16px rgba(44,62,80,0.10));
}
.tv-ptmap-zone path { transition: stroke .15s ease, stroke-width .15s ease, filter .15s ease; }
a.tv-ptmap-zone path { cursor: pointer; }
a.tv-ptmap-zone:hover path,
a.tv-ptmap-zone:focus-visible path {
    stroke: var(--tv-mp-ink);
    stroke-width: 2.2;
    filter: brightness(1.07);
}
a.tv-ptmap-zone:focus-visible { outline: none; }
.tv-ptmap-islands {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tv-ptmap-islands .tv-tile { min-width: 124px; min-height: 58px; border-radius: 10px; }
.tv-hub-map .tv-cartogram-legend { max-width: 300px; margin: 4px auto 0; justify-content: center; }
.tv-ptmap-attrib {
    font-size: 11px;
    color: var(--tv-mp-mist);
    margin: 8px 0 0;
    text-align: center;
}
.tv-ptmap-attrib a { color: var(--tv-mp-ink-soft); text-decoration: underline; }

/* Colour key shared between the map and the districts table */
.tv-swatch {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10);
}

/* North→south districts table — make the distrito names primary links */
.tv-districts-table th[scope="row"] a { color: var(--tv-mp-primary-dark); text-decoration: none; }
.tv-districts-table th[scope="row"] a:hover { text-decoration: underline; }

/* Editorial SEO block */
.tv-hub-editorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px 32px;
}
.tv-hub-editorial-grid h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tv-mp-ink);
    margin: 0 0 8px;
}
.tv-hub-editorial-grid p {
    margin: 0;
    color: var(--tv-mp-ink-soft);
    font-size: 14.5px;
    line-height: 1.6;
}
.tv-hub-cta { margin: 48px 0; }

@media (max-width: 560px) {
    .tv-cartogram, .tv-cartogram-legend { max-width: 100%; }
    .tv-tile-name { font-size: 11px; }
    .tv-tile-price { font-size: 10px; }
}

/* District price bar chart (national hub) */
.tv-chart-wrap {
    background: #fff;
    border: 1px solid var(--tv-mp-line);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--tv-mp-shadow-sm);
    margin-top: 8px;
}
.tv-chart-wrap canvas { width: 100% !important; }
.tv-chart-wrap-tall { height: 440px; }
@media (max-width: 640px) { .tv-chart-wrap-tall { height: 360px; } }
