/* Podcast feature — scoped styles (page-podcast).
   Mirrors the visual conventions of #page-web (web-scraper.css). */

/* =============================================================
   Page header
   ============================================================= */
#page-podcast .pc-page-header {
    padding: 16px 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#page-podcast .breadcrumb-page {
    font-size: 12px;
    color: var(--text-secondary, #8a93a1);
    letter-spacing: 0.04em;
}

#page-podcast .breadcrumb-sep {
    margin: 0 6px;
    opacity: 0.6;
}

#page-podcast .breadcrumb-item.current {
    color: var(--text-primary, #e6ecf3);
}

#page-podcast .pc-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* =============================================================
   Body
   ============================================================= */
#page-podcast .pc-body {
    padding: 0 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

#page-podcast .pc-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-subtle, #2b3342);
    border-radius: 10px;
    padding: 18px 20px;
    min-width: 0;
}

#page-podcast .pc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

#page-podcast .pc-card-header h2 {
    margin: 0;
    font-size: 17px;
    color: var(--text-primary, #e6ecf3);
}

#page-podcast .pc-card-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary, #8a93a1);
    max-width: 640px;
}

/* =============================================================
   Buttons
   ============================================================= */
#page-podcast .pc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle, #2b3342);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    color: var(--text-primary, #e6ecf3);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

#page-podcast .pc-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

#page-podcast .pc-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#page-podcast .pc-btn-primary {
    background: var(--accent-color, #4f9cf9);
    border-color: var(--accent-color, #4f9cf9);
    color: #ffffff;
}

#page-podcast .pc-btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    background: var(--accent-color, #4f9cf9);
}

#page-podcast .pc-btn-secondary {
    background: rgba(79, 156, 249, 0.12);
    border-color: rgba(79, 156, 249, 0.4);
    color: var(--accent-color, #4f9cf9);
}

#page-podcast .pc-btn-danger {
    background: rgba(239, 83, 80, 0.12);
    border-color: rgba(239, 83, 80, 0.4);
    color: #ef5350;
}

#page-podcast .pc-btn-ghost {
    background: transparent;
}

#page-podcast .pc-btn-icon {
    font-size: 14px;
    line-height: 1;
}

#page-podcast .pc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-subtle, #2b3342);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    color: var(--text-primary, #e6ecf3);
    cursor: pointer;
    text-decoration: none;
}

#page-podcast .pc-icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

#page-podcast .pc-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-podcast .pc-icon-btn-danger:hover:not(:disabled) {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.5);
}

/* GitHub upload indicator next to the status badge */
#page-podcast .pc-gh {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    vertical-align: middle;
}
#page-podcast .pc-gh-ok {
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.12);
    border: 1px solid rgba(46, 125, 50, 0.4);
}
#page-podcast .pc-gh-ok:hover {
    background: rgba(46, 125, 50, 0.22);
}
#page-podcast .pc-gh-fail {
    color: #ed6c02;
    background: rgba(237, 108, 2, 0.12);
    border: 1px solid rgba(237, 108, 2, 0.4);
    cursor: help;
}

/* Active "now playing" state for the per-row play/pause button */
#page-podcast .pc-icon-btn-playing {
    background: rgba(79, 156, 249, 0.18);
    border-color: rgba(79, 156, 249, 0.6);
    color: var(--accent-color, #4f9cf9);
    box-shadow: 0 0 0 2px rgba(79, 156, 249, 0.18);
}
#page-podcast .pc-icon-btn-playing:hover {
    background: rgba(79, 156, 249, 0.28);
}

/* =============================================================
   Pills (status / scheduler)
   ============================================================= */
#page-podcast .pc-status-pill,
#page-podcast .pc-scheduler-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle, #2b3342);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    font-size: 12px;
    color: var(--text-secondary, #b4bdca);
    line-height: 1.2;
}

#page-podcast .pc-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8a93a1;
    flex-shrink: 0;
}

#page-podcast .pc-pill-label {
    color: var(--text-secondary, #8a93a1);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
}

