:root {
    color-scheme: light;
    --bg: #fff;
    --border: #e9dfcf;
    --text: #242426;
    --text2: #5d5d64;
    --ink: #18181b;
    --gold-ink: #76511f;
    --gold: #a67b3e;
    --gold-soft: #f7edda;
    --surface-hover: #faf5e9;
    --field-border: #d9c8ad;
    --red: #b72f41;
    --shadow: 0 8px 24px #18181b16;
    color: var(--text);
    background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, select, input, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.studio-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    transition: transform .2s ease;
}
.studio-header[data-scroll-hidden]:has(.studio-nav:not([hidden])):not(:has(:focus-visible)) {
    transform: translateY(-100%);
}
@media (prefers-reduced-motion: reduce) {
    .studio-header { transition: none; }
}
.header-content { max-width: 1440px; margin: auto; padding: 4px 32px; display: flex; align-items: center; justify-content: flex-start; gap: clamp(18px, 3vw, 46px); min-height: 74px; }
.studio-brand { display: inline-flex; align-items: center; flex: none; gap: 8px; text-decoration: none; }
.studio-brand-art { position: relative; display: block; width: 156px; height: 69px; overflow: hidden; }
.studio-brand-logo { position: absolute; top: 50%; left: 50%; display: block; width: 100%; height: auto; transform: translate(calc(-50% - 1px), -50%); }
.studio-brand-caption {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--field-border);
    color: var(--gold-ink);
    font: italic 800 .875rem/1 var(--site-font);
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
}
.studio-nav { display: flex; align-items: center; gap: 5px; }
.studio-nav a { color: var(--text2); font-size: .875rem; font-weight: 650; white-space: nowrap; padding: 11px 15px; border-radius: 4px; text-decoration: none; }
.studio-nav a:hover, .studio-nav a[aria-current] { color: var(--gold-ink); }
.studio-nav a[aria-current] { background: linear-gradient(var(--gold), var(--gold)) center bottom 4px / 22px 2px no-repeat; }
.header-actions { display: flex; align-items: center; margin-inline-start: auto; gap: 10px; min-width: 0; }
.theme-toggle { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; color: var(--gold-ink); background: transparent; font-size: 1.3rem; line-height: 1; }
.theme-toggle:hover { background: var(--gold-soft); }
.theme-sun, .theme-toggle[aria-pressed="true"] .theme-moon { display: none; }
.theme-toggle[aria-pressed="true"] .theme-sun { display: block; }
.user-info { display: flex; align-items: center; justify-content: flex-end; min-width: 0; gap: 10px; }
.user-avatar, .profile-avatar { display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; }
.user-avatar { width: 34px; height: 34px; font-size: .85rem; background: var(--gold-soft); color: var(--gold-ink); }
.user-name { min-width: 0; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 600; }
.logout-btn { flex: none; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text2); font-size: .84rem; }
.logout-btn:hover { color: var(--gold-ink); border-color: var(--gold); }
.container { max-width: 1440px; margin: 0 auto; padding: 28px 32px 52px; }
.dashboard, .permission-denied { display: none; }
.dashboard.active { display: block; }
.studio-pane { min-width: 0; }
.studio-card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 18px; }
.studio-hero { position: relative; overflow: hidden; border-radius: 20px;
    border: 1px solid var(--border); padding: 29px 38px 31px; min-height: 228px; color: var(--ink); margin-bottom: 22px; }
