/* === Light theme (default) === */
:root {
    --bg: #faf9f7;
    --fg: #1a1a1a;
    --muted: #595959;
    --accent: #8b2500;
    --accent-light: #c44d2a;
    --border: #d0d0d0;
    --card-bg: #fff;
    --mark-bg: #fef3c7;
    --mark-fg: #1a1a1a;
    --input-bg: #fff;
    --focus-ring: #4a90d9;
    --radius: 6px;
    --segment-border: #e5e5e5;
}

/* === Dark theme === */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a1a1e;
        --fg: #e5e5e5;
        --muted: #a0a0a0;
        --accent: #e06040;
        --accent-light: #ff7a55;
        --border: #3a3a3e;
        --card-bg: #242428;
        --mark-bg: #554400;
        --mark-fg: #fef3c7;
        --input-bg: #2a2a2e;
        --focus-ring: #6ab0ff;
        --segment-border: #333;
    }
}

[data-theme="dark"] {
    --bg: #1a1a1e;
    --fg: #e5e5e5;
    --muted: #a0a0a0;
    --accent: #e06040;
    --accent-light: #ff7a55;
    --border: #3a3a3e;
    --card-bg: #242428;
    --mark-bg: #554400;
    --mark-fg: #fef3c7;
    --input-bg: #2a2a2e;
    --focus-ring: #6ab0ff;
    --segment-border: #333;
}

/* === Accessibility === */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

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

/* Focus styles — visible for keyboard, hidden for mouse */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* === Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Navigation === */
header {
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--fg);
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--muted);
    display: flex;
    align-items: center;
}

.theme-toggle:hover { color: var(--fg); border-color: var(--muted); }

/* Show sun in dark mode, moon in light mode */
.icon-dark { display: inline; }
.icon-light { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-dark { display: none; }
    :root:not([data-theme="light"]) .icon-light { display: inline; }
}

[data-theme="dark"] .icon-dark { display: none; }
[data-theme="dark"] .icon-light { display: inline; }
[data-theme="light"] .icon-dark { display: inline; }
[data-theme="light"] .icon-light { display: none; }

/* === Main === */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* === Footer === */
footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

footer a { color: var(--accent); }

/* === Stats === */
.stats {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-sep { color: var(--border); }

/* === Search === */
.search-hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.search-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 2rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--fg);
    transition: border-color 0.2s;
}

.search-form input:focus {
    border-color: var(--accent);
}

/* === Buttons === */
.search-form button,
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.search-form button:hover,
.btn:hover {
    background: var(--accent-light);
}

.btn-secondary { background: var(--muted); }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #ef4444; }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.85rem; }

/* === Results === */
.results { margin-top: 1rem; }

.results-count {
    color: var(--muted);
    margin-bottom: 1rem;
}

.result-list { list-style: none; }

.result-item { margin-bottom: 0.75rem; }

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.result-link {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--fg);
}

