:root,
html[data-theme="dark"] {
    --st-accent: #466aae;
    --st-accent-hi: #6889c6;
    --st-accent-deep: #2a4374;
    --st-accent-soft: rgba(70, 106, 174, 0.22);
    --st-gold: #ffc000;
    --st-solid: #1e212c;
    --st-glass: rgba(21, 23, 31, 0.78);
    --st-glass-strong: rgba(30, 33, 44, 0.94);
    --st-text: #e4e4e4;
    --st-text-2: #b6bccc;
    --st-muted: #8a93a6;
    --st-line: rgba(255, 255, 255, 0.09);
    --st-line-soft: rgba(255, 255, 255, 0.05);
    --st-hover: rgba(255, 255, 255, 0.07);
    --st-chip: rgba(255, 255, 255, 0.08);
    --st-track: rgba(255, 255, 255, 0.06);
    --st-track-strong: rgba(255, 255, 255, 0.18);
    --st-fill: rgba(104, 137, 198, 0.42);
    --st-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --st-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b6bccc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --st-gap: 12px;
    --st-top: 70px;
    --st-bottom: 132px;
    color-scheme: dark;
}
html[data-theme="light"] {
    --st-accent: #3a5795;
    --st-accent-hi: #3a5795;
    --st-accent-deep: #1f3d6b;
    --st-accent-soft: rgba(58, 87, 149, 0.12);
    --st-solid: #ffffff;
    --st-glass: rgba(255, 255, 255, 0.84);
    --st-glass-strong: rgba(255, 255, 255, 0.96);
    --st-text: #151515;
    --st-text-2: #334155;
    --st-muted: #64748b;
    --st-line: rgba(15, 23, 42, 0.1);
    --st-line-soft: rgba(15, 23, 42, 0.06);
    --st-hover: rgba(58, 87, 149, 0.08);
    --st-chip: rgba(15, 23, 42, 0.06);
    --st-track: rgba(15, 23, 42, 0.06);
    --st-track-strong: rgba(15, 23, 42, 0.16);
    --st-fill: rgba(58, 87, 149, 0.26);
    --st-shadow: 0 8px 24px rgba(31, 61, 107, 0.18);
    --st-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: light;
}

html, body.studio-body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #11141c;
    color: var(--st-text);
    font-family: "Exo 2", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
