.resources-hero {
    padding: 8rem 2rem 2.75rem;
    text-align: center;
}

.resources-hero h1 {
    max-width: 800px;
    margin: 0.35rem auto 0.75rem;
    font-size: clamp(2.35rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, var(--text-primary) 35%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.resources-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.08rem;
}

.chapter-ref,
.eyebrow {
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tool-shell {
    width: min(1440px, calc(100% - 4rem));
    margin: 0 auto 5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    align-items: start;
}

.worksheet-panel,
.summary-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.worksheet-intro {
    padding: 2rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.worksheet-intro h2,
.summary-card h2 {
    margin: 0.15rem 0 0.35rem;
    font-size: 1.65rem;
}

.worksheet-intro p:not(.eyebrow) {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.save-state {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.save-state svg,
.form-actions svg,
.privacy-note svg {
    width: 17px;
    height: 17px;
}

.save-state.is-saving {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.form-section {
    margin: 0;
    padding: 2.25rem;
    border: 0;
    border-bottom: 1px solid var(--border-color);
}

.form-section legend {
    width: 100%;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.22rem;
    font-weight: 700;
}

.form-section legend span {
    display: inline-grid;
    width: 30px;
    height: 30px;
    margin-right: 0.65rem;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 9px;
    font: 800 0.82rem var(--font-sans);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.field-wide {
    grid-column: 1 / -1;
}

.field,
.field-pair {
    min-width: 0;
}

.field label,
.field-label,
.pair-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.83rem;
    font-weight: 700;
}

.field label strong {
    color: #dc2626;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 0.72rem 0.85rem;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: 0.92rem/1.45 var(--font-sans);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field textarea {
    min-height: auto;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #94a3b8;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: #dc2626;
}

.field-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.field-pair .pair-label {
    grid-column: 1 / -1;
    margin-bottom: -0.55rem;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    display: block;
    padding: 0.62rem 0.95rem;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
}

.segmented-control input:focus-visible + span {
    outline: 3px solid var(--primary-glow);
    outline-offset: 2px;
}

.segmented-control input:checked + span {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.5rem 2.25rem 2.25rem;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    border: 0;
    cursor: pointer;
    font: 700 0.84rem var(--font-sans);
}

.form-actions .btn-secondary {
    color: var(--text-primary);
    background: #fff;
    border: 1px solid #cbd5e1;
}

.form-actions .btn-secondary:hover {
    background: #f8fafc;
}

.summary-panel {
    position: sticky;
    top: 7rem;
}

.summary-card {
    padding: 1.6rem;
}

.completion-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

#completion-value {
    color: var(--primary);
    font: 800 1.25rem var(--font-heading);
}

.progress-track {
    height: 7px;
    margin: 1rem 0 0.65rem;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: inherit;
    transition: width var(--transition-normal);
}

.completion-copy {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.kpi-preview {
    margin: 1.35rem 0;
    padding: 1.2rem;
    background: linear-gradient(145deg, #0f172a, #172554);
    border-radius: 14px;
    color: #fff;
}

.preview-empty {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.preview-name {
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 1.2rem;
}

.preview-objective {
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 0.82rem;
}

.preview-target {
    margin-bottom: 1rem;
    color: #67e8f9;
    font: 800 2rem/1 var(--font-heading);
}

.preview-target small {
    display: block;
    margin-bottom: 0.35rem;
    color: #94a3b8;
    font: 700 0.68rem var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.preview-meta {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.preview-meta div {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 0.5rem;
    font-size: 0.76rem;
}

.preview-meta dt {
    color: #94a3b8;
}

.preview-meta dd {
    margin: 0;
    color: #f8fafc;
    overflow-wrap: anywhere;
}

.quality-check {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.quality-check h3 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.quality-check ul {
    display: grid;
    gap: 0.55rem;
    list-style: none;
}

.quality-check li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.quality-check li svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.quality-check li.is-complete {
    color: #047857;
    font-weight: 700;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 1.25rem;
    padding: 0.8rem;
    color: #475569;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.72rem;
}

.privacy-note svg {
    flex: 0 0 auto;
    color: #047857;
}

.bibliography-section {
    width: min(1200px, calc(100% - 4rem));
    margin: 0 auto 5rem;
    padding: 2rem;
    background: rgba(255,255,255,0.65);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.bibliography-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.bibliography-list {
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 200;
    padding: 0.8rem 1rem;
    color: #fff;
    background: #0f172a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.2);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    font-size: 0.83rem;
    font-weight: 700;
}

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

@media (max-width: 1080px) {
    .tool-shell {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 720px) {
    .resources-hero {
        padding: 7rem 1.25rem 2.25rem;
    }

    .tool-shell,
    .bibliography-section {
        width: min(100% - 1.5rem, 1440px);
    }

    .worksheet-intro {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.5rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .field-grid,
    .field-pair {
        grid-template-columns: 1fr;
    }

    .field-pair .pair-label,
    .field-wide {
        grid-column: auto;
    }

    .form-actions {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media print {
    header,
    footer,
    .resources-hero,
    .form-actions,
    .save-state,
    .privacy-note,
    .bibliography-section,
    .toast {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .tool-shell {
        width: 100%;
        display: block;
        margin: 0;
    }

    .worksheet-panel,
    .summary-card {
        border: 0;
        box-shadow: none;
    }

    .worksheet-intro {
        padding: 0 0 1rem;
    }

    .form-section {
        padding: 1rem 0;
        break-inside: avoid;
    }

    .summary-panel {
        position: static;
        margin-top: 1.5rem;
        break-inside: avoid;
    }

    .summary-card {
        padding: 0;
    }

    .quality-check,
    .completion-header,
    .progress-track,
    .completion-copy {
        display: none;
    }
}
