/* theme.css — SINH TỪ ui/design-tokens.json (v1.0.0, 2026-07-26).
   Đổi token thì đổi Ở FILE TOKENS trước rồi cập nhật đây (U4 có test đồng bộ).
   Phong cách: Stitch UI của Khánh — light, cyan accent duy nhất, bo góc pill/16/24. */

:root {
    --accent: #00AFB9;
    --accent-hover: #0d9488;
    --accent-soft: rgba(0, 175, 185, 0.12);
    --accent-kinetic: #00B4D8;
    --accent-kinetic-gradient: linear-gradient(180deg, #00C6EB 0%, #0096C7 100%);
    --accent-teal-send: #0096C7;
    --reward-accent: #F59E0B;
    --reward-warm-gradient: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    --ink: #111827;
    --page-bg: #F4F8FA;
    --canvas-bg: #F4F8FA;
    --canvas-tint: #F4F8FA;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.88);
    --surface-liquid-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 100%), rgba(255, 255, 255, 0.18);
    --border-hairline: rgba(28, 28, 30, 0.08);
    --border-specular: rgba(255, 255, 255, 0.6);
    --border-subtle: rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-float: 0 4px 14px rgba(0, 180, 216, 0.25);
    --shadow-porcelain: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 10px 30px -4px rgba(0, 180, 216, 0.08);
    --shadow-glass: 0 12px 32px 0 rgba(0, 30, 20, 0.12);
    --shadow-liquid-glass: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -1px 0 rgba(0, 180, 216, 0.18), 0 12px 40px rgba(0, 180, 216, 0.12);
    --shadow-glow-cyan: 0 4px 18px rgba(0, 180, 216, 0.35), 0 0 12px rgba(0, 180, 216, 0.25);
    --text-primary: #111827;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --text-high: #111827;
    --text-low: #64748B;
    --on-accent: #ffffff;
    --r-pill: 9999px;
    --r-card: 18px;
    --r-sheet: 28px;
    --r-chip: 12px;
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 28px;
    /* dataviz — màu theo ENTITY (validated 2026-07-26, xem tokens.provenance) */
    --viz-on-trip: #1baf7a;
    --viz-enroute: #2a78d6;
    --viz-charge: #eda100;
    --viz-rest: #4a3aa7;
    --viz-relocate: #e87ba4;
    --viz-idle: #eceff2;

    /* Thang MẬT ĐỘ CẦU cho heatmap H3 — sinh từ `dataviz.sequential_cyan` trong
     * `ui/design-tokens.json` (8 bậc, đã qua kiểm CVD/contrast ở `provenance.validation`).
     * Cổng đồng bộ: `ui/backend/tests/test_theme_sync.py::test_sequential_cyan_present_in_css`.
     *
     * ⚠ Vì sao PHẢI đủ 8 bậc: bản trước chép cứng 5 bậc GIỮA vào `app.js`, bỏ bậc nhạt nhất và
     * HAI bậc đậm nhất — tức là vứt đúng phần có tương phản mạnh nhất, nên heatmap trông bẹt.
     * Bậc 1 nhạt gần nền là CÓ CHỦ Ý (ô gần 0 được phép chìm), bậc 8 mới là chỗ mắt bắt được. */
    --viz-seq-1: #e5f6f7;
    --viz-seq-2: #c3ebee;
    --viz-seq-3: #95dbe0;
    --viz-seq-4: #5ec4cc;
    --viz-seq-5: #22a9b4;
    --viz-seq-6: #068c96;
    --viz-seq-7: #046e77;
    --viz-seq-8: #035158;
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #d03b3b;
    --polyline-base: #0f172a;
    --polyline-top: #00AFB9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    font-size: 14px;
}

/* ---- App shell: mobile-first full-viewport; desktop = cột 420px giữa màn ---- */
#shell {
    position: relative;
    height: 100dvh;
    max-width: 420px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--page-bg);
}

