:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --sky: #06b6d4;
    --violet: #7c3aed;
    --green: #14b8a6;
    --text: #0b1220;
    --muted: #647084;
    --soft: #f6f8fc;
    --panel: rgba(255, 255, 255, 0.86);
    --line: rgba(148, 163, 184, 0.24);
    --line-strong: rgba(37, 99, 235, 0.22);
    --shadow-sm: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 26px 70px rgba(30, 64, 175, 0.15);
    --shadow-lg: 0 38px 100px rgba(15, 23, 42, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 8%, rgba(37, 99, 235, 0.12), transparent 28rem),
        radial-gradient(circle at 92% 14%, rgba(20, 184, 166, 0.12), transparent 30rem),
        linear-gradient(180deg, #fbfdff 0%, #f7f9fe 46%, #ffffff 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    backdrop-filter: blur(20px);
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.07);
}

.nav {
    width: min(1180px, calc(100% - 48px));
    height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 850;
    font-size: 18px;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand-mark,
.icon {
    display: inline-grid;
    place-items: center;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
        linear-gradient(135deg, var(--blue), var(--sky));
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 14px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    color: var(--muted);
    font-size: 15px;
    border: 1px solid rgba(226, 232, 240, 0.65);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.nav-links a {
    padding: 9px 12px;
    border-radius: 10px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.07);
    transform: translateY(-1px);
}

.nav-cta,
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 12px;
    font-weight: 760;
    letter-spacing: 0;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.nav-cta,
.primary-btn {
    color: #ffffff !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
        linear-gradient(135deg, var(--blue), #0284c7);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
}

.nav-cta {
    padding: 0 18px !important;
}

.primary-btn,
.secondary-btn {
    padding: 0 24px;
}

.primary-btn:hover,
.secondary-btn:hover,
.nav-cta:hover {
    transform: translateY(-2px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.primary-btn:hover,
.nav-cta:hover {
    box-shadow: 0 24px 46px rgba(37, 99, 235, 0.32);
}

.secondary-btn {
    color: var(--text);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.secondary-btn:hover {
    border-color: var(--line-strong);
    background: #ffffff;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 999px;
    background: var(--text);
}

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: min(1180px, calc(100% - 48px));
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    padding: 88px 0 78px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 540px);
    align-items: center;
    gap: 70px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
}

.glow-one {
    width: 440px;
    height: 440px;
    top: 6%;
    left: -18%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 68%);
}

.glow-two {
    width: 520px;
    height: 520px;
    right: -16%;
    bottom: 0;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 68%);
}

.grid-light {
    position: absolute;
    right: 0;
    top: 12%;
    width: 48%;
    height: 68%;
    border-radius: 28px;
    background:
        linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle, #000 0%, transparent 72%);
}

.hero-content {
    max-width: 690px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 7px 12px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 820;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.78);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.12);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 24px;
    max-width: 780px;
    font-size: clamp(46px, 6.6vw, 82px);
    line-height: 1.03;
    letter-spacing: 0;
}

.hero-subtitle {
    max-width: 680px;
    margin-bottom: 34px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.86;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 610px;
}

.hero-metrics div {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}

.hero-metrics strong,
.hero-metrics span {
    display: block;
}

.hero-metrics strong {
    margin-bottom: 2px;
    font-size: 22px;
    line-height: 1.2;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 13px;
}

.hero-visual {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 62px -20px 28px 44px;
    border-radius: 36px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(6, 182, 212, 0.08)),
        rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
}

.floating-card {
    position: absolute;
    z-index: 3;
    min-width: 176px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
}

.floating-card span,
.floating-card strong {
    display: block;
}

.floating-card span {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
}

.floating-card strong {
    font-size: 15px;
}

.floating-card-left {
    left: -22px;
    top: 88px;
}

.floating-card-right {
    right: -18px;
    bottom: 86px;
}

.doc-window {
    position: relative;
    z-index: 2;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
        #ffffff;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.doc-window::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.55), transparent 24%, transparent 74%, rgba(37, 99, 235, 0.08));
}

.doc-toolbar {
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(248, 250, 252, 0.82);
    border-bottom: 1px solid rgba(226, 232, 240, 0.78);
}

.doc-toolbar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.doc-toolbar i:first-child {
    background: #60a5fa;
}