#page-podcast .pc-pill-value {
    color: var(--text-primary, #e6ecf3);
    font-weight: 500;
}

#page-podcast .pc-status-pill[data-state="idle"] .pc-pill-dot,
#page-podcast .pc-scheduler-pill[data-state="idle"] .pc-pill-dot {
    background: #8a93a1;
}

#page-podcast .pc-status-pill[data-state="running"] .pc-pill-dot,
#page-podcast .pc-scheduler-pill[data-state="scheduled"] .pc-pill-dot {
    background: #4f9cf9;
    box-shadow: 0 0 0 3px rgba(79, 156, 249, 0.18);
    animation: pcPulse 1.5s ease-in-out infinite;
}

#page-podcast .pc-status-pill[data-state="completed"] .pc-pill-dot {
    background: #4caf50;
}

#page-podcast .pc-status-pill[data-state="failed"] .pc-pill-dot,
#page-podcast .pc-scheduler-pill[data-state="error"] .pc-pill-dot {
    background: #ef5350;
}

#page-podcast .pc-scheduler-pill[data-state="disabled"] .pc-pill-dot {
    background: #6b7280;
}

@keyframes pcPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* =============================================================
   Generate card
   ============================================================= */
#page-podcast .pc-generate-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#page-podcast .pc-history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#page-podcast .pc-options-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-subtle, #2b3342);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

#page-podcast .pc-option-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#page-podcast .pc-option-field label {
    font-size: 12px;
    color: var(--text-primary, #e6ecf3);
    font-weight: 600;
}

#page-podcast .pc-option-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle, #2b3342);
    border-radius: 6px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    color: var(--text-primary, #e6ecf3);
    font-size: 13px;
}

#page-podcast .pc-option-hint {
    font-size: 11px;
    color: var(--text-secondary, #8a93a1);
    line-height: 1.35;
}

#page-podcast .pc-option-summary {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-secondary, #b4bdca);
    padding-top: 2px;
}

#page-podcast .pc-option-summary[data-state="error"] {
    color: #ef5350;
}

#page-podcast .pc-progress {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-subtle, #2b3342);
}

#page-podcast .pc-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #b4bdca);
    margin-bottom: 6px;
}

#page-podcast .pc-progress-stage {
    color: var(--text-primary, #e6ecf3);
    font-weight: 500;
}

#page-podcast .pc-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

#page-podcast .pc-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-color, #4f9cf9);
    transition: width 0.3s ease;
}

#page-podcast .pc-progress-fill[data-indeterminate="true"] {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.18) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.18) 75%,
        transparent 75%,
        transparent
    );
    background-size: 18px 18px;
    animation: pcProgressStripe 1s linear infinite;
}

#page-podcast .pc-progress-msg {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary, #8a93a1);
    min-height: 16px;
}

#page-podcast .pc-progress-detail {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-primary, #e6ecf3);
    min-height: 16px;
}

#page-podcast .pc-progress-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary, #8a93a1);
    line-height: 1.4;
}

@keyframes pcProgressStripe {
    from { background-position: 0 0; }
    to { background-position: 18px 0; }
}

/* =============================================================
   Bulk action bar
   ============================================================= */
#page-podcast .pc-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(79, 156, 249, 0.08);
    border: 1px solid rgba(79, 156, 249, 0.3);
    border-radius: 8px;
}

#page-podcast .pc-bulk-count {
    font-size: 13px;
    color: var(--text-primary, #e6ecf3);
    font-weight: 500;
}

#page-podcast .pc-bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =============================================================
   History table
   ============================================================= */
#page-podcast .pc-table-wrap {
    overflow-x: auto;
}

#page-podcast .pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#page-podcast .pc-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #8a93a1);
    border-bottom: 1px solid var(--border-subtle, #2b3342);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

#page-podcast .pc-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle, #2b3342);
    color: var(--text-primary, #e6ecf3);
    vertical-align: middle;
}

#page-podcast .pc-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

#page-podcast .pc-table .pc-col-check {
    width: 36px;
}

