:root {
    color-scheme: dark;
    --bg: #0c0e13;
    --panel: #151820;
    --line: #2a2e3a;
    --muted: #a1a8b9;
    --text: #edf0f7;
    --purple: #a38aff;
    --green: #64dfaa;
    --red: #ff838f;
    --amber: #efc575
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

button,
input,
select {
    font: inherit
}

a {
    color: var(--purple);
    text-decoration: none
}

button,
a,
input,
select,
summary {
    touch-action: manipulation
}

button {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 18px;
    font-weight: 650;
    transition: background .15s, transform .15s
}

button:hover:not(:disabled) {
    transform: translateY(-1px)
}

button:disabled {
    opacity: .4;
    cursor: not-allowed
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--purple);
    outline-offset: 4px
}

header {
    height: 82px;
    padding: 0 max(28px, calc((100vw - 1180px)/2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: #101218
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.5px;
    color: var(--text)
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1px solid #7460b1;
    color: #c1afff;
    border-radius: 10px;
    font-size: 25px;
    background: #251d3d
}

nav {
    display: flex;
    gap: 22px;
    align-items: center
}

.connection {
    font-size: 12px;
    color: var(--muted)
}

.connection.good {
    color: var(--green)
}

.username {
    font-size: 13px;
    padding-left: 22px;
    border-left: 1px solid var(--line)
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 42px 26px 20px
}

.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 20px
}

h1 {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -1px;
    margin: 8px 0 12px;
    font-weight: 650
}

h2 {
    font-size: 19px;
    letter-spacing: -.35px;
    margin: 0;
    font-weight: 650
}

h3 {
    font-size: 17px;
    margin: 0
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 750;
    color: #a7a0bc
}

.muted {
    color: var(--muted)
}

p {
    margin: 10px 0
}

.small {
    font-size: 12px;
    line-height: 1.6
}

.tag,
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid var(--line);
    color: var(--muted);
    white-space: nowrap
}

.tag {
    background: #1a1e28
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px
}

.broadcast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-color: #403553;
    background: radial-gradient(ellipse at 80% 0%, #30213e66, transparent 65%), var(--panel);
    padding: 30px 34px;
    margin-bottom: 32px;
    gap: 24px
}

.status-title {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 10px 0 0
}

.status-title h2 {
    font-size: 28px;
    letter-spacing: -.7px
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #6c7386;
    box-shadow: 0 0 0 5px #737a8918
}

.dot.good {
    background: var(--green);
    box-shadow: 0 0 0 5px #64dfaa14
}

.dot.error {
    background: var(--red)
}

.dot.connecting {
    background: var(--amber)
}

.route {
    display: flex;
    gap: 18px;
    align-items: center;
    font-size: 12px;
    margin-top: 20px
}

.route>span:not(.route-line) {
    padding: 6px 12px;
    background: #242332;
    border: 1px solid #3a344b;
    border-radius: 7px
}

.route-line {
    color: #827493
}

.broadcast-actions {
    display: flex;
    flex-direction: column;
    min-width: 216px;
    gap: 9px
}

.broadcast-actions p {
    margin: 0;
    text-align: center
}

.primary {
    background: #baa4ff;
    color: #181024;
    box-shadow: 0 2px 15px #a18aff10
}

.primary:hover {
    background: #c9b8ff
}

.danger {
    background: #302029;
    border-color: #5a3541;
    color: #ffabb4
}

.secondary {
    background: #272b37;
    border-color: #3a4050;
    color: var(--text)
}

.ghost {
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    padding: 6px 10px
}

.ghost:hover {
    color: var(--text);
    background: #222632
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px
}

.sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px
}

.source {
    padding: 20px
}

.source.selected {
    border-color: #78659f;
    box-shadow: inset 0 0 0 1px #a38aff22
}

.source-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px
}

.source-heading>div {
    display: flex;
    gap: 12px;
    align-items: center
}

.source-number {
    font: 12px ui-monospace, monospace;
    color: #8b829e
}

.badge.online {
    color: var(--green);
    background: #183329;
    border-color: #28503e
}

.badge.stalled {
    color: var(--amber);
    border-color: #5d4c31;
    background: #30291c
}

.preview {
    aspect-ratio: 16/9;
    background: #0b0d12;
    border: 1px solid #242833;
    border-radius: 9px;
    overflow: hidden;
    position: relative
}

.placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6e7587
}

.placeholder>span {
    font-size: 39px;
    line-height: 1
}

.placeholder p {
    font-size: 12px
}

.preview iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #0b0d12
}

.source-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px
}