.doc-toolbar i:nth-child(2) {
    background: #22c55e;
}

.doc-toolbar i:nth-child(3) {
    background: #a78bfa;
}

.doc-toolbar em {
    margin-left: auto;
    color: #8a95a8;
    font-style: normal;
    font-size: 12px;
}

.doc-body {
    position: relative;
    z-index: 1;
    padding: 30px;
}

.doc-chip {
    width: max-content;
    margin-bottom: 18px;
    padding: 6px 11px;
    color: #1d4ed8;
    background: rgba(239, 246, 255, 0.9);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    font-weight: 820;
    font-size: 13px;
}

.doc-body h2 {
    margin-bottom: 20px;
    font-size: 25px;
    line-height: 1.36;
    letter-spacing: 0;
}

.doc-line {
    height: 10px;
    width: 72%;
    margin-bottom: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #dbeafe, #eef2ff);
}

.doc-line.wide {
    width: 92%;
}

.doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 24px 0;
}

.doc-grid div,
.ai-panel {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.doc-grid div {
    padding: 15px;
}

.doc-grid p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.doc-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.doc-steps span {
    padding: 9px 8px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    font-weight: 760;
    border-radius: 10px;
    background: #f1f5f9;
}

.doc-steps .active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), var(--sky));
}

.ai-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px;
    color: var(--muted);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.86));
}

.ai-panel b {
    color: var(--blue);
    font-size: 25px;
}

.section,
.pain-section,
.pricing-section,
.about-section {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 96px 0;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 42px;
}

.section-heading h2,
.pain-copy h2,
.pricing-section h2,
.about-section h2 {
    margin-bottom: 14px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.16;
    letter-spacing: 0;
}

.section-heading p:last-child,
.pain-copy p,
.pricing-section p,
.about-section p {
    color: var(--muted);
}

.feature-grid,
.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card,
.template-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.feature-card::before,
.template-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), transparent 36%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.feature-card:hover,
.template-card:hover {
    transform: translateY(-8px);
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
}

.feature-card:hover::before,
.template-card:hover::before {
    opacity: 1;
}

.feature-card.coming {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.78));
}

.icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
}

.feature-card h3,
.template-card h3 {
    position: relative;
    margin-bottom: 10px;
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: 0;
}

.feature-card p,
.template-card p {
    position: relative;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.72;
}

.feature-card small {
    position: relative;
    display: block;
    margin-top: 18px;
    padding-top: 16px;
    color: #38506f;
    font-size: 13px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.pain-section {
    display: grid;
    grid-template-columns: 0.86fr 1.14fr;
    gap: 50px;
    align-items: center;
}

.pain-copy {
    padding: 34px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.82), rgba(255, 255, 255, 0.66)),
        rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow-sm);
}

.pain-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.pain-list div {
    min-height: 112px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-sm);
    font-weight: 830;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pain-list div:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.pain-list span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: var(--blue);
    border-radius: 12px;
    background: rgba(239, 246, 255, 0.95);
    font-size: 13px;
}

.template-grid {
    grid-template-columns: repeat(3, 1fr);
}

.template-preview {
    position: relative;
    height: 172px;
    margin-bottom: 22px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.8)),
        #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.template-preview::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 70px;
    height: 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.18);
}

.template-preview span {
    border-radius: 9px;
    background: rgba(191, 219, 254, 0.78);
}

.template-preview span:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--blue), var(--sky));
}

.template-preview.split {
    grid-template-columns: 0.8fr 1.2fr;
}

.template-preview.compact {
    grid-template-columns: 1fr;
}

.pricing-section,
.about-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.pricing-section {
    padding: 46px 40px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.74)),
        rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
}

.pricing-section p,
.about-section p {
    max-width: 640px;
    margin-bottom: 0;
}

.site-footer {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 40px 0 48px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted);
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.site-footer strong {
    color: var(--text);
    font-size: 18px;
}

.site-footer p {
    margin: 8px 0 0;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-size: 14px;
}