#page-podcast .pc-table .pc-col-title {
    min-width: 220px;
    color: var(--text-primary, #e6ecf3);
    font-weight: 500;
}

#page-podcast .pc-table .pc-col-date,
#page-podcast .pc-table .pc-col-duration,
#page-podcast .pc-table .pc-col-size {
    white-space: nowrap;
    color: var(--text-secondary, #b4bdca);
}

#page-podcast .pc-table .pc-col-topics {
    color: var(--text-secondary, #b4bdca);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#page-podcast .pc-table .pc-col-actions {
    width: 110px;
    white-space: nowrap;
}

#page-podcast .pc-row-actions {
    display: inline-flex;
    gap: 6px;
}

#page-podcast .pc-muted {
    color: var(--text-secondary, #8a93a1);
    opacity: 0.6;
}

/* =============================================================
   Status badges
   ============================================================= */
#page-podcast .pc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-subtle, #2b3342);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    color: var(--text-secondary, #b4bdca);
}

#page-podcast .pc-badge-completed {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.4);
    color: #69d176;
}

#page-podcast .pc-badge-running {
    background: rgba(79, 156, 249, 0.12);
    border-color: rgba(79, 156, 249, 0.4);
    color: var(--accent-color, #4f9cf9);
}

#page-podcast .pc-badge-failed,
#page-podcast .pc-badge-error {
    background: rgba(239, 83, 80, 0.12);
    border-color: rgba(239, 83, 80, 0.4);
    color: #ef5350;
}

#page-podcast .pc-badge-scheduled {
    background: rgba(186, 104, 200, 0.12);
    border-color: rgba(186, 104, 200, 0.4);
    color: #ce93d8;
}

#page-podcast .pc-badge-pending {
    background: rgba(255, 167, 38, 0.12);
    border-color: rgba(255, 167, 38, 0.4);
    color: #ffa726;
}

/* =============================================================
   Empty / loading states
   ============================================================= */
#page-podcast .pc-empty-state,
#page-podcast .pc-loading-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #8a93a1);
}

#page-podcast .pc-empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.7;
}

#page-podcast .pc-empty-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #e6ecf3);
}

#page-podcast .pc-empty-sub {
    margin: 0;
    font-size: 12px;
}

/* =============================================================
   Checkboxes
   ============================================================= */
#page-podcast input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-color, #4f9cf9);
}

/* =============================================================
   Responsive — stack vertically below 1180px
   ============================================================= */
@media (max-width: 1180px) {
    #page-podcast .pc-body {
        padding: 0 16px 24px;
    }

    #page-podcast .pc-page-header {
        padding: 14px 16px 10px;
    }

    #page-podcast .pc-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #page-podcast .pc-generate-actions {
        width: 100%;
    }

    #page-podcast .pc-generate-actions .pc-btn-primary {
        flex: 1;
        justify-content: center;
    }

    #page-podcast .pc-bulk-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    #page-podcast .pc-bulk-actions {
        width: 100%;
    }

    #page-podcast .pc-bulk-actions .pc-btn {
        flex: 1;
        justify-content: center;
    }

    #page-podcast .pc-table {
        min-width: 760px;
    }
}

/* =============================================================
   Phone breakpoint — collapse the history table into stacked cards.
   Sidebar at <=768px shrinks to 60px-wide icon rail (base.css), so the
   podcast page renders inside ~315px on a 375px iPhone. The 1180px
   horizontal-scroll table is unusable at that width, so we flip the
   <table> into a block-stacked card list. Status persistence (LS_KEY_*)
   and the SocketIO-driven state machine in podcast.js are untouched —
   this is presentation only.
   ============================================================= */
