.layout-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

.cell-publisher,
.cell-source {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: stretch;
}

.cell-header {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 280px);
    align-items: start;
    gap: 24px;
}

.header-brand {
    align-self: start;
}

.header-copy {
    min-width: 0;
}

.header-health {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.health-item {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.header-side {
    min-width: 0;
    justify-self: end;
    align-self: start;
}

.publisher-overview {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.publisher-summary-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(191, 215, 50, 0.18);
    background:
        linear-gradient(135deg, rgba(191, 215, 50, 0.1), rgba(191, 215, 50, 0.02) 45%, rgba(255, 255, 255, 0.02)),
        rgba(7, 12, 18, 0.72);
}

.publisher-summary-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.publisher-summary-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.22rem, 2vw, 1.72rem);
}

#stream-source-summary {
    margin: 0;
    width: 100%;
    color: #d6dee6;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.stream-state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.34rem 0.82rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(248, 251, 255, 0.94);
    white-space: normal;
    text-align: center;
}

.stream-state-badge.state-publishing {
    border-color: rgba(71, 211, 127, 0.32);
    background: rgba(71, 211, 127, 0.16);
    color: #e8fff0;
}

.stream-state-badge.state-waiting_for_publish,
.stream-state-badge.state-idle {
    border-color: rgba(244, 200, 78, 0.3);
    background: rgba(244, 200, 78, 0.14);
    color: #fff2cd;
}

.stream-state-badge.state-disabled,
.stream-state-badge.state-error {
    border-color: rgba(255, 102, 116, 0.36);
    background: rgba(255, 102, 116, 0.16);
    color: #ffe0e5;
}

.stream-target-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.stream-target-panel p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stream-target-panel code {
    font-size: 0.95rem;
    color: #eef5b8;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

#publisher-status-message {
    display: block;
    margin-top: 0;
}

.kpi-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-height: 0;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
        rgba(11, 17, 24, 0.78);
}

.kpi-label {
    margin: 0;
    color: #a7b3bf;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kpi-value {
    margin: 0;
    color: var(--accent-strong);
    font-family: var(--font-display);
    font-size: clamp(1.22rem, 2vw, 1.66rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.kpi-meta {
    margin: 0;
    color: #d0d8df;
    font-size: 0.84rem;
    line-height: 1.45;
}

.upload-note {
    width: 100%;
    margin: 0;
    line-height: 1.6;
}

.source-method-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.source-method-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        rgba(10, 14, 20, 0.78);
}

.source-method-card p {
    margin: 0;
}

.source-method-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.source-method-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.06rem;
}

.source-method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.36rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(80, 238, 199, 0.24);
    background: rgba(80, 238, 199, 0.12);
    color: #dffdf6;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: normal;
    text-align: center;
}

.url-upload-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.url-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 11, 15, 0.62);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 10px 12px;
    min-width: 0;
}

.url-input:focus {
    outline: none;
    border-color: rgba(191, 215, 50, 0.7);
    box-shadow: 0 0 0 3px rgba(191, 215, 50, 0.12);
}

@media (max-width: 640px) {
    .publisher-summary-card,
    .source-method-card,
    .kpi-card {
        padding: 14px;
    }

    .health-item {
        width: 100%;
        min-width: 0;
    }
}