@media (min-width: 480px) {
    #shell {
        height: min(880px, 94dvh);
        top: 3dvh;
        border-radius: 32px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-hairline);
    }
}

.screen {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding-bottom: 92px;
}

.screen.with-map {
    overflow: hidden;
    padding-bottom: 0;
}

.hidden {
    display: none !important;
}

/* ---- Map ---- */
#map {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Dòng danh tính đầu mỗi màn — "số này của ai, tới ngày nào". */
.danh-tinh {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Nút quay lại màn chính trên các màn phụ — thay chức năng của thanh nav đã gỡ. */
.ve-xanh-now {
    margin-top: 10px;
    padding: 7px 14px;
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
/* ---- Pills & floating chrome ---- */

/* ⚠ Guard BẮT BUỘC, cùng lý do bug V-47 ở `.hil-sheet`: thuộc tính `hidden` chỉ là UA-style
 * `display:none`, và `display:flex` của author ĐÈ nó. Không có dòng này thì lệnh ẩn HUD lúc
 * phiên đóng vai chạy (`gsm:hil-active`) im lặng không có tác dụng, và màn hình lại có hai con
 * số tiền mâu thuẫn nhau — đúng thứ nó sinh ra để dập. */
.top-bar[hidden] { display: none; }

.top-bar {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.top-bar>* {
    pointer-events: auto;
}

/* ---- Liquid Glass Base Specification (taste-skill section 12) ---- */
.liquid-glass {
    position: relative;
    isolation: isolate;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-specular);
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    box-shadow: var(--shadow-liquid-glass);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.liquid-glass:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-liquid-glass), var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.45);
}

.liquid-glass:active {
    transform: scale(0.96);
}

.circle-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    border: 1px solid var(--border-specular);
    box-shadow: var(--shadow-liquid-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: var(--text-high);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
    flex-shrink: 0;
}

.circle-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-liquid-glass), var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.45);
}

.circle-btn:active {
    transform: scale(0.93);
}

.pill {
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    border: 1px solid var(--border-specular);
    border-radius: var(--r-pill);
    padding: 10px 18px;
    box-shadow: var(--shadow-liquid-glass);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-high);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.pill:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-liquid-glass), var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.45);
}

.pill .sub {
    font-weight: 500;
    font-size: 10.5px;
    color: var(--text-low);
    display: block;
}

.pill-soc {
    border-radius: var(--r-pill);
    padding: 8px 14px;
    color: var(--on-accent);
    background: var(--accent-kinetic-gradient);
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(0, 180, 216, 0.35);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.pill-soc:hover {
    transform: translateY(-1.5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow-glow-cyan);
}

.pill-soc.low {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(220, 38, 38, 0.35);
}

/* Nút điều hướng quay lại Xanh Now trên các màn hình con */
.ve-xanh-now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--r-pill);
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    border: 1px solid var(--border-specular);
    box-shadow: var(--shadow-liquid-glass);
    color: var(--accent-kinetic);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.ve-xanh-now:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-liquid-glass), var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.45);
}

.ve-xanh-now:active {
    transform: scale(0.96);
}

/* Q-06: nhãn MÔ PHỎNG cạnh chỉ báo pin — 13 bảng GSM chưa có telemetry pin, số SOC do
   `_soc_proxy` sinh ra. Nhãn phải ĐỌC ĐƯỢC, không phải chú thích mờ nhạt. */
.pill-soc-tag {
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    vertical-align: middle;
}

.tag-mock {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    background: var(--status-warning, #b8860b);
    color: #fff;
}

/* ---- Badge mock — BẮT BUỘC mọi màn có số ---- */
.mock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--reward-warm-gradient);
    color: #8a6100;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--r-pill);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.mock-badge::before {
    content: "◦";
    font-weight: 900;
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--r-card);
    border: 1px solid var(--border-specular);
    box-shadow: var(--shadow-porcelain);
    padding: 16px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    box-shadow: var(--shadow-porcelain), 0 0 16px rgba(0, 180, 216, 0.12);
}

