:root {
    --studio-bg: #07111f;
    --studio-bg-deep: #050b15;
    --studio-surface: #0c1728;
    --studio-surface-raised: #101d31;
    --studio-surface-soft: #13213a;
    --studio-border: rgba(160, 180, 222, 0.14);
    --studio-border-strong: rgba(160, 180, 222, 0.24);
    --studio-text: #f5f7ff;
    --studio-muted: #8d9bb7;
    --studio-violet: #8b7cff;
    --studio-violet-strong: #7464f4;
    --studio-cyan: #4ee7d0;
    --studio-danger: #ff5570;
    --studio-radius-xl: 22px;
    --studio-radius-lg: 16px;
    --studio-radius-md: 12px;
    --studio-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html { max-width: 100%; background: var(--studio-bg-deep); overflow-x: hidden; }

body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--studio-text);
    background: var(--studio-bg-deep);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

button,
input,
select { font: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--studio-cyan);
    outline-offset: 2px;
}

.material-symbols-rounded {
    font-family: "Material Symbols Rounded";
    font-weight: 400;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

.studio-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto minmax(310px, 1fr);
    align-items: center;
    min-height: 76px;
    margin: 0;
    padding: 0 26px;
    border-bottom: 1px solid var(--studio-border);
    background: rgba(5, 11, 21, 0.94);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    color: #a892ff;
    font-size: 40px;
    font-variation-settings: "FILL" 1, "wght" 500;
    text-shadow: 0 0 26px rgba(139, 124, 255, 0.46);
}