@media (max-width: 1060px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 76px;
        left: 24px;
        right: 24px;
        display: none;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        border: 1px solid rgba(148, 163, 184, 0.24);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: var(--shadow-md);
    }

    .nav-links a {
        padding: 12px 14px;
    }

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

    .hero,
    .pain-section {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 64px;
        gap: 48px;
    }

    .hero-content {
        max-width: 840px;
    }

    .hero-visual {
        min-height: 500px;
        max-width: 620px;
        width: 100%;
        margin: 0 auto;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .nav,
    .hero,
    .section,
    .pain-section,
    .about-section,
    .site-footer {
        width: min(100% - 32px, 1180px);
    }

    .nav {
        height: 66px;
    }

    .brand {
        font-size: 16px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .nav-links {
        top: 66px;
        left: 16px;
        right: 16px;
    }

    .hero {
        padding: 46px 0 56px;
        gap: 34px;
    }

    h1 {
        font-size: clamp(40px, 12vw, 58px);
    }

    .hero-subtitle {
        font-size: 17px;
        line-height: 1.78;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-metrics,
    .doc-grid,
    .feature-grid,
    .template-grid,
    .pain-list {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-height: auto;
        padding-top: 34px;
    }

    .floating-card {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        margin-bottom: 12px;
    }

    .floating-card-right {
        display: none;
    }

    .hero-visual::before {
        inset: 68px -8px -10px 18px;
        border-radius: 24px;
    }

    .doc-body {
        padding: 22px;
    }

    .doc-toolbar em {
        display: none;
    }

    .doc-steps {
        grid-template-columns: 1fr;
    }

    .section,
    .pain-section,
    .about-section {
        padding: 64px 0;
    }

    .pricing-section {
        width: min(100% - 32px, 1180px);
        padding: 34px 24px;
    }

    .pricing-section,
    .about-section,
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-meta {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .nav,
    .hero,
    .section,
    .pain-section,
    .pricing-section,
    .about-section,
    .site-footer {
        width: min(100% - 24px, 1180px);
    }

    .eyebrow {
        font-size: 12px;
    }

    h1 {
        font-size: 38px;
    }

    .feature-card,
    .template-card,
    .pain-copy {
        padding: 22px;
        border-radius: 16px;
    }
}

/* Product-first information hierarchy */
.primary-btn {
    position: relative;
    min-height: 54px;
    padding-inline: 28px;
    font-size: 16px;
}

.primary-btn::after {
    content: "→";
    margin-left: 10px;
    font-size: 18px;
    transition: transform 0.22s ease;
}

.primary-btn:hover::after {
    transform: translateX(3px);
}

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

.workspace-head h2 {
    margin-bottom: 0;
}

.workspace-head a {
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 9px 12px;
    color: #ffffff;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
    font-size: 13px;
    font-weight: 780;
}

.workspace-preview {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.preview-panel {
    position: relative;
    padding: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.preview-panel.active {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.82));
}

.preview-panel span,
.preview-panel strong {
    display: block;
    position: relative;
    z-index: 1;
}

.preview-panel span {
    margin-bottom: 4px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
}

.preview-panel strong {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.4;
}

.template-mini {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 8px;
}

.template-mini i {
    height: 22px;
    border-radius: 7px;
    background: rgba(191, 219, 254, 0.9);
}

.template-mini i:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--blue), var(--sky));
}

.export-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.export-mini b {
    color: #ffffff;
    padding: 7px 9px;
    border-radius: 8px;
    background: #0f766e;
    font-size: 12px;
}

.export-mini em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.workflow-section {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0 24px;
}

.compact-heading {
    margin-bottom: 24px;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.workflow-grid article {
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
}

.workflow-grid span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    color: #ffffff;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    font-weight: 850;
}

.workflow-grid h3 {
    margin-bottom: 6px;
    font-size: 19px;
}

.workflow-grid p {
    margin-bottom: 0;
    color: var(--muted);
}

.compact-section {
    padding-top: 72px;
    padding-bottom: 64px;
}

.compact-pain {
    padding-top: 58px;
    padding-bottom: 62px;
}

.template-section {
    padding-top: 58px;
    padding-bottom: 56px;
}

.template-section .section-heading {
    margin-bottom: 22px;
}

.template-section .template-card {
    min-height: auto;
    padding: 20px;
}

.template-section .template-preview {
    height: 110px;
    margin-bottom: 14px;
}

.template-section .template-card h3 {
    margin-bottom: 6px;
    font-size: 18px;
}

.template-section .template-card p {
    font-size: 14px;
    line-height: 1.55;
}

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

