:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --danger: #dc2626;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.08);
    --container: 1320px;
    --container-pad: clamp(0.75rem, 2.5vw, 1.25rem);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    max-width: 100%;
}

#main {
    flex: 1;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: min(calc(100% - 2 * var(--container-pad)), var(--container));
    margin-inline: auto;
}

.container-narrow {
    width: min(calc(100% - 2 * var(--container-pad)), 720px);
    margin-inline: auto;
}

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

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem 1.25rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover { text-decoration: none; }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.35rem 0;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin-inline: auto;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
    .header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo toggle"
            "nav nav";
        align-items: center;
        gap: 0;
        padding-block: 0.65rem;
    }

    .logo {
        grid-area: logo;
        min-width: 0;
    }

    .logo-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-toggle {
        display: inline-flex;
        grid-area: toggle;
    }

    .site-nav {
        display: none;
        grid-area: nav;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 0 0.75rem;
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 0.5rem;
        border-radius: var(--radius-sm);
    }

    .site-nav a:hover {
        background: var(--primary-soft);
        text-decoration: none;
    }
}

.logo-svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    stroke: none;
}

.btn-icon, .icon-inline {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.btn-lg {
    padding: 0.9rem 1.35rem;
    font-size: 1rem;
    min-height: 52px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    text-decoration: none;
    color: #fff;
}

.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ytSpin 0.7s linear infinite;
}

.btn-outline.is-loading::after,
.btn-ghost.is-loading::after {
    border-color: rgba(37, 99, 235, 0.25);
    border-top-color: var(--primary);
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.65rem;
}

.btn-ghost:hover {
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.875rem; }

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

/* Hero v2 — homepage */
.hero-v2 {
    padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 3.5rem);
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.12), transparent),
        linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 72%);
    border-bottom: 1px solid var(--border);
}

.hero-v2-inner {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: center;
}

.hero-v2-copy {
    max-width: 760px;
    margin-inline: auto;
}