.card h2 {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.card .big-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-high);
    font-variant-numeric: tabular-nums;
}

.card .note {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 5px;
}

.alert-card {
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    border: 1px solid var(--border-specular);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-porcelain);
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert-card .ico {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.alert-card b {
    font-size: 12.5px;
}

.alert-card p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---- CTA ---- */
.cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 250px;
    margin: 0 auto;
    padding: 15px 0;
    border: none;
    border-radius: var(--r-pill);
    cursor: pointer;
    background: var(--ink);
    color: var(--on-accent);
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-float);
    transition: background 0.2s;
}

.cta.online {
    background: var(--accent);
}

/* ---- Bottom nav ---- */
#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 600;
    background: var(--surface);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 10px 4px calc(12px + env(safe-area-inset-bottom));
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    line-height: 1.15;
}

.nav-btn .ni {
    font-size: 17px;
}

.nav-btn.active {
    color: var(--accent);
    font-weight: 700;
}

.advice-item {
    border: 1px solid rgba(0, 175, 185, 0.3);
    background: #f0fdf9;
    border-radius: var(--r-card);
    padding: 12px;
    margin-bottom: 10px;
}

.advice-item.info {
    border-color: #f0dfae;
    background: #fffbea;
}

.advice-item b {
    font-size: 13.5px;
}

.advice-item p {
    font-size: 12.5px;
    line-height: 1.55;
    margin-top: 5px;
    color: var(--text-primary);
}

.advice-item .meta {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 8px;
}

.confidence-track {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
}

.num-table {
    width: 100%;
    font-size: 11.5px;
    margin-top: 8px;
    border-collapse: collapse;
}

.num-table td {
    padding: 3px 4px;
    border-top: 1px solid var(--border-hairline);
}

.num-table td:nth-child(2) {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.num-table td:nth-child(3) {
    text-align: right;
    color: var(--text-muted);
    font-size: 10px;
}

.silent-box {
    text-align: center;
    padding: 26px 18px;
    border-radius: var(--r-card);
    background: var(--surface-subtle);
    border: 1px dashed rgba(0, 180, 216, 0.25);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    box-shadow: var(--shadow-porcelain);
}

.silent-box .big-ico {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    color: var(--accent-kinetic);
}

/* ---- Buttons ---- */
.btn {
    display: block;
    width: 100%;
    padding: 13px 16px;
    margin-top: 12px;
    border: none;
    border-radius: var(--r-pill);
    cursor: pointer;
    background: var(--accent-kinetic-gradient);
    color: var(--on-accent);
    font-family: inherit;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.35);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-glow-cyan);
    opacity: 0.96;
}

.btn:active {
    transform: scale(0.97);
}

.btn.ghost {
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-specular);
    color: var(--text-primary);
    box-shadow: var(--shadow-porcelain);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r-chip);
    border: 1px solid var(--border-specular);
    background: var(--surface-liquid-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-porcelain);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.4);
}

.chip:active {
    transform: scale(0.96);
}

.chip.active {
    background: var(--accent-kinetic-gradient);
    color: var(--on-accent);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.35);
}

/* ---- Trip overlay (vòng đời cuốc demo) ---- */
.trip-card {
    position: absolute;
    bottom: 104px;
    left: 12px;
    right: 12px;
    z-index: 560;
    background: var(--surface);
    border: 1.5px solid var(--accent);
    border-radius: var(--r-sheet);
    padding: 16px;
    box-shadow: var(--shadow-float);
}

.trip-card .tag {
    background: var(--accent-soft);
    color: #0f766e;
    border-radius: var(--r-pill);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
}

.trip-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    margin-top: 8px;
}