@media (max-width: 768px) {
    #page-podcast {
        overflow-x: hidden;
    }
    #page-podcast .pc-body {
        padding: 0 12px 24px;
        gap: 14px;
    }
    #page-podcast .pc-page-header {
        padding: 12px 12px 8px;
    }
    #page-podcast .page-title {
        font-size: 20px;
    }
    #page-podcast .pc-card {
        padding: 14px;
        border-radius: 8px;
    }
    #page-podcast .pc-card-header {
        margin-bottom: 10px;
    }
    #page-podcast .pc-card-header h2 {
        font-size: 16px;
    }
    #page-podcast .pc-card-header p {
        font-size: 12px;
        line-height: 1.45;
    }

    /* Status / scheduler pills — wrap and shrink so they fit two-up */
    #page-podcast .pc-header-meta {
        gap: 6px;
    }
    #page-podcast .pc-status-pill,
    #page-podcast .pc-scheduler-pill {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 11px;
        padding: 5px 10px;
        gap: 6px;
    }
    #page-podcast .pc-pill-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    #page-podcast .pc-options-panel {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 10px;
        padding: 10px;
    }
    #page-podcast .pc-option-field input {
        min-height: 42px;
        font-size: 16px;
    }
    #page-podcast .pc-option-hint {
        display: none;
    }
    #page-podcast .pc-option-summary {
        line-height: 1.4;
    }

    #page-podcast .pc-progress-row {
        align-items: flex-start;
        gap: 8px;
    }
    #page-podcast .pc-progress-stage {
        min-width: 0;
        line-height: 1.35;
    }
    #page-podcast .pc-progress-pct {
        flex-shrink: 0;
        font-variant-numeric: tabular-nums;
    }

    /* Generate / Sync / History action buttons stack vertically */
    #page-podcast .pc-generate-actions,
    #page-podcast .pc-history-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    #page-podcast .pc-generate-actions .pc-btn,
    #page-podcast .pc-history-actions .pc-btn {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    /* History table → block-stacked cards */
    #page-podcast .pc-table-wrap {
        overflow-x: visible;
    }
    #page-podcast .pc-table {
        min-width: 0 !important;
        display: block;
        border-collapse: separate;
    }
    #page-podcast .pc-table thead {
        display: none;
    }
    #page-podcast .pc-table tbody,
    #page-podcast .pc-table tbody tr {
        display: block;
        width: 100%;
    }
    #page-podcast .pc-table tbody tr {
        position: relative;
        margin-bottom: 10px;
        padding: 12px 12px 10px;
        border: 1px solid var(--border-subtle, #2b3342);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.02);
    }
    #page-podcast .pc-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }
    #page-podcast .pc-table tbody td {
        display: block;
        padding: 2px 0;
        border-bottom: none;
        font-size: 12px;
        line-height: 1.45;
        white-space: normal;
    }
    #page-podcast .pc-table tbody td.pc-col-check {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0;
        width: auto;
    }
    #page-podcast .pc-table .pc-col-title {
        font-size: 14px;
        min-width: 0;
        max-width: none;
        padding-right: 36px;
        margin-bottom: 4px;
        line-height: 1.35;
    }
    #page-podcast .pc-table .pc-col-date,
    #page-podcast .pc-table .pc-col-duration,
    #page-podcast .pc-table .pc-col-size,
    #page-podcast .pc-table .pc-col-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    #page-podcast .pc-table .pc-col-date::before,
    #page-podcast .pc-table .pc-col-duration::before,
    #page-podcast .pc-table .pc-col-size::before,
    #page-podcast .pc-table .pc-col-status::before,
    #page-podcast .pc-table .pc-col-topics::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-secondary, #8a93a1);
        font-size: 10px;
        font-style: normal;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        opacity: 0.85;
    }
    #page-podcast .pc-table .pc-col-topics {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 10px;
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        opacity: 0.85;
    }
    #page-podcast .pc-table .pc-col-status {
        margin-top: 6px;
    }
    #page-podcast .pc-table .pc-col-actions {
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-subtle, #2b3342);
    }
    #page-podcast .pc-table .pc-row-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    /* Tap targets — 44px keeps playback/delete comfortable on phones. */
    #page-podcast .pc-icon-btn {
        width: 100%;
        min-width: 44px;
        min-height: 44px;
    }
    #page-podcast .pc-btn {
        min-height: 44px;
    }

    /* Bulk action bar — keep two columns of buttons on phones */
    #page-podcast .pc-bulk-actions .pc-btn {
        flex: 1 1 calc(50% - 4px);
        font-size: 12px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    #page-podcast .pc-body { padding: 0 10px 20px; }
    #page-podcast .pc-card { padding: 12px; }
    #page-podcast .pc-page-header { padding: 10px 10px 6px; }
    #page-podcast .page-title { font-size: 18px; }

    #page-podcast .breadcrumb-page {
        display: none;
    }

    #page-podcast .pc-status-pill,
    #page-podcast .pc-scheduler-pill {
        flex-basis: 100%;
        font-size: 10.5px;
        padding: 4px 8px;
    }
    #page-podcast .pc-pill-label {
        font-size: 10px;
        letter-spacing: 0.04em;
    }

    #page-podcast .pc-table tbody tr { padding: 10px; }
    #page-podcast .pc-table .pc-col-title { font-size: 13.5px; }

    #page-podcast .pc-bulk-actions .pc-btn { flex: 1 1 100%; }
}