.hero-v2-copy h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(1.85rem, 6vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.hero-badge {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-lead {
    margin: 0 auto;
    max-width: 52ch;
    color: var(--text-muted);
    font-size: clamp(0.95rem, 2.5vw, 1.08rem);
    line-height: 1.55;
}

.hero-tool-shell {
    width: 100%;
    text-align: left;
}

.hero-action-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: clamp(0.85rem, 2vw, 1.15rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: none;
}

.hero-action-card:has(.tool-result:not([hidden])) {
    padding: clamp(0.65rem, 1.5vw, 0.85rem);
}

.hero-action-card .tool-section-hero {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.hero-trust-shell {
    margin-top: clamp(0.85rem, 2vw, 1rem);
    padding-top: clamp(0.85rem, 2vw, 1rem);
    border-top: 1px solid var(--border);
}

.hero-action-card:has(.tool-result:not([hidden])) .hero-trust-shell {
    display: none;
}

.tool-section-hero {
    padding: clamp(0.85rem, 2vw, 1.15rem);
    border-radius: 6px;
    box-shadow: none;
    border: 1px solid var(--border);
    background: var(--surface);
}

.tool-section-hero:has(.tool-result:not([hidden])) {
    padding: clamp(0.65rem, 1.5vw, 0.85rem);
}

.tool-result:not([hidden]) .result-workspace-embedded {
    margin-top: 0.75rem;
    min-width: 0;
    max-width: 100%;
}

.hero-action-card:has(.tool-result:not([hidden])) {
    overflow-x: clip;
}

.tool-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

@media (min-width: 641px) {
    .tool-input-row {
        flex-direction: row;
        align-items: stretch;
    }
}

.tool-input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.tool-input-wrap .tool-input {
    display: block;
    width: 100%;
    flex: none;
    box-sizing: border-box;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}

.tool-input-wrap .tool-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.tool-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    z-index: 1;
}

.tool-input-icon svg {
    width: 18px;
    height: 18px;
}

.tool-input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}

.tool-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.tool-input-row .btn {
    flex-shrink: 0;
}

@media (min-width: 641px) {
    .tool-input-row .btn {
        min-width: 180px;
    }
}

@media (max-width: 640px) {
    .tool-input-row .btn {
        width: 100%;
    }
}

.trust-row {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

@media (min-width: 640px) {
    .trust-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .trust-row li {
        min-height: 52px;
        padding: 0.85rem 1rem;
    }
}

.trust-row li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.trust-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.trust-icon svg {
    width: 16px;
    height: 16px;
}

.home-strip {
    padding: 2.5rem 0;
    background: var(--bg);
}

.home-strip-title {
    margin: 0 0 1.25rem;
    font-size: 1.15rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.steps-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .steps-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.step-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: none;
}

.step-num {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.step-icon svg {
    width: 22px;
    height: 22px;
}

.step-card strong {
    font-size: 0.92rem;
    line-height: 1.4;
}

.home-features {
    padding: 2rem 0 2.5rem;
    background: var(--bg-alt);
    border-block: 1px solid var(--border);
}

.feature-pills {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .feature-pills {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .feature-pills {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-pill {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: none;
}

.feature-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.feature-pill-icon svg {
    width: 20px;
    height: 20px;
}

.feature-pill h3 {
    margin: 0 0 0.2rem;
    font-size: 0.92rem;
}

.feature-pill p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.home-faq {
    padding: 2.5rem 0 3.5rem;
}

.home-faq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-faq-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.home-faq-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.home-faq-more:hover {
    text-decoration: underline;
}

.faq-list-compact .faq-item summary {
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    :root {
        --container-pad: 0.625rem;
    }

    .hero-v2 {
        padding-top: 1.15rem;
        padding-bottom: 1.5rem;
    }

    .hero-v2-copy h1 {
        font-size: 1.65rem;
    }

    .trust-row li {
        padding: 0.55rem 0.6rem;
        font-size: 0.78rem;
    }

    .trust-icon {
        width: 28px;
        height: 28px;
    }

    .step-card {
        padding: 1rem 0.85rem;
    }

    .rw-card-head {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem;
    }

    .rw-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .rw-toolbar-group {
        width: 100%;
        justify-content: space-between;
    }

    .rw-download-wrap {
        flex-wrap: wrap;
    }

    .rw-transcript-prose {
        padding: 1rem;
        font-size: 0.98rem;
    }

    .rw-transcript-scroll {
        max-height: 50vh;
    }

    .rw-feature-grid { grid-template-columns: 1fr; }

    .home-faq-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-workspace,
    .result-workspace-embedded {
        margin-top: 1rem;
        min-width: 0;
        max-width: 100%;
    }

    .rw-video-header {
        padding: 0.85rem;
        margin-bottom: 1rem;
    }

    .rw-video-header-inner {
        flex-direction: column;
        gap: 0.85rem;
    }

    .rw-thumb-wrap {
        width: 100%;
        max-width: 100%;
    }

    .rw-thumb {
        width: 100%;
        max-width: 100%;
    }

    .rw-video-title {
        font-size: 1.05rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .rw-video-author {
        display: flex;
        flex-wrap: wrap;
        gap: 0.15rem 0.35rem;
        align-items: center;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .rw-card {
        min-width: 0;
    }

    .rw-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .rw-card-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .toolbar-select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .rw-toolbar-group {
        flex-direction: column;
        align-items: stretch;
    }

    .rw-download-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .rw-download-wrap .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .line-text {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .tool-input-wrap .tool-input {
        font-size: 0.92rem;
    }
}

/* Hero (legacy pages) */
.hero {
    padding: 2.5rem 0 2rem;
    background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-inner { display: grid; gap: 2rem; }

.eyebrow {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-sub, .page-intro {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 56ch;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Tool */
.tool-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.tool-section-compact {
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.tool-hint {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tool-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
}

.tool-status.is-loading {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.tool-status.is-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Loading spinner + progress */
.status-loading-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-loading-text {
    font-weight: 500;
}

.yt-spinner {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #bfdbfe;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ytSpin 0.7s linear infinite;
}

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

.translate-status-inner {
    align-items: flex-start;
}

.translate-status-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 0.55rem;
}

.progress-track {
    height: 6px;
    background: #dbeafe;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
    border-radius: inherit;
    transition: width 0.35s ease;
    animation: progressPulse 1.4s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Fetch skeleton — transcript + right sidebar */
.rw-skeleton-workspace {
    margin-top: 1.5rem;
    animation: rwFadeIn 0.35s ease;
}

.rw-skeleton {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
    background-size: 200% 100%;
    animation: skShimmer 1.4s ease-in-out infinite;
    animation-delay: var(--sk-delay, 0s);
}

@keyframes skShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.rw-skeleton-header {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: calc(var(--radius) + 4px);
}

.rw-skeleton-thumb {
    width: 168px;
    height: 94px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.rw-skeleton-header-copy {
    flex: 1;
    display: grid;
    gap: 0.55rem;
    padding-top: 0.15rem;
}

.rw-skeleton-line {
    height: 0.85rem;
    width: 100%;
}

.rw-skeleton-line-xs { width: 28%; height: 0.65rem; }
.rw-skeleton-line-sm { width: 42%; }
.rw-skeleton-line-md { width: 68%; }
.rw-skeleton-line-lg { width: 88%; height: 1.1rem; }

.rw-skeleton-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.rw-skeleton-chip {
    width: 4.5rem;
    height: 1.5rem;
    border-radius: 999px;
}

.rw-skeleton-card,
.rw-skeleton-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.rw-skeleton-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.rw-skeleton-player {
    margin: 1rem 1.15rem 0;
    height: min(38vw, 220px);
    border-radius: var(--radius-sm);
}

.rw-skeleton-transcript {
    display: grid;
    gap: 0.65rem;
    padding: 1.15rem 1.25rem 1.35rem;
}

.rw-skeleton-sidebar-head {
    display: grid;
    gap: 0.5rem;
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.rw-skeleton-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding: 1rem 1.15rem;
}

.rw-skeleton-feature {
    display: flex;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: skFeatureIn 0.45s ease both;
    animation-delay: var(--sk-delay, 0s);
}

@keyframes skFeatureIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.rw-skeleton-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 10px;
}

.rw-skeleton-lines {
    flex: 1;
    display: grid;
    gap: 0.4rem;
    padding-top: 0.15rem;
}

.rw-skeleton-generated {
    display: grid;
    gap: 0.65rem;
    padding: 1rem 1.15rem 1.15rem;
    border-top: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.rw-skeleton-block {
    height: 88px;
    border-radius: var(--radius-sm);
    border: 1px dashed #93c5fd;
}

@media (max-width: 1024px) {
    .rw-skeleton-header { flex-direction: column; }
    .rw-skeleton-thumb { width: 100%; max-width: 320px; }
    .rw-skeleton-feature-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .yt-spinner { animation: none; border-top-color: var(--primary); }
    .rw-skeleton { animation: none; background: #e2e8f0; }
    .rw-skeleton-feature { animation: none; }
    .progress-fill { animation: none; }
}

/* Result workspace — post-fetch UI */
.tool-result { margin-top: 1.5rem; }

.result-workspace,
.result-workspace-embedded {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 1.5rem;
    animation: rwFadeIn 0.35s ease;
}

@keyframes rwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rw-video-header {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: calc(var(--radius) + 4px);
}

.rw-video-header-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
}

.rw-thumb-wrap {
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 320px;
}

.rw-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.rw-video-copy { min-width: 0; flex: 1; }

.rw-label {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.rw-video-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.05rem, 2.5vw, 1.55rem);
    line-height: 1.35;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rw-video-author {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    align-items: center;
}

.rw-author-label {
    color: var(--text-muted);
}

.rw-credit-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.rw-credit-link:hover {
    color: var(--primary-dark, #1d4ed8);
    text-decoration: underline;
}

.rw-credit-author {
    color: var(--text);
}

.rw-credit-author:hover {
    color: var(--primary);
}

.rw-credit-sep {
    color: var(--border);
    user-select: none;
}

.rw-video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rw-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rw-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
    width: 100%;
}

.rw-grid > * {
    min-width: 0;
}

@media (min-width: 1025px) {
    .rw-grid {
        grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    }

    .rw-video-header-inner {
        flex-direction: row;
        gap: 1.25rem;
        align-items: flex-start;
    }

    .rw-thumb-wrap {
        width: auto;
        max-width: none;
    }

    .rw-thumb {
        width: 168px;
        max-width: 168px;
    }
}

@media (min-width: 1280px) {
    :root {
        --container: 1400px;
    }

    .rw-grid {
        grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
        gap: 1.5rem;
    }

    .rw-transcript-scroll {
        max-height: min(62vh, 640px);
    }
}

.rw-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.rw-card-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.rw-card-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rw-card-badge,
.rw-ai-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rw-card-title-wrap h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.rw-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: flex-end;
}

.rw-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.rw-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
}

.rw-switch-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rw-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rw-switch-track {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s;
}

.rw-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.rw-switch input:checked + .rw-switch-track {
    background: var(--primary);
}

.rw-switch input:checked + .rw-switch-track::after {
    transform: translateX(16px);
}

.rw-switch input:focus-visible + .rw-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.toolbar-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.875rem;
    min-width: 0;
    max-width: 100%;
}

.rw-download-wrap .btn-ghost {
    font-weight: 700;
    font-size: 0.78rem;
}

.rw-player {
    position: relative;
    aspect-ratio: 16/9;
    background: #0f172a;
}

.rw-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.rw-hint {
    margin: 0;
    padding: 0.7rem 1.15rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.rw-transcript-scroll {
    max-height: 540px;
    overflow: auto;
}

.rw-transcript-prose {
    margin: 0;
    padding: 1.35rem 1.4rem;
    font-size: 1.02rem;
    line-height: 1.85;
    color: #1e293b;
    white-space: normal;
    word-break: break-word;
}

.result-workspace.is-timestamp-mode .rw-transcript-scroll {
    padding: 0;
}

.rw-transcript-lines {
    display: block;
}

.rw-transcript-lines[hidden],
.rw-transcript-prose[hidden] {
    display: none !important;
}

.rw-sidebar .rw-ai-card { padding-bottom: 0; }

.rw-ai-head {
    padding: 1.1rem 1.15rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.rw-ai-head h3 {
    margin: 0.35rem 0 0.25rem;
    font-size: 1.1rem;
}

.rw-ai-head p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.rw-search-wrap {
    padding: 0.85rem 1.15rem 0;
}

.rw-search {
    display: block;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg);
}

.rw-search:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.rw-popular {
    padding: 1rem 1.15rem;
}

.rw-popular h4 {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.rw-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.rw-feature-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.rw-feature-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.rw-feature-btn.is-generating {
    pointer-events: none;
    opacity: 0.72;
    border-color: #93c5fd;
    background: var(--primary-soft);
}

.rw-feature-btn.is-generating .rw-feature-icon {
    animation: ytSpin 0.7s linear infinite;
    color: transparent;
    background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #dbeafe 100%);
    background-size: 200% 100%;
}

.rw-link-btn.is-generating {
    opacity: 0.65;
    pointer-events: none;
}

.rw-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.rw-fi-blue { background: #dbeafe; color: #1d4ed8; }
.rw-fi-violet { background: #ede9fe; color: #6d28d9; }
.rw-fi-teal { background: #ccfbf1; color: #0f766e; }
.rw-fi-amber { background: #fef3c7; color: #b45309; }

.rw-feature-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.rw-feature-copy strong {
    font-size: 0.84rem;
    line-height: 1.2;
}

.rw-feature-copy span {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.rw-accordions {
    padding: 0 1.15rem;
    border-top: 1px solid var(--border);
}

.rw-accordion {
    border-bottom: 1px solid var(--border);
}

.rw-accordion summary {
    cursor: pointer;
    padding: 0.85rem 0;
    font-weight: 600;
    font-size: 0.875rem;
    list-style: none;
}

.rw-accordion summary::-webkit-details-marker { display: none; }

.rw-accordion-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.85rem;
}

.rw-link-btn {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    text-align: left;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
}

.rw-link-btn:hover {
    background: var(--primary-soft);
    border-color: #bfdbfe;
}

.rw-generated {
    margin-top: 0.25rem;
    padding: 1rem 1.15rem 1.15rem;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    border-top: 1px solid #bfdbfe;
}

.rw-generated-head strong {
    display: block;
    font-size: 0.9rem;
}

.rw-generated-head p {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rw-generated-body {
    margin-top: 0.75rem;
    background: var(--surface);
    border: 1px dashed #93c5fd;
    border-radius: var(--radius-sm);
    min-height: 110px;
}

.rw-generated-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.rw-generated-result {
    padding: 1rem;
}

.rw-generated-animate {
    animation: rwGeneratedIn 0.38s ease;
}

@keyframes rwGeneratedIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rw-generated-result h5 {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    color: var(--primary);
}

.rw-generated-text {
    margin: 0 0 0.85rem;
    padding: 0.75rem;
    max-height: 220px;
    overflow: auto;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rw-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 1rem 1.15rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.btn-translate {
    font-weight: 600;
    border-color: #bfdbfe;
    color: var(--primary);
    background: #fff;
}

.btn-translate:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-hover);
}

.rw-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.translate-form {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0;
}

.translate-form-row {
    display: grid;
    gap: 0.35rem;
}

.translate-form-row label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.translate-submit {
    width: 100%;
    margin-top: 0.25rem;
}

.translate-status {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.translate-status.is-loading {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.translate-status.is-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.translate-result {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.translate-result-label {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.translate-result-text {
    max-height: 220px;
    overflow: auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 0.85rem;
    white-space: pre-wrap;
}

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

.translate-ext-link {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

body.modal-open {
    overflow: hidden;
}

.ext-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.ext-modal[hidden] {
    display: none !important;
}

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

.ext-modal-dialog {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #fff;
    border-radius: calc(var(--radius) + 6px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    padding: 1.75rem 1.75rem 1.5rem;
    animation: extModalIn 0.28s ease;
}

@keyframes extModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ext-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ext-modal-close:hover {
    background: #e2e8f0;
    color: var(--text);
}

.ext-modal-badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ext-modal-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    padding-right: 2rem;
}

.ext-modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ext-modal-preview {
    margin: 1.25rem 0;
    padding: 0.65rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
}

.ext-modal-preview-inner {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.ext-preview-bar {
    height: 8px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
}

.ext-preview-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 0;
    min-height: 100px;
}

.ext-preview-video {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.ext-preview-panel {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #f8fafc;
}

.ext-preview-panel span {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #cbd5e1;
}

.ext-preview-panel span:nth-child(1) { width: 90%; }
.ext-preview-panel span:nth-child(2) { width: 75%; }
.ext-preview-panel span:nth-child(3) { width: 85%; }
.ext-preview-panel span:nth-child(4) { width: 60%; }

.ext-modal-features {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.ext-modal-features li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.45;
}

.ext-modal-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #16a34a;
}

.ext-modal-note {
    margin: 0 0 1.15rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.ext-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ext-modal-cta {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
}

.ext-modal-actions .btn-ghost {
    width: 100%;
}

@media (max-width: 640px) {
    .ext-modal-dialog { padding: 1.25rem; }
}

.rw-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.result-page-shell {
    padding: 1.5rem 0 3rem;
}

.result-page-shell .tool-section-compact {
    margin-bottom: 1rem;
}

.transcript-lines {
    background: #fff;
}

.transcript-line {
    display: flex;
    gap: 0.85rem;
    width: 100%;
    padding: 0.75rem 1.15rem;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.12s;
}

.transcript-line:last-child { border-bottom: 0; }

.transcript-line:hover,
.transcript-line:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.line-time {
    flex-shrink: 0;
    min-width: 3.25rem;
    padding-top: 0.1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.line-text {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 640px) {
    .rw-toolbar { width: 100%; justify-content: flex-start; }
}

/* Static & inner pages */
.page-hero-v2 {
    padding: clamp(2rem, 5vw, 3rem) 0 1.5rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% -20%, rgba(37, 99, 235, 0.1), transparent),
        linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.page-hero-v2-inner {
    max-width: 820px;
    margin-inline: auto;
}

.page-hero-v2 h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(1.65rem, 5vw, 2.35rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-hero-v2-sub {
    margin: 0 auto;
    max-width: 48ch;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.section-prose {
    padding: 2.5rem 0 3.5rem;
}

.content-prose-clean {
    max-width: 720px;
    margin-inline: auto;
}

.content-prose-clean h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.content-prose-clean h2:first-child {
    margin-top: 0;
}

.content-prose-clean p,
.content-prose-clean li {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.content-prose-clean ul,
.content-prose-clean ol {
    padding-left: 1.25rem;
}

.home-strip-compact {
    padding: 1.5rem 0 2rem;
}

.related-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-nav-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.related-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.related-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.related-pill.is-active {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    color: var(--primary);
}

.faq-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    transform: rotate(-135deg);
}

.home-seo {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.home-seo h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.home-seo p {
    margin: 0 0 1.25rem;
    max-width: 72ch;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.breadcrumbs {
    margin-bottom: 1rem;
}

.breadcrumbs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumbs-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--border);
}

.breadcrumbs-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs-item a:hover {
    color: var(--primary);
}

.breadcrumbs-item span[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

.page-hero-v2 .breadcrumbs {
    justify-content: center;
}

.page-hero-v2 .breadcrumbs-list {
    justify-content: center;
}

/* Legacy result page bits */
.page-hero {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
}

.page-hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.result-hero {
    padding: 1.5rem 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a { color: var(--text-muted); }

.result-meta {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.result-thumb {
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.result-meta h1 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    line-height: 1.25;
}

.result-channel, .result-stats {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.925rem;
}

.result-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .result-layout { grid-template-columns: 1fr; }
}

.player-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.player-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.result-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.toolbar-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.toolbar-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.875rem;
}

.download-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

@media (max-width: 640px) {
    .download-group { margin-left: 0; width: 100%; }
}

.result-jump-hint {
    margin: 0 0 0.75rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.transcript-lines {
    max-height: 560px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.transcript-line {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.12s;
}

.transcript-line:last-child { border-bottom: 0; }

.transcript-line:hover,
.transcript-line:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.line-time {
    flex-shrink: 0;
    width: 3.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.line-text { flex: 1; }

/* Sections */
.section { padding: 3rem 0; }

.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: 1.5rem; }

.section-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.section-head p { margin: 0; color: var(--text-muted); }

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

.feature-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.925rem;
}

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

.content-grid h3 { margin: 0 0 0.5rem; }
.content-grid p { margin: 0; color: var(--text-muted); }

.content-prose { max-width: 72ch; }
.content-prose h2 { margin: 2rem 0 0.75rem; font-size: 1.25rem; }
.content-prose p, .content-prose li { color: var(--text-muted); }
.content-prose ul, .content-prose ol { padding-left: 1.25rem; }

.steps-list {
    margin: 0;
    padding-left: 1.25rem;
    max-width: 72ch;
}

.steps-list li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.faq-list { display: grid; gap: 0.75rem; }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 0.25rem 1rem;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.65rem 0;
}

.faq-item p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.cta-section { padding-bottom: 4rem; }

.cta-box {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
}

.cta-box h2 { margin: 0 0 0.5rem; }
.cta-box p { margin: 0 0 1.25rem; color: var(--text-muted); }

.narrow { max-width: 640px; }

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2rem;
}

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

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

.footer-tagline {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: 0.925rem;
    max-width: 36ch;
}

.footer-col h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li { margin-bottom: 0.4rem; }

.footer-links a {
    color: var(--text);
    font-size: 0.925rem;
    text-decoration: none;
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    margin: 0.35rem 0;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.footer-note { max-width: 60ch; margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