.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 18px; letter-spacing: 0.02em; }
.brand-copy small { margin-top: 4px; color: var(--studio-muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.studio-header .tab-nav {
    display: flex;
    align-items: center;
    width: auto;
    min-width: 424px;
    margin: 0;
    padding: 5px;
    gap: 4px;
    border: 1px solid var(--studio-border);
    border-radius: 999px;
    background: #091424;
    overflow: visible;
}

.studio-header .tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #a8b2c8;
    background: transparent;
    font-size: 14px;
    font-weight: 650;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.studio-header .tab-btn:hover { color: var(--studio-text); background: rgba(255, 255, 255, 0.045); transform: translateY(-1px); }
.studio-header .tab-btn.active { color: #fff; background: var(--studio-violet-strong); box-shadow: 0 9px 26px rgba(116, 100, 244, 0.3); }
.studio-header .tab-btn .material-symbols-rounded { font-size: 19px; }

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.status-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 45px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 64, 93, 0.28);
    border-radius: 13px;
    background: rgba(255, 64, 93, 0.065);
}

.status-copy { display: grid; line-height: 1.15; min-width: 0; }
#connection-text { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-copy strong { color: #ff405d; font-size: 12px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 0 14px rgba(255, 64, 93, 0.62); }
.status-copy small { margin-top: 3px; color: var(--studio-muted); font-size: 11px; }
.status-dot { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #64748b; box-shadow: none; }
.status-dot.live,
.status-dot.connected { background: var(--studio-cyan); box-shadow: 0 0 0 5px rgba(78, 231, 208, 0.08), 0 0 18px rgba(78, 231, 208, 0.6); }
.status-panel .status-dot.live,
.live-overview-copy .status-dot.live,
.live-orbit .status-dot.live { background: #ff405d; box-shadow: 0 0 0 5px rgba(255, 64, 93, 0.11), 0 0 20px rgba(255, 64, 93, 0.82); }
.status-dot.offline,
.status-dot.disconnected { background: #7d8aa2; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--studio-border);
    border-radius: 12px;
    color: #c5cee0;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
}
.icon-button:hover { color: #fff; border-color: var(--studio-border-strong); background: rgba(255, 255, 255, 0.07); }

.account-menu { position: relative; }
.account-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 45px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--studio-border);
    border-radius: 14px;
    background: #0c1728;
    cursor: pointer;
    list-style: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #d7d1ff; background: #2a2454; }
#user-display-name { max-width: 100px; overflow: hidden; color: #f5f7ff; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#user-plan-badge { padding: 3px 7px; border-radius: 999px; color: #dcd7ff !important; background: rgba(139, 124, 255, 0.18) !important; font-size: 9px !important; font-weight: 800 !important; text-transform: uppercase; }
.account-chevron { color: var(--studio-muted); font-size: 17px; transition: transform 160ms ease; }
.account-menu[open] .account-chevron { transform: rotate(180deg); }

.account-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1100;
    display: grid;
    min-width: 238px;
    padding: 8px;
    border: 1px solid var(--studio-border-strong);
    border-radius: 15px;
    background: #0d1829;
    box-shadow: var(--studio-shadow);
}
.account-popover a,
.account-popover button,
.account-language {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    width: 100%;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    color: #cbd3e2;
    background: transparent;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.account-popover a:hover,
.account-popover button:hover,
.account-language:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.account-popover .material-symbols-rounded { color: #9a8dff; font-size: 18px; }
.account-language select { flex: 1; min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; }
.account-language select option { color: #111827; }
.account-popover .account-logout { color: #ff7a90; }

.account-details-overlay { z-index: 12000; padding: 18px; background: rgba(2, 8, 20, 0.82); backdrop-filter: blur(12px); }
.account-details-card { width: min(700px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 0; border: 1px solid rgba(128, 113, 255, 0.32); border-radius: 22px; background: linear-gradient(145deg, #101d31, #091423 72%); box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58), 0 0 45px rgba(103, 80, 255, 0.1); }
.account-details-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 20px; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
.account-details-kicker { display: block; margin-bottom: 5px; color: #8f81ff; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.account-details-header h2 { margin: 0; color: #f8f9ff; font-size: 22px; }
.account-details-header p { margin: 5px 0 0; color: #8491a8; font-size: 12px; line-height: 1.45; }
.account-details-close { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 11px; color: #aab5c8; background: rgba(255, 255, 255, 0.025); cursor: pointer; }
.account-details-close:hover { color: #fff; border-color: rgba(255, 107, 135, 0.5); background: rgba(255, 83, 119, 0.12); }
.account-details-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; padding: 20px 26px; }
.account-identity-card, .account-plan-card { min-width: 0; padding: 17px; border: 1px solid rgba(130, 146, 179, 0.15); border-radius: 17px; background: rgba(6, 16, 31, 0.58); }
.account-identity-heading { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.account-identity-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #ddd8ff; background: linear-gradient(145deg, #5540ba, #2b2765); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.account-identity-avatar .material-symbols-rounded { font-size: 24px; }
.account-identity-heading > div { display: grid; min-width: 0; gap: 3px; }
.account-identity-heading strong { overflow: hidden; color: #f7f8ff; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-identity-heading div span { overflow: hidden; color: #8996ac; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-role-badge { padding: 4px 7px; border-radius: 999px; color: #c9c1ff; background: rgba(139, 124, 255, 0.13); font-size: 9px; font-weight: 800; letter-spacing: 0.5px; }
.account-info-list { display: grid; gap: 0; margin: 10px 0 0; }
.account-info-list > div { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.08); }
.account-info-list > div:last-child { border-bottom: 0; }
.account-info-list dt { display: flex; align-items: center; gap: 6px; color: #75839a; font-size: 10px; }
.account-info-list dt .material-symbols-rounded { color: #9486ff; font-size: 14px; }
.account-info-list dd { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; color: #d9deea; font-size: 12px; }
.account-info-list code { overflow: hidden; color: #aeb8ca; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-info-list dd button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 8px; color: #a99fff; background: rgba(255,255,255,0.025); cursor: pointer; }
.account-info-list dd button .material-symbols-rounded { font-size: 15px; }
.account-plan-card { border-color: rgba(56, 214, 192, 0.18); background: linear-gradient(145deg, rgba(23, 60, 67, 0.28), rgba(8, 19, 36, 0.7)); }
.account-plan-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-plan-heading > div { display: flex; align-items: center; gap: 9px; }
.account-plan-heading > div > .material-symbols-rounded { color: #49dfcf; font-size: 26px; }
.account-plan-heading > div span { display: grid; gap: 1px; }
.account-plan-heading small { color: #6f7e95; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.account-plan-heading strong { color: #f4f7ff; font-size: 17px; letter-spacing: 0.5px; }
.account-plan-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(63, 221, 175, 0.2); border-radius: 999px; color: #53e8b7; background: rgba(32, 192, 141, 0.09); font-size: 9px; font-weight: 800; white-space: nowrap; }
.account-plan-status > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.account-plan-status[data-status="expired"] { color: #ff768e; border-color: rgba(255, 82, 114, 0.22); background: rgba(255, 62, 99, 0.09); }
.account-plan-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.account-plan-dates > div { display: grid; gap: 4px; padding: 10px; border: 1px solid rgba(148, 163, 184, 0.11); border-radius: 11px; background: rgba(3, 10, 22, 0.35); }
.account-plan-dates span { color: #728198; font-size: 9px; }
.account-plan-dates strong { color: #e6eaf3; font-size: 11px; }
.account-plan-capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.account-capability { display: flex; align-items: center; gap: 6px; min-width: 0; color: #9eabbf; font-size: 9px; }
.account-capability .material-symbols-rounded { flex: 0 0 auto; color: #7f70ef; font-size: 14px; }
.account-access-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.account-access-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; color: #718097; background: rgba(148, 163, 184, 0.08); font-size: 9px; font-weight: 700; }
.account-access-chip .material-symbols-rounded { font-size: 13px; }
.account-access-chip.is-enabled { color: #55e1ce; background: rgba(46, 205, 183, 0.11); }
.account-details-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 26px 22px; border-top: 1px solid rgba(148, 163, 184, 0.12); }
.account-details-actions a, .account-details-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 0 14px; border-radius: 11px; font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer; }
.account-details-actions a { border: 1px solid rgba(92, 228, 207, 0.28); color: #6ce4d4; background: rgba(42, 195, 175, 0.09); }
.account-details-actions a .material-symbols-rounded { font-size: 16px; }
.account-details-actions button { border: 0; color: #fff; background: linear-gradient(135deg, #7562f5, #614bd3); }

@media (max-width: 650px) {
    .account-details-overlay { align-items: flex-end; padding: 0; }
    .account-details-card { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
    .account-details-header { padding: 20px 18px 16px; }
    .account-details-body { grid-template-columns: 1fr; padding: 15px 18px; }
    .account-details-actions { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); }
}

.tab-content { display: none; padding: 18px; }
.tab-content.active { display: block; }
#tab-dashboard { min-height: calc(100vh - 76px); background: var(--studio-bg-deep); }
.glass-panel { border: 1px solid var(--studio-border); background: var(--studio-surface); box-shadow: none; backdrop-filter: none; }

.studio-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(318px, 0.92fr) minmax(360px, 1.05fr) minmax(430px, 1.25fr);
    gap: 14px;
    width: 100%;
    max-width: 1880px;
    margin: 0 auto;
    align-items: start;
    min-width: 0;
}

.studio-overview-column,
.chat-col,
.studio-control-column { min-width: 0; }

.studio-overview-column {
    display: grid;
    grid-template-rows: auto auto;
    gap: 14px;
}

.live-overview {
    position: relative;
    min-height: 0;
    padding: 20px;
    border-radius: var(--studio-radius-xl);
    background-color: #101949;
    background-image: url("/assets/aurora-live-background.png");
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(8, 14, 48, 0.32);
}

.live-overview::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(4, 10, 27, 0.38);
}

.live-overview::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(171, 164, 255, 0.28);
    border-radius: inherit;
}

.live-overview-copy { position: relative; z-index: 3; }
.live-kicker { display: inline-flex; align-items: center; gap: 8px; color: #d8e1f3; font-size: 13px; font-weight: 700; }
.live-overview-title-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; }
.live-overview h1 { margin: 0; color: #fff; font-size: 29px; line-height: 1; letter-spacing: -0.04em; }

.section-heading-actions,
.title-with-info,
.compact-field-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.section-heading-actions { justify-content: flex-end; }
.info-disclosure {
    position: relative;
    z-index: 30;
    display: inline-flex;
    flex: 0 0 auto;
}
.info-disclosure summary {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(139, 124, 255, 0.24);
    border-radius: 9px;
    color: #a99fff;
    background: rgba(139, 124, 255, 0.08);
    list-style: none;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.info-disclosure summary::-webkit-details-marker { display: none; }
.info-disclosure summary:hover,
.info-disclosure[open] summary { color: #fff; border-color: rgba(139, 124, 255, 0.56); background: rgba(139, 124, 255, 0.22); }
.info-disclosure summary .material-symbols-rounded { font-size: 17px; }
.info-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1250;
    width: min(290px, calc(100vw - 32px));
    padding: 11px 12px;
    border: 1px solid var(--studio-border-strong);
    border-radius: 11px;
    color: #c6d0e2;
    background: #111e31;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
}
.info-disclosure.align-left .info-popover { right: auto; left: 0; }

.connect-stats-row { position: relative; z-index: 2; display: block; margin: 12px 0 0; }
.connect-bar-mini {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
    padding: 5px !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 13px;
    background: rgba(5, 10, 26, 0.48);
    backdrop-filter: blur(12px);
}
.connect-bar-mini > .material-symbols-rounded { margin-left: 7px; color: #c9c5ff; font-size: 18px; }
.connect-bar-mini input { min-width: 0; height: 38px; padding: 0 4px; border: 0; color: #fff; background: transparent; font-size: 13px; }
.connect-bar-mini button { min-height: 38px; padding: 0 11px; border: 0; border-radius: 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
#connect-btn { color: #fff; background: var(--studio-violet-strong); }
.connect-bar-mini .btn-danger { color: #fff; background: var(--studio-danger); }
.connect-bar-mini .icon-button { min-width: 36px; width: 36px; padding: 0; color: #d1d7e5; background: rgba(255, 255, 255, 0.08); }

.live-orbit {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 184px;
    height: 184px;
    margin: 13px auto;
    border: 8px solid rgba(113, 238, 235, 0.2);
    border-top-color: #49e7d4;
    border-right-color: #9586ff;
    border-radius: 50%;
    box-shadow: inset 0 0 38px rgba(6, 11, 35, 0.72), 0 0 38px rgba(87, 204, 244, 0.18);
}
.live-orbit::before { content: ""; position: absolute; inset: 10px; border: 2px solid rgba(255, 255, 255, 0.11); border-radius: 50%; }
.live-orbit-core { position: relative; z-index: 1; display: grid; justify-items: center; gap: 4px; width: 148px; text-align: center; }
.orbit-status { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 11px; border: 1px solid rgba(255, 64, 93, 0.32); border-radius: 999px; color: #ff405d; background: rgba(73, 8, 24, 0.58); box-shadow: 0 0 22px rgba(255, 64, 93, 0.12); font-size: 12px; font-weight: 850; letter-spacing: 0.08em; text-shadow: 0 0 14px rgba(255, 64, 93, 0.68); }
.live-orbit .stat-label { display: none; }
.live-orbit strong { display: block; width: 142px; max-width: 142px; overflow: hidden; color: #fff; font-size: clamp(22px, 1.75vw, 25px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: 0; text-align: center; text-overflow: clip; white-space: nowrap; }

.finance-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}
.finance-grid .stat-card {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 94px;
    padding: 10px 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 13px;
    background: rgba(5, 10, 26, 0.42);
    backdrop-filter: blur(12px);
}
.finance-grid .stat-card::before { display: none; }
.finance-grid .card-usd { grid-column: auto; min-height: 94px; }
.finance-grid .stat-icon { margin: 0; color: #d8d3ff; font-size: 23px; }
.finance-grid .stat-body { min-width: 0; text-align: center; }
.finance-grid .stat-label { overflow: hidden; color: rgba(222, 230, 251, 0.72); font-size: 10px; font-weight: 650; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.finance-grid .stat-value { margin-top: 3px; color: #fff; font-size: 18px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.finance-grid .stat-sub { margin-top: 3px; overflow: hidden; color: rgba(222, 230, 251, 0.58); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.finance-grid #btn-open-finance { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: 0; background: transparent; }
.finance-grid #btn-open-finance .material-symbols-rounded { font-size: 17px; }

.live-overview .stats-grid-compact {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    margin: 10px 0 0;
    padding: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    background: rgba(5, 10, 26, 0.44);
    backdrop-filter: blur(12px);
}
.live-overview .stat-compact {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    padding: 2px 4px !important;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0;
    background: transparent;
}
.live-overview .stat-compact::before { display: none; content: none; }
.live-overview .stat-compact:last-child { border-right: 0; }
.live-overview .stat-compact .material-symbols-rounded { color: #d3ceff; font-size: 17px; }
.live-overview .stat-compact-label { max-width: 100%; color: rgba(224, 231, 250, 0.64); font-size: 11px; font-weight: 650; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-overview .stat-compact strong { color: #fff; font-size: 15px; }

.session-toggles { position: relative; z-index: 1; display: flex; gap: 8px; margin: 8px 0 0; }
.toggle-pill { margin: 0; }
.toggle-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--studio-border);
    border-radius: 9px;
    color: #aeb8cb;
    background: rgba(255, 255, 255, 0.035);
    font-size: 12px;
    font-weight: 650;
}
.toggle-pill-label .material-symbols-rounded { font-size: 15px; }
.toggle-pill input:checked + .toggle-pill-label { color: #e5e0ff; border-color: rgba(139, 124, 255, 0.44); background: rgba(139, 124, 255, 0.15); box-shadow: none; }

.leaderboard,
.chat-panel,
.bgm-panel,
.gift-effects-panel,
.queue-panel,
.profile-panel {
    border-radius: var(--studio-radius-lg);
}

.leaderboard { min-height: 240px; padding: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading > div { min-width: 0; }
.eyebrow { display: block; margin-bottom: 5px; color: #7787a5; font-size: 10px; font-weight: 800; letter-spacing: 0.13em; }
.section-heading h2,
.studio-control-heading h2,
.chat-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: #f5f7ff; font-size: 16px; line-height: 1.2; letter-spacing: -0.02em; }
.section-heading h2 .material-symbols-rounded,
.chat-heading h2 .material-symbols-rounded { color: #9c90ff; font-size: 20px; }
.text-button { border: 0; color: #9a8dff; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.leaderboard ul { margin: 12px 0 0; }
.leaderboard li { min-height: 37px; padding: 8px 5px; border-bottom: 1px solid rgba(160, 180, 222, 0.1); color: #cbd4e5; font-size: 13px; }
.leaderboard .rank { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 7px; border-radius: 7px; color: #e9e5ff; background: rgba(139, 124, 255, 0.18); font-size: 9px; }
.leaderboard .diamond-total { display: inline-flex; align-items: center; gap: 4px; color: #cfd8e9; font-weight: 700; }
.leaderboard .diamond-total .material-symbols-rounded { color: #71d9ff; font-size: 14px; }

.chat-col { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; position: sticky; top: 94px; min-height: 0; }
.chat-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; overflow: hidden; }
.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px;
    border-bottom: 1px solid var(--studio-border);
}
.chat-heading { flex: 1 1 auto; }
.chat-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.chat-select { width: auto; min-width: 70px; height: 34px; padding: 0 27px 0 9px; border: 1px solid var(--studio-border); border-radius: 9px; color: #c9d2e3; background-color: #111e31; font-size: 12px; }
.chat-messages { flex: 1; min-height: 0; max-height: none; padding: 10px 14px 12px; gap: 2px; overflow-y: auto; }
.chat-msg {
    display: grid;
    grid-template-columns: minmax(88px, 0.72fr) minmax(0, 1.45fr);
    align-items: start;
    gap: 9px;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid rgba(160, 180, 222, 0.08);
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    line-height: 1.4;
}
.chat-msg:hover { background: rgba(255, 255, 255, 0.025); }
.chat-msg-user { min-width: 0; margin: 0; color: #a99fff; font-size: 12px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msg-text { min-width: 0; color: #d6ddea; word-break: break-word; }
.chat-msg-translated { grid-column: 2; margin: 2px 0 0; padding: 0; border: 0; color: #83dfcf; font-size: 12px; }
.chat-empty { display: grid; place-items: center; align-content: center; gap: 7px; height: 100%; padding: 30px; color: #7f8ca7; }
.chat-empty .material-symbols-rounded { color: #665ba9; font-size: 38px; }
.chat-empty strong { color: #b7c1d3; font-size: 13px; }
.chat-empty small { font-size: 11px; }
.chat-statusbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--studio-border); color: #73809b; font-size: 11px; }
.chat-statusbar span:first-child { display: flex; align-items: center; gap: 7px; }

.studio-control-column { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 112px); overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(139, 124, 255, 0.38) transparent; }
.studio-control-column > * { flex: 0 0 auto; }
.studio-control-column::-webkit-scrollbar { width: 4px; }
.studio-control-column::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(139, 124, 255, 0.35); }
.studio-control-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 4px 2px; }
.studio-control-heading .panel-save-button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: var(--studio-violet-strong); font-size: 12px; font-weight: 750; }
.studio-control-heading .panel-save-button .material-symbols-rounded { font-size: 16px; }

.bgm-panel,
.gift-effects-panel,
.queue-panel,
.profile-panel { margin: 0; padding: 16px; }
.help-text { color: var(--studio-muted); font-size: 12px; line-height: 1.45; }
.bgm-panel > .help-text,
.gift-effects-panel > .help-text { margin: 7px 0 10px; }
.always-on-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(78, 231, 208, 0.16); border-radius: 999px; color: #8cebdd; background: rgba(78, 231, 208, 0.055); font-size: 10px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.always-on-badge .status-dot { width: 6px; height: 6px; }

.now-playing-card { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--studio-border); border-radius: 13px; background: #0a1423; }
.album-art { width: 74px; height: 74px; border-radius: 10px; object-fit: cover; }
.now-playing-content { display: grid; grid-template-rows: auto auto 1fr; min-width: 0; gap: 5px; }
.now-playing-label { color: #7787a5; font-size: 10px; font-weight: 800; letter-spacing: 0.11em; }
#bgm-select { width: 100%; min-width: 0; height: 34px; padding: 0 28px 0 8px; border: 0; border-radius: 7px; color: #f4f6fc; background-color: #121f34; font-size: 12px; font-weight: 650; text-overflow: ellipsis; }
.bgm-controls { display: flex; align-items: center; gap: 6px; margin: 0; }
.bgm-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 33px; padding: 0 10px; border: 1px solid var(--studio-border); border-radius: 8px; font-size: 11px; font-weight: 700; }
.bgm-controls button .material-symbols-rounded { font-size: 15px; }
.bgm-controls .btn-accent { color: #fff; border-color: transparent; background: var(--studio-violet-strong); }
.bgm-controls .btn-secondary { color: #b9c3d5; background: rgba(255, 255, 255, 0.04); }

.volume-row { display: grid; grid-template-columns: auto minmax(90px, 1fr) 34px; align-items: center; gap: 9px; margin: 10px 0 0; }
.volume-row label { display: inline-flex; align-items: center; gap: 6px; color: #aeb9cc; font-size: 11px; font-weight: 650; }
.volume-row label .material-symbols-rounded { color: #9285f7; font-size: 16px; }
.volume-row input[type="range"] { width: 100%; accent-color: var(--studio-violet); }
.volume-row > span { color: #aeb9cc; font-size: 11px; text-align: right; }
.bgm-upload-row { display: block; margin-top: 9px; }
.custom-file-upload { display: block; width: 100%; cursor: pointer; }
.custom-file-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-btn-ui { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 10px; border: 1px dashed rgba(139, 124, 255, 0.34); border-radius: 9px; color: #a79dfd; background: rgba(139, 124, 255, 0.055); font-size: 11px; }
.upload-btn-ui .material-symbols-rounded { font-size: 16px; }

.gift-effects-panel {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    resize: none;
}
.gift-volume-row { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--studio-border); border-radius: 10px; background: rgba(255, 255, 255, 0.025); }
#gift-audio-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    padding: 1px 0 0;
}
.audio-row {
    display: grid;
    grid-template-columns: minmax(108px, 0.75fr) minmax(0, 1.45fr) 56px;
    gap: 8px;
    padding: 10px;
    margin: 0;
    border: 1px solid var(--studio-border);
    border-radius: 12px;
    background: #0a1423;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}
.audio-row.is-rescue-rule { grid-template-columns: minmax(118px, 0.78fr) minmax(0, 1.55fr) 52px; }
.audio-col { min-width: 0; }
.audio-col > label { margin: 0 0 5px; color: #7787a5; font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.gift-selector-row { display: flex; gap: 5px; }
.gift-idol-field { display: grid; gap: 4px; margin: 8px 0 0 !important; }
.gift-idol-field > span { color: #7787a5; font-size: 10px; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
.gift-idol-field input { width: 100%; }
.btn-open-library { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 32px; padding: 0; border: 1px solid var(--studio-border); border-radius: 8px; color: #aa9fff; background: rgba(139, 124, 255, 0.08); }
.btn-open-library .material-symbols-rounded { font-size: 16px; }
.custom-gift-select { min-width: 0; }
.cgs-trigger,
.audio-col select,
.audio-col input[type="text"] { min-height: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--studio-border); border-radius: 8px; color: #dbe2ee; background-color: #111e31; font-size: 12px; }
.cgs-trigger { display: flex; align-items: center; }
.cgs-img { width: 23px; height: 23px; }
.cgs-options { z-index: 1200; border-color: var(--studio-border-strong); background: #101d31; }
.effect-audio-config { display: flex; flex-direction: column; gap: 5px; }
.effect-mode-select { border-color: rgba(139, 124, 255, 0.32) !important; color: #e5e1ff !important; font-weight: 700; }
.fixed-audio-panel,
.random-audio-panel,
.rescue-audio-panel { padding: 7px; border: 1px solid var(--studio-border); border-radius: 9px; background: rgba(139, 124, 255, 0.04); }
.fixed-audio-panel { gap: 5px; }
.audio-picker-row { gap: 5px; }
.btn-play-test { display: grid; place-items: center; width: 32px; min-width: 32px; padding: 0; }
.btn-play-test .material-symbols-rounded { font-size: 16px; }
.random-controls-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.random-controls-grid > div { gap: 4px; }
.playlist-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; }
.btn-add-playlist-track { padding: 0 8px; color: #9af0df; border: 1px solid rgba(78, 231, 208, 0.22); background: rgba(78, 231, 208, 0.07); font-size: 11px; }
.random-playlist { max-height: 116px; gap: 4px; }
.playlist-track { grid-template-columns: 20px minmax(0, 1fr) 30px 26px; min-height: 31px; padding: 3px 4px; border-radius: 7px; background: rgba(255, 255, 255, 0.025); }
.playlist-track-name { font-size: 11px; }
.playlist-track-play,
.playlist-track-remove { display: grid; place-items: center; min-width: 0; width: 26px; height: 26px; padding: 0; }
.playlist-track-play .material-symbols-rounded,
.playlist-track-remove .material-symbols-rounded { font-size: 14px; }
.random-upload-control .upload-btn-ui { min-height: 29px; }
.rescue-audio-panel { display: grid; gap: 6px; padding: 6px; border-color: rgba(78, 231, 208, 0.2); background: rgba(78, 231, 208, 0.045); }
.rescue-audio-panel[hidden] { display: none; }
.rescue-mode-title { display: flex; align-items: center; gap: 5px; min-height: 25px; color: #9af0df; font-size: 12px; font-weight: 750; }
.rescue-mode-title > .material-symbols-rounded { font-size: 15px; }
.rescue-mode-title .info-disclosure { margin-left: auto; }
.rescue-mode-title .info-disclosure summary,
.compact-field-title .info-disclosure summary { width: 24px; height: 24px; border-radius: 7px; }
.rescue-mode-title .info-disclosure summary .material-symbols-rounded,
.compact-field-title .info-disclosure summary .material-symbols-rounded { font-size: 15px; }
.rescue-audio-panel p { margin: 0; color: #93a2bb; font-size: 11px; line-height: 1.45; }
.rescue-gift-map { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 5px; }
.rescue-gift-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; align-items: center; gap: 3px 5px; min-width: 0; min-height: 56px; padding: 6px 7px; border: 1px solid rgba(160, 180, 222, 0.14); border-radius: 8px; background: rgba(5, 14, 27, 0.48); }
.rescue-gift-box > span { grid-column: 1; grid-row: 1; overflow: hidden; color: #8999b3; font-size: 9px; font-weight: 800; letter-spacing: 0.055em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.rescue-gift-box strong { grid-column: 1 / -1; grid-row: 2; min-width: 0; overflow: hidden; color: #ecfdf8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rescue-gift-box small { grid-column: 2; grid-row: 1; color: #ffc857; font-size: 9px; white-space: nowrap; }
.rescue-target-box select { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; min-height: 29px; height: 29px; padding-inline: 7px 24px; font-size: 11px; }
.rescue-map-arrow { align-self: center; color: #4ee7d0; font-size: 15px; }
.rescue-count-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 8px; min-width: 0; margin: 0; }
.rescue-count-field > span:first-child { color: #8999b3; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.rescue-count-control { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(62px, 0.55fr) minmax(92px, 1fr); gap: 5px; }
.rescue-subtract-count { width: 100%; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid rgba(78, 231, 208, 0.28); border-radius: 7px; color: #f4f7ff; background: #111e31; font-size: 12px; font-weight: 750; }
.rescue-use-suggestion { min-width: 0; min-height: 30px; padding: 0 7px; border: 1px solid rgba(139, 124, 255, 0.28); border-radius: 7px; color: #c6beff; background: rgba(139, 124, 255, 0.08); font-size: 10px; white-space: nowrap; }
.rescue-use-suggestion:disabled { cursor: not-allowed; opacity: 0.4; }
.rescue-suggestion-copy { min-width: 0; overflow: hidden; color: #8fa0b9; font-size: 9px; line-height: 1.25; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.rescue-target-select { width: 100%; }
.rescue-equation { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 29px; padding: 5px 7px; border-radius: 7px; color: #9eacc1; background: rgba(5, 14, 27, 0.48); font-size: 10px; }
.rescue-equation .material-symbols-rounded { flex: 0 0 auto; color: #4ee7d0; font-size: 15px; }
.rescue-equation span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rescue-equation strong { color: #ff879a; font-size: 10px; }
.rescue-sound-field { display: grid; gap: 4px; min-width: 0; padding-top: 6px; border-top: 1px solid rgba(78, 231, 208, 0.14); }
.compact-field-title { justify-content: space-between; color: #8999b3; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.rescue-audio-picker { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.rescue-audio-select { width: 100%; min-width: 0; }
.rescue-sound-field .audio-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px 32px; gap: 5px; }
.rescue-audio-preview { display: grid; place-items: center; min-width: 32px; min-height: 32px; height: 32px; padding: 0; }
.rescue-audio-preview .material-symbols-rounded { font-size: 17px; }
.rescue-upload-control { display: block; width: 32px; height: 32px; }
.rescue-upload-control .upload-btn-ui { width: 32px; height: 32px; min-height: 32px; padding: 0; border-style: solid; }
.rescue-upload-control .upload-btn-ui .material-symbols-rounded { font-size: 16px; }
.rescue-upload-filename { display: none; }
.audio-actions { display: flex; flex-direction: column; gap: 5px; }
.audio-actions .btn-sm { width: 100%; min-height: 35px; padding: 0 4px; border-radius: 8px; font-size: 11px; }
.btn-update { color: #fff; background: var(--studio-violet-strong); }
.btn-del { color: #ff8598; border-color: rgba(255, 85, 112, 0.26); background: rgba(255, 85, 112, 0.06); }
.btn-add-effect { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; margin: 0; border: 1px dashed rgba(139, 124, 255, 0.38); border-radius: 10px; color: #b2a9ff; background: rgba(139, 124, 255, 0.055); font-size: 12px; font-weight: 700; }
.btn-add-effect .material-symbols-rounded { font-size: 16px; }
.add-effect-row { margin-top: 9px; }

.queue-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; padding: 13px 14px; overflow: hidden; }
.queue-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 7px; }
.compact-heading { min-width: 0; }
.compact-heading h2 { font-size: 15px; }
.queue-count { padding: 5px 8px; border-radius: 999px; color: var(--studio-cyan); background: rgba(78, 231, 208, 0.08); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.queue-time-summary { display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(78, 231, 208, 0.18); border-radius: 9px; color: #a5b2c8; background: rgba(78, 231, 208, 0.045); font-size: 12px; white-space: nowrap; }
.queue-time-summary .material-symbols-rounded { color: var(--studio-cyan); font-size: 16px; }
.queue-time-summary strong { color: #ecfdf8; font-size: 13px; }
.queue-time-summary.is-empty { color: #73809a; border-color: var(--studio-border); background: rgba(255, 255, 255, 0.025); }
.queue-time-summary.is-empty .material-symbols-rounded { color: #6f7f9f; }
.queue-time-divider { color: #4e607d; }
.queue-transport { display: flex; align-items: center; gap: 9px; min-width: 0; }
.queue-pause-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 11px; border: 1px solid rgba(248, 187, 80, 0.38); border-radius: 9px; color: #ffe4ac; background: rgba(248, 187, 80, 0.1); font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.queue-pause-button:hover { border-color: rgba(248, 187, 80, 0.68); background: rgba(248, 187, 80, 0.16); }
.queue-pause-button .material-symbols-rounded { font-size: 17px; }
.queue-pause-button.is-paused { border-color: rgba(255, 77, 109, 0.78); color: #fff; background: #d91f49; box-shadow: 0 0 0 2px rgba(255, 77, 109, 0.13), 0 8px 22px rgba(217, 31, 73, 0.24); }
#queue-pause-note { min-width: 0; overflow: hidden; color: #7f91ad; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.queue-panel.is-paused .queue-time-summary { border-color: rgba(255, 77, 109, 0.4); color: #ffc3cf; background: rgba(255, 77, 109, 0.09); }
.queue-panel.is-paused .queue-time-summary .material-symbols-rounded { color: #ff5773; }
.queue-item.is-paused { border-color: rgba(255, 77, 109, 0.38); background: rgba(255, 77, 109, 0.08); }
#audio-queue-list { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; min-height: 0; max-height: none; margin-top: 7px; padding: 0 3px 2px 0; overflow-x: hidden; overflow-y: auto; }
#audio-queue-list::-webkit-scrollbar { width: 4px; }
#audio-queue-list::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(139, 124, 255, 0.32); }
#audio-queue-list .help-text { display: flex; align-items: center; min-height: 38px; margin: 0; }
.queue-item { display: grid; grid-template-columns: auto minmax(104px, 1fr) auto; align-items: center; gap: 7px; flex: 0 0 auto; width: 100%; min-width: 0; min-height: 42px; padding: 6px 9px; border: 1px solid var(--studio-border); border-radius: 9px; color: #9faec5; background: #0a1423; font-size: 12px; }
.queue-item .material-symbols-rounded { color: #8b7cff; font-size: 15px; }
.queue-item span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item strong { color: #dce4f2; font-size: 11px; white-space: nowrap; }
.queue-item.is-playing { border-color: rgba(78, 231, 208, 0.25); color: #bcefe7; background: rgba(78, 231, 208, 0.055); }
.queue-item.is-playing .material-symbols-rounded,
.queue-item.is-playing strong { color: var(--studio-cyan); }

.profile-panel { padding-top: 11px; padding-bottom: 11px; }
.profile-dock { display: grid; grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.28fr); align-items: center; gap: 12px; border-color: rgba(139, 124, 255, 0.2); background: rgba(139, 124, 255, 0.045); }
.profile-dock-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile-dock-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; color: #c8c1ff; background: rgba(139, 124, 255, 0.16); }
.profile-dock-icon .material-symbols-rounded { font-size: 18px; }
.profile-dock-heading > div { display: grid; min-width: 0; }
.profile-dock-heading strong { color: #e8e5ff; font-size: 13px; }
.profile-dock-heading small { margin-top: 2px; color: #75839e; font-size: 10px; line-height: 1.3; }
.profile-dock-heading .info-disclosure { margin-left: auto; }
.profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 0; min-width: 0; }
.profile-actions select { flex: 1 1 180px; min-width: 0; min-height: 34px; }
.profile-actions button { flex: 0 0 auto; min-height: 34px; padding: 0 9px; font-size: 10px; white-space: nowrap; }

#tab-gifts,
#tab-dev-test,
#tab-history { max-width: 1540px; margin: 0 auto; padding: 24px; }

.admin-only-tab[hidden],
#tab-dev-test[hidden] { display: none !important; }
.admin-only-tab { color: #9ff4e8; }
.admin-only-tab .material-symbols-rounded { color: #4ee7d0; }

#tab-dev-test { min-height: calc(100dvh - 76px); padding: 20px 24px 28px; }
.admin-test-page { max-width: 1080px; min-width: 0; margin: 0 auto; padding: 26px; border-radius: var(--studio-radius-xl); overflow: hidden; }
.admin-test-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--studio-border); }
.admin-test-header > div { min-width: 0; }
.admin-test-header h2 { display: flex; align-items: center; gap: 9px; margin: 5px 0 0; color: var(--studio-text); font-size: 22px; letter-spacing: -0.025em; }
.admin-test-header h2 .material-symbols-rounded { color: #7ef2df; font-size: 25px; }
.admin-test-header p { max-width: 680px; margin: 8px 0 0; color: var(--studio-muted); font-size: 12px; line-height: 1.55; }
.admin-access-badge { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid rgba(78, 231, 208, 0.28); border-radius: 999px; color: #9ff4e8; background: rgba(78, 231, 208, 0.08); font-size: 10px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.admin-access-badge .material-symbols-rounded { font-size: 16px; }
.admin-test-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: 18px; margin-top: 20px; }
.admin-test-form,
.admin-test-preview { min-width: 0; border: 1px solid var(--studio-border); border-radius: 16px; background: linear-gradient(155deg, rgba(16, 29, 50, 0.88), rgba(6, 15, 27, 0.94)); }
.admin-test-form { padding: 20px; }
.admin-test-gift-field { margin-top: 0; }
.admin-test-picker-row { align-items: stretch; gap: 9px; }
.admin-test-library-button { flex-basis: 54px; width: 54px; height: 54px; border-radius: 12px; }
.admin-test-library-button .material-symbols-rounded { font-size: 22px; }
.admin-test-gift-trigger { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 54px; padding: 7px 12px 7px 10px; border-radius: 12px; text-align: left; }
.admin-test-gift-trigger .cgs-img { flex: 0 0 auto; width: 38px; height: 38px; }
.admin-test-gift-trigger .cgs-img[hidden] { display: none; }
.admin-test-trigger-copy { display: grid; min-width: 0; gap: 3px; }
.admin-test-trigger-copy strong,
.admin-test-trigger-copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-test-trigger-copy strong { color: #eef2fb; font-size: 12px; font-weight: 800; }
.admin-test-trigger-copy small { color: #73829c; font-size: 9px; font-weight: 700; }
.admin-test-trigger-arrow { flex: 0 0 auto; margin-left: auto; color: #7686a2; font-size: 20px; }
.admin-test-quantity-block { margin-top: 18px; padding: 15px; border: 1px solid rgba(139, 124, 255, 0.14); border-radius: 13px; background: rgba(139, 124, 255, 0.04); }
.admin-test-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #d8dfec; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.admin-test-label-row small { color: #6f7f9a; font-size: 9px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.admin-test-quantity-row { display: grid; grid-template-columns: 46px minmax(90px, 1fr) 46px; gap: 8px; margin-top: 10px; }
.admin-test-quantity-row input { width: 100%; min-width: 0; height: 46px; border: 1px solid rgba(139, 124, 255, 0.28); border-radius: 10px; outline: none; color: #fff; background: #071321; font-size: 18px; font-weight: 850; text-align: center; }
.admin-test-quantity-row input:focus { border-color: rgba(78, 231, 208, 0.6); box-shadow: 0 0 0 3px rgba(78, 231, 208, 0.08); }
.admin-quantity-step { display: grid; place-items: center; height: 46px; padding: 0; border: 1px solid rgba(139, 124, 255, 0.22); border-radius: 10px; color: #c9c2ff; background: rgba(139, 124, 255, 0.08); cursor: pointer; }
.admin-quantity-step:hover { border-color: rgba(139, 124, 255, 0.45); background: rgba(139, 124, 255, 0.15); }
.admin-test-quick-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.admin-test-quick-counts button { min-height: 34px; border: 1px solid var(--studio-border); border-radius: 9px; color: #91a0b9; background: rgba(7, 19, 33, 0.78); font-size: 11px; font-weight: 800; cursor: pointer; }
.admin-test-quick-counts button:hover,
.admin-test-quick-counts button.is-active { color: #b8fff5; border-color: rgba(78, 231, 208, 0.35); background: rgba(78, 231, 208, 0.08); }
.admin-test-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 18px; font-size: 12px; font-weight: 850; }
.admin-test-submit .material-symbols-rounded { font-size: 20px; }
.admin-test-submit:disabled { cursor: wait; opacity: 0.65; }
.admin-test-status { min-height: 17px; margin: 9px 2px 0; color: #7f8da6; font-size: 10px; line-height: 1.45; }
.admin-test-status.is-success { color: #72e6d3; }
.admin-test-status.is-error { color: #ff879d; }
.admin-test-preview { display: flex; flex-direction: column; align-items: center; padding: 22px; text-align: center; }
.admin-preview-kicker { align-self: stretch; color: #65748f; font-size: 9px; font-weight: 850; letter-spacing: 0.12em; text-align: left; }
.admin-preview-art { display: grid; place-items: center; width: 150px; height: 150px; margin: 18px auto 12px; border: 1px solid rgba(139, 124, 255, 0.17); border-radius: 28px; background: radial-gradient(circle at 50% 35%, rgba(139, 124, 255, 0.22), rgba(7, 17, 31, 0.9) 70%); }
.admin-preview-art img { display: none; width: 118px; height: 118px; object-fit: contain; filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.38)); }
.admin-preview-art img.has-image { display: block; }
.admin-test-preview > strong { max-width: 100%; color: #f0f3fa; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-preview-coins { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: #ffc857; font-size: 11px; font-weight: 850; }
.admin-preview-coins .material-symbols-rounded { font-size: 15px; }
.admin-preview-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--studio-border); color: #7787a2; font-size: 10px; text-align: left; }
.admin-preview-summary + .admin-preview-summary { margin-top: 10px; padding-top: 0; border-top: 0; }
.admin-preview-summary strong { color: #dce4f3; font-size: 12px; text-align: right; }
.notification.is-test { border-color: rgba(78, 231, 208, 0.72); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(78, 231, 208, 0.08); }
.notification-test-badge { display: inline-flex; margin-bottom: 3px; padding: 2px 6px; border: 1px solid rgba(78, 231, 208, 0.3); border-radius: 999px; color: #a7fff2; background: rgba(78, 231, 208, 0.1); font-size: 8px; font-weight: 900; letter-spacing: 0.09em; }

/* Gifts library: flexible desktop-first layout, isolated from dashboard logic. */
#tab-gifts { min-height: calc(100dvh - 76px); padding: 20px 24px 28px; }
.gifts-page-panel { min-width: 0; padding: 22px 24px 26px; border-radius: var(--studio-radius-xl); overflow: hidden; }
.gifts-header { display: block; margin: 0; }
.gifts-titlebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--studio-border);
}
.gifts-title-copy { min-width: 0; }
.gifts-title-copy h2 { display: flex; align-items: center; gap: 9px; margin: 4px 0 0; color: var(--studio-text); font-size: 20px; letter-spacing: -0.025em; }
.gifts-title-copy h2 .material-symbols-rounded { color: #a99dff; font-size: 24px; }
.gifts-title-copy p { margin: 7px 0 0; color: var(--studio-muted); font-size: 11px; line-height: 1.5; }
.gifts-view-switch { display: inline-flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--studio-border); border-radius: 999px; background: #091424; }
.gifts-view-switch button { min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.gifts-view-switch .btn-primary { color: #fff; background: var(--studio-violet-strong); box-shadow: 0 8px 20px rgba(116, 100, 244, 0.22); }
.gifts-view-switch .btn-secondary { color: #9facbf; background: transparent; }

.gifts-controls { display: grid; grid-template-columns: minmax(180px, 0.75fr) minmax(190px, 0.8fr) minmax(280px, 1.45fr); gap: 12px; margin-top: 18px; }
.gifts-controls.is-favorites { grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 2.2fr); }
.gift-filter-field { display: grid; min-width: 0; gap: 7px; }
.gift-filter-field > span:first-child { color: #75839e; font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.gift-filter-field select,
.gift-search-control { width: 100%; min-width: 0; height: 44px; border: 1px solid var(--studio-border); border-radius: 11px; color: #dce4f2; background: #091424; }
.gift-filter-field select { padding: 0 34px 0 12px; }
.gift-search-control { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.gift-search-control .material-symbols-rounded { flex: 0 0 auto; color: #6f7f9f; font-size: 18px; }
.gift-search-control input { flex: 1 1 auto; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; color: #edf1fb; background: transparent; }
.gift-search-control input::placeholder { color: #61708d; }
.gift-filter-field select:hover,
.gift-search-control:hover { border-color: var(--studio-border-strong); }
.gift-filter-field:focus-within select,
.gift-search-control:focus-within { border-color: rgba(139, 124, 255, 0.55); box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.08); }

.gifts-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; margin-top: 13px; }
.gifts-hint { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; color: #8391aa; font-size: 10px; line-height: 1.4; }
.gifts-hint .material-symbols-rounded { flex: 0 0 auto; color: #ff7890; font-size: 15px; font-variation-settings: "FILL" 1; }
.gift-result-count { flex: 0 0 auto; padding: 5px 9px; border: 1px solid rgba(78, 231, 208, 0.16); border-radius: 999px; color: #94eadc; background: rgba(78, 231, 208, 0.055); font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }

#tab-gifts .gifts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; min-width: 0; margin-top: 16px; }
#tab-gifts .gift-card { display: grid; grid-template-rows: 78px minmax(32px, auto) auto; align-items: center; min-width: 0; min-height: 154px; padding: 13px 12px 12px; border: 1px solid var(--studio-border); border-radius: 14px; color: var(--studio-text); background: linear-gradient(155deg, rgba(19, 33, 58, 0.82), rgba(7, 17, 31, 0.92)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025); overflow: hidden; }
#tab-gifts .gift-card:hover { transform: translateY(-2px); border-color: rgba(139, 124, 255, 0.38); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 124, 255, 0.05); }
#tab-gifts .gift-card img { width: 72px; height: 72px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.32)); }
#tab-gifts .gift-card .gift-name { display: -webkit-box; min-width: 0; min-height: 34px; margin: 5px 0 3px; overflow: hidden; color: #edf1fb; font-size: 12px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#tab-gifts .gift-card .gift-coins { display: inline-flex; align-items: center; justify-content: center; min-width: 0; color: #ffc857; font-size: 11px; font-weight: 800; }
#tab-gifts .gift-fav-btn { top: 8px; right: 8px; width: 28px; height: 28px; border: 1px solid rgba(160, 180, 222, 0.12); color: #8593ad; background: rgba(5, 11, 21, 0.68); backdrop-filter: blur(8px); }
#tab-gifts .gift-fav-btn:hover,
#tab-gifts .gift-fav-btn.active { color: #ff7890; border-color: rgba(255, 120, 144, 0.3); background: rgba(255, 85, 112, 0.09); }
#tab-gifts .gift-card.favorited { border-color: rgba(255, 120, 144, 0.3); }
.gifts-load-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 8px; }
#tab-gifts .gifts-load-more-button { min-height: 40px; padding: 0 18px; border: 1px solid rgba(139, 124, 255, 0.28); border-radius: 10px; color: #c6beff; background: rgba(139, 124, 255, 0.08); font-size: 11px; font-weight: 750; }
#tab-gifts .gifts-load-more-button:hover { border-color: rgba(139, 124, 255, 0.5); background: rgba(139, 124, 255, 0.14); }
.gifts-empty-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 220px; padding: 32px; border: 1px dashed var(--studio-border); border-radius: 14px; color: var(--studio-muted); text-align: center; }
.gifts-empty-state .material-symbols-rounded { margin-bottom: 8px; color: #71809d; font-size: 32px; }
.app-footer { margin: 0; padding: 18px; border-top-color: var(--studio-border); background: var(--studio-bg-deep); }

@media (min-width: 1500px) {
    .studio-dashboard-grid { grid-template-columns: minmax(342px, 0.88fr) minmax(440px, 1.08fr) minmax(500px, 1.26fr); gap: 16px; }
    .live-overview { padding: 22px; }
    .chat-panel { min-height: 0; }
    .studio-control-column { gap: 12px; }
}

@media (min-width: 1101px) {
    #tab-dashboard.active { height: calc(100dvh - 76px); min-height: 0; padding: 14px 18px; overflow: hidden; }
    #tab-dashboard.active .studio-dashboard-grid { height: 100%; min-height: 0; align-items: stretch; }
    .studio-overview-column { height: 100%; min-height: 0; overflow-y: auto; padding-right: 2px; }
    .chat-col { position: static; top: auto; height: 100%; min-height: 0; overflow: hidden; }
    .studio-control-column { height: 100%; max-height: none; min-height: 0; overflow-y: auto; }
    body:has(#tab-dashboard.active) .app-footer { display: none; }
}

@media (max-width: 1280px) {
    .studio-header { grid-template-columns: 180px auto minmax(260px, 1fr); padding-inline: 16px; }
    .studio-header .tab-nav { min-width: 360px; }
    .studio-header .tab-btn { padding-inline: 12px; }
    .notification-button { display: none; }
    .studio-dashboard-grid { grid-template-columns: 300px minmax(330px, 1fr) minmax(400px, 1.12fr); gap: 10px; }
    .tab-content { padding: 12px; }
    .profile-dock { grid-template-columns: 1fr; gap: 8px; }
    .profile-dock-heading small { display: none; }
    .profile-actions select { flex-basis: 130px; }
}

@media (max-width: 1100px) {
    .studio-header { grid-template-columns: auto 1fr auto; }
    .brand-copy { display: none; }
    .studio-header .tab-nav { justify-self: center; min-width: 360px; }
    .studio-dashboard-grid { grid-template-columns: minmax(300px, 0.9fr) minmax(390px, 1.1fr); }
    .studio-control-column { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
    .studio-control-heading { grid-column: 1 / -1; }
    .profile-panel { align-self: start; }
    .chat-col { position: static; min-height: 720px; }
}

@media (max-width: 1000px) {
    .gifts-titlebar { grid-template-columns: 1fr; gap: 14px; }
    .gifts-view-switch { justify-self: start; }
    .gifts-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gift-search-field { grid-column: 1 / -1; }
}

/* Phase 2: touch-first phone layout. Desktop rules above stay unchanged. */
@media (max-width: 768px) {
    :root {
        --mobile-page-gap: 12px;
        --mobile-control-height: 44px;
    }

    body {
        padding: 0;
        font-size: 16px;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .container { overflow-x: clip; }

    .studio-header {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "brand controls"
            "tabs tabs";
        gap: 8px 10px;
        min-height: 0;
        padding: 9px 12px 8px;
        padding-top: max(9px, env(safe-area-inset-top));
        background: rgba(5, 11, 21, 0.97);
    }

    .brand-lockup { grid-area: brand; gap: 7px; }
    .brand-mark { font-size: 30px; }
    .brand-copy { display: grid; }
    .brand-copy strong { font-size: 13px; letter-spacing: 0.01em; }
    .brand-copy small { display: none; }

    .header-right {
        grid-area: controls;
        justify-self: end;
        width: auto;
        min-width: 0;
        gap: 6px;
    }

    .status-panel {
        min-height: 36px;
        padding: 4px 9px;
        gap: 6px;
        border-radius: 10px;
    }
    .status-panel .status-dot { width: 6px; height: 6px; }
    .status-copy strong { font-size: 10px; letter-spacing: 0.055em; }
    .status-copy small { display: none; }
    .notification-button { display: none; }

    .account-menu summary {
        min-height: 36px;
        width: 38px;
        padding: 3px;
        justify-content: center;
        border-radius: 10px;
    }
    .account-avatar { width: 30px; height: 30px; border-radius: 8px; }
    #user-display-name,
    #user-plan-badge,
    .account-chevron { display: none; }
    .account-popover {
        position: fixed;
        top: calc(max(9px, env(safe-area-inset-top)) + 44px);
        right: 12px;
        width: min(264px, calc(100vw - 24px));
        min-width: 0;
    }

    .studio-header .tab-nav {
        grid-area: tabs;
        justify-self: stretch;
        width: 100%;
        min-width: 0;
        padding: 3px;
        gap: 2px;
        border-radius: 14px;
        overflow: hidden;
    }
    .studio-header .tab-btn {
        min-width: 0;
        min-height: 42px;
        padding: 0 7px;
        gap: 6px;
        border-radius: 11px;
        font-size: 12px;
    }
    .studio-header .tab-btn .material-symbols-rounded { font-size: 18px; }

    .tab-content,
    #tab-gifts,
    #tab-dev-test,
    #tab-history {
        width: 100%;
        max-width: none;
        padding: 10px 12px 24px;
    }
    #tab-dashboard { min-height: 0; }

    .studio-dashboard-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--mobile-page-gap);
        width: 100%;
    }
    .studio-overview-column,
    .chat-col,
    .studio-control-column {
        width: 100%;
        min-width: 0;
    }
    .studio-overview-column { gap: var(--mobile-page-gap); }

    .live-overview {
        padding: 15px;
        border-radius: 18px;
        background-position: 52% center;
    }
    .live-kicker { font-size: 12px; }
    .live-overview-title-row { margin-top: 8px; }
    .live-overview h1 { font-size: 24px; }
    .connect-stats-row { margin-top: 11px; }
    .connect-bar-mini {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        gap: 5px;
        padding: 4px !important;
        border-radius: 12px;
    }
    .connect-bar-mini > .material-symbols-rounded { margin-left: 5px; }
    .connect-bar-mini input {
        width: 100%;
        min-height: 42px;
        height: 42px;
        font-size: 16px;
    }
    .connect-bar-mini button {
        min-width: 42px;
        min-height: 42px;
        height: 42px;
        padding-inline: 10px;
    }
    .connect-bar-mini .icon-button { width: 42px; min-width: 42px; }

    .live-orbit {
        width: 174px;
        height: 174px;
        margin: 14px auto;
        border-width: 7px;
    }
    .live-orbit-core { width: 146px; }
    .orbit-status { min-height: 29px; padding: 5px 10px; font-size: 11px; }
    .live-orbit strong { width: 136px; max-width: 136px; font-size: 22px; }

    .finance-grid { gap: 7px; }
    .finance-grid .stat-card {
        min-height: 96px;
        padding: 10px 5px;
        border-radius: 12px;
    }
    .finance-grid .card-usd { min-height: 96px; }
    .finance-grid .stat-icon { font-size: 21px; }
    .finance-grid .stat-label { font-size: 9px; line-height: 1.25; }
    .finance-grid .stat-value { font-size: clamp(15px, 4.7vw, 18px); }
    .finance-grid .stat-sub { font-size: 8px; }

    .live-overview .stats-grid-compact {
        margin-top: 9px;
        padding: 8px 0;
    }
    .live-overview .stat-compact {
        min-width: 0;
        min-height: 50px;
        padding: 2px !important;
    }
    .live-overview .stat-compact-label { display: none; }
    .live-overview .stat-compact .material-symbols-rounded { font-size: 18px; }
    .live-overview .stat-compact strong { font-size: 14px; }

    .session-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .session-toggles .toggle-pill-label {
        justify-content: center;
        width: 100%;
        min-height: 42px;
        padding-inline: 7px;
    }

    .leaderboard {
        min-height: 0;
        padding: 15px;
        border-radius: 15px;
    }
    .leaderboard li { min-height: 43px; padding-block: 9px; }

    .chat-col {
        position: static;
        display: grid;
        grid-template-rows: repeat(2, 390px);
        gap: var(--mobile-page-gap);
        min-height: 0;
    }
    .chat-panel,
    .queue-panel {
        width: 100%;
        height: 390px;
        min-height: 390px;
        border-radius: 15px;
    }
    .chat-toolbar { padding: 14px; gap: 12px; }
    .chat-heading { flex-basis: 100%; }
    .chat-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 7px;
    }
    .chat-actions .toggle-pill,
    .chat-actions .toggle-pill-label { width: 100%; }
    .chat-actions .toggle-pill-label {
        justify-content: center;
        min-height: 40px;
        padding-inline: 8px;
    }
    .chat-select {
        width: 100%;
        min-width: 0;
        height: 40px;
        font-size: 12px;
    }
    .chat-messages { padding: 5px 12px 8px; }
    .chat-msg {
        grid-template-columns: minmax(84px, 0.7fr) minmax(0, 1.45fr);
        gap: 8px;
        padding: 9px 4px;
        font-size: 12px;
        line-height: 1.45;
    }
    .chat-msg-user { font-size: 11.5px; }
    .chat-statusbar { padding: 9px 12px; font-size: 10px; }
    .chat-statusbar > span:last-child { display: none; }

    .queue-panel { padding: 14px; }
    .queue-header { gap: 9px; }
    .queue-time-summary {
        min-height: 44px;
        height: auto;
        padding: 7px 10px;
        white-space: normal;
        line-height: 1.4;
    }
    .queue-transport { align-items: stretch; flex-direction: column; gap: 5px; }
    .queue-pause-button { width: 100%; min-height: 42px; }
    #queue-pause-note { text-align: center; white-space: normal; }
    #audio-queue-list { margin-top: 9px; }
    .queue-item { min-height: 46px; }

    .studio-control-column {
        display: flex;
        flex-direction: column;
        gap: var(--mobile-page-gap);
        max-height: none;
        padding: 0;
        overflow: visible;
    }
    .studio-control-heading { min-height: 52px; padding: 4px 2px; }
    .studio-control-heading .panel-save-button {
        min-height: var(--mobile-control-height);
        padding-inline: 13px;
    }

    .bgm-panel,
    .gift-effects-panel,
    .profile-panel { padding: 14px; border-radius: 15px; }
    .profile-dock {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }
    .profile-dock-icon { width: 38px; height: 38px; }
    .profile-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
        gap: 7px;
    }
    .profile-actions select,
    .profile-actions button {
        min-height: var(--mobile-control-height);
        height: var(--mobile-control-height);
        font-size: 12px;
    }

    .section-heading h2,
    .studio-control-heading h2,
    .chat-heading h2 { font-size: 17px; }
    .section-heading h2 .material-symbols-rounded,
    .chat-heading h2 .material-symbols-rounded { font-size: 21px; }
    .section-heading-actions { gap: 6px; }
    .always-on-badge { padding: 5px 7px; font-size: 9px; }
    .info-disclosure summary { width: 34px; height: 34px; }
    .info-popover {
        position: fixed;
        top: calc(max(9px, env(safe-area-inset-top)) + 102px);
        right: 12px !important;
        left: 12px !important;
        width: auto;
        max-height: calc(100dvh - 126px);
        overflow-y: auto;
    }

    .now-playing-card {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px;
        padding: 9px;
    }
    .album-art { width: 64px; height: 64px; }
    #bgm-select { height: 40px; font-size: 12px; }
    .bgm-controls { gap: 7px; }
    .bgm-controls button {
        flex: 1;
        min-height: 40px;
        padding-inline: 8px;
    }
    .volume-row {
        grid-template-columns: minmax(110px, auto) minmax(0, 1fr) 36px;
        gap: 7px;
    }
    .volume-row label { font-size: 11px; }
    .upload-btn-ui { min-height: var(--mobile-control-height); font-size: 12px; }

    .gift-volume-row { padding: 9px; }
    #gift-audio-container { gap: 10px; }
    .audio-row,
    .audio-row.is-rescue-rule {
        grid-template-columns: minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
        border-radius: 13px;
        overflow: visible;
    }
    .audio-col > label { margin-bottom: 6px; font-size: 10px; }
    .gift-selector-row { gap: 7px; }
    .btn-open-library {
        flex-basis: var(--mobile-control-height);
        width: var(--mobile-control-height);
        height: var(--mobile-control-height);
    }
    .cgs-trigger,
    .audio-col select,
    .audio-col input[type="text"] {
        min-height: var(--mobile-control-height);
        height: var(--mobile-control-height);
        padding-inline: 11px;
        font-size: 13px;
    }
    .fixed-audio-panel,
    .random-audio-panel,
    .rescue-audio-panel {
        padding: 10px;
        border-radius: 10px;
    }
    .audio-picker-row { gap: 7px; }
    .btn-play-test {
        width: var(--mobile-control-height);
        min-width: var(--mobile-control-height);
        min-height: var(--mobile-control-height);
        height: var(--mobile-control-height);
    }
    .random-controls-grid { gap: 9px; }
    .playlist-picker-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .btn-add-playlist-track { min-height: 42px; }
    .random-playlist { max-height: 230px; gap: 6px; }
    .playlist-track {
        grid-template-columns: 26px minmax(0, 1fr) 40px 40px;
        min-height: 46px;
        gap: 6px;
        padding: 4px 6px;
    }
    .playlist-track-play,
    .playlist-track-remove {
        width: 40px;
        height: 40px;
    }
    .random-upload-control .upload-btn-ui { min-height: 42px; }

    .rescue-mode-title { min-height: 34px; font-size: 13px; }
    .rescue-mode-title .info-disclosure summary,
    .compact-field-title .info-disclosure summary { width: 34px; height: 34px; }
    .rescue-gift-map { gap: 7px; }
    .rescue-gift-box { min-height: 70px; padding: 8px; }
    .rescue-gift-box > span { font-size: 9px; }
    .rescue-gift-box strong { font-size: 12px; }
    .rescue-target-box select { min-height: 38px; height: 38px; font-size: 12px; }
    .rescue-count-field { gap: 6px 8px; }
    .rescue-count-control { gap: 7px; }
    .rescue-subtract-count,
    .rescue-use-suggestion { min-height: 42px; height: 42px; font-size: 12px; }
    .rescue-suggestion-copy {
        font-size: 10px;
        text-align: left;
        white-space: normal;
    }
    .rescue-equation { min-height: 42px; padding: 7px 9px; }
    .rescue-sound-field { gap: 7px; padding-top: 9px; }
    .rescue-sound-field .audio-picker-row {
        grid-template-columns: minmax(0, 1fr) 44px 44px;
        gap: 7px;
    }
    .rescue-audio-preview,
    .rescue-upload-control,
    .rescue-upload-control .upload-btn-ui {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }
    .audio-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }
    .audio-actions .btn-sm {
        width: 100%;
        min-height: var(--mobile-control-height);
        font-size: 12px;
    }
    .btn-add-effect { min-height: 46px; font-size: 13px; }

    .gifts-page-panel {
        padding: 16px;
        border-radius: 18px;
    }
    .gifts-titlebar { gap: 14px; padding-bottom: 15px; }
    .gifts-title-copy h2 { font-size: 18px; line-height: 1.3; }
    .gifts-title-copy p { font-size: 11px; }
    .gifts-view-switch { display: flex; width: 100%; }
    .gifts-view-switch button { flex: 1; min-width: 0; min-height: 42px; padding-inline: 8px; }
    .gifts-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
    .gift-filter-field select,
    .gift-search-control { height: var(--mobile-control-height); }
    .gifts-meta-row { margin-top: 11px; }
    #tab-gifts .gifts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 14px;
    }
    #tab-gifts .gift-card {
        grid-template-rows: 68px minmax(34px, auto) auto;
        min-height: 148px;
        padding: 11px 8px 10px;
        border-radius: 13px;
    }
    #tab-gifts .gift-card img { width: 64px; height: 64px; }
    #tab-gifts .gift-card .gift-name { font-size: 11px; }
    #tab-gifts .gift-fav-btn { width: 36px; height: 36px; }

    #tab-history > .glass-panel {
        min-height: 360px;
        padding: 18px !important;
        border-radius: 18px;
    }
    #tab-history .title-with-info { align-items: flex-start; gap: 9px; }
    #tab-history .title-with-info h2 { font-size: 20px; line-height: 1.35; }
    .admin-test-page { padding: 18px; border-radius: 18px; }
    .admin-test-layout { grid-template-columns: 1fr; }
    .admin-test-preview { min-height: 300px; }
    .history-header { align-items: flex-start; }
    .history-actions { width: 100%; }
    .history-actions button { flex: 1; min-height: 42px; }
    .history-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .modal-overlay { padding: 12px; }
    .modal-content {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 24px);
        padding: 16px !important;
        overflow-y: auto;
    }
    .modal-content input,
    .modal-content select,
    .modal-content button { min-height: 44px; }

    #notification-area {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0));
        left: 12px;
    }
    .app-footer {
        padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0));
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .studio-header { padding-inline: 10px; }
    .brand-copy strong { font-size: 12px; }
    .status-panel { padding-inline: 7px; }
    .studio-header .tab-btn { gap: 4px; padding-inline: 4px; font-size: 11px; }
    .tab-content,
    #tab-gifts,
    #tab-dev-test,
    #tab-history { padding-inline: 10px; }
    .admin-test-header { align-items: flex-start; }
    .admin-test-form { padding: 15px; }
    .admin-test-library-button { flex-basis: var(--mobile-control-height); width: var(--mobile-control-height); height: 54px; }
    .admin-test-gift-trigger { min-height: 54px; }
    .admin-preview-art { width: 132px; height: 132px; }
    .admin-preview-art img { width: 104px; height: 104px; }
    .live-overview { padding: 13px; }
    .connect-bar-mini button { padding-inline: 8px; }
    .finance-grid .stat-label { font-size: 8px; }
    .finance-grid .stat-sub { font-size: 7.5px; }
    .section-heading-actions .always-on-badge { display: none; }
    .volume-row { grid-template-columns: minmax(94px, auto) minmax(0, 1fr) 32px; }
    .rescue-gift-map { grid-template-columns: 1fr; }
    .rescue-map-arrow { justify-self: center; transform: rotate(90deg); }
    .rescue-count-control { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
}

@media (hover: none) and (pointer: coarse) {
    .studio-header .tab-btn:hover,
    #tab-gifts .gift-card:hover { transform: none; }
    button,
    summary,
    select,
    input[type="range"],
    label.custom-file-upload { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Responsive fixes (2026-09-19): chống tràn ô trên màn laptop nhỏ
   và mọi cỡ màn. Chỉ BỔ SUNG cuối file, không sửa rule cũ.
   ============================================================ */

/* Nhãn ô "Thu nhập (VND/USD)" bị cắt khi cột trái hẹp (layout 3 cột ≥1101px).
   Cho xuống dòng thay vì cắt chữ — an toàn ở mọi cỡ (khi đủ rộng vẫn 1 dòng). */
.finance-grid .stat-label {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.2;
    word-break: break-word;
}
.finance-grid .stat-card { min-height: 100px; }

/* Toast thông báo không được đè header: hạ xuống dưới header, giới hạn bề rộng,
   cho nội dung dài xuống dòng thay vì tràn. */
.toast-container { top: 88px; right: 20px; max-width: min(380px, calc(100vw - 32px)); }
.toast { max-width: 100%; white-space: normal; word-break: break-word; }
@media (max-width: 600px) {
    .toast-container { top: 72px; left: 12px; right: 12px; max-width: none; }
}

/* DBO LIVE LAB — entry to the LIVE Simulator (Phòng tập) */
.studio-header .tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #fe2c55, #ff6a88);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(254, 44, 85, 0.28);
    transition: transform 160ms ease;
}
.studio-header .tab-link:hover { transform: translateY(-1px); }
.studio-header .tab-link .material-symbols-rounded { font-size: 19px; }
@media (max-width: 900px) {
    .studio-header .tab-link { min-width: 0; min-height: 42px; padding: 0 7px; gap: 6px; border-radius: 11px; font-size: 12px; }
}

/* DBO LIVE LAB: gift set switch (Quà TikTok | Quà DBO) */
.gift-set-toggle { display: flex; align-items: center; gap: 6px; margin: 10px 0 12px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.gift-set-toggle[hidden] { display: none; }
.gift-set-label { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; color: var(--studio-muted, #94a3b8); font-size: 12px; font-weight: 700; white-space: nowrap; }
.gift-set-label .material-symbols-rounded { font-size: 16px; }
.gift-set-toggle button { flex: 1; min-height: 32px; border: 0; border-radius: 9px; background: transparent; color: #cbd5e1; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.gift-set-toggle button:hover { background: rgba(255, 255, 255, 0.06); }
.gift-set-toggle button.is-active { background: linear-gradient(135deg, #7c5cff, #5b8cff); color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35); }
.gift-set-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.12); font-size: 11px; line-height: 17px; }
