/* ==================== CSS Variables ==================== */

:root {
    /* Surface Colors */
    --surface-app: #eff2f8;
    --surface-base: rgba(255, 255, 255, 0.96);
    --surface-elevated: rgba(255, 255, 255, 0.72);
    --surface-muted: #0f172a;
    --surface-sidebar: linear-gradient(210deg, rgba(11, 18, 33, 0.92) 0%, rgba(17, 24, 39, 0.88) 100%);

    /* Border Colors */
    --border-soft: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(99, 102, 241, 0.3);

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.62);
    --text-inverse: #f8fafc;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-primary-dark: #4f46e5;
    --accent-secondary: #f97316;
    --accent-muted: rgba(99, 102, 241, 0.16);

    /* Border Radius */
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    /* Shadows */
    --shadow-soft: 0 30px 60px rgba(15, 23, 42, 0.14);
    --shadow-bump: 0 18px 36px rgba(15, 23, 42, 0.12);
    --shadow-subtle: 0 12px 28px rgba(15, 23, 42, 0.08);

    /* Transitions */
    --transition-snappy: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --layout-max-width: 1280px;
}


/* ==================== Global Styles ==================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 45%),
                radial-gradient(circle at bottom left, rgba(244, 114, 182, 0.08), transparent 40%),
                var(--surface-app);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}


/* ==================== Application Shell ==================== */

.app-shell {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: clamp(20px, 4vw, 36px);
    padding: clamp(18px, 4vw, 48px);
    min-height: 100vh;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    position: relative;
}


/* ==================== Sidebar ==================== */

.sidebar {
    background: var(--surface-sidebar);
    color: var(--text-inverse);
    padding: clamp(24px, 3vw, 38px);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2.8vw, 28px);
    position: sticky;
    top: clamp(16px, 3vw, 32px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    align-self: flex-start;
}

.sidebar__brand {
    display: flex;
    gap: 18px;
    align-items: center;
}

.sidebar__toggle {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color var(--transition-snappy),
                border-color var(--transition-snappy),
                transform var(--transition-snappy);
}

.sidebar__toggle:hover {
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

.sidebar__toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

.sidebar__toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar__toggle-bars span {
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform var(--transition-snappy), opacity var(--transition-snappy);
}

.sidebar__toggle-label {
    pointer-events: none;
}

.sidebar__toggle--open .sidebar__toggle-bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar__toggle--open .sidebar__toggle-bars span:nth-child(2) {
    opacity: 0;
}

.sidebar__toggle--open .sidebar__toggle-bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(148, 163, 184, 0.16);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.35);
}

.brand-name {
    margin: 0;
    font-size: 1.5rem;
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.sidebar__status {
    margin: 6px 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.72);
    letter-spacing: 0.02em;
}

.sidebar__status--muted {
    color: rgba(248, 250, 252, 0.72);
}

.sidebar__status--good {
    color: rgba(134, 239, 172, 0.92);
}

.sidebar__status--warn {
    color: rgba(253, 224, 71, 0.92);
}

.sidebar__meta {
    display: flex;
    justify-content: flex-start;
}


/* ==================== Status Badges ==================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(248, 250, 252, 0.12);
    backdrop-filter: blur(6px);
}

.status-badge--muted {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(248, 250, 252, 0.78);
}

.status-badge--good {
    background: rgba(74, 222, 128, 0.18);
    color: #bbf7d0;
}

.status-badge--warn {
    background: rgba(251, 191, 36, 0.18);
    color: #facc15;
}


/* ==================== Navigation ==================== */

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-heading {
    margin: 0 0 4px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: rgba(248, 250, 252, 0.55);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: rgba(248, 250, 252, 0.84);
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color var(--transition-snappy),
                transform var(--transition-snappy),
                color var(--transition-snappy),
                border-color var(--transition-snappy);
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateX(3px);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.32);
    color: var(--text-inverse);
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateX(3px);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn--compact {
    margin-top: 4px;
    padding: 10px 16px;
    font-size: 0.88rem;
}


/* ==================== Workspace ==================== */

.workspace {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vw, 40px);
}

.workspace__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--surface-base);
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
}

.workspace__header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 55%);
    pointer-events: none;
    opacity: 0.45;
}

.workspace__header > * {
    position: relative;
    z-index: 1;
}

.workspace__header-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.workspace__latest-btn {
    color: var(--accent-primary);
    border-color: rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.08);
}

.workspace__header h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2.2vw, 2rem);
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.workspace__header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    max-width: 640px;
}