.rate {
    font: 13px ui-monospace, monospace;
    color: #d8d5e4
}

.source>p {
    margin-bottom: 0
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px
}

.twitch-button {
    display: block;
    text-align: center;
    background: #322448;
    border: 1px solid #624987;
    border-radius: 10px;
    color: #d6c6ff;
    padding: 12px;
    margin-top: 18px;
    font-weight: 650
}

.quiet {
    margin-top: 15px;
    margin-left: -10px
}

details {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 15px
}

summary {
    cursor: pointer;
    font-size: 13px;
    color: #c5cada;
    font-weight: 600
}

details[open]>summary {
    margin-bottom: 18px
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 15px 0;
    color: #c7cbd6;
    font-size: 12px;
    font-weight: 600
}

input,
select {
    width: 100%;
    background: #101219;
    border: 1px solid #383e4b;
    color: var(--text);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px
}

input:focus,
select:focus {
    outline: 2px solid #a38aff88;
    border-color: #a38aff
}

input[type=file] {
    font-size: 12px
}

.upload-box {
    border: 1px dashed #484053;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    align-items: center;
    background: #191821;
    font-size: 23px;
    gap: 8px
}

.upload-box strong {
    font-size: 13px
}

.upload-box input {
    background: transparent;
    border: 0;
    padding: 0;
    max-width: 100%
}

.wide-details {
    margin: 0 0 16px;
    padding: 21px 24px
}

.wide-details>summary {
    font-size: 14px
}

.wide-details>summary>span {
    float: right;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400
}

.inner {
    margin-top: 24px;
    margin-bottom: 0;
    gap: 36px
}

.password-form {
    max-width: 500px
}

code,
.code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    font: 12px/1.7 ui-monospace, monospace;
    background: #0c0e14;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: #c8c4db;
    font-weight: 400
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    font-size: 13px
}

.progress {
    height: 4px;
    background: #292334;
    border-radius: 9px;
    margin-top: 14px;
    overflow: hidden
}

.progress span {
    display: block;
    background: var(--purple);
    width: 35%;
    height: 100%;
    animation: loading 1.4s infinite alternate
}

@keyframes loading {
    to {
        transform: translateX(190%)
    }
}

#alert,
#toast {
    padding: 14px 18px;
    border: 1px solid #6d4650;
    background: #2f1e27;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px
}

#toast {
    border-color: #375747;
    background: #172b24;
    color: #abe7ca
}

.error {
    color: var(--red);
    font-size: 13px
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #727a8d;
    font-size: 11px;
    border-top: 1px solid var(--line);
    margin-top: 35px;
    padding: 21px 0
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at top, #33244755, transparent 60%), var(--bg)
}

.login-card {
    width: min(440px, calc(100% - 32px));
    padding: 36px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    margin: 30px 0
}

.login-card .brand {
    margin-bottom: 35px
}

.login-card h1 {
    font-size: 29px
}

.login-card form {
    margin-top: 26px
}

.full {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-top: 26px
}

[hidden] {
    display: none !important
}

@media(max-width:760px) {
    header {
        padding: 0 18px;
        height: 70px
    }

    .brand {
        font-size: 18px
    }

    nav {
        gap: 6px
    }

    .connection {
        display: none
    }

    .username {
        border: 0;
        padding: 0;
        font-size: 12px
    }

    main {
        padding: 28px 16px 16px
    }

    .heading {
        display: block
    }

    .heading>.tag {
        margin-top: 10px
    }

    h1 {
        font-size: 26px
    }

    .broadcast {
        padding: 23px;
        display: block
    }

    .broadcast-actions {
        margin-top: 25px
    }

    .status-title h2 {
        font-size: 25px
    }

    .sources,
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px
    }

    .panel {
        padding: 20px
    }

    .wide-details>summary>span {
        float: none;
        display: block;
        margin-top: 4px
    }

    footer {
        flex-wrap: wrap
    }

    .inner {
        gap: 30px
    }
}

.program-preview {
    margin-bottom: 28px
}

.program-preview .preview {
    max-width: 760px;
    margin: 0 auto
}

.program-preview h2 {
    margin-top: 5px
}

.program-preview .source-footer {
    align-items: center;
    gap: 18px
}

.form-feedback {
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 8px;
    background: #22222d;
    margin: 14px 0 0
}

.form-feedback.success {
    color: var(--green);
    border: 1px solid #345546
}

.form-feedback.error {
    color: var(--red);
    border: 1px solid #66424c
}

@media(max-width:760px) {
    .program-preview .source-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px
    }
}