@media (max-width: 760px) {
    .workflow-section {
        width: min(100% - 32px, 1180px);
        padding-top: 40px;
    }

    .workspace-head {
        flex-direction: column;
    }

    .workspace-head a,
    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .template-section .template-preview {
        height: 96px;
    }
}

@media (max-width: 420px) {
    .workflow-section {
        width: min(100% - 24px, 1180px);
    }
}

/* Homepage SaaS layout refinement */
:root {
    --container: 1160px;
    --page-x: 48px;
    --section-y: 88px;
    --radius-lg: 24px;
}

.nav,
.hero,
.workflow-section,
.section,
.pain-section,
.pricing-section,
.about-section,
.site-footer {
    width: min(var(--container), calc(100% - var(--page-x)));
}

.hero {
    min-height: calc(100vh - 76px);
    padding: 76px 0 70px;
    grid-template-columns: minmax(420px, 0.92fr) minmax(440px, 1.08fr);
    gap: clamp(44px, 5vw, 76px);
}

.hero-content {
    max-width: 560px;
}

h1 {
    max-width: 620px;
    margin-bottom: 22px;
    font-size: clamp(44px, 5.4vw, 68px);
    line-height: 1.06;
}

.hero-subtitle {
    max-width: 540px;
    margin-bottom: 28px;
    font-size: 19px;
    line-height: 1.78;
}

.hero-actions {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 22px;
}

.hero-primary {
    min-height: 68px;
    min-width: 286px;
    padding: 12px 58px 12px 24px;
    align-items: flex-start;
    flex-direction: column;
    line-height: 1.2;
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.34);
}

.hero-primary span,
.hero-primary small {
    display: block;
}

.hero-primary span {
    font-size: 17px;
}

.hero-primary small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 650;
}

.hero-primary::after {
    position: absolute;
    right: 24px;
    top: 50%;
    margin-left: 0;
    transform: translateY(-50%);
}

.hero-primary:hover::after {
    transform: translate(4px, -50%);
}

.hero-actions .secondary-btn {
    min-height: 68px;
    padding-inline: 22px;
}

.hero-value {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-value span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    font-size: 13px;
    font-weight: 720;
}

.hero-metrics {
    max-width: 540px;
    gap: 10px;
}

.hero-metrics div {
    padding: 14px;
    border-radius: 16px;
}

.hero-visual {
    min-height: 520px;
    align-items: center;
}

.hero-visual::before {
    inset: 34px -12px 22px 28px;
    border-radius: 32px;
    transform: none;
}

.doc-window {
    border-radius: var(--radius-lg);
}

.doc-body {
    padding: 26px;
}

.workspace-head {
    align-items: center;
    margin-bottom: 18px;
}

.workspace-head h2 {
    font-size: 22px;
}

.workspace-shell {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.workspace-sidebar {
    padding: 10px;
    display: grid;
    align-content: start;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.82);
}

.workspace-sidebar span {
    display: block;
    padding: 10px 11px;
    color: var(--muted);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 780;
}

.workspace-sidebar .is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.workspace-main {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preview-panel {
    min-width: 0;
    padding: 15px;
    border-radius: 14px;
}

.preview-panel strong {
    min-height: 42px;
    font-size: 14px;
}

.doc-steps {
    margin-bottom: 12px;
}

.ai-panel {
    padding: 15px 16px;
}

.workflow-section,
.compact-section,
.compact-pain,
.template-section,
.section,
.pain-section,
.about-section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.workflow-section {
    margin: 0 auto;
}

.compact-heading {
    max-width: 720px;
    margin-bottom: 30px;
}

.compact-heading h2 {
    font-size: clamp(30px, 3.5vw, 42px);
}

.workflow-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.workflow-grid article {
    position: relative;
    min-height: 210px;
    padding: 28px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
        #ffffff;
}

.workflow-grid article:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 52px;
    right: -14px;
    z-index: 2;
    width: 28px;
    height: 1px;
    background: rgba(37, 99, 235, 0.34);
}

.workflow-grid .step-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 22px;
    border-radius: 14px;
    font-size: 14px;
}

.workflow-grid h3 {
    margin-bottom: 9px;
    font-size: 21px;
}

