/* Tesla Logbook — light public dashboard */
:root {
    --tlog-bg: #f4f6f8;
    --tlog-panel: #ffffff;
    --tlog-panel2: #eef1f4;
    --tlog-border: #d5dae0;
    --tlog-text: #1a1d21;
    --tlog-muted: #5c6570;
    --tlog-dim: #8a939e;
    --tlog-red: #c8102e;
    --tlog-tesla: #e82127;
    --tlog-green: #15803d;
    --tlog-amber: #b45309;
    --tlog-blue: #2563eb;
    --tlog-purple: #7c3aed;
    --tlog-jarvis: #2563eb;
    --tlog-sparky: #e11d48;
}

.tlog-pub {
    font-size: 15px;
    line-height: 1.45;
    background: var(--tlog-bg);
    color: var(--tlog-text);
    border: 1px solid var(--tlog-border);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.tlog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--tlog-border);
    padding-bottom: 12px;
    transition: border-color 0.15s;
}
.tlog-pub[data-filter-vehicle="Jarvis"] .tlog-header {
    border-bottom-color: var(--tlog-jarvis);
}
.tlog-pub[data-filter-vehicle="Sparky"] .tlog-header {
    border-bottom-color: var(--tlog-sparky);
}
.tlog-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.tlog-tmark {
    display: block;
    flex: none;
    width: 32px;
    height: 32px;
}
.tlog-title {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #111;
    line-height: 1.15;
}
.tlog-subtitle {
    font-size: 10px;
    color: var(--tlog-muted);
    margin-top: 1px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.tlog-header-meta {
    text-align: right;
    font-size: 11px;
    color: var(--tlog-muted);
    letter-spacing: 0.3px;
    flex: none;
}
.tlog-meta-label {
    display: block;
    color: var(--tlog-dim);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.tlog-meta-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.tlog-meta-row strong {
    color: #111;
    font-size: 12px;
}
.tlog-meta-hint {
    display: block;
    font-size: 9px;
    color: var(--tlog-dim);
    margin-top: 2px;
}
.tlog-lag-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.tlog-lag-ok {
    background: #ecfdf5;
    color: #15803d;
    border-color: #a7f3d0;
}
.tlog-lag-warn {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}
.tlog-lag-stale {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Filters */
.tlog-filterbar {
    background: var(--tlog-panel);
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    border: 1px solid var(--tlog-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tlog-filterbar-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.94);
    margin-bottom: 0;
}
.tlog-fgroup { display: flex; flex-direction: column; gap: 3px; }
.tlog-flabel {
    font-size: 9px;
    color: var(--tlog-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}
.tlog-pills { display: flex; gap: 3px; flex-wrap: wrap; }
.tlog-pill {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 4px 11px;
    font-size: 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.08s;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.tlog-pill:hover { border-color: #9ca3af; color: #111; background: #e5e7eb; }
.tlog-pill.active { background: var(--tlog-red); color: #fff; border-color: var(--tlog-red); }
.tlog-btn {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 11.5px;
    cursor: pointer;
    font-weight: 500;
}
.tlog-btn:hover { background: #f3f4f6; color: #111; border-color: #9ca3af; }
.tlog-btn-primary { background: var(--tlog-red); border-color: var(--tlog-red); color: #fff; }
.tlog-btn-xs {
    font-size: 9px;
    padding: 2px 7px;
    margin-top: 4px;
}
.tlog-factions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}
.tlog-scope-chip {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #1f2937;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.tlog-pub[data-filter-vehicle="Jarvis"] .tlog-scope-chip {
    border-color: var(--tlog-jarvis);
    color: #1d4ed8;
    background: #eff6ff;
}
.tlog-pub[data-filter-vehicle="Sparky"] .tlog-scope-chip {
    border-color: var(--tlog-sparky);
    color: #be123c;
    background: #fff1f2;
}

/* Section nav */
.tlog-section-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px 12px;
    margin: 0 0 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--tlog-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tlog-section-nav::-webkit-scrollbar { display: none; }
.tlog-section-nav-sticky {
    position: sticky;
    top: 52px;
    z-index: 39;
    background: rgba(244, 246, 248, 0.96);
    backdrop-filter: blur(10px);
    margin-top: 0;
    padding-left: 2px;
    padding-right: 2px;
}
.tlog-section-nav a {
    font-size: 10px;
    color: var(--tlog-dim);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    flex: none;
    padding: 2px 0;
}
.tlog-section-nav a:hover { color: #111; }

/* Banners */
.tlog-banner {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0 0 10px;
    border: 1px solid var(--tlog-border);
}
.tlog-banner-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.tlog-banner-muted {
    background: #f3f4f6;
    color: var(--tlog-muted);
}

/* Status cards */
.tlog-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 10px;
}
.tlog-status-card {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-radius: 8px;
    padding: 11px 13px;
    transition: 0.1s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tlog-status-card:hover { border-color: #b0b8c2; }
.tlog-status-card.tlog-vehicle-card { cursor: pointer; }
.tlog-status-card.tlog-vehicle-card.active {
    box-shadow: 0 0 0 2px var(--tlog-red) inset;
    background: #fffafb;
}
.tlog-status-card.is-charging { box-shadow: 0 0 0 1px var(--tlog-green) inset; }
.tlog-home-card { border-color: var(--tlog-border); }
.tlog-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    margin-bottom: 5px;
    color: #1f2937;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.tlog-card-head small { color: var(--tlog-dim); font-weight: 400; font-size: 11px; }
.tlog-metrics { display: flex; gap: 16px; margin: 4px 0 2px; }
.tlog-metric .num { font-size: 20px; font-weight: 700; color: #111; letter-spacing: -0.2px; }
.tlog-metric .unit { font-size: 10.5px; color: var(--tlog-muted); margin-left: 1px; }
.tlog-card-foot {
    font-size: 11px;
    color: var(--tlog-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.tlog-card-foot .cost { color: #b91c1c; font-weight: 600; }

/* Status card inner day/trip tiles (inline styles override helpers) */
.tlog-status-card [style*="background:#111"],
.tlog-status-card [style*="background: #111"] {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
}
.tlog-status-card [style*="color:#fff"],
.tlog-status-card [style*="color: #fff"] {
    color: #111 !important;
}
.tlog-status-card [style*="color:#ddd"],
.tlog-status-card [style*="color: #ddd"] {
    color: #374151 !important;
}
.tlog-status-card [style*="color:#888"],
.tlog-status-card [style*="color: #888"],
.tlog-status-card [style*="color:#777"],
.tlog-status-card [style*="color: #777"] {
    color: #6b7280 !important;
}

/* SOC */
.soc-bar { margin-top: 4px; }
.soc-track {
    height: 14px;
    background: linear-gradient(to right, #e82127 0%, #eab308 20%, #22c55e 50%, #4ade80 100%);
    border-radius: 999px;
    border: 1px solid var(--tlog-border);
    position: relative;
    overflow: hidden;
}
.soc-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: calc(100% - var(--soc));
    background: var(--tlog-panel);
    border-radius: 0 999px 999px 0;
}
.soc-text {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--soc);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    line-height: 1;
    white-space: nowrap;
    z-index: 1;
}
.current-status, .live-status {
    font-size: 10px;
    color: var(--tlog-muted);
    margin: 4px 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 20px;
    align-items: center;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #374151;
    letter-spacing: 0.2px;
}
.live-badge.live-state.is-parked {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}
.live-badge.live-state.is-driving {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.live-badge.live-state.is-charging,
.live-badge.live-charge.charging {
    background: #ecfdf5;
    color: #15803d;
    border-color: #a7f3d0;
}
.live-badge.live-range { color: #1f2937; }
.live-badge.live-gear { color: #1d4ed8; }
.live-badge.live-speed { color: #6d28d9; }
.current-status .charging,
.live-status .charging { color: var(--tlog-green); font-weight: 600; }

.tlog-home-spend { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e5e7eb; font-size: 10px; }
.tlog-spend-label { color: var(--tlog-muted); font-size: 9px; letter-spacing: 1px; display: block; margin-bottom: 2px; }
.tlog-home-spend canvas { background: #f8fafc; border-radius: 2px; max-height: 70px; }

/* Story hero */
.tlog-story {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #fff5f5 100%);
    border: 1px solid var(--tlog-border);
    border-left: 3px solid var(--tlog-red);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 14px 0 12px;
}
.tlog-story-label {
    font-size: 9px;
    color: var(--tlog-muted);
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 6px;
}
.tlog-story-line {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    line-height: 1.45;
}
.tlog-story-line strong { color: #000; }
.tlog-story-line .pos { color: var(--tlog-green); }
.tlog-story-line .neg { color: var(--tlog-amber); }
.tlog-story-sub {
    font-size: 11px;
    color: var(--tlog-muted);
    margin-top: 6px;
}

/* KPIs */
.tlog-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 10px 0 4px;
    gap: 8px;
    flex-wrap: wrap;
}
.tlog-scope-label { font-size: 10px; color: var(--tlog-dim); }
.tlog-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--tlog-panel);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--tlog-border);
    margin: 0 0 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tlog-kpi { flex: 1 1 72px; text-align: center; }
.tlog-kpi span { display: block; font-size: 18px; font-weight: 700; color: #111; line-height: 1; }
.tlog-kpi label {
    font-size: 9px;
    color: var(--tlog-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cost breakdown */
.tlog-cost-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0 0 12px;
}
.tlog-cost-col {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.tlog-cost-col.home { border-top: 3px solid var(--tlog-green); }
.tlog-cost-col.super { border-top: 3px solid var(--tlog-blue); }
.tlog-cost-col.gas { border-top: 3px solid var(--tlog-amber); }
.tlog-cost-col.result { border-top: 3px solid var(--tlog-red); }
.tlog-cost-col.result.saved { border-top-color: var(--tlog-green); }
.tlog-cost-col.result.extra { border-top-color: var(--tlog-amber); }
.tlog-cost-label {
    font-size: 9px;
    color: var(--tlog-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}
.tlog-cost-val {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
}
.tlog-cost-sub { font-size: 10px; color: var(--tlog-dim); margin-top: 3px; }

/* Insights / charts */
.tlog-insights, .tlog-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin: 4px 0 10px;
}
.tlog-charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}
.tlog-charts-note {
    font-size: 12px;
    color: var(--tlog-muted);
    margin: 0 0 10px;
    line-height: 1.4;
}
.tlog-chart-panel {
    min-height: 260px;
    display: flex;
    flex-direction: column;
}
.tlog-chart-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 200px;
    height: 200px;
}
.tlog-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
.tlog-insights-punch {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tlog-panel {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tlog-panel-savings {
    border-left: 3px solid var(--tlog-green);
}
.tlog-panel-head {
    font-size: 10px;
    color: var(--tlog-muted);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}
.tlog-panel-hint {
    font-size: 9px;
    color: var(--tlog-dim);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
.tlog-insight-body {
    font-size: 14px;
    min-height: 72px;
    line-height: 1.35;
    color: var(--tlog-green);
}
.tlog-insight-fsd { color: var(--tlog-purple); }
.tlog-muted { color: var(--tlog-dim); font-size: 11px; }
.tlog-empty-note {
    font-size: 12px;
    color: var(--tlog-dim);
    padding: 8px 4px;
    text-align: center;
}

/* Collapsible sections */
.tlog-details {
    margin: 12px 0 10px;
    border: 1px solid var(--tlog-border);
    border-radius: 8px;
    background: var(--tlog-panel);
}
.tlog-details-summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #374151;
    user-select: none;
}
.tlog-details-summary::-webkit-details-marker { display: none; }
.tlog-details-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    color: var(--tlog-red);
    transition: transform 0.12s;
}
.tlog-details[open] > .tlog-details-summary::before {
    transform: rotate(90deg);
}
.tlog-details-summary:hover { color: #111; background: #f9fafb; }
.tlog-details-body {
    padding: 4px 12px 12px;
    border-top: 1px solid #eef0f3;
}
.tlog-details .tlog-section-head:first-child { margin-top: 10px; }

/* Trip of week */
.tlog-tow {
    background: var(--tlog-panel);
    border-left: 3px solid var(--tlog-red);
    padding: 10px 12px;
    border-radius: 8px;
    margin: 10px 0 12px;
    border: 1px solid var(--tlog-border);
}
.tlog-tow-card {
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.tlog-tow-card:hover,
.tlog-tow-card:focus {
    border-color: #b0b8c2;
    background: #fafbfc;
    outline: none;
}
.tlog-tow-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff1f2;
    color: var(--tlog-red);
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
}
.tlog-tow-body { margin-top: 6px; font-size: 15px; color: #111; }
.tlog-tow-hint {
    font-size: 10px;
    color: var(--tlog-dim);
    margin-top: 4px;
}

/* Sections / tables / map */
.tlog-section-head {
    font-size: 11px;
    color: var(--tlog-muted);
    font-weight: 600;
    margin: 20px 0 5px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    scroll-margin-top: 110px;
}
.tlog-section-head .tlog-sub {
    font-size: 9px;
    color: var(--tlog-dim);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.tlog-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tlog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: #fff;
    border: 1px solid var(--tlog-border);
    border-radius: 6px;
    overflow: hidden;
}
.tlog-table th {
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--tlog-border);
    font-size: 9px;
    letter-spacing: 0.5px;
}
.tlog-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eef0f3;
    color: #1f2937;
    vertical-align: top;
}
.tlog-table tr:hover td { background: #f9fafb; }
.tlog-table-clickable tr { cursor: pointer; }
.tlog-table .route { color: var(--tlog-muted); font-size: 10px; }
.tlog-badge {
    font-size: 9px;
    padding: 0 5px;
    border-radius: 2px;
    display: inline-block;
    border: 1px solid #d1d5db;
}
.tlog-badge.home { background: #ecfdf5; color: #15803d; border-color: #a7f3d0; }
.tlog-badge.supercharger { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tlog-badge.other { background: #fffbeb; color: #b45309; border-color: #fde68a; }

.tlog-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    min-height: 22px;
}
.tlog-map-count {
    font-size: 11px;
    color: var(--tlog-muted);
    font-weight: 500;
}
.tlog-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #374151;
    background: #fff;
    border: 1px solid var(--tlog-border);
    border-radius: 6px;
}
.tlog-leg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tlog-leg i {
    display: inline-block;
    width: 14px;
    height: 4px;
    border-radius: 2px;
    background: #888;
}
.tlog-leg-jarvis i { background: var(--tlog-jarvis); height: 4px; width: 18px; }
.tlog-leg-sparky i { background: var(--tlog-sparky); height: 4px; width: 18px; }
.tlog-leg-hint {
    color: var(--tlog-dim);
    font-style: italic;
}
.tlog-leg-hint i { display: none; }
.tlog-home-spend canvas {
    height: 88px !important;
    max-height: 100px;
}
.tlog-map {
    height: 520px;
    min-height: 420px;
    border: 1px solid #c8ccd2;
    border-radius: 8px;
    background: #e8eef4;
    margin-bottom: 6px;
}
/* Light map chrome (Leaflet + OSM) */
.tlog-map .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #555 !important;
    font-size: 9px !important;
}
.tlog-map .leaflet-control-attribution a { color: #2563eb !important; }
.tlog-map .leaflet-control-zoom a {
    background: #fff !important;
    color: #333 !important;
    border-color: #ccc !important;
}
.tlog-map .leaflet-control-zoom a:hover {
    background: #f3f4f6 !important;
}
.tlog-map .leaflet-popup-content-wrapper {
    background: #fff;
    color: #222;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.tlog-map .leaflet-popup-tip { background: #fff; }
.tlog-map .leaflet-popup-content { margin: 10px 12px; font-size: 12px; }
.tlog-map .leaflet-popup-content a { color: #2563eb; }

.tlog-footer {
    margin-top: 14px;
    font-size: 10px;
    color: var(--tlog-dim);
    border-top: 1px solid var(--tlog-border);
    padding-top: 7px;
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.tlog-footer-right { opacity: 0.75; letter-spacing: 0.5px; }

/* Modal */
.tlog-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
}
.tlog-modal-inner {
    max-width: 860px;
    margin: 24px auto;
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    position: relative;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}
.tlog-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}
.tlog-modal-inner h3 {
    margin: 0 0 8px;
    color: #111;
    font-size: 18px;
    padding-right: 28px;
}
.tlog-modal-map {
    height: 280px;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e8eef4;
    border: 1px solid #c8ccd2;
}
.tlog-modal-body {
    color: #4b5563;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.45;
}
.tlog-modal-graph-label {
    font-size: 11px;
    color: var(--tlog-dim);
    margin-bottom: 4px;
}

/* Fleet compare */
.tlog-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.tlog-compare-card {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-top: 3px solid var(--tlog-red);
    border-radius: 8px;
    padding: 12px 14px;
}
.tlog-compare-name {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}
.tlog-compare-name small { color: var(--tlog-dim); font-weight: 400; font-size: 11px; margin-left: 4px; }
.tlog-compare-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    text-align: center;
}
.tlog-compare-grid2 .n { display: block; font-size: 18px; font-weight: 700; color: #111; }
.tlog-compare-grid2 label { font-size: 9px; color: var(--tlog-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.tlog-compare-foot { font-size: 11px; color: var(--tlog-muted); margin-top: 10px; line-height: 1.4; }
.tlog-compare-foot .pos { color: var(--tlog-green); font-weight: 600; }
.tlog-compare-foot .neg { color: var(--tlog-amber); font-weight: 600; }

/* FSD panel */
.tlog-fsd-panel {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 12px;
}
.tlog-fsd-big { font-size: 18px; color: var(--tlog-purple); margin-bottom: 8px; }
.tlog-fsd-big strong { color: #5b21b6; font-size: 22px; }
.tlog-fsd-pct {
    display: inline-block;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}
.tlog-fsd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: #6d28d9;
    margin-bottom: 8px;
}
.tlog-fsd-eff, .tlog-fsd-longest { font-size: 13px; color: #374151; margin: 4px 0; }
.tlog-fsd-timeline { margin-top: 8px; font-size: 11px; color: var(--tlog-muted); }
.tlog-day-chip {
    display: inline-block;
    background: #f5f3ff;
    color: #6d28d9;
    padding: 1px 6px;
    border-radius: 2px;
    margin: 2px;
    font-size: 10px;
}
.tlog-link { color: #2563eb; text-decoration: none; }
.tlog-link:hover { text-decoration: underline; }

/* Coaching */
.tlog-coach-panel { margin-bottom: 12px; }
.tlog-coach-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}
.tlog-coach-list li { margin-bottom: 6px; }

/* Places */
.tlog-places-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.tlog-place-chip {
    background: var(--tlog-panel);
    border: 1px solid var(--tlog-border);
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}
.tlog-place-chip strong { color: #111; font-size: 13px; }
.tlog-place-home { border-left: 3px solid var(--tlog-green); }
.tlog-place-supercharger { border-left: 3px solid var(--tlog-blue); }
.tlog-place-other, .tlog-place-work { border-left: 3px solid var(--tlog-amber); }

/* Chart axis readability on light panels */
.tlog-panel canvas { max-width: 100%; }
.tlog-chart-panel .tlog-panel-head { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 900px) {
    .tlog-cost-breakdown { grid-template-columns: repeat(2, 1fr); }
    .tlog-map { height: 400px; min-height: 300px; }
    .tlog-header { flex-wrap: wrap; }
}
@media (max-width: 680px) {
    .tlog-pub { padding: 10px 8px; border-radius: 0; border-left: none; border-right: none; }
    .tlog-title { font-size: 20px; }
    .tlog-status-grid { grid-template-columns: 1fr; gap: 8px; }
    .tlog-map { height: 300px; min-height: 240px; }
    .tlog-table { font-size: 10px; }
    .tlog-table .col-min,
    .tlog-table .col-kw,
    .tlog-table .col-rate { display: none; }
    .tlog-metrics { gap: 10px; }
    .tlog-insights, .tlog-charts-grid { gap: 6px; grid-template-columns: 1fr; }
    .tlog-section-head { margin: 14px 0 4px; }
    .tlog-card-head { font-size: 14px; }
    .tlog-pill, .tlog-btn { padding: 6px 8px; min-height: 32px; }
    .tlog-btn-hide-sm { display: none; }
    .tlog-story-line { font-size: 14px; }
    .tlog-cost-val { font-size: 17px; }
    .tlog-filterbar { gap: 10px; }
    .tlog-factions { margin-left: 0; width: 100%; }
    .tlog-scope-chip { font-size: 10px; }
    .tlog-modal-inner { margin: 8px auto; padding: 14px; }
    .tlog-modal-map { height: 220px; }
    .tlog-section-nav { gap: 4px 14px; }
    .tlog-section-nav-sticky { top: 96px; }
    .tlog-header-meta { text-align: left; width: 100%; }
    .tlog-meta-row { justify-content: flex-start; }
}
