.tlss-app {
    --tlss-ink: #151719;
    --tlss-muted: #687078;
    --tlss-soft: #f4f5f3;
    --tlss-line: #dfe2dc;
    --tlss-panel: #ffffff;
    --tlss-accent: #0f766e;
    --tlss-accent-2: #9f2d45;
    --tlss-warm: #c7953d;
    --tlss-shadow: 0 18px 44px rgba(21, 23, 25, 0.12);
    width: 100vw;
    max-width: 100vw;
    color: var(--tlss-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 calc(50% - 50vw);
    isolation: isolate;
    overflow-x: clip;
    text-size-adjust: 100%;
}

.tlss-app *,
.tlss-app *::before,
.tlss-app *::after {
    box-sizing: border-box;
}

.tlss-shell {
    width: 100%;
    margin: 0 auto;
    padding: 42px clamp(16px, 4vw, 64px);
}

.tlss-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
}

.tlss-hero h2 {
    margin: 0;
    max-width: 820px;
    font-size: 36px;
    line-height: 1.08;
    font-weight: 750;
    letter-spacing: 0;
}

.tlss-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--tlss-muted);
    font-size: 16px;
    line-height: 1.65;
}

.tlss-source {
    min-width: 180px;
    border-left: 1px solid var(--tlss-line);
    padding-left: 18px;
}

.tlss-source span,
.tlss-source strong {
    display: block;
}

.tlss-source span {
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.tlss-source strong {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 650;
}

.tlss-toolbar {
    display: grid;
    grid-template-columns: 0.9fr 1.8fr 0.7fr 1.3fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--tlss-soft);
    border: 1px solid var(--tlss-line);
    border-radius: 8px;
}

.tlss-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.tlss-toolbar span {
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.tlss-toolbar select {
    width: 100%;
    min-height: 42px;
    appearance: none;
    color: var(--tlss-ink);
    background:
        linear-gradient(45deg, transparent 50%, currentColor 50%) calc(100% - 17px) 18px / 5px 5px no-repeat,
        linear-gradient(135deg, currentColor 50%, transparent 50%) calc(100% - 12px) 18px / 5px 5px no-repeat,
        #ffffff;
    border: 1px solid #cfd4cf;
    border-radius: 7px;
    padding: 0 34px 0 12px;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

.tlss-toolbar select:focus {
    border-color: var(--tlss-accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
    outline: none;
}

.tlss-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(340px, 0.82fr);
    gap: 16px;
    align-items: stretch;
}

.tlss-map-panel,
.tlss-detail,
.tlss-ranking,
.tlss-context {
    background: var(--tlss-panel);
    border: 1px solid var(--tlss-line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(21, 23, 25, 0.04);
}

.tlss-map-panel {
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

.tlss-map {
    height: 600px;
    min-height: 600px;
    background: #eef1ee;
}

.tlss-map .leaflet-control-zoom a {
    color: var(--tlss-ink);
    border-color: var(--tlss-line);
}

.tlss-map .leaflet-tile-pane {
    filter: saturate(0.85) contrast(0.96);
}

.tlss-map-legend {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 450;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: calc(100% - 28px);
    padding: 9px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(223, 226, 220, 0.9);
    border-radius: 8px;
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 650;
    box-shadow: 0 10px 24px rgba(21, 23, 25, 0.08);
    backdrop-filter: blur(10px);
}

.tlss-legend-scale {
    width: 82px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.18), rgba(199, 149, 61, 0.7), rgba(159, 45, 69, 0.86));
}

.tlss-marker {
    display: grid;
    position: relative;
    place-items: center;
    width: var(--tlss-size, 18px);
    height: var(--tlss-size, 18px);
    border-radius: 999px;
    transform: scale(1);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 44%),
        var(--tlss-color, var(--tlss-accent));
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        0 0 0 1px rgba(21, 23, 25, 0.14),
        inset 0 -5px 10px rgba(21, 23, 25, 0.18),
        0 12px 24px rgba(21, 23, 25, 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.tlss-marker-wrap {
    background: transparent;
    border: 0;
}

.tlss-marker::before {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;
    border-radius: inherit;
    background: var(--tlss-color, var(--tlss-accent));
    opacity: 0.14;
    transform: scale(0.92);
}

.tlss-marker.is-active,
.tlss-marker:hover {
    transform: scale(1.18);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.82),
        0 0 0 7px rgba(15, 118, 110, 0.16),
        inset 0 -5px 10px rgba(21, 23, 25, 0.18),
        0 18px 34px rgba(21, 23, 25, 0.24);
}

.tlss-map-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--tlss-shadow);
}

.tlss-popup {
    min-width: 180px;
}

.tlss-popup strong,
.tlss-popup span,
.tlss-popup em {
    display: block;
}

.tlss-popup strong {
    font-size: 14px;
    line-height: 1.3;
}

.tlss-popup span {
    margin-top: 5px;
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 650;
}

.tlss-popup em {
    margin-top: 8px;
    color: var(--tlss-ink);
    font-size: 15px;
    font-style: normal;
    font-weight: 780;
    line-height: 1.2;
}

.tlss-detail {
    min-height: 600px;
    padding: 18px;
}

