/* LivePilot: shared visual language for the entire application. */
:root {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light; color: #252c3a; background: #f5f6f8; font-size: 16px; line-height: 1.5;
  --text: #252c3a; --navy: #161b26; --muted: #626c7e; --border: #e5e7eb;
  --red: #e33446; --blue: #365fc7; --green: #187453; --shadow: 0 2px 5px #151c2b03, 0 8px 24px #151c2b03; --sidebar-width: 228px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, a, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #365fc766; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.9rem; line-height: 1.25; font-weight: 700; letter-spacing: -.04em; }
h2 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.02em; }
h3 { font-size: 1rem; font-weight: 650; }
small { font-size: .875rem; }
.muted, .field-help { color: var(--muted); }
.eyebrow { font-size: .65rem; letter-spacing: .12em; font-weight: 700; color: #687386; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
[hidden] { display: none !important; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; font-weight: 600; font-size: .8125rem; min-height: 42px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.button svg { width: 17px; height: 17px; flex-shrink: 0; }
.button:hover { text-decoration: none; }
.primary { background: var(--red); color: white; box-shadow: 0 2px 3px #91283816; }
.primary:hover:not(:disabled) { background: #ce293b; }
.secondary { background: white; border-color: #dce0e7; color: #394355; box-shadow: 0 1px 2px #161b2604; }
.secondary:hover:not(:disabled) { background: #f7f8fa; border-color: #c0c8d6; }
.quiet { background: #f4f5f7; color: #566174; border-color: #e9ebf0; }
.quiet:hover:not(:disabled) { background: #eaeef4; }
.danger-solid { background: #c92b40; color: white; }
.full-width { width: 100%; }
.text-button { border: 0; background: transparent; padding: 4px 7px; color: var(--blue); font-weight: 600; font-size: .8125rem; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
input, select, textarea { width: 100%; min-width: 0; color: var(--text); border: 1px solid #dce0e7; border-radius: 9px; padding: 11px 13px; background: white; outline: 0; min-height: 44px; font-size: .875rem; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8993a4; font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: #758fd6; box-shadow: 0 0 0 3px #365fc713; }
input[readonly] { background: #f6f7f9; color: #626c7e; }
input:disabled, select:disabled { background: #f4f5f7; color: #757f8f; }
label { display: flex; flex-direction: column; gap: 8px; font-size: .8125rem; font-weight: 600; margin: 19px 0 0; color: #394355; }
.field-help { font-size: .75rem; line-height: 1.75; margin-top: 9px; font-weight: 400; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 70px; }
.reveal-password { position: absolute; right: 4px; top: 4px; bottom: 4px; border: 0; background: transparent; border-radius: 6px; padding: 0 12px; color: #626c7e; font-size: .75rem; font-weight: 600; }
.reveal-password:hover { background: #f5f6f8; }
.form-error { background: #fff1f3; border: 1px solid #f2ccd4; color: #a22b41; padding: 12px 14px; border-radius: 9px; font-size: .8125rem; margin-top: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.remember-option { flex-direction: row; align-items: center; gap: 10px; margin-top: 16px !important; font-size: .75rem; color: #596476; font-weight: 500; cursor: pointer; }
.remember-option input, .stream-checkbox, .youtube-share-choice input { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex-shrink: 0; accent-color: var(--blue); box-shadow: none; }
.remember-option span { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; }
.remember-option small { font-size: .6875rem; font-weight: 400; color: #798396; }

/* Brand and sign-in. */
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 1.375rem; letter-spacing: -.04em; color: white; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--red); color: white; border-radius: 10px; flex-shrink: 0; }
.brand-mark svg { width: 24px; height: 24px; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: 46% 54%; background: #fff; }
.auth-intro { position: relative; overflow: hidden; background: #161b26; color: white; padding: clamp(32px,4vw,64px); display: flex; flex-direction: column; justify-content: space-between; gap: 60px; }
.auth-intro::after { content: ''; position: absolute; width: 460px; height: 460px; border: 1px solid #ffffff08; border-radius: 50%; right: -240px; bottom: -170px; box-shadow: 0 0 0 70px #ffffff02, 0 0 0 140px #ffffff02; pointer-events: none; }
.auth-heading, .auth-intro > .brand, .auth-foot { position: relative; z-index: 1; }
.auth-heading { max-width: 490px; }
.auth-heading .eyebrow { color: #afbacd; }
.auth-heading h1 { font-size: clamp(2rem,3.15vw,3.35rem); font-weight: 650; line-height: 1.18; letter-spacing: -.05em; margin: 24px 0; }
.auth-heading p { color: #b2bac9; max-width: 400px; font-size: .9375rem; line-height: 1.85; }
.auth-foot { border-top: 1px solid #ffffff14; padding-top: 24px; color: #a7b1c3; display: flex; align-items: center; gap: 15px; font-size: .8125rem; line-height: 1.8; }
.outline-play { border: 1px solid #ffffff20; border-radius: 10px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; color: #f69eac; flex-shrink: 0; }
.outline-play svg { width: 23px; height: 23px; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 44px 28px; background: #f7f8fa; }
.auth-form { width: 100%; max-width: 438px; padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 10px 40px #161b2606; }
.auth-form h2 { font-size: 1.75rem; margin: 10px 0; letter-spacing: -.04em; }
.auth-form > .muted { font-size: .8125rem; margin-bottom: 25px; line-height: 1.75; }
.auth-form label { margin-top: 20px; }
.auth-form .primary { margin-top: 25px; min-height: 46px; }
.auth-switch { border-top: 1px solid var(--border); padding-top: 23px; margin-top: 25px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .8125rem; color: var(--muted); }

/* Navigation and overview. */
.workspace { position: relative; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--navy); color: #b8c1d1; padding: 34px 16px 20px; display: flex; flex-direction: column; z-index: 5; overflow-y: auto; scrollbar-width: thin; }
.sidebar > .brand { margin: 0 11px; }
.brand-subtitle { font-size: .6875rem; color: #97a3b8; margin: 12px 11px 35px; }
.sidebar-caption { font-size: .6rem; letter-spacing: .1em; font-weight: 650; color: #8792a6; margin: 0 12px 13px; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 45px; padding: 12px; border: 1px solid transparent; background: transparent; color: #abb5c7; border-radius: 9px; font-size: .8125rem; font-weight: 550; text-align: left; }
.nav-item:hover { background: #ffffff06; color: white; }
.nav-item.active { background: #ffffff0b; border-color: #ffffff09; color: white; box-shadow: inset 3px 0 var(--red); }
.nav-item.active .nav-symbol { color: #fb97a4; }
.nav-symbol { line-height: 1; width: 20px; display: flex; align-items: center; justify-content: center; }
.nav-symbol svg { width: 19px; height: 19px; }
.nav-count { margin-left: auto; font-size: .6875rem; min-width: 20px; padding: 1px 5px; border-radius: 5px; background: #ffffff16; text-align: center; }
.sidebar-note { margin-top: auto; padding: 40px 12px 26px; }
.sidebar-note .eyebrow { color: #8792a6; font-size: .6rem; }
.sidebar-note p { margin-top: 9px; font-size: .8125rem; color: #bcc6d7; }
.sidebar-note strong { font-weight: 500; font-size: .75rem; color: #909eb4; }
.account-card { padding: 19px 6px 3px; border-top: 1px solid #ffffff13; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 35px; height: 35px; border-radius: 50%; background: #2b3446; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 650; color: white; flex-shrink: 0; }
.account-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.account-info strong { font-size: .8125rem; color: #e8edf5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-tag { font-size: .625rem; border: 1px solid #ffffff14; background: #ffffff06; border-radius: 4px; padding: 1px 6px; color: #abb7cb; align-self: flex-start; }
.logout-button { border: 0; border-radius: 7px; background: transparent; color: #94a3bd; font-size: 1.25rem; padding: 5px; }
.logout-button:hover { color: white; background: #ffffff08; }
.sidebar-toggle { position: fixed; z-index: 6; top: 7px; left: calc(var(--sidebar-width) - 32px); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 23px; padding: 0; border: 1px solid #ffffff12; border-radius: 6px; background: #ffffff05; color: #97a3b8; }
.sidebar-toggle:hover { background: #ffffff12; color: white; }
.sidebar-toggle svg { width: 16px; height: 16px; }
.main { margin-left: var(--sidebar-width); padding: 30px 28px 26px; max-width: 2400px; min-width: 0; }
.workspace.sidebar-collapsed .sidebar { display: none; }
.workspace.sidebar-collapsed .main { margin-left: 0; }
.workspace.sidebar-collapsed .sidebar-toggle { left: 12px; top: 12px; width: 30px; height: 30px; background: white; border-color: #dce0e7; color: #626c7e; }
.workspace.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.workspace.sidebar-collapsed .page-header { padding-left: 34px; }
.page-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
.page-title-group { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { font-size: .6875rem; color: #7a8495; margin-bottom: 10px; display: flex; gap: 9px; align-items: center; }
.breadcrumb > span:last-child { color: #576274; }
.page-header h1 { font-size: 1.75rem; margin-bottom: 7px; }
.page-header p { color: var(--muted); font-size: .8125rem; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.sync-state { font-size: .6875rem; color: #6c7688; white-space: nowrap; }
.sync-state::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #20815d; border-radius: 50%; margin-right: 7px; vertical-align: middle; box-shadow: 0 0 0 3px #20815d10; }
.sync-state.offline { color: #b02b40; }
.sync-state.offline::before { background: #b02b40; box-shadow: none; }
.local-badge { font-size: .625rem; color: #646f82; border: 1px solid #dde2e9; background: #fff; border-radius: 6px; padding: 5px 8px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 13px; padding: 18px 20px; min-height: 142px; box-shadow: var(--shadow); }
.stat-label { display: flex; justify-content: space-between; align-items: center; color: #596476; font-size: .75rem; font-weight: 500; gap: 8px; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; background: #eef2fc; color: #5773bd; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 17px; height: 17px; }
.live-icon { background: #fff0f2; color: var(--red); }
.ready-icon { background: #ebf7f1; color: var(--green); }
.stat-card > strong { font-size: 2.15rem; line-height: 1.2; display: block; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.045em; margin: 10px 0 6px; }
.stat-card small { font-size: .6875rem; color: #707b8d; }
.plan-chip { font-size: .625rem; color: #536cb0; background: #f0f3fb; border: 1px solid #e2e8f5; padding: 3px 7px; border-radius: 5px; }
.quota-number { display: flex; align-items: baseline; gap: 8px; margin: 9px 0 8px; }
.quota-number strong { font-size: 2.15rem; font-weight: 650; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.quota-number strong:last-child { font-size: 1.125rem; color: #808b9d; }
.quota-number > span { color: #b0b8c7; font-size: 1.125rem; }
progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 10px; overflow: hidden; background: #eceff4; accent-color: var(--blue); }
progress::-webkit-progress-bar { background: #eceff4; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--blue); }
.quota-stat small { display: block; margin-top: 8px; }
.setup-note { background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 20px; color: #586477; font-size: .8125rem; }
.setup-note summary { cursor: pointer; list-style: none; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: .75rem; }
.setup-note summary::-webkit-details-marker { display: none; }
.info-icon { display: flex; align-items: center; justify-content: center; border: 1.5px solid #8e9ab0; border-radius: 50%; width: 16px; height: 16px; font-size: .625rem; font-weight: 700; flex-shrink: 0; }
.details-toggle { margin-left: auto; font-size: .6875rem; color: #536cb0; white-space: nowrap; }
.setup-note > div { padding: 0 18px 16px 42px; line-height: 1.8; }
.setup-note p + p { margin-top: 8px; }

/* Names remain visible while operational columns scroll. */
.panel { background: white; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.panel-heading { padding: 21px 22px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 1rem; }
.panel-heading p { font-size: .6875rem; color: #707b8d; margin-top: 5px; }
.count-chip { font-size: .625rem; display: inline-flex; justify-content: center; min-width: 23px; padding: 2px 6px; border-radius: 5px; background: #f0f2f5; color: #626c7e; font-weight: 600; }
.stream-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stream-heading-actions .button { min-height: 39px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 0 22px 18px; }
.search-field { position: relative; max-width: 310px; width: 100%; }
.search-field > span { position: absolute; left: 12px; top: 12px; color: #8893a5; pointer-events: none; display: flex; }
.search-field > span svg { width: 16px; height: 16px; }
.search-field input { padding: 10px 12px 10px 36px; font-size: .8125rem; min-height: 40px; background: #fafbfc; border-color: #e2e5eb; }
.stream-filters { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.filter-field { margin: 0; min-width: 170px; }
.stream-filters .owner-filter { min-width: 180px; max-width: 240px; }
.stream-filters .channel-filter { min-width: 170px; max-width: 240px; }
.filter-field select { font-size: .75rem; min-height: 40px; padding: 9px 11px; background: #fafbfc; border-color: #e2e5eb; }
.bulk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 10px 22px; border-top: 1px solid #eef0f4; background: #fcfcfd; }
.select-all-label, .row-selection { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: .6875rem; font-weight: 500; cursor: pointer; }
.selection-heading { display: flex; align-items: center; gap: 8px; }
.stream-checkbox { cursor: pointer; }
.stream-checkbox:disabled { cursor: not-allowed; }
.stream-checkbox:focus-visible { outline: 3px solid #365fc766; outline-offset: 3px; }
.selection-count { font-size: .6875rem; color: #69768b; }
.bulk-actions { display: flex; gap: 7px; margin-left: auto; }
.table-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: #c9ced9 #f5f6f8; }
.stream-panel .table-scroll { max-height: min(65vh,780px); scroll-padding-top: 50px; overscroll-behavior: contain; }
table { border-collapse: collapse; width: 100%; font-size: .8125rem; text-align: left; }
th { background: #f7f8fa; border-top: 1px solid #e9ecf1; border-bottom: 1px solid #e9ecf1; color: #667184; font-weight: 600; padding: 14px 16px; font-size: .6875rem; white-space: nowrap; }
td { padding: 19px 16px; vertical-align: top; border-bottom: 1px solid #eceff3; line-height: 1.65; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td strong { font-weight: 600; color: #303b4e; display: block; }
td small { display: block; font-size: .6875rem; color: #69768b; line-height: 1.7; margin-top: 4px; }
td a { font-size: .6875rem; color: #556ba0; }
td select { font-size: .8125rem; min-height: 38px; padding: 8px 10px; min-width: 160px; max-width: 245px; }
.stream-table { table-layout: fixed; min-width: 1590px; border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.stream-table:has(.owner-column:not([hidden])) { min-width: 1750px; }
.stream-table th { position: sticky; top: 0; z-index: 2; background: #f7f8fa; padding: 14px 12px; }
.stream-table td { padding: 18px 12px; background: white; }
.stream-table tbody tr:hover td { background: #fafbfc; }
.stream-table tbody tr.is-selected td { background: #f0f4ff; }
.stream-table tbody tr.is-selected:hover td { background: #eaf0fd; }
.stream-table .id-column { width: 64px; }
.stream-table .name-heading { width: 200px; }
.stream-table .channel-heading { width: 150px; }
.stream-table .owner-column { width: 160px; }
.stream-table .youtube-status-heading { width: 175px; }
.stream-table .telemetry-heading { width: 178px; }
.stream-table .status-heading { width: 150px; }
.stream-table .video-heading { width: 133px; }
.stream-table .start-heading { width: 140px; }
.stream-table .stop-heading { width: 140px; }
.stream-table .loop-heading { width: 72px; }
.stream-table .actions-column { width: 188px; }
.stream-table th:first-child, .stream-table td:first-child { position: sticky; left: 0; z-index: 1; }
.stream-table th.name-heading, .stream-table .stream-name { position: sticky; left: 64px; z-index: 1; box-shadow: 6px 0 12px -10px #161b2650; }
.stream-table th:first-child, .stream-table th.name-heading { z-index: 3; }
.stream-table td:first-child { color: #7a8597; font-size: .75rem; font-variant-numeric: tabular-nums; }
.stream-name { overflow-wrap: anywhere; }
.stream-name > strong { font-size: .8125rem; line-height: 1.6; font-weight: 650; margin-bottom: 7px; }
.stream-channel, .stream-owner, .key-cell { overflow-wrap: anywhere; min-width: 0; }
.stream-table .stream-channel-select { min-width: 0; width: 100%; max-width: none; min-height: 36px; border-radius: 7px; padding: 7px 6px; font-size: .75rem; background: #fafbfc; }
.source-inline { display: flex; align-items: flex-start; gap: 7px; margin-top: 5px; }
.source-inline a { line-height: 1.7; }
.row-message { overflow-wrap: anywhere; margin-top: 7px; }
.date-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.date-cell strong { font-size: .8125rem; }
.schedule-date-inline { display: inline-flex; align-items: flex-start; gap: 6px; }
.schedule-date-inline > .key-edit-button { margin-top: -2px; }
.stream-sort-button { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; white-space: nowrap; }
.stream-sort-button:hover { color: var(--blue); }
.sort-arrows { display: inline-flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.sort-arrows::before, .sort-arrows::after { content: ''; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; }
.sort-arrows::before { border-bottom: 4px solid #a4afc1; }
.sort-arrows::after { border-top: 4px solid #a4afc1; }
.stream-sort-button[data-sort-direction="ascending"] .sort-arrows::before { border-bottom-color: var(--blue); }
.stream-sort-button[data-sort-direction="descending"] .sort-arrows::after { border-top-color: var(--blue); }
.stream-sort-button[data-sort-direction="ascending"] .sort-arrows::after, .stream-sort-button[data-sort-direction="descending"] .sort-arrows::before { opacity: .3; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-button { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; min-width: 31px; border-radius: 7px; font-size: .6875rem; padding: 5px 9px; border: 1px solid #dce1ea; background: white; color: #54637a; white-space: nowrap; font-weight: 550; }
.row-button:hover:not(:disabled) { background: #f3f5fa; border-color: #c4cddb; }
.row-button.delete { border-color: #f0d8de; background: #fff8f9; color: #b33048; }
.row-button.delete:hover:not(:disabled) { background: #ffedf1; }
.row-button.primary { color: white; border-color: var(--red); background: var(--red); }
.row-button.reschedule { border-color: #d8e2fb; background: #edf2fd; color: #3558ad; }
.row-button.reschedule:hover:not(:disabled) { background: #dfe9fc; border-color: #b9ccef; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: .6875rem; font-weight: 550; white-space: nowrap; line-height: 1.5; background: #eef2fc; color: #4c66a7; }
.badge.running, .badge.ready { background: #ebf7f0; color: #19704e; }
.badge.running::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.preparing, .badge.reconnecting { background: #fff6e7; color: #986820; }
.badge.error { background: #fff0f3; color: #b33048; }
.badge.completed, .badge.cancelled { background: #f0f2f6; color: #657185; }
.loop-tag { font-size: .75rem; color: #67758b; }
.stream-progress { max-width: 180px; margin-top: 11px; }
.stream-progress progress { height: 4px; }
.stream-progress small { font-variant-numeric: tabular-nums; }
.telemetry-cell { white-space: nowrap; font-variant-numeric: tabular-nums; color: #5c6b82; }
.telemetry-group { display: inline-flex; align-items: center; gap: 5px; font-size: .6875rem; }
.metric-divider { color: #a5afc0; }
.metric-normal { color: #197c58; }
.metric-warning { color: #a27025; }
.metric-slow { color: #c02e49; font-weight: 600; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding: 13px 22px; color: #6e7a8f; font-size: .6875rem; background: #fcfcfd; }
.table-scroll-hint { margin-left: auto; font-size: .625rem; color: #7d8797; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 20px; gap: 10px; }
.empty-icon { width: 54px; height: 54px; background: #f5f7fb; border: 1px solid #e5eaf3; border-radius: 15px; color: #8897b0; display: flex; align-items: center; justify-content: center; margin-bottom: 5px; }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { color: #42536e; font-weight: 600; }
.empty-state p { color: #6e7a8f; font-size: .8125rem; max-width: 360px; }
.empty-state .button { margin-top: 9px; }
.key-inline { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key-value { font-family: Consolas, monospace; font-size: .75rem; color: #69768b; }
.key-edit-button { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; flex-shrink: 0; border: 1px solid #e2e6ed; border-radius: 7px; background: #f7f8fa; color: #7586a3; padding: 0; }
.key-edit-button svg { width: 14px; height: 14px; }
.key-edit-button:hover:not(:disabled) { background: #eef3fd; border-color: #c4d3ef; color: var(--blue); }

/* Shared dialog geometry, focus and fixed action area. */
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
dialog { color: var(--text); border: 1px solid #e1e5ed; border-radius: 17px; padding: 0; max-height: calc(100dvh - 40px); box-shadow: 0 24px 90px #0b142833; overflow: hidden; background: white; }
dialog::backdrop { background: #131b2b65; backdrop-filter: blur(3px); }
.stream-dialog { width: 640px; max-width: calc(100% - 28px); }
.stream-dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 42px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 23px 26px 21px; border-bottom: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.dialog-header .eyebrow { color: #697a96; font-size: .625rem; }
.dialog-header h2 { font-size: 1.125rem; margin-top: 5px; letter-spacing: -.025em; }
.close-button { border: 1px solid #e7eaf0; background: #f7f8fa; border-radius: 8px; width: 32px; height: 32px; font-size: 1.25rem; color: #79879d; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.close-button:hover { background: #edf1f7; color: #435b80; }
.dialog-body { padding: 23px 26px 26px; overflow: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: #cad2df #fff; }
.stream-dialog .dialog-body > label:first-child { margin-top: 0; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
fieldset + fieldset { border-top: 1px solid var(--border); padding-top: 23px; margin-top: 23px; }
fieldset label:first-of-type { margin-top: 0; }
fieldset label { margin-top: 17px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 26px; border-top: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: flex; flex-direction: column; gap: 10px; max-width: 430px; }
.toast { padding: 14px 18px; background: #253149; color: white; box-shadow: 0 5px 25px #15243a30; border-radius: 10px; font-size: .8125rem; line-height: 1.7; animation: toast-in .18s ease; }
.toast.error { background: #92273b; }
@keyframes toast-in { from { transform: translateY(7px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* Specialized scheduling, administration and channel components. */
.pending-panel { display: flex; align-items: center; flex-direction: column; text-align: center; background: white; border: 1px solid var(--border); border-radius: 18px; padding: 55px 25px; max-width: 700px; margin: 40px auto; gap: 16px; box-shadow: var(--shadow); }
.pending-panel p { max-width: 450px; color: var(--muted); font-size: .9375rem; line-height: 1.8; }
.pending-icon { width: 56px; height: 56px; background: #fff4e2; color: #b87c1e; border-radius: 17px; display: flex; justify-content: center; align-items: center; font-size: 2rem; }
.admin-overview { display: flex; align-items: center; gap: 45px; background: white; border: 1px solid var(--border); border-radius: 13px; padding: 23px 26px; margin-bottom: 24px; box-shadow: var(--shadow); }
.admin-overview > div { display: flex; flex-direction: column; font-size: .875rem; gap: 5px; }
.admin-overview strong { font-size: 1.8rem; font-weight: 600; }
.admin-overview p { margin-left: auto; color: #8390a4; font-size: .875rem; max-width: 300px; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .avatar { background: #edf3fc; color: #6a84af; }
.user-cell > div { min-width: 0; }
.user-cell strong, .user-cell small { overflow-wrap: anywhere; }
td select { font-size: .8125rem; min-height: 38px; padding: 8px 10px; min-width: 160px; max-width: 245px; }
.dirty-note { font-size: .75rem; color: #bd7d20; margin-top: 3px; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 18px; margin: 20px 0 28px; }
.plan-card { background: white; border: 1px solid var(--border); border-radius: 13px; padding: 23px; box-shadow: var(--shadow); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.plan-card h2 { font-size: 1rem; }
.plan-number { margin: 16px 0 8px; color: #344760; }
.plan-number strong { font-size: 2.2rem; font-weight: 600; letter-spacing: -.04em; }
.plan-number span { font-size: .8125rem; color: #8090a8; margin-left: 8px; }
.plan-card label { font-size: .8125rem; }
.plan-card input { font-size: .875rem; min-height: 40px; padding: 9px 11px; }
.plan-card .button { width: 100%; margin-top: 20px; min-height: 38px; }
.plan-note { font-size: .875rem; line-height: 1.7; color: #697b94; max-width: 820px; }
.new-plan { padding: 24px; display: grid; grid-template-columns: 1fr 1.5fr auto; align-items: center; gap: 25px; }
.new-plan h2 { margin: 5px 0; }
.new-plan .muted { font-size: .8125rem; }
.new-plan .form-grid label { margin: 0; }
.new-plan .form-error { grid-column: 1 / -1; }
.loop-option { flex-direction: row; gap: 12px; align-items: flex-start; border: 1px solid #e3e7ef; border-radius: 10px; padding: 14px; background: #fafbfc; margin-top: 18px; }
.loop-option input { width: 17px; height: 17px; min-height: 0; margin: 4px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.loop-option strong { display: block; font-size: .875rem; font-weight: 600; }
.loop-option small { display: block; font-weight: 400; color: #8090a6; margin-top: 3px; font-size: .8125rem; }
.playback-description { font-size: .8125rem; line-height: 1.75; color: #6a7b94; margin-top: 12px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 17px 28px; border-top: 1px solid var(--border); background: #fafcff; flex-shrink: 0; }
.reschedule-source, .key-source { padding: 14px 16px; border: 1px solid #e3e7ef; border-radius: 10px; background: #f8fafc; overflow-wrap: anywhere; }
.reschedule-source small, .key-source small { color: #889ab3; font-size: .75rem; }
.reschedule-source strong, .key-source strong { display: block; margin-top: 4px; font-size: .9375rem; font-weight: 600; }
.reschedule-source p { color: #6c7d96; font-size: .8125rem; line-height: 1.7; margin-top: 7px; }
.reschedule-note { padding: 13px 15px; background: #eef4fd; border: 1px solid #e0e6f0; border-radius: 11px; color: #6b83a5; font-size: .8125rem; line-height: 1.75; margin-top: 20px; }
.clock-field { margin-top: 20px; }
.clock-field legend { font-size: .875rem; font-weight: 600; padding: 0; margin-bottom: 8px; }
.clock-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; }
.clock-time { display: flex; align-items: center; gap: 6px; }
.clock-time select { width: 68px; padding: 10px 8px; font-variant-numeric: tabular-nums; }
.clock-time > span { color: #74859e; font-weight: 600; }
.key-dialog { max-width: 560px; }
.key-dialog-body > .muted { font-size: .8125rem; overflow-wrap: anywhere; }
#stream-key, #edit-stream-key { padding-right: 13px; }
.current-key { background: #f7f9fd; font-family: Consolas, monospace; font-size: .875rem; }
.current-key-help { font-size: .75rem; color: #76859a; margin-top: 7px; }
.confirm-dialog { width: 420px; max-width: calc(100% - 28px); }
.confirm-dialog form { padding-top: 24px; }
.confirm-icon { display: flex; align-items: center; justify-content: center; background: #fff0f2; color: #c4354c; width: 44px; height: 44px; border-radius: 14px; margin: 0 26px 16px; font-size: 1.5rem; font-weight: 600; }
.confirm-dialog h2 { padding: 0 26px; font-size: 1.125rem; }
.confirm-dialog p { padding: 10px 26px 24px; font-size: .875rem; line-height: 1.75; color: #7a899d; }
.key-warning { margin: 10px 0 0; padding: 10px 12px; border: 1px solid #f3d795; border-radius: 10px; background: #fff8e8; color: #855900; font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.reschedule-key-details { margin-top: 18px; }
.reschedule-key-details label { margin: 0; }
.key-warning.key-clear { color: #167454; background: #edf8f2; border-color: #cdebdc; }
.schedule-slot + .schedule-slot { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e6edf7; }
.schedule-slot-label { display: block; margin: 0 0 5px; color: #8090a6; font-size: 10px; line-height: 1.5; }
.existing-schedules { margin-top: 16px; padding: 14px 16px; background: #f8fafc; border: 1px solid #e3e7ef; border-radius: 10px; }
.existing-schedules h3 { margin: 0 0 10px; color: #43546f; font-size: .8125rem; }
.existing-schedules ol { margin: 0; padding: 0; list-style: none; max-height: 190px; overflow: auto; }
.existing-schedules li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; }
.existing-schedules li + li { border-top: 1px solid #e3e7ef; }
.existing-schedules li:first-child { padding-top: 0; }
.existing-schedules strong { display: block; font-size: .8125rem; font-weight: 600; }
.existing-schedules small { display: block; margin-top: 4px; font-size: .75rem; color: #6c7d96; }
.existing-schedules .badge { flex-shrink: 0; }
.youtube-dialog { width: 690px; max-width: min(690px,calc(100% - 28px)); }
.youtube-dialog .dialog-footer { flex-wrap: wrap; }
#youtube-dialog[open] { display: flex; flex-direction: column; }
#youtube-dialog > .dialog-body { overflow-y: auto; overscroll-behavior-y: contain; }
.youtube-dialog label { margin-top: 16px; }
.youtube-dialog textarea { width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid #d9e2f0; border-radius: 10px; font: inherit; color: var(--text); resize: vertical; }
.youtube-connections { margin-top: 20px; display: grid; gap: 10px; }
.youtube-connection { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 12px 14px; background: #f8fafc; border: 1px solid #e3e7ef; border-radius: 10px; }
.youtube-connection small { display: block; margin-top: 4px; color: #6c7d96; font-size: .75rem; overflow-wrap: anywhere; }
.youtube-setup { border-top: 1px solid #e3e7ef; margin-top: 24px; padding-top: 18px; }
.youtube-setup summary { cursor: pointer; color: #43546f; font-weight: 600; font-size: .875rem; }
.youtube-guide { padding-left: 20px; margin: 16px 0; font-size: .8125rem; color: #6b7e9b; line-height: 1.8; }
.youtube-guide li + li { margin-top: 7px; }
.youtube-thumbnail-preview { display: block; max-width: 100%; max-height: 190px; object-fit: contain; margin-top: 10px; border: 1px solid #e3e7ef; border-radius: 10px; }
.youtube-watch-link { display: block; margin-top: 8px; font-size: .75rem; }
.youtube-event-status { display: block; margin-top: 5px; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.oauth-result { max-width: 600px; margin: 15vh auto; padding: 30px; background: white; border: 1px solid #e3e7ef; border-radius: 14px; }
.oauth-result p { margin: 20px 0; line-height: 1.7; }
/* YouTube scheduling and channel connection workspace. */
.form-section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 0; color: #43546f; font-size: .875rem; font-weight: 650; }
.form-section-title span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid #dce5f3; border-radius: 8px; background: #f3f7fe; color: #5275a6; font-size: .75rem; }
#stream-auto-key { margin-top: 16px; padding: 16px; border: 1px solid #e0e6f0; border-radius: 10px; background: #f8fafc; }
#stream-auto-key .text-button { padding: 9px 0 0; }
#stream-key-mode-help { margin-top: 8px; }
.stream-heading-actions { flex-wrap: wrap; }
.youtube-event-dialog { width: 880px; max-width: min(880px,calc(100% - 28px)); }
.youtube-event-dialog .dialog-body { background: #f8f9fb; overscroll-behavior: contain; }
.youtube-event-overview { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; }
.youtube-event-overview small { color: #6d7d95; font-size: .75rem; }
.youtube-event-overview strong { display: block; font-size: 1rem; margin-top: 3px; overflow-wrap: anywhere; }
.youtube-event-overview p { color: #6d7d95; font-size: .8125rem; margin-top: 6px; }
.event-state { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 5px 9px; border: 1px solid #dfe7f3; border-radius: 7px; font-size: .6875rem; font-weight: 600; background: #f2f6fc; color: #58779f; line-height: 1.5; }
.event-state.is-ready { color: #167454; background: #edf8f2; border-color: #cdebdc; }
.event-state.is-pending { color: #886224; background: #fff8e9; border-color: #f1dfb4; }
.event-state.needs-attention { color: #a7273c; background: #fff1f3; border-color: #f8d4dc; }
.youtube-form-section { margin-bottom: 14px; padding: 17px 18px; border: 1px solid #e3e7ee; border-radius: 10px; background: #fff; min-width: 0; }
.youtube-form-section h3 { font-size: .875rem; color: #43546f; }
.youtube-form-section > .form-grid > label { margin-top: 0; }
.youtube-form-section > .text-button { padding: 8px 0 0; }
.youtube-content-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 14px; }
.youtube-key-card { display: grid; grid-template-columns: minmax(140px,.75fr) minmax(0,1.5fr); gap: 16px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: #f5f8fd; }
.youtube-key-card .eyebrow { font-size: .625rem; letter-spacing: .09em; }
.youtube-key-card strong { display: block; font-size: .8125rem; margin-top: 3px; color: #43546f; }
.youtube-key-card p { color: #6b7e99; font-size: .75rem; line-height: 1.65; }
.youtube-event-dialog textarea { min-height: 150px; resize: vertical; line-height: 1.6; border-color: #dce3ed; }
.youtube-event-dialog textarea:focus { outline: none; border-color: #729be4; box-shadow: 0 0 0 4px #2563eb0d; }
.youtube-thumbnail-section input[type=file] { padding: 9px; font-size: .75rem; }
input[type=file]::file-selector-button { margin-right: 9px; padding: 5px 9px; border: 1px solid #dce3ee; border-radius: 6px; background: #f5f8fd; color: #41536d; cursor: pointer; }
.youtube-thumbnail-frame { position: relative; aspect-ratio: 16/9; background: #f5f8fc; border: 1px dashed #cedbed; border-radius: 10px; margin-top: 12px; overflow: hidden; display: grid; place-items: center; }
.youtube-thumbnail-frame .youtube-thumbnail-preview { width: 100%; height: 100%; max-height: none; max-width: none; margin: 0; border: 0; border-radius: 0; object-fit: contain; position: absolute; inset: 0; background: #edf2f9; }
.youtube-thumbnail-placeholder { color: #8c9bb0; font-size: .75rem; }
.youtube-thumbnail-frame:has(img:not([hidden])) .youtube-thumbnail-placeholder { display: none; }
.youtube-thumbnail-section .remember-option { margin-top: 10px; font-size: .75rem; }
.youtube-visibility-note { margin-top: 12px; color: #607999; font-size: .75rem; line-height: 1.7; }
.youtube-event-dialog .dialog-footer { background: #fff; }
#stream-dialog .dialog-footer { flex-wrap: wrap; }
.youtube-event-dialog #cancel-youtube-event { margin-right: auto; }
.youtube-manager-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 16px; border: 1px solid #e0e6f0; background: #f8fafc; border-radius: 10px; }
.youtube-manager-intro h3 { font-size: .9375rem; margin-top: 5px; }
.youtube-manager-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.youtube-manager-toolbar .field-help { margin: 0; }
.youtube-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.youtube-list-heading h3 { font-size: .8125rem; }
.youtube-list-heading .field-help { margin: 0; font-size: .6875rem; }
.youtube-connections { margin-top: 12px; }
.youtube-connection { align-items: flex-start; background: white; padding: 14px; }
.youtube-connection-info { flex: 1; min-width: 0; }
.youtube-connection-info strong { font-size: .875rem; overflow-wrap: anywhere; }
.youtube-connection-info .event-state { margin-top: 7px; }
.youtube-connection .row-actions { max-width: 175px; justify-content: flex-end; }
.youtube-empty { padding: 24px 18px; border: 1px dashed #d8e2ef; border-radius: 10px; text-align: center; }
.youtube-empty strong { font-size: .875rem; }
.youtube-empty p { color: #6d7d95; font-size: .8125rem; margin-top: 6px; }
.youtube-schedule-action { display: inline-block; margin-top: 7px; padding: 4px 7px; border: 1px solid #f1dfb4; border-radius: 6px; color: #886224; background: #fff8e9; font-size: .625rem; text-align: left; line-height: 1.5; }
.youtube-schedule-action:hover { background: #fff0ce; }
.youtube-event-status.needs-attention { color: #aa3045; }
.youtube-action.needs-setup { background: #fff8e9; border-color: #f1dfb4; color: #886224; }
.stream-table .row-actions { align-items: stretch; }
.stream-table .youtube-event-status { white-space: normal; }
.youtube-channel-editor { margin-top: 16px; padding: 16px; border: 1px solid #e0e6f0; border-radius: 10px; background: #f8fafc; }
.youtube-share-panel { margin-top: 16px; padding: 13px 14px; border: 1px solid #dae6f6; border-radius: 10px; background: #f8fafc; }
.youtube-share-panel .youtube-share-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
.youtube-share-choice input { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; }
.youtube-share-choice strong { display: block; font-size: .8125rem; }
.youtube-share-choice small { display: block; color: #6d7d95; font-size: .75rem; line-height: 1.55; margin-top: 4px; }
.youtube-shared-badge { display: inline-block; color: #315bab; background: #edf3ff; border-radius: 5px; margin: 7px 0 0 6px; padding: 3px 7px; font-size: .6875rem; }
.youtube-status-cell { overflow-wrap: anywhere; }
.youtube-status-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.youtube-status-slot .schedule-slot-label { margin-bottom: 0; }
.youtube-status-button { cursor: pointer; text-align: left; white-space: normal; font: inherit; }
.youtube-status-button:hover { filter: brightness(.96); }
.youtube-status-slot .youtube-watch-link { margin-top: 0; font-size: .6875rem; }
.youtube-status-slot .youtube-visibility { margin: 0; }
.youtube-apply-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e4eaf3; }
.youtube-apply-panel label { max-width: 420px; }
.youtube-apply-panel .field-help { margin-bottom: 0; }
#youtube-apply-dates { max-height: 84px; overflow-y: auto; color: #345578; }
.youtube-dual-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.youtube-dual-panel > div { flex: 1 1 280px; }
.youtube-dual-panel h3 { margin-bottom: 6px; }
.youtube-dual-panel .field-help { margin: 0; }
.youtube-dual-panel .button { text-decoration: none; }
.youtube-dual-panel .youtube-watch-link { flex-basis: 100%; margin: 0; }
.youtube-dual-panel .youtube-studio-help, #youtube-dual-url { flex-basis: 100%; }
.app-public-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 15px; margin-top: 19px; font-size: .75rem; }
.app-public-links a { color: #6b7e97; }
.app-public-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 22px 0 0; margin-top: 12px; font-size: .75rem; color: #7c8da2; }
.app-public-footer .app-public-links { margin: 0; }
.youtube-channel-editor label { margin-top: 0; }
.youtube-channel-editor .row-actions { margin-top: 12px; justify-content: flex-end; }
.youtube-connection .row-actions { max-width: 180px; }
/* Match the shared spacing and typographic scale. */
.youtube-event-dialog { width: 930px; max-width: min(930px,calc(100% - 28px)); }
.youtube-form-section { padding: 20px; margin-bottom: 16px; border-radius: 11px; }
.youtube-content-grid { gap: 16px; }
.youtube-event-overview { padding-bottom: 20px; }
.youtube-event-dialog textarea { min-height: 166px; }
.youtube-event-dialog textarea:focus { border-color: #758fd6; box-shadow: 0 0 0 3px #365fc713; }
.youtube-key-card { background: #f8fafc; border: 1px solid #edf0f6; margin-top: 16px; }
.youtube-apply-panel { margin-top: 18px; padding-top: 17px; }
.youtube-apply-panel label { margin-top: 0; max-width: 440px; }
.youtube-connection { padding: 16px; }
.youtube-dialog:not(.youtube-event-dialog) { max-width: min(690px,calc(100% - 28px)); }
.youtube-event-dialog { max-width: min(930px,calc(100% - 28px)); }
.youtube-thumbnail-placeholder { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.youtube-thumbnail-placeholder svg { width: 27px; height: 27px; margin-bottom: 2px; }
.youtube-thumbnail-placeholder strong { font-size: .75rem; font-weight: 500; }
.youtube-thumbnail-placeholder small { font-size: .625rem; color: #7d8fa9; }
.youtube-thumbnail-frame:has(img:not([hidden])) .youtube-thumbnail-placeholder { display: none; }
.app-public-footer { font-size: .625rem; padding-top: 22px; margin-top: 8px; }
.app-public-links { font-size: .6875rem; }
.app-public-footer .app-public-links { font-size: .625rem; }

.youtube-status-slot .youtube-event-name { font-size: .6875rem; line-height: 1.65; margin: 0 0 2px; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.youtube-event-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }

/* Responsive layouts retain every action and column. */
@media (min-width: 1700px) { .main { padding: 34px 36px 28px; } .stat-card { padding: 20px 23px; } }
@media (max-width: 1200px) {
  :root { --sidebar-width: 206px; }
  .main { padding: 26px 22px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .sidebar .brand { font-size: 1.25rem; }
  .brand-subtitle { font-size: .625rem; }
  .stats { gap: 12px; } .stat-card { padding: 16px; }
  .local-badge { display: none; }
  .new-plan { grid-template-columns: 1fr; gap: 20px; } .new-plan > .button { justify-self: start; }
  .stream-panel > .panel-heading { flex-wrap: wrap; }
  .table-tools .search-field { max-width: none; flex: 1 1 250px; }
  .stream-filters { flex: 1 1 480px; }
  .stream-filters .filter-field { flex: 1; min-width: 140px; max-width: none; }
}
@media (max-width: 950px) {
  :root { --sidebar-width: 190px; }
  .sidebar .brand-mark { width: 31px; height: 31px; }
  .nav-item { padding: 11px 10px; font-size: .75rem; gap: 8px; }
  .main { padding: 24px 18px; } .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-header { gap: 12px; } .page-header h1 { font-size: 1.5rem; }
  .page-header p { max-width: 320px; line-height: 1.7; } .sync-state { font-size: .625rem; }
  .admin-overview { gap: 25px; } .admin-overview p { display: none; }
  .auth-shell { grid-template-columns: 42% 58%; } .auth-intro { padding: 30px; }
  .auth-heading h1 { font-size: 2rem; }
}
@media (max-width: 760px) { .youtube-content-grid { grid-template-columns: 1fr; gap: 0; } .youtube-thumbnail-frame { max-width: 420px; } }
@media (max-width: 680px) {
  .sidebar { position: static; width: 100%; padding: 20px 16px 0; display: grid; grid-template-columns: 1fr auto; gap: 17px; overflow: visible; }
  .sidebar > .brand { margin: 0; align-self: center; font-size: 1.2rem; }
  .brand-subtitle, .sidebar-caption, .sidebar-note { display: none; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 5px; padding-bottom: 12px; overflow: auto; }
  .nav-item { width: auto; white-space: nowrap; min-height: 40px; padding: 10px 12px; }
  .nav-symbol { width: 16px; } .nav-symbol svg { width: 17px; height: 17px; }
  .account-card { border: 0; padding: 0 27px 0 0; grid-column: 2; grid-row: 1; gap: 7px; }
  .account-card .avatar { display: none; } .account-info strong { max-width: 100px; font-size: .75rem; }
  .plan-tag { font-size: .625rem; } .logout-button { padding: 4px; }
  .sidebar-toggle { position: absolute; left: auto; right: 10px; top: 25px; width: 26px; height: 26px; }
  .main { margin: 0; padding: 23px 14px; }
  .page-header { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .page-header h1 { font-size: 1.5rem; } .page-header p { display: none; }
  .breadcrumb { font-size: .625rem; margin-bottom: 8px; }
  .header-tools { padding-top: 3px; } .sync-state { font-size: .5625rem; }
  .stat-card { padding: 14px; min-height: 133px; } .stat-label { font-size: .6875rem; }
  .stat-icon { width: 26px; height: 26px; } .stat-card > strong, .quota-number strong { font-size: 1.85rem; }
  .stat-card small { font-size: .625rem; }
  .setup-note summary { padding: 12px; font-size: .6875rem; }
  .details-toggle { font-size: 0; min-width: 12px; } .details-toggle::after { content: '+'; font-size: 1rem; }
  .setup-note[open] .details-toggle::after { content: '−'; }
  .setup-note > div { padding: 0 14px 14px; font-size: .75rem; }
  .stream-panel > .panel-heading { display: block; padding: 18px 16px 16px; }
  .stream-heading-actions { display: grid; grid-template-columns: 1fr 1.15fr auto; gap: 7px; margin-top: 17px; }
  .stream-heading-actions .button { padding: 9px 10px; min-height: 39px; font-size: .6875rem; gap: 5px; }
  .stream-heading-actions .button svg { width: 14px; height: 14px; }
  .table-tools { padding: 0 16px 16px; gap: 9px; }
  .table-tools .search-field { max-width: none; width: 100%; flex-basis: 100%; }
  .stream-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; gap: 9px; margin: 0; }
  .stream-filters .filter-field { width: 100%; min-width: 0; max-width: none; }
  .stream-filters .owner-filter { grid-column: 1 / -1; } .filter-field select { font-size: .6875rem; }
  .bulk-toolbar { padding: 11px 16px; gap: 9px; }
  .select-all-label, .selection-count { font-size: .625rem; } .bulk-actions { justify-content: flex-end; }
  .stream-panel .table-scroll { max-height: none; }
  .stream-table, .stream-table:has(.owner-column:not([hidden])) { min-width: 0; table-layout: auto; }
  .stream-table thead { display: none; } .stream-table tbody { display: block; }
  .stream-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px 12px; border-top: 1px solid var(--border); padding: 20px 16px; background: white; }
  .stream-table tbody tr.is-selected { background: #f0f4ff; }
  .stream-table td, .stream-table tbody tr:hover td, .stream-table tbody tr.is-selected td, .stream-table tbody tr.is-selected:hover td { display: block; padding: 0; border: 0; background: transparent; min-width: 0; font-size: .8125rem; }
  .stream-table td::before { content: attr(data-label); display: block; font-size: .625rem; color: #7b899f; margin-bottom: 7px; }
  .stream-table td:first-child, .stream-table .stream-name { position: static; box-shadow: none; }
  .stream-table td:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin-bottom: -7px; }
  .stream-table td:first-child::before { margin: 0; }
  .stream-table .stream-name, .stream-table .stream-channel, .stream-table .stream-owner, .stream-table .youtube-status-cell, .stream-table .telemetry-cell, .stream-table td:last-child { grid-column: 1 / -1; }
  .stream-name > strong { font-size: .9375rem; }
  .stream-table .stream-channel-select { min-height: 41px; padding: 9px 10px; font-size: .8125rem; }
  .source-inline a { font-size: .75rem; } .source-inline { align-items: center; }
  .key-edit-button { width: 32px; height: 32px; }
  .date-cell { white-space: normal; } .date-cell strong { font-size: .8125rem; }
  .telemetry-group { font-size: .8125rem; gap: 9px; }
  .stream-table .row-actions { justify-content: flex-start; }
  .row-button { min-height: 36px; padding: 7px 11px; font-size: .75rem; }
  .table-footer { padding: 12px 16px; font-size: .625rem; } .table-scroll-hint { display: none; }
  .panel-heading { padding: 18px 16px; } .plans-grid { grid-template-columns: 1fr; }
  .plan-card, .new-plan { padding: 20px; } .admin-overview { padding: 20px; gap: 26px; }
  #users-view table { min-width: 650px; } #users-view .panel-heading { align-items: flex-start; flex-direction: column; }
  #users-view .search-field { max-width: none; }
  .dialog-header { padding: 20px; } .dialog-body { padding: 20px; } .dialog-footer { padding: 15px 20px; }
  .auth-shell { display: block; } .auth-intro { padding: 24px; gap: 0; }
  .auth-intro::after, .auth-heading, .auth-foot { display: none; }
  .auth-form-wrap { padding: 26px 18px; min-height: calc(100dvh - 84px); align-items: flex-start; }
  .auth-form { max-width: 438px; padding: 28px 24px; }
  .pending-panel { padding: 35px 20px; margin-top: 20px; }
  .app-public-footer { justify-content: center; gap: 12px; }
  .toast-region { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (max-width: 520px) {
  .youtube-event-overview, .youtube-manager-intro { flex-direction: column; gap: 10px; }
  .youtube-form-section { padding: 15px; }
  .youtube-event-dialog .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .youtube-key-card { grid-template-columns: 1fr; gap: 7px; padding: 12px; }
  .youtube-connection { flex-wrap: wrap; gap: 12px; }
  .youtube-connection .row-actions { max-width: none; justify-content: flex-start; }
  .youtube-list-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .youtube-event-dialog .dialog-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .youtube-event-dialog #cancel-youtube-event { margin: 0; }
  .youtube-event-dialog #save-youtube-event { grid-column: 1/-1; white-space: normal; }
  .youtube-dual-panel .button { width: 100%; white-space: normal; }
}
@media (max-width: 420px) {
  .clock-controls { grid-template-columns: 1fr; } .clock-time select { flex: 1; }
  .existing-schedules li { flex-direction: column; gap: 6px; }
  .header-tools { display: none; } .bulk-actions { width: 100%; }
  .sidebar > .brand { font-size: 1.125rem; gap: 8px; } .account-info strong { max-width: 80px; }
  .stream-heading-actions { grid-template-columns: 1fr 1.15fr; } #refresh-streams { grid-column: 1/-1; }
  .channel-picker { flex-wrap: wrap; } .channel-picker select { flex-basis: 100%; width: 100%; }
  .channel-picker .button { min-height: 36px; }
}
@media (max-height: 540px) and (min-width: 681px) {
  .sidebar { padding-top: 30px; } .brand-subtitle { margin-bottom: 20px; }
  .sidebar-note { display: none; } .account-card { margin-top: auto; }
  .dialog-header { padding: 16px 24px; } .dialog-footer { padding: 12px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