#upload-meter {
    width: 100%;
    height: 9px;
    margin-top: 18px;
    border: 0;
    border-radius: 8px;
    background: #292334;
    accent-color: var(--purple)
}

#upload-meter::-webkit-progress-bar {
    background: #292334;
    border-radius: 8px
}

#upload-meter::-webkit-progress-value {
    background: var(--purple);
    border-radius: 8px
}

#upload-meter::-moz-progress-bar {
    background: var(--purple);
    border-radius: 8px
}

.video-library {
    margin-bottom: 24px
}

.video-library h2 {
    margin-top: 5px
}

#video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
    margin-top: 22px
}

.video-card {
    padding: 18px;
    background: #10131a;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-width: 0
}

.video-card.chosen {
    border-color: #78659f
}

.video-card h3 {
    overflow-wrap: anywhere;
    margin-bottom: 8px
}

.video-card video {
    width: 100%;
    aspect-ratio: 16/9;
    background: #080a0e;
    border-radius: 8px
}

.video-card .video-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px
}

.video-card button {
    font-size: 12px;
    padding: 8px 12px
}

.video-card textarea {
    width: 100%;
    min-height: 95px;
    background: #101219;
    color: var(--text);
    border: 1px solid #383e4b;
    border-radius: 8px;
    padding: 12px;
    font: 14px system-ui;
    resize: vertical
}

.video-card .selected-label {
    color: var(--green);
    font-size: 12px
}

.video-card .delete-confirm {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #66424c;
    border-radius: 8px
}

.video-card .form-feedback {
    font-size: 12px
}

.text-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px
}

.text-controls input[type=color] {
    height: 42px;
    padding: 4px
}

.text-controls input[type=range] {
    padding: 0;
    accent-color: var(--purple)
}

.checkbox-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px
}

.checkbox-label input {
    width: auto;
    accent-color: var(--purple)
}

.text-stage {
    position: relative;
    aspect-ratio: 16/9;
    background: #080a0e;
    container-type: inline-size;
    overflow: hidden;
    border-radius: 8px
}

.text-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.overlay-caption {
    position: absolute;
    pointer-events: none;
    white-space: pre;
    line-height: 1.25;
    text-align: left;
    z-index: 2
}

.browser-form button {
    margin: 5px 8px 5px 0
}

@media(max-width:400px) {
    .text-controls {
        gap: 0 8px
    }
}

.twitch-metadata {
    margin-bottom: 24px
}

.twitch-metadata h2 {
    margin-top: 5px
}

.category-search {
    display: flex;
    gap: 10px
}

.category-search input {
    min-width: 0
}

.category-search button {
    flex-shrink: 0
}

.twitch-metadata form {
    max-width: 800px
}

.twitch-metadata .twitch-button {
    max-width: 500px
}

.twitch-metadata label>span {
    font-weight: 400
}

@media(max-width:600px) {
    .twitch-metadata .section-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .category-search {
        flex-direction: column
    }
}

.recording-panel,
.renewal-panel {
    margin-bottom: 24px
}

.recording-panel h2 {
    margin-top: 5px
}

.record-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px
}

.record-controls label {
    min-width: 230px;
    margin: 12px 0 0
}

.record-controls button {
    margin-bottom: 0
}

#recording-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 20px
}

.download-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 650
}

.recording-panel .small.error {
    color: var(--red)
}

@media(max-width:600px) {
    .record-controls {
        align-items: stretch;
        flex-direction: column
    }

    .record-controls label {
        min-width: 0
    }

    .record-controls button {
        width: 100%
    }
}

/* Compact application workspace */
.workspace {
    --panel: #141820;
    --line: #282e3b;
    background: #0c1017;
    font-size: 14px;
    line-height: 1.5
}

.workspace .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    background: #11151d;
    border-right: 1px solid var(--line);
    padding: 28px 16px;
    z-index: 20
}

.sidebar .brand {
    padding: 0 8px;
    font-size: 22px;
    gap: 10px
}

.workspace-label {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #737e94;
    margin: 14px 9px 28px
}

.workspace .side-menu {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 5px
}

.menu-link {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 43px;
    padding: 10px 13px;
    color: #9ca6bb;
    font-weight: 550;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent
}

.menu-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0
}

.menu-link:hover {
    background: #1b202c;
    color: #eee7ff
}

.menu-link[aria-current=page] {
    background: #282139;
    color: #d4bfff;
    border-color: #48365e
}

.menu-label {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #677389;
    margin: 25px 13px 7px
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 15px 6px 0;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: #b6bed0
}