.workflow-grid p {
    max-width: 300px;
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 1060px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 62px;
    }

    .hero-content {
        max-width: 760px;
    }

    .hero-subtitle,
    .hero-metrics {
        max-width: 680px;
    }

    .workflow-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workflow-grid article {
        padding: 22px;
    }
}

@media (max-width: 820px) {
    :root {
        --page-x: 32px;
        --section-y: 64px;
    }

    .workflow-grid,
    .preview-row {
        grid-template-columns: 1fr;
    }

    .workflow-grid article:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 760px) {
    .hero {
        padding: 44px 0 52px;
        gap: 32px;
    }

    h1 {
        font-size: clamp(38px, 11vw, 52px);
    }

    .hero-primary,
    .hero-actions .secondary-btn {
        width: 100%;
    }

    .hero-value {
        display: grid;
        grid-template-columns: 1fr;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        grid-template-columns: repeat(3, 1fr);
    }

    .workspace-sidebar span {
        padding: 9px 7px;
        text-align: center;
    }

    .doc-steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .pricing-section {
        width: min(var(--container), calc(100% - var(--page-x)));
    }
}

@media (max-width: 420px) {
    :root {
        --page-x: 24px;
    }

    .hero-primary {
        min-width: 0;
        padding-left: 20px;
        padding-right: 50px;
    }

    .doc-body {
        padding: 20px;
    }

    .workspace-sidebar {
        grid-template-columns: 1fr;
    }

    .workflow-grid article {
        min-height: auto;
    }
}

/* Modern AI workspace */
.workspace-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.12), transparent 26rem),
        radial-gradient(circle at 88% 18%, rgba(6, 182, 212, 0.11), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, #eef5ff 48%, #ffffff 100%);
}

.workspace-app {
    width: min(1560px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 0;
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr) minmax(430px, 480px);
    gap: 20px;
}

.workspace-nav,
.workspace-center,
.workspace-preview-pane {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(22px);
}

.workspace-nav {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.workspace-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.workspace-brand strong {
    font-size: 17px;
    line-height: 1.25;
}

.workspace-menu {
    display: grid;
    gap: 10px;
}

.workspace-menu a {
    position: relative;
    min-height: 56px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #40516a;
    border: 1px solid transparent;
    border-radius: 16px;
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.workspace-menu a:hover {
    transform: translateY(-1px);
    background: rgba(239, 246, 255, 0.8);
    border-color: rgba(37, 99, 235, 0.12);
}

.workspace-menu a.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #0284c7);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.workspace-menu span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.09);
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
}

.workspace-menu a.active span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.workspace-menu strong {
    font-size: 15px;
}

.workspace-menu em {
    margin-left: auto;
    padding: 4px 7px;
    color: #647084;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.7);
    font-size: 11px;
    font-style: normal;
}

.workspace-menu .disabled {
    opacity: 0.72;
}

.workspace-nav-card {
    margin-top: auto;
    padding: 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.76)),
        #ffffff;
}

.workspace-nav-card span,
.workspace-nav-card strong {
    display: block;
}

.workspace-nav-card span {
    margin-bottom: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
}

.workspace-nav-card strong {
    color: #1e293b;
    font-size: 14px;
    line-height: 1.55;
}

.workspace-center {
    min-width: 0;
    padding: 34px;
}

.workspace-topbar {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.workspace-topbar h1 {
    max-width: 720px;
    margin-bottom: 0;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.08;
}

.workspace-home-link {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 760;
}

.lesson-composer {
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.82)),
        #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 48px rgba(15, 23, 42, 0.06);
}

.composer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.lesson-composer label,
.style-picker {
    display: grid;
    gap: 8px;
}

.lesson-composer label > span,
.style-picker > span {
    color: #475569;
    font-size: 13px;
    font-weight: 820;
}

.lesson-composer input,
.lesson-composer select,
.lesson-composer textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lesson-composer input::placeholder,
.lesson-composer textarea::placeholder {
    color: #a8b3c4;
}

.lesson-composer select:invalid,
.lesson-composer select.is-placeholder {
    color: #94a3b8;
}

.lesson-composer select:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background-color: rgba(241, 245, 249, 0.78);
}

.lesson-composer select option {
    color: #0f172a;
}

.lesson-composer select option[value=""] {
    color: #94a3b8;
}

.lesson-composer select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.lesson-composer textarea {
    min-height: 132px;
    padding: 14px;
    resize: vertical;
}