.workspace__inner {
      display: flex;
      flex-direction: column;
      gap: clamp(20px, 3.5vw, 32px);
      padding-bottom: 56px;
  }

.settings-card {
      display: flex;
      flex-direction: column;
      gap: 24px;
}

.settings-card.is-disabled {
      opacity: 0.6;
      pointer-events: none;
}

.settings-card__header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 16px;
}

.settings-card__header h2 {
      margin: 0;
}

.settings-description {
      margin: 8px 0 0;
      font-size: 0.9rem;
      color: var(--text-secondary);
      max-width: 520px;
}

.settings-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: flex-start;
      gap: 24px;
}

.settings-details {
      flex: 1 1 280px;
}

.settings-meta {
      margin: 0;
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--text-secondary);
}

.settings-helper {
      margin: 10px 0 0;
      font-size: 0.85rem;
      color: var(--text-secondary);
      max-width: 460px;
}

.model-toggle {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
}

.model-toggle__option {
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-md);
      padding: 14px 18px;
      text-align: left;
      background: rgba(148, 163, 184, 0.06);
      cursor: pointer;
      transition: border-color var(--transition-snappy), background-color var(--transition-snappy), color var(--transition-snappy);
      display: flex;
      flex-direction: column;
      gap: 4px;
}

.model-toggle__option.is-active {
      border-color: var(--accent-primary);
      background: rgba(99, 102, 241, 0.12);
      box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.model-toggle__option.is-disabled {
      opacity: 0.6;
      cursor: not-allowed;
}

.model-toggle__label {
      font-weight: 600;
      color: var(--text-primary);
}

.model-toggle__subtitle {
      font-size: 0.85rem;
      color: var(--text-secondary);
}

.settings-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
}

.settings-actions .ghost-btn {
      margin: 0;
}

.settings-row--stack {
      flex-direction: column;
      align-items: stretch;
      gap: 16px;
}


/* ==================== Views ==================== */

.view {
    display: none;
}

.view.active {
    display: block;
}

.view.card-view {
    display: none;
    align-items: center;
    justify-content: center;
}

.view.card-view.active {
    display: flex;
}


/* ==================== Cards ==================== */

.card {
    background: var(--surface-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    padding: clamp(22px, 3vw, 32px);
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vw, 26px);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), transparent 60%);
    pointer-events: none;
    opacity: 0.55;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-header h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.card-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

.card-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.card h2 {
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.login-card {
    max-width: 380px;
    width: 100%;
    align-self: center;
}

.login-card__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-divider {
    width: 100%;
    text-align: center;
    position: relative;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(148, 163, 184, 0.3);
}

.login-divider::before {
    left: 0;
}

.login-divider::after {
    right: 0;
}

.intro-card {
    gap: 28px;
}

.intro-copy {
    margin: 0;
    color: var(--text-secondary);
}


/* ==================== Quick Links ==================== */

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.quick-link {
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.4vw, 24px);
    text-align: left;
    background: linear-gradient(140deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.85));
    color: var(--text-primary);
    transition: transform var(--transition-snappy),
                box-shadow var(--transition-snappy),
                border-color var(--transition-snappy),
                background-color var(--transition-snappy);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.quick-link h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.quick-link p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quick-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-subtle);
    border-color: rgba(99, 102, 241, 0.36);
}


/* ==================== Form Elements ==================== */

.input-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.input {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: border-color var(--transition-snappy),
                box-shadow var(--transition-snappy);
    color: var(--text-primary);
    background: var(--surface-elevated);
}

.input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-muted);
    outline: none;
}