.pitch-drawing {
    --pitch-line: 2px solid #a67b3e50;
    position: absolute;
    inset: -30px -32px -40px auto;
    width: 49%;
    min-width: 300px;
    border: var(--pitch-line);
    border-radius: 12px;
    background: linear-gradient(90deg, transparent 25%, #a67b3e0d 25% 75%, transparent 75%) center / 128px 100% repeat-x;
    transform: rotate(-14deg) skewX(-8deg);
    mask-image: linear-gradient(90deg, transparent, black 37%);
}
.pitch-drawing::before, .pitch-drawing::after { content: ""; position: absolute; left: 50%; }
.pitch-drawing::before { inset-block: 0; border-left: var(--pitch-line); transform: translateX(-50%); }
.pitch-drawing::after { top: 50%; width: 112px; aspect-ratio: 1; border: var(--pitch-line); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch-drawing span { position: absolute; inset-block: 25%; width: 19%; border: var(--pitch-line); }
.pitch-drawing span:first-child { left: 0; }
.pitch-drawing span:last-child { right: 0; }
.hero-content { position: relative; }
.hero-kicker { display: flex; align-items: center; gap: 9px; color: var(--gold-ink); font-weight: 750; font-size: .72rem; letter-spacing: .14em; }
.hero-kicker span { width: 7px; height: 7px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.studio-hero h1 { font: 800 clamp(2.45rem, 4.4vw, 3.45rem)/1.05 var(--site-font); margin: 8px 0 9px; }
.hero-content > p:nth-of-type(2) { color: var(--text2); max-width: 34ch; line-height: 1.5; margin-bottom: 18px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.32fr) minmax(298px, 1fr); gap: 20px; align-items: start; }
.overview-aside { display: grid; gap: 20px; }
.card-heading, .chart-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-heading h2, .profile-card h2, .calendar-card h2 { font: 800 1.38rem/1.15 var(--site-font); }
.card-heading p, .chart-header p { color: var(--text2); font-size: .84rem; margin-top: 5px; line-height: 1.45; }
.text-link { font-size: .875rem; color: var(--gold-ink); font-weight: 700; text-underline-offset: 3px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.stat-card, .session-stats > div { padding: 15px; min-width: 0; }
.stat-card + .stat-card, .session-stats > div + div { border-inline-start: 1px solid var(--border); }
.stat-label, .session-stats span { display: block; color: var(--text2); font-size: .875rem; font-weight: 550; }
.stats-grid .stat-label, .calendar-title { display: flex; align-items: center; gap: 8px; }
.overview-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--gold-soft); color: var(--gold-ink); }
.overview-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.stat-value, .session-stats strong { display: inline-block; color: var(--ink); font: 800 clamp(1.55rem, 3vw, 2rem)/1 var(--site-font); margin: 7px 0 2px; font-variant-numeric: tabular-nums; }
.stat-card small { display: inline-block; margin-inline-start: 6px; font-size: .74rem; color: var(--text2); }
.chart-header { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.chart-header h3 { font-size: 1rem; }
.activity-chart { margin-top: 14px; min-height: 132px; }
.chart-plot { height: 126px; display: grid; align-items: end; gap: 5px; padding: 6px 4px 0; background: repeating-linear-gradient(to top, var(--border) 0 1px, transparent 1px 33.333%); }
.chart-bar { display: block; justify-self: center; width: 70%; max-width: 40px; min-height: 2px; background: var(--gold); border-radius: 5px 5px 0 0; }
.chart-bar[data-zero] { background: var(--field-border); }
.chart-labels { display: flex; justify-content: space-between; color: var(--text2); font-size: .73rem; padding-top: 8px; }
.chart-empty { display: grid; min-height: 132px; place-items: center; color: var(--text2); border: 1px dashed var(--border); border-radius: 8px; font-size: .875rem; }
.chart-legend, .calendar-legend { display: flex; align-items: center; gap: 7px; color: var(--text2); font-size: .75rem; margin-top: 12px; }
.chart-legend span, .calendar-legend span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.profile-header { display: flex; gap: 12px; align-items: center; min-width: 0; }
.profile-header > div { min-width: 0; }
.profile-avatar { width: 49px; height: 49px; font: 800 1.45rem var(--site-font); }
.profile-header p { color: var(--text2); margin-top: 4px; font-size: .875rem; overflow-wrap: anywhere; }
.profile-card dl { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.profile-card dl div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .875rem; }
.profile-card dt { color: var(--text2); }
.profile-card dd { font-weight: 750; }
.profile-status { color: var(--text2); }
.profile-status[data-live="true"] { color: #963141; }
.calendar-heading { margin: 15px 0 7px; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.calendar-heading strong { font-size: .865rem; }
.calendar-actions { display: flex; gap: 5px; }
.calendar-actions button { border: 1px solid var(--border); background: #fff; color: var(--text2); border-radius: 6px; font-size: .76rem; padding: 5px 7px; }
.calendar-actions button:hover { color: var(--gold-ink); background: var(--surface-hover); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; text-align: center; font-size: .805rem; }
.calendar-grid span { display: grid; place-items: center; position: relative; min-height: 30px; border-radius: 6px; }
.calendar-weekday { font-weight: 600; color: var(--text2); font-size: .72rem; }
.calendar-day[aria-current="date"] { background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; }
.calendar-day[data-broadcasts]::after { content: ""; position: absolute; bottom: 2px; width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }

.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 1px 0 22px; }
.page-heading h1 { font: 800 clamp(2rem, 4vw, 2.9rem)/1.1 var(--site-font); }
.page-heading p { color: var(--text2); margin-top: 6px; line-height: 1.5; }
.live-banner { display: flex; align-items: center; gap: 7px; flex: none; border: 1px solid var(--border); border-radius: 99px; color: var(--text2); background: #fff; padding: 7px 11px; font-size: .82rem; font-weight: 700; }
.live-banner.active { background: #fbe8eb; color: var(--red); border-color: #f0c4cd; }
.live-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--text2); }
.live-banner.active .live-indicator { background: currentColor; }
.control-grid { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(330px,1fr); gap: 20px; align-items: start; }
.monitor-column { min-width: 0; }
.studio-sidebar { display: grid; gap: 14px; min-width: 0; }
.studio-chat { padding: 20px; }
.studio-chat-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.studio-chat-heading h2 { font: 800 1.38rem/1.15 var(--site-font); }
.studio-chat-indicator { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-ink); font-size: .8rem; font-weight: 650; }
.studio-chat-indicator span { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }
.studio-chat-feed { height: clamp(240px, 42vh, 430px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 10px; }
.studio-chat-empty { padding: 46px 12px; color: var(--text2); text-align: center; font-size: .875rem; }
.studio-chat-list { list-style: none; padding: 0; margin: 0; }
.studio-chat-list li { padding: 10px 12px; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.45; }
.studio-chat-list li + li { border-top: 1px solid var(--border); }
.studio-chat-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--gold-ink); }
.studio-chat-meta span { color: var(--text2); flex: none; font-size: .75rem; }
.studio-chat-list p { margin-top: 3px; white-space: pre-wrap; }
.studio-chat-notice { margin-top: 8px; color: var(--text2); font-size: .82rem; }
.monitor-header, .monitor-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.monitor-header { margin-bottom: 12px; }
.monitor-header h2 { font-size: .95rem; }
.monitor-header > span { font-size: .77rem; color: var(--gold-ink); padding: 5px 8px; border: 1px solid var(--field-border); border-radius: 6px; }
.monitor-header .monitor-source-action { min-height: 34px; padding: 5px 9px; font-size: .8rem; }
.monitor-header .monitor-source-action:hover:not(:disabled) { background: var(--gold-soft); }
.monitor-frame { aspect-ratio: 16/9; position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.monitor-placeholder, .broadcast-preview { position: absolute; inset: 0; width: 100%; height: 100%; }
.broadcast-preview { object-fit: contain; background: #100e0b; }
.monitor-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 7px; }
.monitor-placeholder strong { font-size: .95rem; }
.monitor-placeholder > span:last-child { font-size: .8rem; color: var(--text2); }
.monitor-glyph { width: 37px; height: 25px; color: var(--gold); border: 2px solid currentColor; border-radius: 5px; margin-bottom: 8px; position: relative; }
.monitor-glyph::after { content: ""; position: absolute; width: 16px; border-top: 2px solid currentColor; left: 50%; bottom: -7px; transform: translateX(-50%); }
.monitor-footer { min-height: 41px; margin-top: 8px; }
.monitor-footer > span { color: var(--text2); flex: none; font-size: .77rem; }
.broadcast-status { color: var(--text2); font-size: .85rem; line-height: 1.4; }
.broadcast-status[data-state="live"] { color: var(--gold-ink); }
.broadcast-status[data-state="stop-error"] { color: var(--red); }
.session-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; border-block-start: 1px solid var(--border); }
.broadcast-setup { min-width: 0; padding: 4px 0 0 20px; border-inline-start: 1px solid var(--border); }
#pane-golive .page-heading { flex-wrap: wrap; }
#pane-golive h2 { font-weight: 700; }
#pane-golive .session-stats strong { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.025em; }
.studio-select { position: relative; }
.chart-header .studio-select { min-inline-size: 9rem; }
.studio-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--field-border); border-radius: 6px; background: transparent; color: var(--text); font-size: .875rem; font-weight: 500; text-align: start; }
.studio-select-trigger::after { flex: none; width: 7px; height: 7px; margin-inline-end: 3px; border: solid var(--text2); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); content: ""; }
.studio-select-trigger[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.studio-select-options { position: absolute; z-index: 2; inset: calc(100% + 4px) 0 auto; display: grid; gap: 2px; padding: 4px; border: 1px solid var(--field-border); border-radius: 7px; background: var(--bg); box-shadow: var(--shadow); }
.studio-select-options button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 7px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: .875rem; text-align: start; }
.studio-select-options button[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; }
.studio-select-options button:hover { background: var(--surface-hover); }
.studio-select-options button:focus-visible { outline-offset: -2px; }
.studio-select-options button[aria-pressed="true"]::after { flex: none; width: 6px; height: 10px; margin-inline-end: 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-1px) rotate(45deg); content: ""; }
.gl-gp { border: 1px solid var(--border); border-radius: 8px; padding: 8px 9px; color: var(--text2); background: transparent; font-size: .875rem; font-weight: 680; }
.gl-gp.active { border-color: var(--field-border); background: var(--gold-soft); color: var(--gold-ink); }
.form-group { display: grid; gap: 6px; margin-bottom: 13px; min-width: 0; }
.form-label { font-size: .875rem; font-weight: 700; }
.form-label span { color: var(--red); }
.form-input, .form-textarea { width: 100%; min-width: 0; border: 1px solid var(--field-border); border-radius: 8px; padding: 9px 10px; color: var(--text); background: transparent; font-size: 1rem; }
.form-textarea { resize: vertical; min-height: 70px; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text2); }
.broadcast-hint { color: var(--text2); line-height: 1.55; font-size: .875rem; }
.broadcast-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; margin-top: 10px; padding-top: 6px; border-block-start: 1px solid var(--border); }
.studio-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 7px; border: 0; color: var(--text); background: transparent; text-align: start; font-weight: 500; }
.switch-track { display: flex; align-items: center; flex: none; width: 30px; height: 17px; padding: 2px; border-radius: 20px; background: #777780; }
.switch-track::after { content: ""; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.studio-switch[aria-checked="true"] .switch-track { justify-content: flex-end; background: var(--gold); }
.broadcast-setup :is(.form-label, .btn) { font-weight: 600; }
.control-label { display: inline-flex; align-items: center; gap: 5px; }
.control-icon { width: 15px; height: 15px; flex: none; color: var(--gold-ink); fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.session-stats .control-label { display: flex; font-weight: 650; color: var(--text); }
.go-live-actions .btn-live { gap: 6px; }
.go-live-actions .btn-live .control-icon { color: inherit; }
.broadcast-encoding { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding-block-start: 4px; border-block-start: 1px solid var(--border); }
.go-live-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.go-live-actions > .btn-live, .go-live-actions > .btn-stop { flex: 1 1 auto; }
.go-live-actions .connect-notice { display: inline-flex; align-items: center; gap: 6px; flex: 1 0 auto; min-height: 34px; color: var(--gold-ink); font-size: .88rem; font-weight: 750; }
.broadcast-setup .go-live-actions { justify-content: flex-end; }
.broadcast-setup .go-live-actions > .btn-live { flex: none; min-width: 112px; }
.btn, .login-btn, .contact-btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 9px 13px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: .875rem; line-height: 1.25; }
.btn-hero, .btn-live, .login-btn, .contact-btn {
    background: linear-gradient(110deg, #f4e4c2, #e8c58a);
    color: #38250e;
    border-color: #d7b579;
}
.btn-stop { background: #a2293c; color: #fff; }
.btn-preview { color: var(--gold-ink); background: transparent; border-color: var(--field-border); }
.btn:hover, .login-btn:hover, .contact-btn:hover { filter: brightness(.96); }
.rtmp-connection { border-block-start: 1px solid var(--border); }
.rtmp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-block-end: 1px solid var(--border); }
.rtmp-field { display: grid; min-width: 0; gap: 4px; }
.rtmp-label { font-size: .78rem; font-weight: 650; color: var(--text2); }
.rtmp-field code { color: var(--text); font-family: inherit; font-size: .82rem; overflow-wrap: anywhere; }
.rtmp-actions, .rtmp-tools { display: flex; align-items: center; gap: 5px; }
.rtmp-tools { justify-content: flex-end; flex-wrap: wrap; padding-block-start: 3px; }
.copy-btn, .rtmp-link { min-height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--gold-ink); font-size: .8rem; font-weight: 600; padding: 5px 8px; }
.copy-btn { box-shadow: inset 0 0 0 1px var(--field-border); }
.rtmp-link:hover:not(:disabled), .copy-btn:hover:not(:disabled) { background: var(--gold-soft); }
.rtmp-help { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px; margin-top: 4px; }
.rtmp-help:has(> div:not([hidden]) details[open]) { grid-template-columns: minmax(0, 1fr); }
.rtmp-help > .rtmp-link { justify-self: end; }
.gl-guide-box > summary { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: .8rem; font-weight: 650; color: var(--gold-ink); list-style: none; }
.gl-guide-box > summary::-webkit-details-marker { display: none; }
.gl-guide-box > summary::before { width: 6px; height: 6px; margin-inline: 2px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); flex: none; content: ""; }
.gl-guide-box[open] > summary::before { transform: translateY(-2px) rotate(135deg); }
.glg-body { margin: 4px 0 8px; padding-inline-start: 22px; font-size: .82rem; line-height: 1.5; color: var(--text2); }
.glg-body li + li { margin-block-start: 5px; }
.glg-body a { color: var(--gold-ink); }
.glg-langs { display: flex; flex-wrap: wrap; gap: 5px; }
.glg-lang { padding: 4px 8px; border: 1px solid var(--field-border); border-radius: 6px; background: transparent; color: var(--text2); font-size: .72rem; }
.glg-lang[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold-ink); }