.lesson-composer input:focus,
.lesson-composer select:focus,
.lesson-composer textarea:focus {
    border-color: rgba(37, 99, 235, 0.45);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09), 0 12px 26px rgba(15, 23, 42, 0.05);
}

.lesson-composer .wide {
    grid-column: span 2;
}

.lesson-composer .full {
    grid-column: 1 / -1;
}

.style-picker {
    grid-column: 1 / -1;
}

.style-tags {
    min-height: 48px;
    padding: 7px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}

.style-tags button {
    min-height: 32px;
    padding: 0 12px;
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.style-tags button:hover {
    transform: translateY(-1px);
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(239, 246, 255, 0.88);
}

.style-tags button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.style-tags button.is-selected {
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.58);
    background: linear-gradient(135deg, var(--blue), #0284c7);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.upload-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.upload-mode-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    padding: 14px;
    text-align: left;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.upload-mode-card:hover,
.upload-mode-card.is-selected {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.46);
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92)),
        #ffffff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
}

.upload-mode-card.is-selected {
    color: #1d4ed8;
}

.upload-mode-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    color: #2563eb;
    border-radius: 14px;
    background: rgba(239, 246, 255, 0.95);
    font-size: 12px;
    font-weight: 950;
}

.upload-mode-card.is-selected .upload-mode-icon {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #0284c7);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.upload-mode-card strong,
.upload-mode-card small {
    display: block;
}

.upload-mode-card strong {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 900;
}

.upload-mode-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.upload-dropzone {
    position: relative;
    margin-top: 14px;
    min-height: 210px;
    padding: 28px;
    place-items: center;
    text-align: center;
    overflow: hidden;
    border: 1px dashed rgba(37, 99, 235, 0.4);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 253, 245, 0.7)),
        #ffffff;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.upload-dropzone::before {
    content: "";
    position: absolute;
    inset: 14px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 18px;
}

.upload-dropzone::after {
    content: "";
    position: absolute;
    inset: auto 24px 24px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.22), transparent);
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.62);
    box-shadow: 0 18px 44px rgba(37, 99, 235, 0.12);
}

.upload-dropzone.is-dragover {
    background:
        linear-gradient(135deg, rgba(219, 234, 254, 0.98), rgba(204, 251, 241, 0.86)),
        #ffffff;
}

.upload-dropzone.has-error {
    border-color: rgba(239, 68, 68, 0.55);
    background:
        linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.82)),
        #ffffff;
}

.upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    color: #ffffff;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
        linear-gradient(135deg, var(--blue), var(--green));
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
    font-size: 13px;
    font-weight: 900;
}

.upload-dropzone.is-word .upload-icon {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
        linear-gradient(135deg, #2563eb, #0284c7);
}

.upload-dropzone.is-ocr .upload-icon {
    overflow: hidden;
}

.upload-dropzone.is-ocr .upload-icon::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.92);
    animation: upload-scan-line 1.6s ease-in-out infinite;
}

.upload-dropzone strong,
.upload-dropzone em,
.upload-dropzone small,
.upload-dropzone b,
.upload-file-name,
.ocr-workflow-card,
.template-status,
.template-summary {
    display: block;
    position: relative;
    z-index: 1;
}

.upload-dropzone strong {
    margin-bottom: 4px;
    font-size: 17px;
}

.upload-dropzone em {
    color: var(--muted);
    font-size: 14px;
    font-style: normal;
}

.upload-dropzone small {
    max-width: 520px;
    margin: 10px auto 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.7;
}

.upload-dropzone b {
    width: fit-content;
    margin: 14px auto 0;
    padding: 7px 11px;
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 999px;
    background: rgba(240, 253, 250, 0.92);
    font-size: 12px;
    font-weight: 850;
}

.upload-file-name {
    margin-top: 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 780;
}

.ocr-workflow-card {
    display: none;
    align-items: flex-start;
    gap: 12px;
    width: min(100%, 560px);
    margin: 14px auto 0;
    padding: 14px 16px;
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.9)),
        #eff6ff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.1);
}

.ocr-workflow-card.is-visible {
    display: flex;
}

