:root {
    --hci-navy: #1e3a5f;
    --hci-blue: #4a7bc8;
    --hci-blue-pale: #e8f0fe;
    --hci-gold: #b5925a;
    --hci-gold-pale: #fff8e6;
    --hci-green: #2a7d4f;
    --hci-green-pale: #f0f9f2;
    --hci-ink: #1a1a2e;
    --hci-muted: #5a6a7a;
    --hci-border: #c8d6ea;
}

body.hci-worksheet {
    background: #f4f6fa;
    color: var(--hci-ink);
    font-family: Inter, system-ui, sans-serif;
    margin: 0;
    padding: 5.5rem 1rem 2rem;
}

body.hci-worksheet #site-footer-container {
    overflow: hidden;
}

.worksheet-shell {
    margin-inline: auto;
    max-width: 980px;
}

.worksheet-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.worksheet-header h1 {
    color: var(--hci-navy);
    font-family: Lora, Georgia, serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.25;
    margin: 0;
}

.worksheet-header p {
    color: var(--hci-muted);
    font-size: 0.88rem;
    margin: 0.35rem 0 0;
}

.print-btn {
    background: var(--hci-navy);
    border: 0;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 650;
    padding: 0.65rem 1.1rem;
}

.student-meta {
    background: white;
    border: 1px solid var(--hci-border);
    border-radius: 10px;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
}

.meta-field {
    color: var(--hci-muted);
    font-size: 0.76rem;
    font-weight: 650;
}

.meta-line {
    border-bottom: 1px solid #7c8998;
    height: 1.5rem;
}

.teacher-note,
.student-note {
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.58;
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem;
}

.teacher-note {
    background: var(--hci-blue-pale);
    border: 1.5px solid #c0d0ea;
    color: var(--hci-navy);
}

.student-note {
    background: var(--hci-gold-pale);
    border: 1.5px solid #e8c97a;
    color: #6c531e;
}

.worksheet-card {
    background: white;
    border: 1.5px solid var(--hci-border);
    border-radius: 10px;
    margin: 0 0 1rem;
    padding: 1.15rem 1.25rem;
}

.worksheet-card h2 {
    color: var(--hci-navy);
    font-family: Lora, Georgia, serif;
    font-size: 1.15rem;
    margin: 0 0 0.6rem;
}

.worksheet-card h3 {
    color: var(--hci-navy);
    font-size: 0.94rem;
    margin: 0.7rem 0 0.35rem;
}

.worksheet-card p,
.worksheet-card li {
    font-size: 0.88rem;
    line-height: 1.58;
}

.worksheet-card p {
    margin: 0.35rem 0 0.7rem;
}

.feature-chain {
    counter-reset: chain;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    list-style: none;
    margin-top: 0.8rem;
    padding: 0;
}

.feature-chain--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.feature-chain > * {
    background: var(--hci-blue-pale);
    border: 1px solid #c0d0ea;
    border-radius: 8px;
    counter-increment: chain;
    font-size: 0.8rem;
    line-height: 1.45;
    min-height: 5.4rem;
    padding: 0.75rem;
}

.feature-chain > *::before {
    background: var(--hci-navy);
    border-radius: 999px;
    color: white;
    content: counter(chain);
    display: inline-grid;
    font-size: 0.68rem;
    height: 1.3rem;
    margin-right: 0.3rem;
    place-items: center;
    width: 1.3rem;
}

.worksheet-table-wrap {
    overflow-x: auto;
}

.worksheet-table {
    border-collapse: collapse;
    font-size: 0.79rem;
    width: 100%;
}

.worksheet-table th {
    background: var(--hci-navy);
    color: white;
    font-size: 0.73rem;
    line-height: 1.3;
    padding: 0.55rem;
    text-align: left;
}

.worksheet-table td {
    border: 1px solid #d9e2ef;
    line-height: 1.45;
    min-width: 7rem;
    padding: 0.55rem;
    vertical-align: top;
}

.worksheet-table td:first-child {
    min-width: 9rem;
}

.response-table tbody td {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 1.55rem,
        #d9e2ef 1.55rem,
        #d9e2ef calc(1.55rem + 1px)
    );
    height: 6rem;
}

.response-table--deep tbody td {
    height: 7.5rem;
}

.writing-lines {
    margin-top: 0.35rem;
}

.writing-line {
    border-bottom: 1px solid #9aa8bc;
    height: 1.65rem;
}