.sidebar-bottom small {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    color: #758197
}

.status-led {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #64dfaa
}

.workspace-shell {
    margin-left: 220px
}

.workspace .workspace-header {
    height: 68px;
    background: #0e121a;
    padding: 0 30px;
    gap: 14px
}

.breadcrumb {
    font-size: 12px;
    color: #6f7b91
}

.breadcrumb span {
    margin: 0 12px;
    color: #424e63
}

.breadcrumb strong {
    color: #d6ddeb;
    font-weight: 500
}

.header-account {
    display: flex;
    align-items: center;
    gap: 10px
}

.workspace .connection {
    margin-right: 10px;
    font-size: 11px
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: #29243c;
    border: 1px solid #49375f;
    border-radius: 8px;
    color: #cbb5ff;
    font-size: 11px;
    font-weight: 700
}

.workspace .username {
    border: 0;
    padding: 0;
    font-size: 12px
}

.workspace main {
    max-width: 1560px;
    padding: 26px 30px 15px;
    outline: none
}

.workspace .heading {
    margin-bottom: 22px;
    align-items: center
}

.workspace h1 {
    font-size: 25px;
    letter-spacing: -.65px;
    line-height: 1.3;
    margin: 5px 0 5px
}

.workspace .heading p {
    font-size: 12px;
    margin: 0
}

.workspace .eyebrow {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #8793aa
}

.workspace h2 {
    font-size: 16px
}

.workspace h3 {
    font-size: 15px
}

.workspace .tag {
    font-size: 10px;
    padding: 4px 8px
}

.workspace button {
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12px
}

.workspace .ghost {
    padding: 6px 8px;
    font-size: 11px
}

.workspace .panel {
    border-radius: 12px;
    padding: 20px
}

.workspace .section-heading {
    margin-bottom: 12px
}

.workspace label {
    margin: 12px 0;
    gap: 5px;
    font-size: 11px
}

.workspace input,
.workspace select {
    font-size: 12px;
    padding: 9px 10px
}

.workspace .small {
    font-size: 11px
}

.workspace details {
    margin-top: 14px;
    padding-top: 12px
}

.workspace .wide-details {
    padding: 20px;
    margin-top: 0
}

.workspace footer {
    margin-top: 22px;
    padding: 16px 0;
    font-size: 10px
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px
}

.metric-card {
    min-width: 0;
    padding: 17px 18px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #141820;
    position: relative;
    overflow: hidden
}

.metric-label {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #9da8bd;
    font-size: 11px
}

.metric-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #252134;
    color: #b9a4f6;
    font-size: 14px
}

.metric-value {
    font-size: 27px;
    line-height: 1.25;
    font-weight: 620;
    letter-spacing: -.6px;
    margin-top: 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums
}

.metric-value small {
    font-size: 11px;
    font-weight: 450;
    letter-spacing: 0;
    color: #7b889f
}

.metric-value.timer {
    font-size: 26px;
    letter-spacing: .2px
}

.metric-foot {
    margin-top: 8px;
    min-height: 20px;
    color: #7e8aa0;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px
}

.sparkline {
    width: 76px;
    height: 20px;
    flex-shrink: 0;
    opacity: .8
}

.sparkline polyline {
    fill: none;
    stroke: #a68be4;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round
}

.capacity-track {
    height: 3px;
    background: #252d3c;
    margin-top: 7px;
    border-radius: 2px;
    overflow: hidden
}

.capacity-track span {
    display: block;
    height: 100%;
    background: #ab8ee9;
    width: 0;
    min-width: 2px
}

.workspace .broadcast {
    padding: 18px 22px;
    margin-bottom: 18px;
    gap: 15px
}

.workspace .broadcast .eyebrow {
    display: none
}

.workspace .status-title {
    margin: 0;
    gap: 10px
}

.workspace .status-title h2 {
    font-size: 18px;
    letter-spacing: -.2px
}

.workspace .broadcast-left>p {
    font-size: 11px;
    margin: 7px 0;
    color: #96a1b7;
    max-width: 630px
}

.workspace .route {
    font-size: 10px;
    margin-top: 9px;
    gap: 12px
}

.workspace .route>span:not(.route-line) {
    padding: 3px 9px;
    border-color: #383045;
    background: #211f2d
}

.workspace .broadcast-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 290px;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0
}

.workspace .broadcast-actions p {
    display: none
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
    gap: 18px;
    align-items: stretch
}

.workspace .program-preview,
.workspace .twitch-metadata {
    margin-bottom: 0;
    min-width: 0
}

