.media-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.media-switcher-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    color: #243247;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.media-switcher-link.active {
    border-color: #bfdbfe;
    background: #eaf3ff;
    color: #1d5fbf;
}

.media-module-panel {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.media-module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.media-module-header h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
}

.media-module-header p {
    margin: 6px 0 0;
    color: #64748b;
}

.media-module-actions {
    display: flex;
    gap: 10px;
}

.media-launch-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

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

.media-kpi-card {
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.media-kpi-card span {
    display: block;
    color: #64748b;
    font-size: 14px;
}

.media-kpi-card strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}

.media-placeholder-panel {
    margin-top: 18px;
    border-radius: 14px;
    background: #f8fafc;
    padding: 18px;
    color: #64748b;
}

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

    .media-module-header {
        flex-direction: column;
    }
}

/*--------------------------------------------------------------------
  Media action button alignment
--------------------------------------------------------------------*/

.media-switcher-wrap {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
}

.media-switcher {
    grid-column: 1;
}

.media-report-action-row {
    grid-column: 3;
    justify-self: end;
}

.media-spotrep-button,
.media-weekly-report-button {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .media-switcher-wrap {
        grid-template-columns: 1fr !important;
    }

    .media-report-action-row {
        grid-column: 1;
        justify-self: start;
    }
}

/*--------------------------------------------------------------------
  Final media switcher action layout fix
--------------------------------------------------------------------*/

.media-switcher-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

.media-switcher {
    flex: 0 0 auto !important;
}

.media-report-action-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

.media-spotrep-button,
.media-weekly-report-button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 1100px) {
    .media-switcher-wrap {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .media-report-action-row {
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }
}

/* Report Center */
.report-center-modal.hidden {
    display: none;
}

.report-center-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.report-center-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.report-center-panel {
    position: relative;
    width: min(1320px, calc(100vw - 48px));
    height: min(820px, calc(100vh - 48px));
    margin: 24px auto;
    background: #f8fafc;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.report-center-header,
.report-center-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.report-center-footer {
    border-top: 1px solid #e5e7eb;
    border-bottom: 0;
}

.report-center-header h2 {
    margin: 0;
    font-size: 20px;
}

.report-center-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.report-center-header button,
.report-center-footer button,
.report-center-generate-button {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    background: #e2e8f0;
    color: #0f172a;
}

.report-center-generate-button {
    background: #2563eb;
    color: white;
    width: 100%;
    margin-top: 12px;
}

.report-center-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 260px;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}

.report-center-settings,
.report-center-overview,
.report-center-canvas {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    overflow: auto;
}

.report-center-settings h3,
.report-center-overview h3 {
    margin: 0 0 14px;
}

.report-center-settings label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #334155;
}

.report-center-settings input,
.report-center-settings select,
.report-center-settings textarea {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
}

.report-center-settings textarea {
    min-height: 96px;
    resize: vertical;
}

.report-center-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-center-engine {
    text-align: center;
    max-width: 520px;
}

.report-center-engine.hidden,
.report-center-output.hidden {
    display: none;
}

.report-center-engine-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: #eff6ff;
    color: #2563eb;
    display: grid;
    place-items: center;
    font-size: 30px;
    margin: 0 auto 16px;
}

.report-center-engine h3 {
    margin: 0;
    font-size: 24px;
}

.report-center-engine p {
    color: #64748b;
}

.report-center-progress {
    margin-top: 22px;
    text-align: left;
    display: grid;
    gap: 10px;
}

.report-center-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

.report-center-progress-item.active {
    color: #1d4ed8;
    background: #eff6ff;
}

.report-center-progress-item.done {
    color: #047857;
    background: #ecfdf5;
}

.report-center-output {
    width: 100%;
    height: 100%;
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
    color: #0f172a;
}

.report-center-empty {
    color: #64748b;
    font-size: 13px;
}


.report-center-overview-list {
    display: grid;
    gap: 12px;
}

.report-center-overview-list > div {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.report-center-overview-list span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.report-center-overview-list strong {
    color: #0f172a;
    font-size: 15px;
}




.report-center-settings label.report-center-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 8px 0 14px;
    cursor: pointer;
}

.report-center-settings label.report-center-checkbox input {
    margin: 0;
    flex: 0 0 auto;
}

.report-center-settings label.report-center-checkbox span {
    font-size: 14px;
    color: #475569;
}

.report-center-footer > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-center-action-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.report-center-action-button.word {
    color: #1d4ed8;
}

.report-center-action-button.copy {
    color: #334155;
}

.report-center-action-button i {
    font-size: 16px;
}

.report-center-overview {
    position: sticky;
    top: 0;
}

/* Shared Report Center yellow identity */
.media-weekly-report-button,
.report-center-generate-button {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #111827 !important;
}