.trip-row .wp {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex: none;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---- Screens nội dung (Thu nhập, Chuyến, ...) ---- */
.screen-pad {
    padding: 52px 14px 100px;
    background: var(--page-bg);
}

.screen-pad>h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-high);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.row-item {
    background: var(--surface);
    border-radius: var(--r-card);
    border: 1px solid var(--border-specular);
    box-shadow: var(--shadow-porcelain);
    padding: 13px 15px;
    margin-top: 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.row-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-porcelain), var(--shadow-glow-cyan);
    border-color: rgba(0, 180, 216, 0.35);
}

.row-item .amt {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-high);
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 18px 0 8px;
}

select,
input[type="date"],
input[type="text"],
input[type="time"] {
    font-family: inherit;
    font-size: 13px;
    padding: 10px 14px;
    width: 100%;
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-chip);
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}

.leaflet-container {
    font-family: inherit;
}

/* ---- UX-CARDS (UPDATE-067): proactive advice cards ---- */
#card-stack {
    position: absolute;
    bottom: 176px;
    left: 14px;
    right: 14px;
    z-index: 520;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.adv-card {
    pointer-events: auto;
    background: var(--surface);
    border: 1.5px solid rgba(0, 175, 185, 0.35);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-float);
    padding: 12px 13px;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.adv-card.enter {
    animation: card-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes card-in {
    from {
        transform: translateY(26px) scale(0.97);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.adv-card.followed {
    transform: translateX(110%);
    opacity: 0;
}

.adv-card.dismissed {
    transform: translateX(-110%);
    opacity: 0;
}

.adv-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.adv-kind {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.2px;
}

.adv-title {
    font-size: 13.5px;
    display: block;
}

.adv-msg {
    font-size: 12.5px;
    line-height: 1.5;
    margin-top: 4px;
    color: var(--text-primary);
}

.adv-why {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-hairline);
}

.adv-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.adv-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: var(--r-chip);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    background: var(--surface-subtle);
    color: var(--text-primary);
}

.adv-btn.follow {
    background: var(--accent);
    color: var(--on-accent);
}

.adv-btn.why {
    flex: 0.7;
}

/* countup pill nhấn nhá khi số đổi */
.pill.bump {
    animation: pill-bump 0.5s ease;
}

@keyframes pill-bump {
    30% {
        transform: scale(1.06);
    }
}

/* ---- R1/R4 (UPDATE-068): khu Mô phỏng đồng ngôn ngữ app + playback ---- */
.mp-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mp-topbar .spacer {
    flex: 1;
}

.speed-chip {
    min-width: 44px;
    text-align: center;
}

.feed {
    margin-top: 8px;
    background: #10161a;
    color: #d7e2e8;
    border-radius: var(--r-chip);
    font: 11px/1.7 ui-monospace, Consolas, monospace;
    padding: 8px 10px;
    height: 128px;
    overflow-y: auto;
}

.feed .fl {
    opacity: 0;
    animation: feed-in 0.3s forwards;
}

@keyframes feed-in {
    to {
        opacity: 1;
    }
}

.feed .t {
    color: #7fd4db;
}

.feed .who {
    color: #9fb3bd;
}

.tab-intro {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.flash-ring {
    animation: flash-ring 1.8s ease-out;
}

@keyframes flash-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 175, 185, 0.65);
    }

    100% {
        box-shadow: 0 0 0 26px rgba(0, 175, 185, 0);
    }
}

/* Nhãn ô đích trên heatmap — dùng --viz-relocate (cùng màu viền lục giác đích) để mắt nối được
   nhãn với ô. Ghi đè nền/viền mặc định của Leaflet tooltip, nếu không nó ra hộp trắng lẫn vào
   nền bản đồ. `pointer-events:none` để nhãn không chặn cú bấm vào chính ô bên dưới. */
.leaflet-tooltip.heat-target-label {
    background: var(--viz-relocate);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    white-space: nowrap;
    pointer-events: none;
}

.leaflet-tooltip.heat-target-label::before {
    display: none;
    /* bỏ mũi nhọn — nhãn nằm GIỮA ô, không trỏ từ ngoài vào */
}