.workspace .program-preview .preview {
    max-width: 100%;
    margin-top: 15px
}

.workspace .program-preview .section-heading .tag {
    display: none
}

.workspace .program-preview .source-footer {
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px
}

.workspace .program-preview #program-hint {
    margin: 0;
    max-width: 75%;
    font-size: 10px
}

.workspace .twitch-metadata form {
    max-width: 100%
}

.workspace .twitch-metadata .section-heading {
    align-items: center;
    gap: 4px
}

.workspace .twitch-metadata h2 {
    margin-top: 2px;
    font-size: 16px
}

.workspace .twitch-metadata .section-heading .ghost {
    font-size: 10px;
    max-width: 120px;
    text-align: right
}

.workspace .twitch-metadata label>span {
    display: none
}

.workspace .twitch-metadata #twitch-meta-note {
    font-size: 10px;
    line-height: 1.5;
    margin: 4px 0 12px
}

.workspace .twitch-metadata .twitch-button {
    font-size: 11px;
    padding: 9px;
    margin: 8px 0
}

.workspace .twitch-metadata .category-search {
    gap: 6px
}

.workspace .twitch-metadata .category-search button {
    padding: 8px 11px
}

.workspace #category-note:empty {
    display: none
}

.media-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px
}

.summary-tile {
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    min-width: 0;
    background: #131820;
    border: 1px solid var(--line);
    padding: 16px 18px;
    border-radius: 10px;
    color: var(--text)
}

a.summary-tile:hover {
    border-color: #69517f;
    background: #181b27
}

.summary-icon {
    font-size: 23px;
    color: #9480bb;
    line-height: 1
}

.summary-tile>div {
    min-width: 0
}

.summary-tile div>span {
    font-size: 10px;
    color: #95a1b5;
    display: block
}

.summary-tile strong {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .1px;
    display: block;
    margin: 2px 0;
    font-variant-numeric: tabular-nums
}

.summary-tile small {
    font-size: 10px;
    color: #6f7f96;
    display: block
}

.tile-arrow {
    margin-left: auto;
    color: #66748c;
    align-self: flex-start;
    font-size: 13px
}

.dashboard-bottom {
    margin: 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

.source-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.source-pill {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 10px;
    color: #929eb4
}

.source-pill.online {
    color: var(--green);
    border-color: #2d4b40;
    background: #15241f
}

.source-pill.stalled {
    color: var(--amber)
}

.text-link {
    font-size: 10px;
    color: #9b88bf
}

.workspace .sources {
    margin-bottom: 18px;
    gap: 18px
}

.workspace .source {
    min-width: 0
}

.workspace .settings-columns {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 18px;
    align-items: start
}

.settings-columns>div>.panel {
    margin-bottom: 18px
}

.workspace .settings-columns .inner {
    margin-top: 0;
    gap: 12px
}

.workspace .settings-columns .renewal-panel {
    margin-bottom: 0
}

.workspace .settings-columns .wide-details {
    padding: 20px
}

.workspace .upload-drawer {
    margin: 0 0 18px;
    padding: 16px 20px
}

.workspace .upload-drawer>summary {
    font-size: 12px
}

.upload-drawer>summary>span {
    font-size: 10px;
    color: #76859e;
    float: right
}

.workspace .upload-drawer article {
    border: 0;
    padding: 12px 0 0;
    background: transparent
}

.workspace .upload-drawer article>.section-heading,
.workspace .upload-drawer article>p:first-of-type {
    display: none
}

.workspace .upload-drawer form {
    display: flex;
    gap: 18px;
    align-items: center
}

.workspace .upload-drawer .upload-box {
    margin: 10px 0;
    flex: 1;
    min-width: 0;
    padding: 12px;
    gap: 4px
}

.workspace .upload-drawer strong {
    font-size: 12px
}

.workspace .video-library {
    margin-bottom: 0
}

.workspace #video-list,
.workspace #recording-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: 14px;
    margin-top: 16px
}

.workspace .video-card {
    padding: 15px
}

.workspace .video-card h3 {
    font-size: 13px
}

.workspace .record-controls {
    gap: 9px
}

.workspace .record-controls label {
    min-width: 190px
}

.workspace .recording-panel .tag {
    white-space: normal
}

.workspace #admin>.inner {
    margin-top: 18px;
    gap: 30px
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 240px;
    z-index: 100;
    background: #d1bcff;
    color: #160f22;
    padding: 12px;
    border-radius: 8px
}

.skip-link:focus {
    top: 12px
}