/* =============================================================
   Error banner — shown when a job fails or is cancelled. Sits
   inside the Generate card after the (now-hidden) progress section.
   ============================================================= */
#page-podcast .pc-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 14px;
    border-radius: 8px;
    border: 1px solid rgba(239, 83, 80, 0.45);
    background: rgba(239, 83, 80, 0.08);
}

/* The HTML `hidden` attribute defaults to display:none via the user-agent
   stylesheet, but the rule above (`display: flex`) is more specific and
   wins — so without this override `banner.hidden = true` from JS would
   set the attribute but the banner would stay visible. Same gotcha
   applies to the self-heal sub-row. */
#page-podcast .pc-error-banner[hidden],
#page-podcast .pc-error-banner-selfheal[hidden] {
    display: none !important;
}

#page-podcast .pc-error-banner-icon {
    font-size: 20px;
    line-height: 1;
    color: #ef5350;
    flex-shrink: 0;
    margin-top: 2px;
}

#page-podcast .pc-error-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

#page-podcast .pc-error-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #ef5350;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

#page-podcast .pc-error-banner-message {
    font-size: 13px;
    color: var(--text-primary, #e6ecf3);
    line-height: 1.5;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

#page-podcast .pc-error-banner-selfheal {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(239, 83, 80, 0.25);
    font-size: 12px;
    color: var(--text-secondary, #b4bdca);
    line-height: 1.5;
}

#page-podcast .pc-error-banner-selfheal[data-state="running"] { color: var(--accent-color, #4f9cf9); }
#page-podcast .pc-error-banner-selfheal[data-state="success"] { color: #69d176; }
#page-podcast .pc-error-banner-selfheal[data-state="failure"] { color: #ffa726; }
#page-podcast .pc-error-banner-selfheal[data-state="skipped"] { color: var(--text-secondary, #8a93a1); }

#page-podcast .pc-error-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(239, 83, 80, 0.35);
    background: rgba(239, 83, 80, 0.05);
    color: var(--text-primary, #e6ecf3);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#page-podcast .pc-error-banner-btn:hover {
    background: rgba(239, 83, 80, 0.18);
    border-color: rgba(239, 83, 80, 0.65);
}

#page-podcast .pc-error-banner-btn-icon {
    font-size: 13px;
}

#page-podcast .pc-error-banner-btn-label {
    font-weight: 500;
}

#page-podcast .pc-error-banner-btn.pc-error-banner-copied {
    color: #69d176;
    border-color: rgba(76, 175, 80, 0.55);
    background: rgba(76, 175, 80, 0.12);
}

#page-podcast .pc-error-banner-close .pc-error-banner-btn-label {
    display: none;   /* close button is icon-only */
}

@media (max-width: 480px) {
    #page-podcast .pc-error-banner {
        flex-wrap: wrap;
    }
    #page-podcast .pc-error-banner-body {
        flex: 1 1 100%;
        order: 2;
    }
    #page-podcast .pc-error-banner-icon {
        order: 1;
    }
    #page-podcast .pc-error-banner-btn {
        order: 3;
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-height: 36px;
    }
}