.writing-box {
    border: 1.5px dashed #9aa8bc;
    border-radius: 7px;
    min-height: 7rem;
    padding: 0.6rem;
}

.writing-box--exam {
    min-height: 16rem;
}

.writing-box--comparison {
    min-height: 13rem;
}

.scenario-grid,
.check-grid,
.mock-interface-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scenario,
.check-item,
.mock-panel {
    border: 1px solid var(--hci-border);
    border-radius: 8px;
    padding: 0.85rem;
}

.scenario strong,
.check-item strong,
.mock-panel strong {
    color: var(--hci-navy);
    display: block;
    font-size: 0.84rem;
    margin-bottom: 0.3rem;
}

.scenario p,
.check-item p,
.mock-panel p {
    color: var(--hci-muted);
    font-size: 0.8rem;
    line-height: 1.48;
    margin: 0;
}

.judgement-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.judgement-scale span {
    background: #f8faff;
    border: 1px solid var(--hci-border);
    border-radius: 999px;
    color: var(--hci-muted);
    font-size: 0.69rem;
    font-weight: 700;
    padding: 0.24rem 0.52rem;
    text-transform: uppercase;
}

.model-frame {
    background: #f8faff;
    border: 2px solid var(--hci-navy);
    border-radius: 12px;
    margin: 0.8rem 0;
    overflow: hidden;
}

.model-frame-header {
    align-items: center;
    background: var(--hci-navy);
    color: white;
    display: flex;
    font-size: 0.82rem;
    font-weight: 650;
    justify-content: space-between;
    padding: 0.65rem 0.8rem;
}

.model-frame-body {
    padding: 0.9rem;
}

.mock-button {
    background: var(--hci-blue);
    border-radius: 5px;
    color: white;
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 650;
    margin: 0.3rem 0.3rem 0 0;
    padding: 0.4rem 0.65rem;
}

.mock-button.muted {
    background: #99a4b2;
}

.mock-alert {
    background: #fff0f0;
    border-left: 4px solid #bb3d3d;
    color: #7a2020;
    font-size: 0.76rem;
    margin-top: 0.65rem;
    padding: 0.55rem 0.7rem;
}

.timer-box {
    background: var(--hci-gold-pale);
    border: 1.5px solid #e8c97a;
    border-radius: 8px;
    color: #6c531e;
    font-size: 0.84rem;
    font-weight: 650;
    margin: 0.7rem 0;
    padding: 0.65rem 0.8rem;
}

.page-break {
    break-before: page;
}

@media (max-width: 720px) {
    body.hci-worksheet {
        padding: 2rem 0.75rem;
    }

    .student-meta,
    .feature-chain,
    .scenario-grid,
    .check-grid,
    .mock-interface-grid {
        grid-template-columns: 1fr;
    }

    .worksheet-table {
        min-width: 760px;
    }
}

@media print {
    @page {
        margin: 1.05cm;
        size: A4 portrait;
    }

    body.hci-worksheet {
        background: white;
        font-size: 10pt;
        padding: 0;
    }

    .no-print,
    .teacher-note {
        display: none !important;
    }

    #site-header-container,
    #site-footer-container {
        display: none !important;
    }

    .worksheet-shell {
        max-width: none;
    }

    .worksheet-header {
        border-bottom: 2px solid var(--hci-navy);
        margin-bottom: 0.35cm;
        padding-bottom: 0.25cm;
    }

    .worksheet-header h1 {
        font-size: 16pt;
    }

    .student-meta,
    .worksheet-card {
        break-inside: avoid;
        box-shadow: none;
    }

    .worksheet-card {
        margin-bottom: 0.35cm;
        padding: 0.4cm;
    }

    .worksheet-card h2 {
        break-after: avoid;
        font-size: 12pt;
    }

    .worksheet-card p,
    .worksheet-card li {
        font-size: 9pt;
        line-height: 1.4;
    }

    .worksheet-table {
        font-size: 7.5pt;
        min-width: 0;
    }

    .worksheet-table th,
    .worksheet-table td {
        padding: 0.3cm;
    }

    .response-table tbody td {
        height: 3.2cm;
    }

    .response-table--deep tbody td {
        height: 4cm;
    }

    .writing-box--exam {
        min-height: 10cm;
    }

    .writing-box--comparison {
        min-height: 6cm;
    }

    .improvement-block {
        break-before: page;
        page-break-before: always;
    }

    .worksheet-table tr,
    .scenario,
    .check-item,
    .mock-panel,
    .model-frame {
        break-inside: avoid;
    }
}