.workspace #toast {
    position: fixed;
    bottom: 20px;
    right: 24px;
    max-width: min(460px, calc(100vw - 40px));
    z-index: 30;
    box-shadow: 0 8px 35px #0006;
    margin: 0
}

.workspace .timer,
.workspace .metric-value {
    font-variant-numeric: tabular-nums
}

@media(min-width:1600px) {
    .workspace .program-preview .preview {
        max-width: 670px
    }

    .workspace main {
        padding: 30px 38px
    }

    .workspace .workspace-header {
        padding: 0 38px
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr)
    }
}

@media(max-width:1190px) {
    .workspace .sidebar {
        width: 190px;
        padding: 24px 12px
    }

    .workspace-shell {
        margin-left: 190px
    }

    .workspace main {
        padding: 24px 22px
    }

    .workspace .workspace-header {
        padding: 0 22px
    }

    .metric-card {
        padding: 14px 13px
    }

    .metric-value {
        font-size: 24px
    }

    .metric-value.timer {
        font-size: 23px
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr)
    }

    .summary-tile {
        gap: 9px;
        padding: 14px 12px
    }

    .summary-icon {
        display: none
    }

    .workspace .broadcast-actions {
        max-width: 145px;
        flex-direction: column
    }

    .workspace .program-preview .source-footer {
        flex-direction: column
    }

    .workspace .program-preview #program-hint {
        max-width: none
    }

    .sparkline {
        width: 48px
    }
}

@media(max-width:960px) {
    .dashboard-grid {
        grid-template-columns: 1fr
    }

    .workspace .program-preview .preview {
        max-width: 680px
    }

    .workspace .program-preview .source-footer {
        flex-direction: row
    }

    .workspace .twitch-metadata form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 14px
    }

    .workspace .twitch-metadata form>label:first-child {
        grid-column: 1/-1
    }

    .workspace .twitch-metadata form>button {
        align-self: end;
        justify-self: start
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .workspace .settings-columns {
        grid-template-columns: 1fr
    }

    .workspace .twitch-metadata .section-heading .ghost {
        max-width: none
    }

    .workspace .sources {
        grid-template-columns: 1fr
    }

    .summary-tile strong {
        font-size: 16px
    }
}

