/* ═══════════════════════════════════════════════════════════════════
   Worksheet Wizard — Homepage Design System
   Design tokens: Inter font · #4F46E5 brand · flat / no shadows
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset helpers scoped to new homepage classes ─────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
    --hw-brand:        #4F46E5;
    --hw-brand-hover:  #4338CA;
    --hw-brand-tint:   #EEF2FF;
    --hw-brand-mid:    #818CF8;
    --hw-text:         #374151;
    --hw-text-dark:    #111827;
    --hw-muted:        #6B7280;
    --hw-border:       #E5E7EB;
    --hw-border-mid:   #D1D5DB;
    --hw-surface:      #F9FAFB;
    --hw-white:        #FFFFFF;
    --hw-green:        #22C55E;
    --hw-amber:        #F59E0B;
    --hw-r8:           8px;
    --hw-r12:          12px;
}

/* ── Global font override for homepage ────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Shared container ──────────────────────────────────────────────── */
.hw-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Section header block ──────────────────────────────────────────── */
.hw-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.hw-section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hw-brand);
    margin-bottom: 0.5rem;
}
.hw-section-h2 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--hw-text-dark);
    margin: 0 0 0.5rem;
    line-height: 1.25;
}
.hw-section-sub {
    font-size: 0.9rem;
    color: var(--hw-muted);
    margin: 0;
    max-width: 540px;
    margin-inline: auto;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════
   SECTION 1 — NAVBAR
   ══════════════════════════════════════════════════════════════════════ */
.hw-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 60px;
    background: var(--hw-white);
    border-bottom: 1px solid var(--hw-border);
    display: flex;
    align-items: center;
}
.hw-nav__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.hw-nav__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--hw-text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.hw-nav__logo img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.hw-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Right-side group (auth actions / user controls) */
.hw-nav__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Pro badge */
.hw-nav__pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #FEF9C3;
    color: #854D0E;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1;
}

/* Avatar circle */
.hw-nav__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #EEF2FF;
    color: var(--hw-brand);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}
.hw-nav__avatar:hover { background: #E0E7FF; }

/* Avatar dropdown menu */
.avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 0.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.avatar-menu a,
.avatar-menu-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    border-radius: 8px;
    text-decoration: none;
    background: none;
    border: none;
    box-shadow: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    transition: background 0.1s;
}
.avatar-menu a:hover,
.avatar-menu-btn:hover {
    background: #F9FAFB;
}

/* Mobile-only nav items (hidden on desktop, shown in dropdown) */
.hw-nav__mobile-item { display: none; }
.hw-nav__link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: var(--hw-muted);
    text-decoration: none;
    border-radius: var(--hw-r8);
    transition: color 0.15s, background 0.15s;
    font-weight: 400;
    white-space: nowrap;
}
.hw-nav__link:hover { color: var(--hw-text-dark); background: var(--hw-surface); }
.hw-nav__link--active { color: var(--hw-brand); font-weight: 500; }
.hw-nav__cta {
    display: inline-block;
    padding: 7px 16px;
    background: var(--hw-brand);
    color: var(--hw-white);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--hw-r8);
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    margin-left: 4px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: normal;
}
.hw-nav__cta:hover { background: var(--hw-brand-hover); }
button.hw-nav__link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: normal;
}
.hw-nav__hamburger {
    display: none;
    background: none;
    border: 1px solid var(--hw-border);
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 9px;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
}
.hw-nav__hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--hw-text-dark);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ── Flash messages ────────────────────────────────────────────────── */
.hw-flash {
    max-width: 1100px;
    margin: 0.75rem auto;
    padding: 0 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   SECTION 2 — HERO
   ══════════════════════════════════════════════════════════════════════ */
.hw-hero {
    background: var(--hw-white);
    border-bottom: 1px solid var(--hw-border);
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
}
.hw-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--hw-muted);
    margin-bottom: 1.25rem;
}
.hw-hero__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hw-green);
    flex-shrink: 0;
}
.hw-hero__h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 500;
    color: var(--hw-text-dark);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin: 0 0 1rem;
}
.hw-hero__h1 .hw-accent { color: var(--hw-brand); }
.hw-hero__sub {
    font-size: 15px;
    color: var(--hw-muted);
    max-width: 480px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}