.result-episode {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.result-time {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.result-text {
    display: block;
    line-height: 1.5;
}

.result-text mark {
    background: var(--mark-bg);
    color: var(--mark-fg);
    padding: 0 2px;
    border-radius: 2px;
}

/* Audio player in search results */
.result-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.play-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.play-btn:hover {
    background: var(--accent-light);
}

.waveform-container {
    flex: 1;
    min-height: 40px;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    color: var(--muted);
    text-align: center;
    padding: 2rem;
}

/* === Episode list === */
.episode-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.episode-card a {
    display: block;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--fg);
    transition: border-color 0.2s;
}

.episode-card a:hover { border-color: var(--accent); }

.episode-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

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

.episode-card p {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* === Episode page === */
.episode-page { max-width: 700px; }

.episode-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.episode-header time,
.episode-header .duration {
    color: var(--muted);
    font-size: 0.9rem;
    margin-right: 1rem;
}

.episode-description {
    margin: 1.5rem 0;
    line-height: 1.7;
}

.listen-cta {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin: 2rem 0;
}

.listen-cta p { margin-bottom: 1rem; }

.transcript { margin-top: 2rem; }

.transcript h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.segment {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--segment-border);
}

.seg-time {
    flex-shrink: 0;
    width: 60px;
    color: var(--muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.seg-text { flex: 1; }

.seg-speaker {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
}

.seg-speaker-0 {
    background: #dbeafe;
    color: #1e40af;
}

.seg-speaker-1 {
    background: #fce7f3;
    color: #9d174d;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .seg-speaker-0 { background: #1e3a5f; color: #93c5fd; }
    :root:not([data-theme="light"]) .seg-speaker-1 { background: #4a1942; color: #f9a8d4; }
}

[data-theme="dark"] .seg-speaker-0 { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .seg-speaker-1 { background: #4a1942; color: #f9a8d4; }

/* === Result meta === */
.result-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-speaker {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: var(--mark-bg);
    color: var(--mark-fg);
}

/* === Speaker mapping form === */
.speaker-mapping {
    margin: 2rem 0;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.speaker-mapping h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.speaker-mapping p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.speaker-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.speaker-fields label {
    margin-top: 0;
}

/* === Admin === */
.admin-stats {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table a { color: var(--accent); }

.status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending { background: #e5e7eb; color: #374151; }
.status-queued { background: #dbeafe; color: #1e40af; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* === Forms === */
.admin-login,
.upload-form {
    max-width: 500px;
    margin: 2rem auto;
}

.admin-login h1,
.upload-form h1 {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin: 1rem 0 0.35rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="search"],
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    background: var(--input-bg);
    color: var(--fg);
}

textarea { resize: vertical; }

.upload-form button,
.admin-login button {
    margin-top: 1.5rem;
    width: 100%;
}

.error {
    color: #dc2626;
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.episode-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin: 1.5rem 0;
}

.episode-meta dt {
    font-weight: 600;
    color: var(--muted);
}

/* === Feed import === */
.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row input { flex: 1; }

.feed-url-form { margin-bottom: 1rem; }
.feed-fetch { margin-bottom: 2rem; }

.feed-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feed-list-actions {
    display: flex;
    gap: 0.5rem;
}

.feed-list-footer {
    margin-top: 1rem;
    text-align: right;
}

.feed-table .col-check { width: 40px; }
.feed-table .col-num { width: 50px; }

.feed-table tr.imported { opacity: 0.5; }

.success {
    color: #065f46;
    background: #d1fae5;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

/* === Progress bar === */
.progress-section {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--muted);
}

.progress-bar {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-detail {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* === Analytics === */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.analytics-card .big-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.analytics-card .label {
    color: var(--muted);
    font-size: 0.85rem;
}

.analytics-section {
    margin-bottom: 2rem;
}

.analytics-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.analytics-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
}

.analytics-table .count {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.period-links {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.period-links a {
    color: var(--muted);
    text-decoration: none;
}

.period-links a:hover,
.period-links a.active {
    color: var(--accent);
    font-weight: 600;
}

/* === About page === */
.about-section {
    margin: 2rem 0;
}

.about-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.about-section p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.about-section a {
    color: var(--accent);
}

/* === Batch transcription === */
.batch-section {
    margin: 2rem 0;
}

.batch-form {
    margin-top: 1.5rem;
}

.batch-option {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.batch-option label {
    font-weight: 600;
    cursor: pointer;
}

.batch-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.server-status {
    margin-bottom: 2rem;
}

.server-info {
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.cost-estimate {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cost-warning {
    margin-top: 0.5rem;
    color: var(--accent);
    font-weight: 600;
}

.budget-form {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.budget-form label {
    font-weight: 600;
}

.budget-form .batch-help {
    flex-basis: 100%;
}

.input-small {
    width: 10rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--fg);
    font-size: 0.9rem;
}

/* === Server type selection === */
.server-type-table-wrap {
    overflow-x: auto;
}

.server-type-table td,
.server-type-table th {
    white-space: nowrap;
}

.server-type-row {
    cursor: pointer;
}

.server-type-row:hover {
    background: var(--bg);
}

.server-type-default {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.server-type-label {
    display: inline;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

.server-type-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.default-badge {
    background: #dbeafe;
    color: #1e40af;
}

.dedicated-badge {
    background: #d1fae5;
    color: #065f46;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .default-badge { background: #1e3a5f; color: #93c5fd; }
    :root:not([data-theme="light"]) .dedicated-badge { background: #064e3b; color: #6ee7b7; }
}

[data-theme="dark"] .default-badge { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .dedicated-badge { background: #064e3b; color: #6ee7b7; }

/* === Search input === */
.search-input-row {
    display: flex;
    gap: 0.5rem;
}

/* === Result date === */
.result-date {
    font-size: 0.8rem;
    color: var(--muted);
}

/* === Result actions (player + copy link) === */
.result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.result-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    padding: 0;
    border-top: none;
    background: transparent;
}

.copy-link-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-link-btn:hover {
    color: var(--fg);
    border-color: var(--muted);
    background: var(--card-bg);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination-info {
    color: var(--muted);
    font-size: 0.9rem;
}

/* === Episodes header with filter === */
.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.episodes-header h1 {
    margin: 0;
}

.episodes-filter input {
    width: 200px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.episode-card-inner {
    display: block;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
}

.episode-card-pending {
    opacity: 0.7;
}

.episode-card .status {
    font-size: 0.7rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* === Episode page meta line === */
.episode-meta-line {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

/* === Transcript header with export buttons === */
.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.transcript-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.transcript-export {
    display: flex;
    gap: 0.5rem;
}

/* === Clickable timestamp button in transcript === */
.seg-time-btn {
    flex-shrink: 0;
    width: 60px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-family: inherit;
}

.seg-time-btn:hover {
    text-decoration: underline;
}

/* === Segment player (in transcript) === */
.seg-player {
    flex-basis: 100%;
    margin-top: 0.25rem;
    min-height: 32px;
}

.segment-playing {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    border-radius: var(--radius);
    margin: -0.25rem -0.5rem;
    padding: 0.25rem 0.5rem;
}

/* === Segment highlight (when navigating to #t=) === */
@keyframes segment-flash {
    0%, 100% { background: transparent; }
    50% { background: color-mix(in srgb, var(--accent) 10%, transparent); }
}

.segment-highlight {
    animation: segment-flash 1s ease 3;
    border-radius: var(--radius);
}

/* === Clip page === */
.clip-page { max-width: 700px; }

.clip-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.clip-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.clip-content {
    margin-bottom: 1.5rem;
}

.clip-context {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.4rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--segment-border);
}

.clip-context-time {
    flex-shrink: 0;
    width: 50px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.clip-context-text { flex: 1; }

.clip-main {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 0.75rem 0;
}

.clip-main-text {
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 0.5rem 0 1rem;
    border: none;
    padding: 0;
}

.clip-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clip-player .waveform-container {
    flex: 1;
    min-height: 48px;
}

.clip-actions {
    margin-bottom: 1.5rem;
}

/* === Responsive === */
@media (max-width: 600px) {
    .search-input-row {
        flex-direction: column;
    }
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .episodes-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .episodes-filter input {
        width: 100%;
    }
    .result-actions {
        flex-direction: column;
        padding: 0.5rem 0.75rem;
    }
    .result-player {
        width: 100%;
    }
    .result-link {
        padding: 0.75rem;
    }
    .result-meta {
        flex-wrap: wrap;
    }
    .transcript-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .segment {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .seg-time-btn {
        width: auto;
    }
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .episode-page {
        max-width: 100%;
    }
}