.media-weekly-report-button:hover,
.report-center-generate-button:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #111827 !important;
}

/* Better vertical spacing for top section */
.media-switcher-wrap {
    margin-bottom: 24px;
}

.news-status-card,
.am-status-card,
.ap-status-card {
    margin-bottom: 24px;
}

/* Report Center mobile layout */
@media (max-width: 768px) {
    .report-center-panel {
        width: min(96vw, 520px);
        max-height: calc(100vh - 24px);
        margin: 12px auto;
        border-radius: 18px;
        overflow: hidden;
    }

    .report-center-header,
    .report-center-footer {
        padding: 14px 16px;
    }

    .report-center-header h2 {
        font-size: 22px;
    }

    .report-center-header p {
        font-size: 14px;
        line-height: 1.25;
    }

    .report-center-header button {
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
    }

    .report-center-layout {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 14px 16px;
        max-height: calc(100vh - 170px);
        overflow-y: auto;
    }

    .report-center-settings,
    .report-center-overview,
    .report-center-canvas {
        width: 100%;
        max-width: none;
        min-width: 0;
        position: static;
    }

    .report-center-settings {
        order: 1;
    }

    .report-center-overview {
        order: 2;
    }

    .report-center-canvas {
        order: 3;
        min-height: 260px;
    }

    .report-center-settings input,
    .report-center-settings select,
    .report-center-settings textarea {
        min-height: 44px;
        font-size: 15px;
    }

    .report-center-generate-button {
        min-height: 48px;
        width: 100%;
    }

    .report-center-engine {
        min-height: 240px;
        padding: 18px;
    }

    .report-center-output {
        max-height: 45vh;
        overflow-y: auto;
        white-space: normal;
        font-size: 15px;
        line-height: 1.5;
    }

    .report-center-footer {
        min-height: 60px;
        gap: 12px;
    }

    .report-center-footer > span {
        font-size: 14px;
        line-height: 1.25;
    }

    .report-center-footer > div {
        margin-left: auto;
        flex-shrink: 0;
    }

    .report-center-action-button {
        width: 44px;
        height: 44px;
    }
}

/* Report Center mobile optimisation */
@media (max-width: 768px) {

    /* Hide desktop-only summary panel */
    .report-center-overview {
        display: none !important;
    }

    /* Use full width for report preview */
    .report-center-layout {
        display: flex;
        flex-direction: column;
    }

    .report-center-settings {
        order: 1;
    }

    .report-center-canvas {
        order: 2;
        width: 100%;
        max-width: none;
    }

    .report-center-output {
        max-height: 55vh;
        overflow-y: auto;
    }
}


/* Report Center mobile UX improvements */
@media (max-width: 768px) {

    /* One continuous scroll instead of nested scrolling */
    .report-center-layout {
        overflow-y: auto;
        max-height: calc(100vh - 170px);
    }

    /* Settings should fully expand */
    .report-center-settings {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .report-center-settings form,
    .report-center-settings-body,
    #report-center-settings-body {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    /* Don't reserve unnecessary space before report generation */
    .report-center-canvas {
        min-height: auto !important;
    }

    .report-center-engine {
        min-height: auto !important;
        padding: 24px 16px;
    }

    /* Let preview size naturally */
    .report-center-output {
        max-height: none;
        overflow: visible;
    }
}


/* Media Report Center mobile polish */
@media (max-width: 768px) {
    .report-center-panel {
        width: min(96vw, 520px);
        margin: 12px auto;
        max-height: calc(100vh - 24px);
    }

    .report-center-layout {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        max-height: calc(100vh - 170px);
    }

    .report-center-overview {
        display: none !important;
    }

    .report-center-settings,
    .report-center-canvas {
        width: 100%;
        max-width: none;
        min-width: 0;
        position: static;
    }

    .report-center-settings {
        order: 1;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .report-center-canvas {
        order: 2;
        min-height: auto !important;
    }

    .report-center-engine {
        min-height: auto !important;
        padding: 20px 16px;
    }

    .report-center-output {
        max-height: none;
        overflow: visible;
        white-space: normal;
    }

    .report-center-footer {
        min-height: 60px;
        padding: 12px 16px;
    }

    .report-center-footer > div {
        margin-left: auto;
    }

    .report-center-action-button {
        width: 44px;
        height: 44px;
    }
}

/* Report Center mobile: taller report area, popup scrolls */
@media (max-width: 768px) {
    .report-center-panel {
        overflow-y: auto !important;
    }

    .report-center-layout {
        max-height: none !important;
        overflow: visible !important;
    }

    .report-center-canvas {
        min-height: 420px !important;
    }

    .report-center-engine {
        min-height: 380px !important;
    }

    .report-center-output {
        min-height: 420px;
        max-height: none !important;
        overflow: visible !important;
    }
}