.hw-hero__ctas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.hw-btn-primary {
    display: inline-block;
    background: var(--hw-brand);
    color: var(--hw-white);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: var(--hw-r8);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.hw-btn-primary:hover { background: var(--hw-brand-hover); color: var(--hw-white); }
.hw-btn-secondary {
    display: inline-block;
    background: var(--hw-white);
    color: var(--hw-text-dark);
    font-size: 0.9rem;
    font-weight: 400;
    padding: 10px 22px;
    border-radius: var(--hw-r8);
    text-decoration: none;
    border: 1px solid var(--hw-border-mid);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.hw-btn-secondary:hover { border-color: var(--hw-brand-mid); background: var(--hw-brand-tint); }
.hw-hero__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    border-top: 1px solid var(--hw-border);
    border-bottom: 1px solid var(--hw-border);
    padding: 1.25rem 0;
}
.hw-stat {
    text-align: center;
    padding: 0 2rem;
}
.hw-stat + .hw-stat {
    border-left: 1px solid var(--hw-border);
}
.hw-stat__num {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--hw-text-dark);
    line-height: 1.2;
}
.hw-stat__desc {
    display: block;
    font-size: 12px;
    color: var(--hw-muted);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════════
   SECTION 3 — GENERATOR
   ══════════════════════════════════════════════════════════════════════ */
.hw-gen-section {
    background: var(--hw-surface);
    padding: 3rem 0 3.5rem;
    border-bottom: 1px solid var(--hw-border);
}
.hw-gen-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 2rem;
}
.hw-card {
    background: var(--hw-white);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r12);
    padding: 1.25rem;
}

/* Form field rows */
.hw-field {
    margin-bottom: 1.25rem;
}
.hw-field:last-child { margin-bottom: 0; }
.hw-field__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hw-muted);
    margin-bottom: 0.5rem;
}
.hw-field__sublabel {
    font-size: 10px;
    color: var(--hw-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

/* Subject cards — override styles.css .subject-card for new design */
.hw-gen-section .subject-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.hw-gen-section .subject-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 10px 9px;
    background: var(--hw-white);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r8);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
    width: 100%;
}
.hw-gen-section .subject-card:hover {
    border-color: var(--hw-brand-mid);
    background: #F5F3FF;
}
.hw-gen-section .subject-card--selected {
    border: 2px solid var(--hw-brand);
    background: var(--hw-brand-tint);
}
.hw-gen-section .subject-card__icon {
    font-size: 16px;
    line-height: 1;
}
.hw-gen-section .subject-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--hw-text-dark);
    line-height: 1.2;
}
.hw-gen-section .subject-card__desc {
    font-size: 11px;
    color: var(--hw-muted);
    line-height: 1.3;
    font-weight: 400;
}

/* Grade pills — override styles.css .grade-pill for new design */
.hw-gen-section .grade-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.hw-gen-section .grade-pill {
    padding: 5px 13px;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--hw-border-mid);
    background: var(--hw-white);
    color: var(--hw-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    font-weight: 400;
}
.hw-gen-section .grade-pill:hover:not(:disabled) {
    border-color: var(--hw-brand-mid);
    color: var(--hw-brand);
}
.hw-gen-section .grade-pill--selected {
    background: var(--hw-brand);
    color: var(--hw-white);
    border-color: var(--hw-brand);
    font-weight: 500;
}
.hw-gen-section .grade-pill--coming-soon {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Topic input */
.hw-topic-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r8);
    outline: none;
    transition: border-color 0.15s;
    color: var(--hw-text-dark);
    background: var(--hw-white);
}
.hw-topic-input:focus { border-color: var(--hw-brand); }
.hw-topic-note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--hw-muted);
    font-style: italic;
    display: none;
}
.hw-ai-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--hw-brand);
    background: var(--hw-brand-tint);
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 6px;
}

/* Question count stepper */
.hw-stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hw-stepper-row .hw-field__label { margin-bottom: 0; }
.hw-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}
.hw-stepper__btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    background: var(--hw-white);
    border: 1px solid var(--hw-border-mid);
    border-radius: 6px;
    cursor: pointer;
    color: var(--hw-text-dark);
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
    padding: 0;
    user-select: none;
}
.hw-stepper__btn:hover { border-color: var(--hw-brand); background: var(--hw-brand-tint); }
.hw-stepper__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.hw-stepper__val {
    min-width: 36px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hw-text-dark);
}