.input--area {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row--end {
    justify-content: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* ==================== Buttons ==================== */

.primary-btn,
.secondary-btn,
.ghost-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-snappy),
                box-shadow var(--transition-snappy),
                transform var(--transition-snappy),
                border-color var(--transition-snappy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.primary-btn {
    background: var(--accent-primary);
    color: #f8fafc;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.28);
}

.primary-btn:hover {
    background: var(--accent-primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.22);
}

.secondary-btn:hover {
    background: rgba(99, 102, 241, 0.18);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.ghost-btn:hover {
    background: rgba(148, 163, 184, 0.24);
}

.ghost-btn.full-width {
    width: 100%;
}

.ghost-btn--compact {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.ghost-btn--compact.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.ghost-link {
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.ghost-link:hover {
    text-decoration: underline;
}

.primary-btn.full-width {
    width: 100%;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

button.is-loading {
    opacity: 0.7;
    pointer-events: none;
    box-shadow: none;
}


/* ==================== Drop Zone ==================== */

.drop-zone {
    border: 1px dashed rgba(99, 102, 241, 0.28);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 40px);
    text-align: center;
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.06);
    transition: border-color var(--transition-snappy),
                background-color var(--transition-snappy);
}

.drop-zone__meta {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.drop-zone__selection {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.12);
}

.drop-zone.has-file {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.12);
}

.drop-zone.has-file .drop-zone__selection {
    color: var(--accent-primary);
    font-weight: 600;
}

.drop-zone input[type="file"] {
    display: none;
}


/* ==================== Podcast Components ==================== */


.podcast-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
}

.podcast-tabs {
    display: inline-flex;
    background: var(--surface-base);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 6px;
    gap: 6px;
    box-shadow: var(--shadow-subtle);
    width: min(520px, 100%);
}

.podcast-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 18px;
    border-radius: calc(var(--radius-lg) - 6px);
    font-size: 0.95rem;
    transition: background-color var(--transition-snappy),
                color var(--transition-snappy),
                transform var(--transition-snappy);
    cursor: pointer;
}

.podcast-tab:hover {
    color: var(--text-primary);
}

.podcast-tab.active {
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.18));
    color: var(--text-inverse);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
}

.podcast-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.podcast-tab-panels {
    display: block;
}

.podcast-tab-panel {
    margin-top: clamp(16px, 3vw, 24px);
}

.podcast-panel {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.5vw, 26px);
    background: var(--surface-base);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.podcast-panel h3 {
    margin: 0;
    font-size: 1.05rem;
    font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.podcast-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.podcast-panel__header h3 {
    margin: 0;
}

.podcast-panel--full {
    height: 100%;
    grid-column: 1 / -1;
}

.podcast-discovery-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
}

.podcast-discovery {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.podcast-discovery__block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-md);
}

.podcast-lower-grid {
    display: grid;
    gap: clamp(16px, 3vw, 24px);
    margin-top: clamp(20px, 3vw, 32px);
}

@media (min-width: 1100px) {
    .podcast-lower-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.podcast-discovery__block h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.podcast-button {
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--accent-primary);
    border: none;
    color: #f8fafc;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-snappy),
                background-color var(--transition-snappy);
}

.podcast-button:hover {
    transform: translateY(-1px);
    background: var(--accent-primary-dark);
}

.podcast-show-card {
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    background: rgba(249, 250, 251, 0.65);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 16px;
}

.podcast-show-card__image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-subtle);
    align-self: flex-start;
}

.podcast-show-card__details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.podcast-show-card__meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.podcast-show-card__description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.podcast-show-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.podcast-saved-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.podcast-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.saved-show-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(16px, 2.2vw, 22px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-subtle);
    height: 100%;
}

.saved-show-card__meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.saved-show-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: auto;
}

.podcast-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.podcast-result-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(16px, 2.2vw, 22px);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.podcast-result-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: auto;
}

.podcast-save-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.podcast-save-form.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.podcast-save-form .input {
    flex: 1 1 240px;
}


/* ==================== Episode Components ==================== */

.episode-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.episode-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(16px, 2.2vw, 22px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-elevated);
    min-height: 100%;
}

.episode-card h4 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 1rem;
}

.episode-card time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.episode-card p {
    margin: 0;
    color: var(--text-secondary);
}

.episode-card button {
    align-self: flex-start;
}

.episode-card__actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


/* ==================== Topic Components ==================== */

.podcast-topics-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topics-list-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.5vw, 24px);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.topics-action-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.5vw, 24px);
    background: var(--surface-base);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.topics-action-card__actions {
    display: flex;
    justify-content: center;
}

.topics-action-card__button {
    min-width: 220px;
    align-self: center;
}

.topic-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.topic-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--surface-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-subtle);
}

.topic-item input {
    margin-top: 4px;
}

.topic-item__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-item__title {
    font-weight: 600;
    color: var(--text-primary);
}

.topic-item__snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
}


/* ==================== Image Preview ==================== */

.image-preview {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(22px, 3vw, 28px);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--surface-elevated);
    color: var(--text-secondary);
    text-align: center;
}

.image-preview__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.image-preview__meta-line {
    margin: 0;
}

.image-preview.is-loading {
    opacity: 0.7;
}

.image-preview img {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-bump);
}

.image-preview__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}


/* ==================== Results Components ==================== */

.result-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.result-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-elevated);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.95rem;
}

.result-link[hidden] {
    display: none;
}