@media(max-width:760px) {
    .workspace .sidebar {
        position: sticky;
        top: 0;
        width: auto;
        height: auto;
        padding: 12px 16px 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        gap: 10px
    }

    .sidebar .brand {
        font-size: 18px;
        padding: 0;
        gap: 8px
    }

    .sidebar .brand-mark {
        width: 27px;
        height: 27px;
        border-radius: 7px;
        font-size: 20px
    }

    .workspace-label,
    .sidebar-bottom,
    .menu-label {
        display: none
    }

    .workspace .side-menu {
        flex-direction: row;
        gap: 5px;
        overflow-x: auto;
        padding: 0 0 10px;
        scrollbar-width: thin
    }

    .menu-link {
        flex-shrink: 0;
        min-height: 34px;
        padding: 7px 10px;
        font-size: 11px;
        gap: 6px
    }

    .menu-link svg {
        width: 14px;
        height: 14px
    }

    .workspace-shell {
        margin-left: 0
    }

    .workspace .workspace-header {
        height: 52px;
        padding: 0 16px
    }

    .breadcrumb {
        font-size: 10px
    }

    .breadcrumb span {
        margin: 0 6px
    }

    .workspace .connection {
        display: none
    }

    .workspace .header-account {
        gap: 7px
    }

    .workspace main {
        padding: 22px 16px 14px
    }

    .workspace .heading {
        display: flex;
        gap: 10px;
        margin-bottom: 18px
    }

    .workspace .heading>.tag {
        display: none
    }

    .workspace h1 {
        font-size: 22px
    }

    .workspace .heading p {
        font-size: 11px
    }

    .workspace .panel {
        padding: 17px
    }

    .workspace .broadcast {
        display: flex;
        padding: 17px;
        gap: 12px
    }

    .workspace .broadcast-left {
        min-width: 0
    }

    .workspace .status-title h2 {
        font-size: 16px
    }

    .workspace .broadcast-actions {
        max-width: 125px;
        flex-shrink: 0;
        margin: 0;
        gap: 7px
    }

    .workspace .broadcast-actions button {
        font-size: 10px;
        padding: 8px 9px
    }

    .workspace .broadcast-left>p {
        font-size: 10px
    }

    .workspace .route {
        font-size: 9px;
        gap: 7px
    }

    .workspace .route>span:not(.route-line) {
        padding: 3px 7px
    }

    .metrics-grid {
        gap: 10px;
        margin-bottom: 14px
    }

    .metric-label {
        font-size: 10px;
        gap: 6px
    }

    .metric-icon {
        width: 18px;
        height: 18px;
        font-size: 12px
    }

    .metric-value {
        font-size: 25px
    }

    .metric-value.timer {
        font-size: 24px
    }

    .metric-foot {
        font-size: 9px;
        min-height: 24px;
        gap: 4px
    }

    .metric-card {
        padding: 13px
    }

    .metric-value small {
        font-size: 10px
    }

    .media-summary {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 14px
    }

    .summary-tile {
        padding: 12px 14px
    }

    .summary-tile>div {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 14px;
        width: 100%
    }

    .summary-tile div>span {
        font-size: 11px
    }

    .summary-tile strong {
        grid-column: 2;
        grid-row: 1/3;
        align-self: center;
        font-size: 18px
    }

    .summary-tile small {
        font-size: 9px
    }

    .tile-arrow {
        display: none
    }

    .dashboard-grid {
        gap: 14px
    }

    .workspace .program-preview .source-footer {
        flex-direction: column;
        gap: 6px
    }

    .workspace .twitch-metadata form {
        display: block
    }

    .workspace .twitch-metadata .category-search {
        flex-direction: row
    }

    .workspace .twitch-metadata .section-heading {
        flex-direction: row
    }

    .workspace .twitch-metadata .section-heading .ghost {
        font-size: 9px;
        max-width: 95px
    }

    .workspace .upload-drawer form {
        flex-direction: column;
        align-items: stretch;
        gap: 0
    }

    .workspace .upload-drawer>summary>span {
        float: none;
        display: block;
        margin: 4px 0
    }

    .workspace .upload-drawer {
        padding: 15px
    }

    .workspace .record-controls {
        align-items: stretch
    }

    .workspace .record-controls label {
        min-width: 0
    }

    .workspace .record-controls button {
        width: 100%
    }

    .workspace .settings-columns .inner {
        grid-template-columns: 1fr
    }

    .workspace .source-pills {
        gap: 6px
    }

    .source-pill {
        font-size: 9px
    }

    .skip-link {
        left: 16px
    }

    .workspace #toast {
        bottom: 15px;
        right: 15px
    }

    .workspace .user-avatar {
        display: none
    }

    .workspace footer {
        flex-direction: column;
        gap: 5px
    }

    .workspace .wide-details>summary>span {
        float: none;
        display: block
    }
}

@media(prefers-reduced-motion:reduce) {
    .workspace * {
        animation: none !important;
        transition: none !important
    }
}

/* Multistream destinations and shared chat */
.destination-health {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 9px
}

.destination-pill {
    padding: 3px 7px;
    border: 1px solid var(--line);
    font-size: 9px;
    border-radius: 5px;
    color: var(--muted)
}

.destination-pill.forwarding {
    color: var(--green);
    background: #14271f;
    border-color: #2c4d3e
}

.destination-pill.error {
    color: var(--red);
    border-color: #6d3944
}

.destination-pill.renewing,
.destination-pill.connecting {
    color: var(--amber)
}

.target-list {
    margin: 15px 0
}

.target-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line)
}

.target-item label {
    flex-direction: row;
    align-items: center;
    margin: 0;
    gap: 10px
}

.target-item input[type=checkbox] {
    width: auto;
    accent-color: var(--purple)
}

.target-item .badge {
    font-size: 9px;
    white-space: normal
}

.platform-connections {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: 16px
}

.youtube-button {
    display: block;
    text-align: center;
    padding: 10px;
    border: 1px solid #743940;
    background: #321e24;
    color: #ffb9bd;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600
}

.youtube-broadcast-controls {
    margin: 12px 0
}

.youtube-broadcast-controls>.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.google-app-settings {
    grid-column: 1/-1;
    max-width: 760px;
    border-top: 1px solid var(--line);
    padding-top: 22px
}

.studio-panel {
    min-width: 0;
    display: flex;
    flex-direction: column
}

.studio-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 12px
}

.workspace .studio-tabs button {
    background: transparent;
    color: #95a0b5;
    padding: 7px 12px;
    font-size: 11px;
    border: 1px solid transparent
}

.workspace .studio-tabs button[aria-selected=true] {
    background: #292238;
    color: #d4bfff;
    border-color: #493657
}

.workspace .studio-panel .twitch-metadata {
    background: transparent;
    border: 0;
    padding: 0
}

.workspace .studio-panel .twitch-metadata .section-heading .eyebrow {
    display: none
}

