/* Stream Factory 3.0 UI Kit layer — matches CEF Control Panel, Stream Delivery 3.0 & OKTV 3.0 (kit.css loaded first). */
:root {
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 0.875rem; --text-lg: 1rem; --text-xl: 1.25rem; --text-2xl: 1.5rem;
}

[hidden] { display: none !important; }
.tr-wait body { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
select.input { appearance: auto; }
.note.note-bad, .note.note-ok, #support-bar { margin: 0 0 12px; border-radius: 6px; padding: 8px 12px; font-size: var(--text-sm); }
.note-bad { background: var(--danger-bg); color: var(--danger); }
.note-ok { background: var(--ok-bg); color: var(--ok); }

/* Unified sign-in page (Rule 23). */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.signin-box { width: 100%; max-width: 400px; }
.signin-head { text-align: center; margin-bottom: 24px; }
.signin-head h1 { margin: 0; font-size: var(--text-2xl); font-weight: 600; }
.signin-head p { margin: 12px 0 0; font-size: var(--text-sm); }
.signin form { padding: 20px; gap: 16px; }
.signin #forms { display: grid; gap: 12px; }
.signin .form-grid div:has(> label.label:first-child) { grid-template-columns: minmax(0, 1fr); }
.signin .form-grid div:has(> label.label:first-child) > :not(label.label:first-child) { grid-column: 1; }
.signin .form-grid div:has(> label.label:first-child) > label.label:first-child { padding-top: 0; }
.signin .btn-wide { width: 100%; padding: 8px 12px; }
.signin input[name="code"] { letter-spacing: 0.4em; text-align: center; font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.signin-foot { margin-top: 16px; text-align: center; font-size: var(--text-xs); }
.signin-top { position: absolute; top: 16px; right: 24px; }
.brand.brand-big { justify-content: center; gap: 12px; }
.brand.brand-big img { height: 45px; width: auto; }
.brand.brand-big .suffix, .brand.brand-big span { font-size: var(--text-2xl); }

/* Brand logo light/dark swap. */
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand strong { font-size: var(--text-lg); }
.brand .suffix { color: var(--accent); font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.01em; }
.brand .logo-dark { display: none !important; }
:root[data-theme="dark"] .brand .logo-light { display: none !important; }
:root[data-theme="dark"] .brand .logo-dark:not([hidden]) { display: block !important; }

/* Language dropdown & flags. */
.flag { width: 22px; height: 15px; border-radius: 2px; display: block; object-fit: cover; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
.lang-drop { position: relative; }
.lang-drop > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; font-size: var(--text-sm); color: var(--muted); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.lang-drop > summary::-webkit-details-marker { display: none; }
.lang-drop > summary::marker { content: ''; }
.lang-drop > summary:hover, .lang-drop[open] > summary { color: var(--text); background: var(--bg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 170px; display: grid; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.lang-menu button, .lang-menu a { display: flex; align-items: center; gap: 10px; background: none; border: 0; text-align: left; color: var(--muted); font: inherit; font-size: var(--text-sm); padding: 8px 12px; border-radius: 6px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.lang-menu button:hover, .lang-menu a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.lang-menu a.on, .lang-menu button[aria-current="true"] { color: var(--text); background: var(--accent-bg); font-weight: 500; }

/* Dashboard & Library helpers */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--panel, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 16px; }
.kpi-card .kpi-label { font-size: 12px; color: var(--muted, #64748b); margin-bottom: 6px; }
.kpi-card .kpi-val { font-size: 26px; font-weight: 700; line-height: 1.1; }
.badge-online, .badge-ready { background: #dcfce7; color: #166534; }
.badge-paused { background: #fef3c7; color: #92400e; }
.badge-draft  { background: #f1f5f9; color: #475569; }
.badge-queued, .badge-transcoding, .badge-uploading { background: #dbeafe; color: #1d4ed8; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.tag-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; background: #f1f5f9; color: #334155; margin: 2px 4px 2px 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.upload-box { border: 1px dashed var(--border, #cbd5e1); border-radius: 10px; padding: 16px; margin-bottom: 16px; background: var(--panel, #fff); }
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-bar > span { display: block; height: 100%; background: var(--accent, #2563eb); width: 0%; transition: width 0.2s ease; }