/* Customize layout accordion */
.hw-layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--hw-brand);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-weight: 400;
    margin-bottom: 0;
    transition: color 0.15s;
}
.hw-layout-toggle:hover { color: var(--hw-brand-hover); }
.hw-layout-toggle .hw-toggle-arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-style: normal;
    line-height: 1;
}
.hw-layout-toggle.is-open .hw-toggle-arrow { transform: rotate(90deg); }
.hw-layout-panel {
    background: var(--hw-surface);
    border-radius: var(--hw-r8);
    padding: 12px;
    margin-top: 8px;
    display: none;
}
.hw-layout-panel.is-open { display: block; }
.hw-layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--hw-border);
}
.hw-layout-row:last-child { border-bottom: none; padding-bottom: 0; }
.hw-layout-row__label {
    font-size: 12px;
    color: var(--hw-muted);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
}
.hw-layout-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.hw-layout-pill {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid var(--hw-border-mid);
    background: var(--hw-white);
    color: var(--hw-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    font-family: inherit;
    font-weight: 400;
}
.hw-layout-pill:hover { border-color: var(--hw-brand-mid); color: var(--hw-brand); }
.hw-layout-pill--selected {
    background: var(--hw-brand);
    color: var(--hw-white);
    border-color: var(--hw-brand);
}

/* Generate button */
.hw-gen-btn {
    display: block;
    width: 100%;
    background: var(--hw-brand);
    color: var(--hw-white);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 11px 0;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    text-align: center;
    margin-top: 1.25rem;
}
.hw-gen-btn:hover:not(:disabled) { background: var(--hw-brand-hover); }
.hw-gen-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hw-gen-btn-note {
    text-align: center;
    font-size: 11px;
    color: var(--hw-muted);
    margin-top: 6px;
}
.hw-gen-btn-note a { color: var(--hw-brand); text-decoration: none; }
.hw-gen-btn-note a:hover { text-decoration: underline; }
.hw-gen-btn-note--pro { color: #059669; font-weight: 500; }

/* Divider */
.hw-divider {
    border: none;
    border-top: 1px solid var(--hw-border);
    margin: 1rem 0;
}

/* Right column — preview panel */
.hw-preview-col {
    position: sticky;
    top: 72px;
}
.hw-preview-wrap {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r12);
    padding: 1.25rem;
}
.hw-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.hw-preview-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--hw-text-dark);
}
.hw-preview-badge {
    font-size: 11px;
    color: var(--hw-brand);
    background: var(--hw-brand-tint);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}
.hw-preview-sheet {
    background: var(--hw-white);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r8);
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}
/* Override existing preview-panel styles inside the new wrapper */
.hw-preview-wrap .preview-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    min-height: 260px;
}
/* Iframe PDF preview state */
.preview-generated--iframe {
    height: 480px;
    min-height: 420px;
    padding-top: 1rem;
    margin-top: 0.5rem;
    box-sizing: border-box;
}
.preview-generated--iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 6px;
}
.hw-preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 0.75rem;
}
.hw-preview-actions .hw-btn-outline {
    flex: 1;
    padding: 8px 0;
    font-size: 0.82rem;
    font-weight: 400;
    text-align: center;
    background: var(--hw-white);
    border: 1px solid var(--hw-border-mid);
    border-radius: var(--hw-r8);
    color: var(--hw-text-dark);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.hw-preview-actions .hw-btn-outline:hover:not(:disabled) {
    border-color: var(--hw-brand-mid);
    background: var(--hw-brand-tint);
}
.hw-preview-actions .hw-btn-filled {
    flex: 1;
    padding: 8px 0;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    background: var(--hw-brand);
    border: none;
    border-radius: var(--hw-r8);
    color: var(--hw-white);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.hw-preview-actions .hw-btn-filled:hover:not(:disabled) { background: var(--hw-brand-hover); }
.hw-preview-actions button:disabled,
.hw-preview-actions a.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════
   SECTION 4 — FEATURES
   ══════════════════════════════════════════════════════════════════════ */
.hw-features-section {
    background: var(--hw-white);
    padding: 3rem 0 3.5rem;
    border-bottom: 1px solid var(--hw-border);
}
.hw-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.hw-feature-card {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r12);
    padding: 1.25rem;
}
.hw-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--hw-r8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}
.hw-feature-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--hw-text-dark);
    margin: 0 0 0.35rem;
}
.hw-feature-desc {
    font-size: 12px;
    color: var(--hw-muted);
    line-height: 1.6;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   SECTION 5 — PRICING
   ══════════════════════════════════════════════════════════════════════ */
.hw-pricing-section {
    background: var(--hw-white);
    padding: 3rem 0 3.5rem;
    border-bottom: 1px solid var(--hw-border);
}
.hw-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}
.hw-price-card {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r12);
    padding: 1.5rem;
    position: relative;
}
.hw-price-card--pro {
    border: 2px solid var(--hw-brand);
    background: var(--hw-white);
}
.hw-price-card__popular {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hw-brand);
    color: var(--hw-white);
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    padding: 3px 14px;
    white-space: nowrap;
}
.hw-price-tier {
    font-size: 13px;
    font-weight: 500;
    color: var(--hw-text-dark);
    margin: 0 0 0.35rem;
}
.hw-price-amount {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--hw-text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.hw-price-amount span {
    font-size: 14px;
    font-weight: 400;
    color: var(--hw-muted);
}
.hw-price-desc {
    font-size: 12px;
    color: var(--hw-muted);
    margin: 0 0 1rem;
    min-height: 18px;
}
.hw-price-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}
.hw-price-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--hw-muted);
    padding: 7px 0;
    border-top: 1px solid var(--hw-border);
    line-height: 1.4;
}
.hw-price-feature:first-child { border-top: none; padding-top: 0; }
.hw-price-check { color: var(--hw-green); font-weight: 500; flex-shrink: 0; }
.hw-price-cross { opacity: 0.4; flex-shrink: 0; }
.hw-price-btn-outline {
    display: block;
    width: 100%;
    padding: 9px 0;
    font-size: 0.875rem;
    font-weight: 400;
    text-align: center;
    background: var(--hw-white);
    border: 1px solid var(--hw-border-mid);
    border-radius: var(--hw-r8);
    color: var(--hw-text-dark);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.hw-price-btn-outline:hover { border-color: var(--hw-brand-mid); background: var(--hw-brand-tint); }
.hw-price-btn-filled {
    display: block;
    width: 100%;
    padding: 9px 0;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    background: var(--hw-brand);
    border: none;
    border-radius: var(--hw-r8);
    color: var(--hw-white);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s;
}
.hw-price-btn-filled:hover { background: var(--hw-brand-hover); color: var(--hw-white); }

/* ══════════════════════════════════════════════════════════════════════
   SECTION 7 — FOOTER
   ══════════════════════════════════════════════════════════════════════ */
.hw-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--hw-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.hw-footer__copy {
    font-size: 12px;
    color: var(--hw-muted);
    margin: 0;
}
.hw-footer__links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.hw-footer__links a {
    font-size: 12px;
    color: var(--hw-muted);
    text-decoration: none;
}
.hw-footer__links a:hover { color: var(--hw-text-dark); }

/* ══════════════════════════════════════════════════════════════════════
   AI topic override note (reuse existing id, new style)
   ══════════════════════════════════════════════════════════════════════ */
#ai-topic-override-note {
    font-size: 12px;
    color: var(--hw-brand);
    font-style: italic;
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — ≤ 768 px
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hw-nav__links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--hw-white);
        border-bottom: 1px solid var(--hw-border);
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1.5rem 1rem;
        gap: 2px;
        z-index: 300;
    }
    .hw-nav__links.is-open { display: flex; }
    .hw-nav__hamburger { display: flex; }
    .hw-nav__inner { position: relative; }
    .hw-nav__right { display: none; }
    .hw-nav__mobile-item { display: list-item; }

    .hw-gen-layout {
        grid-template-columns: 1fr;
    }
    .hw-preview-col {
        position: static;
    }
    .hw-gen-section .subject-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .hw-stat {
        padding: 0 1rem;
    }
    .hw-hero__stats {
        gap: 0.5rem;
    }
    .hw-stat + .hw-stat {
        border-left: none;
        border-top: 1px solid var(--hw-border);
        width: 100%;
        padding: 0.75rem 0;
    }
    .hw-hero__stats {
        flex-direction: column;
        align-items: center;
    }
    .hw-pricing-grid,
    .hw-features-grid {
        grid-template-columns: 1fr;
    }
    .hw-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
    }
}
@media (max-width: 480px) {
    .hw-gen-section .subject-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .hw-layout-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .hw-layout-pills { justify-content: flex-start; }
}