.result-link__label {
    color: var(--text-secondary);
}

.result-link__anchor {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.result-link__anchor:hover,
.result-link__anchor:focus-visible {
    text-decoration: underline;
}

.result-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 12px;
}

.result-block[hidden] {
    display: none;
}

.result-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.result-block__title {
    font-weight: 600;
    color: var(--text-primary);
}

.result-block__textarea {
    width: 100%;
    min-height: 160px;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--surface-base);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    resize: vertical;
}

.result-block__textarea:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
}

.result-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-heading__row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.result-heading__row.is-hidden {
    display: none;
}

.result-heading__row--about {
    align-items: center;
}

.result-copy-button {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-snappy),
                background-color var(--transition-snappy);
}

.result-copy-button:hover {
    color: var(--accent-primary);
    background: rgba(148, 163, 184, 0.18);
}

.result-copy-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-body {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-body__toolbar {
    display: flex;
    justify-content: flex-end;
}

.result-body + .result-media {
    margin-top: 18px;
}

.result-copy-btn {
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.result-copy-btn:hover {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-primary);
}

.result-copy-btn:disabled {
    color: rgba(148, 163, 184, 0.6);
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-meta.is-hidden {
    display: none;
}

.result-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 999px;
}

.result-meta__label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.result-meta__value {
    color: var(--text-primary);
    font-size: 0.85rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-content h1,
.result-content h2,
.result-content h3,
.result-content h4,
.result-content h5,
.result-content h6 {
    margin: 0;
    color: var(--text-primary);
}

.result-content p {
    margin: 0;
    color: var(--text-secondary);
}

.result-content ul,
.result-content ol {
    margin: 0;
    padding-left: 1.4rem;
    color: var(--text-secondary);
}

.result-content blockquote {
    margin: 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent-primary);
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-secondary);
}

.result-content hr {
    border: none;
    border-top: 1px solid var(--border-soft);
}

.result-content code {
    background: rgba(15, 23, 42, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.result-source-note {
    margin: 0;
    margin-top: 16px;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
}

.result-source-note a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.result-source-note a:hover {
    color: var(--accent-primary);
}

.result-media {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.5vw, 24px);
    background: var(--surface-elevated);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.result-media__wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.result-media__toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.result-media__download {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-snappy),
                background-color var(--transition-snappy);
}

.result-media__download:hover {
    color: var(--accent-primary);
    background: rgba(148, 163, 184, 0.18);
}

.result-media__download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-media figure {
    margin: 0;
    width: 100%;
    max-width: 800px;
}

figure.result-media__figure {
    align-self: center;
}

.result-media img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
}

.result-media__caption {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}

.result-media__note {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: left;
}

.result-media .empty-state {
    width: 100%;
    text-align: left;
}


/* ==================== Utility Classes ==================== */

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: left;
}

[hidden] {
    display: none !important;
}

.select-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 0.95rem;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.helper-text {
    font-size: 0.85rem;
    color: rgba(15, 23, 42, 0.56);
    margin: 0;
}


/* ==================== Toast Notifications ==================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.92), rgba(79, 70, 229, 0.85));
    color: #f8fafc;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-bump);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    font-size: 0.95rem;
    max-width: 320px;
    z-index: 1000;
}

.toast.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast--error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.88));
}

.toast.toast--success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.88));
}


/* ==================== Responsive Design ==================== */

@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: clamp(18px, 5vw, 32px);
    }

    .sidebar {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 20px 24px;
        position: static;
        min-height: unset;
    }

    .sidebar__brand {
        flex: 1;
    }

    .sidebar__nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
        flex: 2;
    }

    .workspace {
        gap: 24px;
    }

    .workspace__header {
        flex-direction: column;
        gap: 12px;
    }

    .podcast-tabs {
        width: 100%;
    }

    .podcast-lower-grid {
        grid-template-columns: 1fr;
    }

    .result-main {
        grid-template-columns: 1fr;
    }

    .result-media {
        min-height: 220px;
    }
}

@media (max-width: 720px) {
    .card {
        padding: 22px;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .result-actions {
        justify-content: flex-start;
    }

    .sidebar {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 24px;
    }

    .sidebar__toggle {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
    }

    .sidebar__nav {
        width: 100%;
        display: none;
        flex-direction: column;
        gap: 12px;
        border-top: 1px solid rgba(148, 163, 184, 0.22);
        padding-top: 18px;
    }

    .sidebar__nav.is-open {
        display: flex;
    }

    .nav-btn {
        width: 100%;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