/* ------------------------------------------------------------------
   Live System Telemetry card — sits between Generate and History,
   visible only while a job is running. Shows two SVG gauges and two
   SVG line charts (memory / GPU) updated by podcast.js.
   ------------------------------------------------------------------ */
#page-podcast .pc-telemetry-card { padding: 18px 20px; }
#page-podcast .pc-telemetry-card[hidden] { display: none !important; }

#page-podcast .pc-telemetry-card .pc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

#page-podcast .pc-telemetry-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6dd07a;
    background: rgba(109, 208, 122, 0.10);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

#page-podcast .pc-telemetry-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
    grid-template-rows: 1fr 1fr;
    gap: 14px;
}

#page-podcast .pc-telemetry-tile {
    background: rgba(20, 24, 32, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

#page-podcast .pc-telemetry-tile-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #e8ecf1);
    margin-bottom: 10px;
}

#page-podcast .pc-telemetry-tile-gauge {
    align-items: stretch;
}

#page-podcast .pc-telemetry-gauge-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 6px;
}

#page-podcast .pc-telemetry-gauge {
    width: 100%;
    max-width: 260px;
    height: auto;
    overflow: visible;
}

#page-podcast .pc-gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 22;
    stroke-linecap: round;
}
#page-podcast .pc-gauge-zones {
    fill: none;
    stroke-width: 22;
    stroke-linecap: round;
    opacity: 0.18;
}
#page-podcast .pc-gauge-fill {
    fill: none;
    stroke: #6dd07a;
    stroke-width: 22;
    stroke-linecap: round;
    /* arc length = π * 75 ≈ 235.62 — set as dasharray; offset = arcLen * (1 - pct) */
    stroke-dasharray: 235.62 235.62;
    stroke-dashoffset: 235.62;
    transition: stroke-dashoffset 600ms ease, stroke 300ms ease;
}
#page-podcast .pc-gauge-fill[data-zone="warn"]   { stroke: #f0a13a; }
#page-podcast .pc-gauge-fill[data-zone="danger"] { stroke: #e85a5a; }

#page-podcast .pc-telemetry-gauge-value {
    text-align: center;
    margin-top: -6px;
    line-height: 1.2;
}
#page-podcast .pc-telemetry-gauge-value strong {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary, #e8ecf1);
    display: block;
    letter-spacing: 0.01em;
}
#page-podcast .pc-telemetry-gauge-value span {
    font-size: 12px;
    color: var(--text-secondary, #8a93a1);
    display: block;
    margin-top: 2px;
}

/* line chart tiles */
#page-podcast .pc-telemetry-tile-chart { padding: 16px 12px 12px 18px; }

#page-podcast .pc-telemetry-chart-axis {
    font-size: 11px;
    color: var(--text-secondary, #8a93a1);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

#page-podcast .pc-telemetry-chart {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: block;
}

#page-podcast .pc-chart-grid {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

#page-podcast .pc-chart-line {
    fill: none;
    stroke: #4f9cf9;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

#page-podcast .pc-chart-area {
    fill: rgba(79, 156, 249, 0.18);
    stroke: none;
}

#page-podcast .pc-chart-dots circle {
    fill: #4f9cf9;
    stroke: rgba(11, 14, 20, 0.85);
    stroke-width: 1.5;
}

@media (max-width: 720px) {
    #page-podcast .pc-telemetry-card {
        padding: 14px;
    }
    #page-podcast .pc-telemetry-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 10px;
    }
    #page-podcast .pc-telemetry-tile {
        min-height: 0;
        padding: 12px;
    }
    #page-podcast .pc-telemetry-tile-header {
        font-size: 14px;
        margin-bottom: 6px;
    }
    #page-podcast .pc-telemetry-gauge {
        max-width: 180px;
    }
    #page-podcast .pc-telemetry-gauge-value strong {
        font-size: 22px;
    }
    #page-podcast .pc-telemetry-chart {
        min-height: 120px;
    }
}