.chat-component {
    display: flex;
    flex-direction: column;
    min-width: 0
}

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.chat-toolbar h2 {
    font-size: 14px
}

.workspace .chat-filter {
    width: auto;
    max-width: 180px;
    font-size: 10px;
    padding: 6px
}

.chat-connections {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 9px;
    color: #8390a7;
    margin: 10px 0
}

.chat-twitch-status {
    color: #b4a0db
}

.chat-youtube-status {
    color: #d6a1a8
}

.chat-messages {
    height: 245px;
    overflow-y: auto;
    background: #0d1119;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    min-width: 0;
    overscroll-behavior: contain;
    scrollbar-width: thin
}

.chat-empty {
    color: #7e8ba2;
    font-size: 11px;
    line-height: 1.7;
    margin: 12px 5px
}

.chat-row {
    padding: 7px 0;
    border-bottom: 1px solid #202632;
    font-size: 12px;
    overflow-wrap: anywhere
}

.chat-row:last-child {
    border-bottom: 0
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0
}

.chat-message-header strong {
    font-size: 11px;
    color: #d1d8e7;
    overflow-wrap: anywhere
}

.chat-message-header time {
    margin-left: auto;
    white-space: nowrap;
    font-size: 9px;
    color: #64758f
}

.chat-platform {
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .5px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #31243f;
    color: #c6a9ee;
    flex-shrink: 0
}

.chat-row.youtube .chat-platform {
    background: #38232a;
    color: #edafb6
}

.chat-row p {
    font-size: 12px;
    margin: 5px 0 1px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #c0cadb
}

.workspace .chat-compose label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    margin: 10px 0 7px;
    gap: 8px
}

.workspace .chat-target {
    width: auto;
    max-width: 190px;
    font-size: 10px;
    padding: 6px 8px
}

.chat-input-row {
    display: flex;
    gap: 7px;
    align-items: stretch
}

.chat-message {
    width: 100%;
    min-width: 0;
    resize: vertical;
    min-height: 46px;
    max-height: 150px;
    font: 12px/1.5 system-ui;
    color: var(--text);
    background: #0d1119;
    border: 1px solid #353d4b;
    border-radius: 8px;
    padding: 9px
}

.chat-input-row button {
    flex-shrink: 0
}

.chat-feedback {
    min-height: 16px;
    font-size: 10px !important;
    margin: 7px 0 0
}

.chat-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 18px;
    align-items: start
}

.full-chat .chat-messages {
    height: 440px
}

.widget-settings h2 {
    margin-top: 5px
}

.widget-settings .video-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.chat-widget {
    margin: 0;
    background: #0c1017;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 12px;
    font: 13px/1.5 system-ui;
    color: #d5ddec
}

.widget-chat-heading {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    padding: 0 3px 10px
}

.widget-chat-heading>span {
    font-size: 9px;
    color: #94a1b5
}

.chat-widget .chat-messages {
    height: auto;
    flex: 1
}

.chat-widget.transparent {
    background: transparent;
    padding: 0
}

.chat-widget.transparent .widget-chat-heading {
    display: none
}

.chat-widget.transparent .chat-messages {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 12px
}

.chat-widget.transparent .chat-row {
    background: #10141dcc;
    border-radius: 6px;
    margin: 5px 0;
    padding: 9px;
    border: 0
}

.chat-widget.transparent .chat-row p {
    color: #f1f3fa
}

.chat-widget.transparent .chat-empty {
    display: none
}

@media(max-width:1100px) {
    .chat-page-grid {
        grid-template-columns: 1fr
    }

    .chat-page-grid .widget-settings {
        max-width: none
    }
}

@media(max-width:760px) {
    .workspace .chat-filter {
        max-width: 155px
    }

    .workspace .chat-toolbar h2 {
        font-size: 13px
    }

    .workspace .chat-compose label {
        flex-wrap: wrap
    }

    .chat-messages {
        height: 270px
    }

    .full-chat .chat-messages {
        height: 360px
    }

    .chat-page-grid {
        gap: 14px
    }

    .target-item {
        gap: 6px
    }

    .target-item .ghost {
        font-size: 9px
    }

    .chat-message {
        font-size: 12px
    }

    .workspace .studio-panel {
        padding: 17px
    }
}

.chat-connect-link {
    font-size: 9px;
    color: #a895cb;
    margin-top: 3px;
    align-self: flex-start
}

.target-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0
}

.target-presets button {
    font-size: 10px !important;
    padding: 7px 10px !important
}

#target-summary {
    color: var(--green);
    font-size: 11px;
    line-height: 1.7
}