.tlss-detail-empty,
.tlss-state {
    display: grid;
    place-items: center;
    min-height: 520px;
    color: var(--tlss-muted);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.tlss-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.tlss-detail-head h3 {
    margin: 0;
    font-size: 28px;
    line-height: 1.08;
    font-weight: 760;
    letter-spacing: 0;
}

.tlss-detail-head p {
    margin: 7px 0 0;
    color: var(--tlss-muted);
    font-size: 13px;
    line-height: 1.5;
}

.tlss-year-pill {
    flex: 0 0 auto;
    min-width: 74px;
    padding: 7px 10px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 7px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--tlss-accent);
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}

.tlss-metric {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 18px;
    border-radius: 8px;
    background: #151719;
    color: #ffffff;
}

.tlss-metric-value {
    overflow-wrap: anywhere;
    font-size: 34px;
    line-height: 1;
    font-weight: 780;
    letter-spacing: 0;
}

.tlss-metric-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.45;
}

.tlss-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tlss-mini {
    min-height: 86px;
    padding: 13px;
    border: 1px solid var(--tlss-line);
    border-radius: 8px;
    background: #fafbf9;
}

.tlss-mini span,
.tlss-mini strong {
    display: block;
}

.tlss-mini span {
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 700;
}

.tlss-mini strong {
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.28;
}

.tlss-banner {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(199, 149, 61, 0.12)),
        #fbfbfa;
    border: 1px solid rgba(15, 118, 110, 0.16);
}

.tlss-banner strong {
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.35;
}

.tlss-banner p {
    margin: 0;
    color: var(--tlss-muted);
    font-size: 13px;
    line-height: 1.5;
}

.tlss-banner a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 7px;
    background: var(--tlss-ink);
    color: #ffffff;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.tlss-banner a:hover,
.tlss-banner a:focus {
    background: var(--tlss-accent);
    color: #ffffff;
}

.tlss-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 16px;
    margin-top: 16px;
}

.tlss-ranking,
.tlss-context {
    padding: 18px;
}

.tlss-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tlss-block-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 750;
}

.tlss-block-head span {
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 650;
}

.tlss-ranking-list {
    display: grid;
    gap: 7px;
}

.tlss-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) minmax(92px, auto);
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid var(--tlss-line);
    border-radius: 7px;
    background: #ffffff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tlss-row:hover,
.tlss-row:focus,
.tlss-row.is-active {
    border-color: #800020;
    background: #800020;
    color: #ffffff;
    outline: none;
    box-shadow: 0 10px 26px rgba(128, 0, 32, 0.18);
}

.tlss-row:hover .tlss-row-rank,
.tlss-row:focus .tlss-row-rank,
.tlss-row.is-active .tlss-row-rank,
.tlss-row:hover .tlss-row-value,
.tlss-row:focus .tlss-row-value,
.tlss-row.is-active .tlss-row-value {
    color: rgba(255, 255, 255, 0.86);
}

.tlss-row-rank {
    color: var(--tlss-muted);
    font-size: 12px;
    font-weight: 760;
}

.tlss-row-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.tlss-row-value {
    justify-self: end;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 750;
}

.tlss-context p {
    margin: 0;
    color: var(--tlss-muted);
    font-size: 14px;
    line-height: 1.7;
}

.tlss-context strong {
    color: var(--tlss-ink);
    font-weight: 760;
}

.tlss-context-source {
    display: inline-block;
    margin-top: 6px;
}

.tlss-context code {
    color: var(--tlss-ink);
    background: #f1f2ef;
    border-radius: 5px;
    padding: 1px 5px;
}

.tlss-hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .tlss-shell {
        padding: 28px clamp(12px, 3.4vw, 28px);
    }

    .tlss-hero,
    .tlss-workspace,
    .tlss-bottom {
        grid-template-columns: 1fr;
    }

    .tlss-source {
        border-left: 0;
        border-top: 1px solid var(--tlss-line);
        padding: 14px 0 0;
    }

    .tlss-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tlss-map-panel,
    .tlss-detail,
    .tlss-map {
        min-height: 430px;
    }

    .tlss-map {
        height: 430px;
    }
}

@media (max-width: 640px) {
    .tlss-shell {
        padding: 22px 10px;
    }

    .tlss-hero h2 {
        font-size: 28px;
        line-height: 1.12;
    }

    .tlss-hero p {
        font-size: 15px;
        line-height: 1.55;
    }

    .tlss-toolbar {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 10px;
    }

    .tlss-toolbar select {
        min-height: 44px;
    }

    .tlss-map-panel,
    .tlss-map {
        min-height: 360px;
    }

    .tlss-map {
        height: 360px;
    }

    .tlss-map-legend {
        left: 10px;
        right: 10px;
        justify-content: space-between;
    }

    .tlss-detail {
        min-height: 0;
        padding: 14px;
    }

    .tlss-detail-empty,
    .tlss-state {
        min-height: 220px;
    }

    .tlss-detail-head {
        display: grid;
    }

    .tlss-detail-head h3 {
        font-size: 24px;
    }

    .tlss-year-pill {
        justify-self: start;
    }

    .tlss-metric {
        padding: 15px;
    }

    .tlss-metric-value {
        font-size: 29px;
    }

    .tlss-mini-grid {
        grid-template-columns: 1fr;
    }

    .tlss-banner a {
        width: 100%;
    }

    .tlss-block-head {
        display: grid;
        gap: 4px;
    }

    .tlss-row {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .tlss-row-value {
        grid-column: 2;
        justify-self: start;
    }
}