.ocr-workflow-card.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.22) 35%, rgba(255, 255, 255, 0.68) 50%, rgba(255, 255, 255, 0.22) 65%, transparent 100%);
    transform: translateX(-110%);
    animation: ocr-shimmer 1.8s ease-in-out infinite;
}

.ocr-workflow-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.36);
    animation: ocr-dot-pulse 1.2s ease-in-out infinite;
}

.ocr-workflow-body {
    min-width: 0;
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.55;
}

.ocr-workflow-text {
    display: inline;
}

.ocr-workflow-dots::after {
    content: "";
    display: inline-block;
    width: 1.5em;
    animation: ocr-loading-dots 1.5s steps(4, end) infinite;
}

.ocr-workflow-steps {
    display: none;
    color: #155e75;
    font-size: 13px;
    font-weight: 780;
}

.ocr-workflow-steps span {
    display: block;
}

.ocr-workflow-steps span + span {
    margin-top: 3px;
}

.ocr-workflow-card.is-complete {
    border-color: rgba(20, 184, 166, 0.2);
    background:
        linear-gradient(135deg, rgba(240, 253, 250, 0.98), rgba(236, 253, 245, 0.9)),
        #f0fdfa;
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.09);
}

.ocr-workflow-card.is-complete .ocr-workflow-dot {
    background: #0f766e;
    animation: none;
    box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.12);
}

.ocr-workflow-card.is-complete .ocr-workflow-text,
.ocr-workflow-card.is-complete .ocr-workflow-dots {
    display: none;
}

.ocr-workflow-card.is-complete .ocr-workflow-steps {
    display: block;
}

.ocr-workflow-card.is-complete .ocr-workflow-steps span::before {
    content: "✓ ";
    color: #0f766e;
    font-weight: 950;
}

.template-status,
.template-summary {
    max-width: 620px;
    margin: 10px auto 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.65;
}

.template-status {
    font-weight: 820;
}

.template-summary {
    color: var(--muted);
}

.upload-dropzone.has-error .upload-file-name {
    color: #dc2626;
}

.composer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.workspace-generate {
    min-height: 56px;
    padding-inline: 30px;
}

.workspace-preview-pane {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    padding: 22px;
    overflow: auto;
}

.preview-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 850;
}

.preview-status span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.preview-status.is-loading span {
    background: var(--blue);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.preview-status.is-error {
    color: #dc2626;
}

.preview-status.is-error span {
    background: #ef4444;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
}

.preview-status.is-success {
    color: #0f766e;
}

.lesson-preview-card {
    overflow: hidden;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.08);
}

.preview-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.preview-card-head span {
    display: block;
    margin-bottom: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
}

.preview-card-head h2 {
    margin-bottom: 0;
    font-size: 24px;
    line-height: 1.24;
}

.preview-card-head b {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 54px;
    height: 54px;
    padding: 0 8px;
    color: var(--blue);
    border-radius: 18px;
    background: rgba(239, 246, 255, 0.95);
    font-size: 15px;
}

.lesson-preview-card.is-loading {
    min-height: 360px;
}

.preview-skeleton {
    height: 18px;
    margin-top: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
    background-size: 220% 100%;
    animation: preview-loading 1.2s ease-in-out infinite;
}

.preview-skeleton.short {
    width: 58%;
}

.preview-skeleton.medium {
    width: 78%;
}

@keyframes preview-loading {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 220% 50%;
    }
}

@keyframes ocr-dot-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.36);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(37, 99, 235, 0);
        transform: scale(0.82);
    }
}

@keyframes ocr-loading-dots {
    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75%,
    100% {
        content: "...";
    }
}

@keyframes ocr-shimmer {
    100% {
        transform: translateX(110%);
    }
}

@keyframes upload-scan-line {
    0%,
    100% {
        transform: translateY(-16px);
        opacity: 0.15;
    }

    50% {
        transform: translateY(16px);
        opacity: 1;
    }
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 14px;
}

.preview-meta span {
    padding: 6px 9px;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 760;
}

.preview-section {
    padding: 16px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.preview-section strong {
    display: block;
    margin-bottom: 7px;
    font-size: 15px;
}

.preview-section p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.preview-action-panel {
    position: sticky;
    top: -1px;
    z-index: 3;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96)),
        #ffffff;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.1);
}

.preview-action-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.preview-action-head span,
.preview-action-head strong {
    display: block;
}