html[data-theme="light"] body.studio-body { background: #eef2f7; }
.studio-body *,
.studio-body *::before,
.studio-body *::after { box-sizing: border-box; }
.studio-body button,
.studio-body input,
.studio-body select { font-family: inherit; }

.studio-map {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    z-index: 0;
}
.studio-map .maplibregl-map,
.studio-map canvas {
    width: 100%;
    height: 100%;
}
.studio-map .mdl-webgl-controls-toolbar,
.studio-map .mdl-webgl-controls-toggle,
.studio-map .mdl-webgl-settings-panel,
.studio-map .mdl-webgl-projection-panel {
    display: none !important;
}

.studio-app {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}
.studio-app button,
.studio-app a,
.studio-app input,
.studio-app select,
.studio-drawer,
.studio-rail,
.studio-glass,
.studio-toast,
.studio-status {
    pointer-events: auto;
}
.studio-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.studio-app[hidden],
.studio-drawer[hidden],
.studio-legend[hidden],
.studio-toast[hidden],
.studio-status[hidden],
.studio-param-mobile[hidden] { display: none !important; }

.studio-glass {
    background: var(--st-glass);
    color: var(--st-text);
    border: 1px solid var(--st-line);
    box-shadow: var(--st-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

.studio-app ::-webkit-scrollbar { width: 6px; height: 6px; }
.studio-app ::-webkit-scrollbar-thumb { background: var(--st-track-strong); border-radius: 999px; }
.studio-app ::-webkit-scrollbar-track { background: transparent; }
.studio-rail,
.studio-drawer-body { scrollbar-width: thin; scrollbar-color: var(--st-track-strong) transparent; }

.studio-app select {
    -webkit-appearance: none;
    appearance: none;
    background: transparent var(--st-chevron) no-repeat right 10px center;
    color: inherit;
    border: 1px solid var(--st-line);
    border-radius: 999px;
    padding: 6px 28px 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.studio-app select:hover { border-color: var(--st-accent-hi); }
.studio-app select:focus-visible { border-color: var(--st-accent-hi); box-shadow: 0 0 0 3px var(--st-accent-soft); }
.studio-app select option { background: var(--st-solid); color: var(--st-text); }
.studio-app button:focus-visible,
.studio-app a:focus-visible,
.studio-track:focus-visible {
    outline: 2px solid var(--st-accent-hi);
    outline-offset: 2px;
}

.studio-search-wrap {
    position: relative;
    margin-bottom: 6px;
}
.studio-search-wrap > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-muted);
    font-size: 12px;
    pointer-events: none;
}
.studio-search-wrap input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 32px;
    border-radius: 999px;
    border: 1px solid var(--st-line);
    background: var(--st-chip);
    color: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.studio-search-wrap input::placeholder { color: var(--st-muted); }
.studio-search-wrap input:focus { border-color: var(--st-accent-hi); box-shadow: 0 0 0 3px var(--st-accent-soft); }

/* ---------- Top bar ---------- */
.studio-top {
    position: absolute;
    top: var(--st-gap);
    left: var(--st-gap);
    right: var(--st-gap);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.studio-top-left,
.studio-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.studio-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px 0 10px;
    border-radius: 999px;
    color: var(--st-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.studio-brand img { border-radius: 50%; }
.studio-brand:hover { border-color: var(--st-accent-hi); }
.studio-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    min-width: 200px;
    padding: 0 14px 0 14px;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}
.studio-pill:hover,
.studio-pill[aria-expanded="true"] { border-color: var(--st-accent-hi); }
.studio-pill img { border-radius: 3px; box-shadow: 0 0 0 1px var(--st-line); }
.studio-pill-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.15;
}
.studio-pill-text strong { font-size: 14px; letter-spacing: 0.02em; }
.studio-pill-text small {
    color: var(--st-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.studio-pill-caret {
    color: var(--st-muted);
    font-size: 11px;
    transition: transform 0.2s;
}
.studio-pill[aria-expanded="true"] .studio-pill-caret { transform: rotate(180deg); }
.studio-region-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    padding: 0 4px 0 14px;
    border-radius: 999px;
}
.studio-region-wrap > i { color: var(--st-accent-hi); }
.studio-region-wrap select { border: 0; }

.studio-tool-group {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 4px;
    border-radius: 999px;
}
.studio-tool-group button,
.studio-icon-btn,
.studio-tl-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--st-text-2);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.studio-tool-group button:hover,
.studio-icon-btn:hover,
.studio-tl-controls button:hover {
    background: var(--st-hover);
    color: var(--st-text);
}
.studio-tool-group button[aria-pressed="true"] {
    background: var(--st-accent);
    color: #fff;
    box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.studio-tool-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--st-line);
    flex: 0 0 auto;
}
.studio-layers-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--st-accent-hi), var(--st-accent) 55%, var(--st-accent-deep));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--st-shadow);
    transition: filter 0.15s;
}
.studio-layers-btn:hover { filter: brightness(1.1); }
.studio-layers-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--st-accent-soft), var(--st-shadow); }