.table-card { padding: 8px 20px; }
.table-scroll { overflow: auto; }
.history-table, #glGiftTbl { width: 100%; border-collapse: collapse; text-align: left; }
.history-table th, .history-table td, #glGiftTbl th, #glGiftTbl td { padding: 13px 10px; border-bottom: 1px solid var(--border); }
.history-table th, #glGiftTbl th { color: var(--text2); font-size: .82rem; white-space: nowrap; }
.history-table td, #glGiftTbl td { font-size: .875rem; overflow-wrap: anywhere; }
.history-table td:first-child { font-weight: 650; }
.history-table tr:last-child td, #glGiftTbl tr:last-child td { border: 0; }
.history-table .empty-history { text-align: center; color: var(--text2); padding: 35px 12px; font-weight: 400; }
.status-badge { display: inline-block; white-space: nowrap; padding: 4px 7px; border-radius: 99px; color: var(--text2); background: var(--gold-soft); font-size: .76rem; font-weight: 700; }
.status-live { color: var(--red); background: #fcebef; }
#glGiftTabs { display: flex; flex-wrap: wrap; gap: 6px; }
#glGiftSummary { color: var(--text2); margin: 16px 0 10px; }

.login-section, .permission-denied { max-width: 470px; margin: 45px auto; }
.login-card, .permission-denied { border: 1px solid var(--border); border-radius: 18px; padding: 25px; }
.login-title, .permission-title { font: 800 1.95rem var(--site-font); }
.login-desc, .permission-desc { color: var(--text2); margin: 6px 0 17px; line-height: 1.45; }
.phone-input { display: flex; align-items: stretch; border: 1px solid var(--field-border); border-radius: 8px; }
.phone-prefix { display: grid; place-items: center; width: 52px; color: var(--gold-ink); font-weight: 800; background: var(--gold-soft); border-radius: 7px 0 0 7px; }
.phone-input .form-input { border: 0; }
.login-btn { width: 100%; }
.login-note, .login-error { font-size: .875rem; margin-top: 10px; color: var(--text2); }
.login-error { color: var(--red); }
.login-error:empty { display: none; }
.permission-icon { display: none; }
.toast { display: none; position: fixed; bottom: 18px; left: 50%; z-index: 20; transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 8px; background: #242426; color: #fff; box-shadow: var(--shadow); }
.toast.show { display: block; }
.toast.error { background: var(--red); }

@media (min-width: 1161px) and (max-width: 1320px) {
    .header-content:has(.studio-nav:not([hidden])) .studio-brand-caption { display: none; }
}
@media (max-width: 1160px) {
    .header-content { gap: 10px 20px; flex-wrap: wrap; }
    .studio-nav { order: 3; width: 100%; overflow: auto; padding: 2px 0; }
}
@media (max-width: 920px) {
    .control-grid { grid-template-columns: minmax(0, 1.45fr) minmax(285px,1fr); gap: 14px; }
    .overview-grid { grid-template-columns: minmax(0,1.65fr) minmax(258px,1fr); gap: 14px; }
    .studio-card { padding: 17px; }
}
@media (max-width: 680px) {
    .header-content { padding: 10px 14px; }
    .studio-brand-art { width: 126px; height: 56px; }
    .studio-brand-caption { display: none; }
    .header-content:has(.studio-nav[hidden]) .studio-brand-art { width: clamp(106px, 35vw, 145px); }
    .header-content:has(.studio-nav[hidden]) .studio-brand-caption { display: inline-flex; padding-inline-start: 8px; font-size: .72rem; }
    .container { padding: 16px 12px 32px; }
    .studio-nav a { padding: 8px 10px; }
    .studio-hero { padding: 22px 18px; min-height: 0; border-radius: 14px; margin-bottom: 14px; }
    .pitch-drawing { right: -96px; opacity: .44; }
    .overview-grid, .control-grid { grid-template-columns: minmax(0,1fr); }
    .overview-aside { gap: 14px; }
    .studio-sidebar:has(.studio-chat[hidden]) { grid-row: 1; }
    .broadcast-setup { padding: 12px 0 0; border-inline-start: 0; border-block-start: 1px solid var(--border); }
    .stats-grid, .session-stats { gap: 6px; }
    .stat-card, .session-stats > div { padding: 9px 7px; }
    .stat-label, .session-stats span { font-size: .78rem; }
    .stats-grid .stat-label { flex-direction: column; align-items: flex-start; gap: 5px; }
    .page-heading { margin-bottom: 14px; }
    .page-heading p { font-size: .85rem; }
    .user-name { display: none; }
    .history-table th, .history-table td { padding-inline: 7px; }
    #pane-golive .session-stats strong { font-size: clamp(1.1rem, 4.5vw, 1.55rem); }
    .session-stats .control-label { min-height: 2.4em; }
}

@media (max-width: 360px) {
    .header-content { column-gap: 10px; }
    .header-actions, .user-info { gap: 6px; }
    .header-content:has(.studio-nav[hidden]) .studio-brand-caption { display: none; }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--brand-ink);
    --border: color-mix(in srgb, var(--brand-gold) 17%, transparent);
    --text: var(--brand-text);
    --text2: var(--brand-muted);
    --ink: var(--brand-text);
    --gold-ink: var(--brand-gold);
    --gold: var(--brand-gold);
    --gold-soft: var(--brand-edge);
    --red: #ffb0b7;
    --shadow: 0 12px 30px #0003;
    --studio-surface: var(--brand-surface);
    --studio-line: color-mix(in srgb, var(--brand-gold) 28%, transparent);
    --field-border: var(--studio-line);
    background:
        radial-gradient(ellipse 700px 560px at 90% 4%, color-mix(in srgb, var(--brand-foil) 28%, transparent), transparent 85%),
        radial-gradient(ellipse 650px 440px at 0% 96%, color-mix(in srgb, var(--brand-foil) 21%, transparent), transparent 85%),
        var(--bg);
}

:root[data-theme="dark"] .studio-header {
    background: color-mix(in srgb, var(--brand-ink) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}
:root[data-theme="dark"] .studio-brand-caption { border-inline-start-color: var(--studio-line); }
:root[data-theme="dark"] .toast.error { background: #852e3d; }

[data-theme="dark"] .studio-hero { border-color: var(--studio-line); }
[data-theme="dark"] .pitch-drawing {
    --pitch-line: 2px solid color-mix(in srgb, var(--brand-gold) 51%, transparent);
    background-image: linear-gradient(90deg, transparent 25%, color-mix(in srgb, var(--brand-gold) 9%, transparent) 25% 75%, transparent 75%);
}
[data-theme="dark"] .chart-bar[data-zero] { background: var(--brand-edge); }
[data-theme="dark"] .profile-status[data-live="true"] { color: var(--red); }
[data-theme="dark"] :is(.calendar-actions button, .gl-gp, .status-badge) { background: var(--studio-surface); color: var(--text2); }
[data-theme="dark"] :is(.calendar-actions button:hover, .gl-gp.active) { background: var(--gold-soft); color: var(--gold-ink); }
[data-theme="dark"] .status-live { background: #75384350; color: var(--red); }
[data-theme="dark"] #pane-golive .monitor-frame { background: var(--brand-surface); }
[data-theme="dark"] #pane-golive .monitor-placeholder {
    background:
        radial-gradient(ellipse at 50% 48%, #b98b4630, transparent 58%),
        linear-gradient(155deg, #24211e, #141311 76%);
}
[data-theme="dark"] #pane-golive :where(.monitor-header > span, .live-banner) {
    border-color: var(--studio-line);
    background: color-mix(in srgb, var(--brand-gold) 7%, transparent);
    color: var(--gold-ink);
}
[data-theme="dark"] #pane-golive .live-banner.active { border-color: #ffb0b755; background: #75384350; color: var(--red); }
#pane-golive .live-banner[data-state="connecting"] {
    border-color: #e2b86e;
    background: #f0ce94;
    color: #38250e;
    font-size: .875rem;
}
.live-banner[data-state="connecting"] .live-indicator, .connect-notice::before {
    width: 12px;
    height: 12px;
    flex: none;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    background: transparent;
    animation: studio-connecting .8s linear infinite;
    content: "";
}
@keyframes studio-connecting { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .live-banner[data-state="connecting"] .live-indicator, .connect-notice::before { animation: none; }
}
[data-theme="dark"] #pane-golive .studio-chat { border-radius: 10px; }
[data-theme="dark"] :is(.form-input, .form-textarea)::placeholder { color: #ab9f90; }
[data-theme="dark"] .studio-select-options { background: #221e19; border-color: var(--studio-line); box-shadow: 0 8px 20px #0008; }
[data-theme="dark"] .studio-select-options button:hover { background: #383025; }
[data-theme="dark"] #pane-golive .switch-track { background: #655e54; }
[data-theme="dark"] #pane-golive .studio-switch[aria-checked="true"] .switch-track { background: var(--brand-foil); }
[data-theme="dark"] :is(.btn-hero, .btn-live, .login-btn, .contact-btn) {
    background: linear-gradient(110deg, var(--brand-gold), var(--brand-foil));
    border-color: var(--brand-gold);
    color: var(--brand-ink);
    box-shadow: inset 0 1px color-mix(in srgb, var(--brand-text) 53%, transparent);
}

:is(.broadcast-setup, .source-field) {
    --field-edge: var(--field-border);
    --field-menu: #fffd;
    --field-menu-shadow: #18181b16;
}
[data-theme="dark"] :is(.broadcast-setup, .source-field) {
    --field-edge: #e1c4914d;
    --field-menu: #231e18cc;
    --field-menu-shadow: #0004;
}
.broadcast-setup :is(.form-input, .form-textarea, .studio-select-trigger),
:is(.broadcast-setup, .source-field) .studio-select-options {
    border-color: var(--field-edge);
    border-radius: 12px;
}
.broadcast-setup :is(.form-input, .form-textarea, .studio-select-trigger) {
    padding-inline: 13px;
    background: transparent;
}
.broadcast-setup :is(.form-input, .studio-select-trigger) { min-height: 42px; }
.broadcast-setup .form-textarea { min-height: 76px; }
.broadcast-setup :is(.form-input, .form-textarea, .studio-select-trigger):hover:not(:disabled),
.broadcast-setup .studio-select-trigger[aria-expanded="true"] { border-color: var(--gold); }
:is(.broadcast-setup, .source-field) .studio-select-options {
    background: var(--field-menu);
    backdrop-filter: blur(16px);
    box-shadow: 0 5px 14px var(--field-menu-shadow);
    padding: 5px;
}
:is(.broadcast-setup, .source-field) .studio-select-options button { border-radius: 7px; }

.source-field { max-width: 100%; }
.source-field .studio-select-trigger {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-height: 40px;
    border: 0;
    padding: 4px 8px 4px 0;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
}
.source-field .studio-select-trigger:is(:hover:not(:disabled), [aria-expanded="true"]) {
    color: var(--gold-ink);
}
.source-field .studio-select-trigger::after { width: 9px; height: 9px; }
.source-field .studio-select-options {
    inset-inline-end: auto;
    inline-size: min(23rem, calc(100vw - 48px));
    max-block-size: min(22rem, 60vh);
    overflow-y: auto;
}
.source-field .studio-select-options button { min-height: 51px; padding: 8px 10px; }
.source-field .studio-select-options button[aria-pressed="true"]:hover { background: var(--gold-soft); }
.source-option-copy { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.source-option-description { color: var(--text2); font-size: .78rem; font-weight: 400; line-height: 1.35; }

.broadcast-controls :is(.studio-switch, .studio-select-trigger) {
    min-height: 34px;
    border-radius: 6px;
    font-size: .82rem;
}
.broadcast-setup .encoding-select .studio-select-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 5px;
    min-height: 46px;
    padding: 5px 7px;
    border-color: transparent;
    line-height: 1.2;
}
.encoding-select .control-label {
    grid-column: 1 / -1;
    font-size: .75rem;
    color: var(--text2);
}
.encoding-select .encoding-value {
    color: var(--gold-ink);
    font-weight: 650;
}
.encoding-select .studio-select-options {
    inset-inline-end: auto;
    inline-size: max(100%, 7.5rem);
}
.encoding-select:last-child .studio-select-options {
    inset-inline-start: auto;
    inset-inline-end: 0;
}
.broadcast-controls :is(.studio-switch, .studio-select-trigger):hover:not(:disabled),
.broadcast-setup .encoding-select .studio-select-trigger[aria-expanded="true"] { background: var(--gold-soft); }

@media (pointer: coarse) {
    .broadcast-controls :is(.studio-switch, .studio-select-trigger),
    .monitor-header .monitor-source-action,
    .source-field .studio-select-trigger { min-height: 44px; }
    .rtmp-connection :is(.copy-btn, .rtmp-link, summary) { min-height: 44px; }
}

.studio-tour-entry, .tour-bar, .tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-launcher { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid #b28c46; border-radius: 9px; background: #efd190; color: #332715; font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; }
.tour-launcher svg { flex: none; width: 19px; height: 19px; }
.tour-launcher:hover { background: #f6dda8; }
.tour-launcher:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.studio-tour-entry { flex: 1 1 auto; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.studio-tour-entry .live-banner { margin-inline-start: auto; }
.studio-tour { position: fixed; z-index: 1001; width: min(21rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; margin: 0; padding: 14px 16px; border: 1px solid var(--gold); border-radius: 10px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); scroll-margin-top: 80px; }
.tour-bar { color: var(--text2); font-size: .8rem; }
.tour-bar span { margin-right: auto; }
.tour-bar button { padding: 4px 8px; color: inherit; background: transparent; border: 0; }
#tourClose { font-size: 1.25rem; }
.studio-tour h2 { margin: 6px 0; font-size: 1.05rem; }
.studio-tour p { margin: 0; font-size: .9rem; line-height: 1.5; }
.tour-actions { justify-content: flex-end; margin-top: 10px; }
#tourNext { background: var(--gold-soft); color: var(--gold-ink); }
.studio-tour-shade {
    position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / 72%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0,
        var(--l) var(--t), var(--l) var(--b), var(--r) var(--b), var(--r) var(--t), var(--l) var(--t), 0 0);
}
.studio-tour-ring { position: fixed; z-index: 1000; pointer-events: none; border: 2px solid var(--gold); border-radius: 8px; }
body:has(.studio-tour:not([hidden])) #broadcastSourceOptions { max-height: 38dvh; overflow-y: auto; }

.studio-preferences { display: inline-flex; flex: none; align-items: center; gap: 4px; }
.studio-language { -webkit-appearance: none; appearance: none; text-align: center; width: 36px; height: 34px; padding-inline: 6px; color: var(--gold-ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: .8rem; font-weight: 650; }
.language-picker .studio-select-options { inset: calc(100% + 7px) 0 auto auto; width: 78px; padding: 5px; border-radius: 12px; }
.language-picker .studio-select-options button { justify-content: flex-start; gap: 10px; padding: 8px 10px; border-radius: 7px; }
.language-picker .studio-select-options button::after { margin-inline-start: auto; }
.studio-language[aria-expanded="true"], .studio-language:hover { background: var(--gold-soft); }
@media (max-width: 700px) {
    .header-content:has(#studioLanguage) { flex-wrap: wrap; }
    .header-actions .studio-language { max-width: 7rem; }
}

.studio-tour.obs-modal { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(35rem, calc(100vw - 24px)); padding: clamp(16px, 3vw, 26px); border-radius: 16px; }
.studio-tour-shade.obs-backdrop { clip-path: none; background: rgb(0 0 0 / .65); pointer-events: auto; }
body:has(.obs-modal:not([hidden])) { overflow: hidden; }
.tour-obs-controls { margin: 16px 0; overflow: hidden; border-radius: 9px; background: #24262b; color: #f1f2f4; font: 500 .85rem/1.45 system-ui, sans-serif; }
.tour-obs-controls header { position: static; padding: 8px 14px; background: #35383f; color: #e3e5ea; }
.obs-stage { display: flex; padding: 12px; gap: 12px; flex-wrap: wrap; }
.obs-stage section { flex: 1; min-width: 0; }
.obs-stage b, .obs-stage label { display: block; margin: 4px 0; }
.obs-stage label, .obs-stage aside { color: #c4c8d2; font-size: .76rem; }
.obs-stage aside { line-height: 2.5; padding-right: 10px; border-right: 1px solid #454954; }
.obs-input, .obs-highlight { border: 1px solid #4d5260; background: #33363e; padding: 5px 10px; border-radius: 5px; margin: 4px 0; }
.obs-highlight { background: #4a3b25; border-color: #ebbe70; color: #fff3da; }
.obs-canvas { flex-basis: 100%; display: grid; place-items: center; padding: 10px; background: #151619; }
.obs-canvas i { width: min(60%, 180px); aspect-ratio: 16 / 9; background: linear-gradient(145deg,#415873,#86a7bd 54%,#55778b 55%,#273c48); }
.obs-meter { height: 6px; width: 82%; margin: 8px 0 3px; background: linear-gradient(90deg,#57c788 70%,#e6c865 85%,#e57a68); }