.preview-action-head span {
    margin-bottom: 4px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.preview-action-head strong {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.45;
}

.preview-action-head em {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 999px;
    background: rgba(240, 253, 250, 0.9);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.preview-action-btn {
    min-height: 44px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    font: inherit;
    font-size: 14px;
    font-weight: 860;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.preview-action-btn span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.09);
    color: var(--blue);
    font-size: 14px;
    line-height: 1;
}

.preview-action-btn:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.32);
    background: rgba(239, 246, 255, 0.88);
    transform: translateY(-1px);
}

.preview-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

.download-action {
    flex: 1 1 150px;
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.72);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
        linear-gradient(135deg, var(--blue), #0284c7);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

.download-action span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.download-action:hover {
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.86);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
        linear-gradient(135deg, var(--blue-dark), #0369a1);
}

.copy-action {
    flex: 1 1 132px;
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.2);
    background: #ffffff;
}

.regenerate-action {
    flex: 1 1 132px;
    color: #334155;
    background: #f8fafc;
}

.preview-action-message {
    display: block;
    min-height: 20px;
    margin-top: 10px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 780;
}

.lesson-section-cards {
    display: grid;
    gap: 12px;
}

.lesson-section-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
        #ffffff;
}

.lesson-section-card summary {
    min-height: 50px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 860;
    cursor: pointer;
    list-style: none;
}

.lesson-section-card summary::-webkit-details-marker {
    display: none;
}

.lesson-section-card summary b {
    position: relative;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
}

.lesson-section-card summary b::before,
.lesson-section-card summary b::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 11px;
    height: 2px;
    border-radius: 999px;
    background: var(--blue);
}

.lesson-section-card summary b::after {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

.lesson-section-card[open] summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.lesson-section-card[open] summary b::after {
    transform: rotate(0deg);
}

.lesson-section-body {
    padding: 14px;
    color: #334155;
    font-size: 14px;
    line-height: 1.82;
}

.lesson-section-body p {
    margin: 0 0 12px;
}

.lesson-section-body p:last-child {
    margin-bottom: 0;
}

.generated-content {
    max-height: none;
    overflow: auto;
}

.generated-content .lesson-section-body p {
    margin-bottom: 12px;
    color: #334155;
}

.lesson-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.lesson-process-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    line-height: 1.65;
}

.lesson-process-table th,
.lesson-process-table td {
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    vertical-align: top;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.lesson-process-table th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 800;
}

.lesson-process-table td:first-child,
.lesson-process-table th:first-child {
    width: 18%;
}

.preview-error {
    padding: 16px;
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 16px;
    background: rgba(254, 242, 242, 0.92);
    font-size: 14px;
    line-height: 1.7;
}

.preview-timeline {
    display: grid;
    gap: 10px;
    margin: 8px 0 18px;
}

.preview-timeline div {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 760;
}

.preview-timeline span {
    color: var(--blue);
    font-size: 12px;
}

.preview-export {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.08));
}

.preview-export span {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 38px;
    color: #ffffff;
    border-radius: 12px;
    background: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.preview-export strong {
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .workspace-app {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .workspace-preview-pane {
        grid-column: 1 / -1;
        position: relative;
        top: auto;
        height: auto;
    }
}

@media (max-width: 860px) {
    .workspace-app {
        width: min(100% - 28px, 720px);
        grid-template-columns: 1fr;
        padding: 14px 0;
    }

    .workspace-nav,
    .workspace-preview-pane {
        position: relative;
        top: auto;
        height: auto;
    }

    .workspace-nav {
        padding: 18px;
    }

    .workspace-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-nav-card {
        margin-top: 18px;
    }

    .workspace-center {
        padding: 22px;
    }

    .workspace-topbar {
        flex-direction: column;
    }

    .workspace-topbar h1 {
        font-size: clamp(32px, 8vw, 44px);
    }

    .composer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .workspace-app {
        width: min(100% - 20px, 720px);
    }

    .workspace-menu,
    .upload-mode-switch,
    .composer-grid {
        grid-template-columns: 1fr;
    }

    .lesson-composer .wide {
        grid-column: auto;
    }

    .composer-actions {
        flex-direction: column;
    }

    .composer-actions .secondary-btn,
    .composer-actions .primary-btn {
        width: 100%;
    }
}