/* ---------- Parameter rail (right, Windy-style) ---------- */
.studio-rail {
    position: absolute;
    top: var(--st-top);
    right: var(--st-gap);
    width: 244px;
    max-height: calc(100% - var(--st-top) - var(--st-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px 8px 8px;
    border-radius: 18px;
    z-index: 1;
}
.studio-cat { margin: 1px 0; }
.studio-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 3px 3px 3px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--st-text);
    font-size: 13.5px;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    transition: background 0.15s;
}
.studio-cat-btn:hover { background: var(--st-hover); }
.studio-cat-btn.is-static { cursor: default; background: transparent; }
.studio-cat-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-cat-icon {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--st-chip);
    color: var(--st-text-2);
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}
.studio-cat-icon.is-fav { color: var(--st-gold); }
.studio-cat.open > .studio-cat-btn .studio-cat-label { color: var(--st-accent-hi); }
html[data-theme="light"] .studio-cat.open > .studio-cat-btn .studio-cat-label { color: var(--st-accent); }
.studio-cat.has-active .studio-cat-icon {
    background: var(--st-accent);
    color: #fff;
    box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.studio-cat-items {
    margin: 2px 18px 6px 0;
    padding: 2px 8px 2px 0;
    border-right: 2px solid var(--st-line);
}
.studio-param {
    display: flex;
    align-items: baseline;
    gap: 6px;
    width: 100%;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--st-text-2);
    font-size: 13px;
    text-align: right;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.studio-param:hover { background: var(--st-hover); color: var(--st-text); }
.studio-param-title { flex: 1; min-width: 0; line-height: 1.25; }
.studio-param .unit {
    color: var(--st-muted);
    font-size: 10.5px;
    white-space: nowrap;
}
.studio-param.active {
    background: var(--st-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.studio-param.active .unit { color: rgba(255, 255, 255, 0.75); }
.studio-param.is-empty { cursor: default; font-style: italic; color: var(--st-muted); }
.studio-param.is-empty:hover { background: transparent; }
.studio-fav {
    align-self: center;
    color: var(--st-muted);
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s;
}
.studio-param:hover .studio-fav,
.studio-fav.on { opacity: 1; }
.studio-fav:hover { color: var(--st-gold); }
.studio-fav.on { color: var(--st-gold); }
.studio-param.active .studio-fav:not(.on) { color: rgba(255, 255, 255, 0.7); }

/* ---------- Drawers ---------- */
.studio-drawer {
    position: absolute;
    top: var(--st-top);
    bottom: var(--st-bottom);
    width: min(360px, calc(100vw - 24px));
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 3;
    background: var(--st-glass-strong);
    animation: studio-drawer-in 0.18s ease-out;
}
.studio-drawer-left { left: var(--st-gap); }
.studio-drawer-right { right: var(--st-gap); }
@keyframes studio-drawer-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.studio-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px 8px 16px;
}
.studio-drawer-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.studio-drawer-head h2 i { color: var(--st-accent-hi); font-size: 14px; }
.studio-drawer > .studio-search-wrap { margin: 2px 14px 8px; }
.studio-drawer-body { flex: 1; overflow: auto; padding: 0 14px 14px; }
.studio-section-label {
    margin: 14px 4px 6px;
    color: var(--st-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.studio-section-label:first-child { margin-top: 4px; }
.studio-model-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 2px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--st-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.studio-model-item:hover { background: var(--st-hover); }
.studio-model-item.active {
    background: var(--st-accent-soft);
    border-color: var(--st-accent);
}
.studio-model-item img { flex: 0 0 auto; border-radius: 3px; box-shadow: 0 0 0 1px var(--st-line); }
.studio-flag-blank { flex: 0 0 22px; width: 22px; height: 16px; border-radius: 3px; background: var(--st-chip); }
.studio-model-text { flex: 1; min-width: 0; }
.studio-model-text strong { display: block; font-size: 13.5px; }
.studio-model-text small { display: block; color: var(--st-muted); font-size: 11.5px; }
.studio-chip {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--st-chip);
    color: var(--st-text-2);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.studio-model-item.active .studio-chip { background: var(--st-accent); color: #fff; }

.studio-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--st-line-soft);
    font-size: 13.5px;
    cursor: pointer;
}
.studio-opt > span {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.studio-opt > span > i {
    width: 18px;
    margin-right: 10px;
    color: var(--st-muted);
    text-align: center;
    font-size: 13px;
}
.studio-opt-range { flex-direction: column; align-items: stretch; gap: 8px; }
.studio-opt-range output {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--st-chip);
    color: var(--st-text-2);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.studio-opt-range input[type="range"] { width: 100%; }

/* Toggle switch */
.studio-switch {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: var(--st-track-strong);
    cursor: pointer;
    transition: background 0.18s;
}
.studio-switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s;
}
.studio-switch:checked { background: var(--st-accent); }
.studio-switch:checked::before { transform: translateX(16px); }
.studio-switch:focus-visible { outline: 2px solid var(--st-accent-hi); outline-offset: 2px; }

/* Range sliders */
.studio-app input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
.studio-app input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--st-accent-hi) 0 var(--pct, 50%), var(--st-track-strong) var(--pct, 50%) 100%);
}
.studio-app input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border: 2px solid var(--st-accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s;
}
.studio-app input[type="range"]:hover::-webkit-slider-thumb,
.studio-app input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
.studio-app input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: var(--st-track-strong);
}
.studio-app input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 999px;
    background: var(--st-accent-hi);
}
.studio-app input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid var(--st-accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ---------- Bottom: dock + timeline ---------- */
.studio-bottom {
    position: absolute;
    left: var(--st-gap);
    right: var(--st-gap);
    bottom: var(--st-gap);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.studio-dock {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 44px;
}
.studio-dock-spacer { flex: 1; }
.studio-tl-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    padding: 0 6px 0 14px;
    border-radius: 999px;
}
.studio-tl-controls > i { color: var(--st-accent-hi); margin-right: 2px; }
.studio-tl-controls select { border: 0; font-variant-numeric: tabular-nums; }
.studio-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 0 6px;
    color: var(--st-text-2);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.studio-speed i { color: var(--st-muted); }
.studio-speed input { width: 76px; }

.studio-legend {
    width: 360px;
    max-width: 100%;
    padding: 7px 10px 9px;
    border-radius: 14px;
}
.studio-legend-title {
    margin: 0 0 5px 2px;
    color: var(--st-text-2);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.studio-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.studio-legend-unit {
    flex: 0 0 auto;
    min-width: 30px;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    background: var(--st-chip);
    color: var(--st-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.studio-legend-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    height: 20px;
    padding: 0 5px;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.studio-timeline {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 62px;
    padding: 6px 14px 6px 8px;
    border-radius: 18px;
}
.studio-play {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--st-accent-hi), var(--st-accent) 55%, var(--st-accent-deep));
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s, filter 0.15s;
}
.studio-play .fa-play { margin-left: 3px; }
.studio-play:hover { filter: brightness(1.1); }
.studio-play:active { transform: scale(0.94); }
.studio-play.is-playing { box-shadow: 0 0 0 4px var(--st-accent-soft), 0 4px 14px rgba(0, 0, 0, 0.35); }
.studio-track-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.studio-bubble {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: baseline;
    gap: 6px;
    height: 22px;
    padding: 0 10px;
    border-radius: 7px;
    background: var(--st-accent);
    color: #fff;
    font-size: 11.5px;
    line-height: 22px;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: left 0.14s ease-out;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.studio-track.is-scrubbing ~ .studio-bubble,
.studio-track-wrap:has(.is-scrubbing) .studio-bubble { transition: none; }
.studio-bubble::after {
    content: "";
    position: absolute;
    left: calc(50% + var(--arrow-shift, 0px));
    bottom: -4px;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    background: inherit;
    transform: rotate(45deg);
}
.studio-bubble-day { opacity: 0.9; }
.studio-bubble strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.studio-bubble-lead { opacity: 0.78; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.studio-track {
    position: relative;
    display: flex;
    gap: 3px;
    height: 24px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.studio-day {
    position: relative;
    flex-basis: 0;
    min-width: 0;
    border-radius: 6px;
    background: var(--st-track);
    overflow: hidden;
}
.studio-day-label {
    position: absolute;
    left: 8px;
    top: 50%;
    z-index: 2;
    max-width: calc(100% - 10px);
    overflow: hidden;
    color: var(--st-text-2);
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    transform: translateY(-50%);
    pointer-events: none;
}
.studio-day.current .studio-day-label { color: var(--st-text); }
.studio-day-ticks {
    position: absolute;
    inset: 0;
    display: flex;
}
.studio-tick {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
}
.studio-tick::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 4px;
    background: var(--st-track-strong);
}
.studio-tick:hover { background: var(--st-hover); }
.studio-tick.past { background: var(--st-fill); }
.studio-tick.active { background: var(--st-fill); }
.studio-tick.active::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--st-accent-hi);
    box-shadow: 0 0 6px var(--st-accent-hi);
}
html[data-theme="light"] .studio-tick.active::after { background: var(--st-accent); box-shadow: none; }

/* ---------- Toast / status ---------- */
.studio-toast,
.studio-status {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--st-glass-strong);
    color: var(--st-text);
    border: 1px solid var(--st-line);
    box-shadow: var(--st-shadow);
    font-size: 13px;
    font-weight: 600;
    transform: translateX(-50%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    z-index: 4;
}
.studio-toast { bottom: calc(var(--st-bottom) + 8px); }
.studio-toast::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Pro";
    font-weight: 900;
    color: var(--green, #5fae5f);
}
.studio-status { top: var(--st-top); }
.studio-status.is-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid var(--st-track-strong);
    border-top-color: var(--st-accent-hi);
    border-radius: 50%;
    animation: studio-spin 0.8s linear infinite;
}
@keyframes studio-spin { to { transform: rotate(360deg); } }

/* ---------- Map widgets rendered by model-webgl / MapLibre ---------- */
.studio-map .maplibregl-ctrl-bottom-right,
.studio-map .maplibregl-ctrl-bottom-left { bottom: calc(var(--st-bottom) - 4px); }
.studio-map .maplibregl-ctrl-bottom-right { right: calc(var(--st-gap) + 250px); }
.studio-map .maplibregl-ctrl-attrib {
    border-radius: 999px;
    background: var(--st-glass) !important;
    color: var(--st-muted);
    font-size: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.studio-map .maplibregl-ctrl-attrib a { color: var(--st-text-2); }
.studio-map .maplibregl-ctrl-group {
    border-radius: 12px;
    background: var(--st-glass);
    box-shadow: var(--st-shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.studio-map .mdl-webgl-data-loading {
    top: auto !important;
    right: auto !important;
    left: 50% !important;
    bottom: calc(var(--st-bottom) + 8px) !important;
    transform: translateX(-50%);
    background: var(--st-glass-strong) !important;
    color: var(--st-text) !important;
    border: 1px solid var(--st-line);
    font-family: "Exo 2", sans-serif !important;
    box-shadow: var(--st-shadow);
}
.studio-map .mdl-webgl-value-modal {
    position: absolute;
    left: var(--st-gap);
    top: var(--st-top);
    z-index: 920;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - var(--st-top) - var(--st-bottom));
    overflow: hidden;
    border-radius: 18px;
    background: var(--st-glass-strong);
    color: var(--st-text);
    border: 1px solid var(--st-line);
    box-shadow: var(--st-shadow);
    font-family: "Exo 2", sans-serif;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.studio-map .mdl-webgl-value-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px 16px;
    border-bottom: 1px solid var(--st-line);
}
.studio-map .mdl-webgl-value-modal-title { font-size: 14px; font-weight: 700; }
.studio-map .mdl-webgl-value-modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--st-text-2);
    cursor: pointer;
}
.studio-map .mdl-webgl-value-modal-close:hover { background: var(--st-hover); color: var(--st-text); }
.studio-map .mdl-webgl-value-modal-body {
    max-height: calc(100vh - var(--st-top) - var(--st-bottom) - 60px);
    overflow-y: auto;
    padding: 10px 14px 14px;
    font-size: 13px;
}
.studio-map .mdl-webgl-value-coords {
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--st-accent-soft);
    color: var(--st-text-2);
    font-size: 12px;
}
.studio-map .mdl-webgl-value-category-title {
    margin: 10px 0 4px;
    color: var(--st-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.studio-map .mdl-webgl-value-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid var(--st-line-soft);
}
.studio-map .mdl-webgl-value-number { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (min-width: 861px) {
    .studio-param-mobile { display: none !important; }
}
@media (max-width: 1180px) {
    .studio-brand span { display: none; }
    .studio-brand { padding: 0 10px; }
}
@media (max-width: 860px) {
    :root { --st-gap: 8px; --st-bottom: 170px; }
    .studio-top { flex-wrap: wrap; }
    .studio-top-left { flex: 1 1 auto; }
    .studio-pill { min-width: 0; flex: 1; padding: 0 12px; }
    .studio-pill-text strong,
    .studio-pill-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .studio-region-wrap { flex: 0 1 auto; min-width: 0; padding-left: 4px; }
    .studio-region-wrap > i { display: none; }
    .studio-region-wrap select { max-width: 130px; text-overflow: ellipsis; }
    .studio-tools { width: 100%; justify-content: space-between; }
    .studio-tool-group { flex: 1; justify-content: space-around; overflow-x: auto; }
    .studio-layers-btn span { display: none; }
    .studio-layers-btn { width: 44px; padding: 0; justify-content: center; }
    .studio-rail {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-height: min(62vh, 520px);
        border-radius: 20px 20px 0 0;
        z-index: 8;
        padding: 12px 10px;
    }
    .studio-rail.is-collapsed { display: none; }
    .studio-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        height: min(70vh, 560px);
        border-radius: 20px 20px 0 0;
        z-index: 9;
    }
    .studio-dock { flex-wrap: wrap; }
    .studio-param-mobile {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 44px;
        max-width: 50%;
        padding: 0 14px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
    .studio-param-mobile i { color: var(--st-accent-hi); }
    .studio-param-mobile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .studio-dock-spacer { display: none; }
    .studio-tl-controls { flex: 1; min-width: 0; justify-content: flex-end; padding: 0 4px 0 6px; }
    .studio-tl-controls select { min-width: 0; flex: 1; }
    .studio-tl-controls > i,
    .studio-tl-controls .studio-tool-sep,
    .studio-speed { display: none; }
    .studio-legend { order: -1; width: 100%; }
    .studio-bubble-lead { display: none; }
    .studio-map .maplibregl-ctrl-bottom-right { right: var(--st-gap); }
    .studio-map .mdl-webgl-value-modal { top: auto; bottom: var(--st-bottom); left: var(--st-gap); right: var(--st-gap); width: auto; max-height: 50vh; }
}