/* ── Button inline spinner ───────────────────────────────────── */
@keyframes hw-spin {
    to { transform: rotate(360deg); }
}
.hw-btn-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: hw-spin 0.65s linear infinite;
    margin-right: 6px;
    vertical-align: -2px;
    flex-shrink: 0;
}

/* ── Recent worksheets section ───────────────────────────────── */
.hw-recent-section {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--hw-border);
}
.hw-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}
.hw-recent-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}
.hw-recent-viewall {
    font-size: 13px;
    color: var(--hw-brand);
    text-decoration: none;
}
.hw-recent-viewall:hover { text-decoration: underline; }
.hw-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-r8);
    overflow: hidden;
}
.hw-recent-empty {
    font-size: 13px;
    color: #6B7280;
    padding: 1.25rem 0;
    text-align: center;
    margin: 0;
    border: none;
}
.hw-recent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--hw-white);
    border-bottom: 1px solid var(--hw-border);
    flex-wrap: wrap;
}
.hw-recent-row:last-child { border-bottom: none; }
.hw-recent-row:nth-child(even) { background: #FAFAFA; }
.hw-recent-badge {
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
    flex-shrink: 0;
}
.hw-recent-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hw-recent-grade,
.hw-recent-date {
    font-size: 12px;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}
.hw-recent-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.hw-recent-btn {
    font-size: 12px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--hw-border-mid);
    background: var(--hw-white);
    color: var(--hw-text-dark);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.hw-recent-btn:hover:not(:disabled) {
    background: var(--hw-brand-tint);
    border-color: var(--hw-brand-mid);
}
.hw-recent-btn:disabled {
    opacity: 0.6;
    cursor: default;
}
@media (max-width: 700px) {
    .hw-recent-grade { display: none; }
    .hw-recent-date  { display: none; }
    .hw-recent-row   { gap: 8px; }
}
