:root {
    /* Original repository colors. */
    --gradient-primary: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
    --gradient-card: linear-gradient(145deg, rgba(15, 118, 110, 0.07) 0%, rgba(37, 99, 235, 0.05) 100%);
    color-scheme:light;
    --bg:#f4f7fb;
    --paper:#fff;
    --ink:#18212f;
    --muted:#526072;
    --line:rgba(125, 138, 154, 0.24);
    --accent:#0f766e;
    --soft:rgba(15, 118, 110, 0.08);
    --warm:#eef3f8;
    --danger:#dc2626;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    font-size:14px;
    line-height:1.5;
    color:var(--ink);
    background:var(--bg)
}

* {
    box-sizing:border-box
}

body {
    margin:0;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.07), transparent 24%),
        var(--bg);
}

button,input,select,textarea {
    font:inherit
}

button,a,input,select,textarea {
    -webkit-tap-highlight-color:transparent
}

button {
    cursor:pointer
}

button:disabled {
    opacity:.4;
    cursor:default
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
    outline:3px solid #0f766e;
    outline-offset:3px
}

button,input,select,textarea {
    max-width:100%
}

[hidden] {
    display:none!important
}

h1,h2,h3,p {
    margin:0
}

h1 {
    font-size:28px;
    line-height:1.25;
    letter-spacing:-.8px;
    font-weight:650
}

h2 {
    font-size:17px;
    font-weight:650
}

h3 {
    font-size:15px
}

strong {
    font-weight:650
}

.muted {
    color:var(--muted)
}

.hint {
    font-size:12px;
    color:var(--muted);
    line-height:1.7;
    margin-top:16px
}

.actions {
    display:flex;
    gap:9px;
    align-items:center;
    flex-wrap:wrap
}

.button,.icon-button {
    border:1px solid var(--line);
    background:white;
    color:var(--ink);
    border-radius:8px;
    padding:9px 14px;
    white-space:normal;
    font-weight:550;
    line-height:1.35
}

.button:hover,.icon-button:hover {
    background:var(--soft);
    border-color:rgba(15, 118, 110, 0.34)
}

.button.primary {
    background:var(--gradient-primary);
    color:white;
    border-color:var(--accent)
}

.button.primary:hover {
    background:#115e59
}

.button.quiet {
    background:transparent
}

.button.small {
    font-size:12px;
    padding:8px 10px
}

.icon-button {
    min-width:36px;
    min-height:36px;
    padding:6px;
    font-size:18px
}

.danger {
    color:var(--danger)
}

.text-button {
    border:0;
    padding:2px 0;
    color:var(--accent);
    background:transparent;
    font-size:11px;
    text-decoration:underline;
    text-underline-offset:3px;
    white-space:nowrap
}

.skip-link {
    position:absolute;
    top:-100px;
    left:16px;
    z-index:50;
    background:white;
    padding:12px
}

.skip-link:focus {
    top:10px
}

.app-header {
    height:72px;
    max-width:1200px;
    margin:auto;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 32px
}

.brand {
    display:flex;
    align-items:center;
    gap:12px
}

.brand-symbol {
    display:grid;
    place-items:center;
    background:var(--gradient-primary);
    color:#ffffff;
    border-radius:12px;
    width:43px;
    height:46px;
    font:34px Georgia,serif;
    padding-bottom:4px
}

.brand strong {
    display:block;
    font-size:23px;
    line-height:1.1;
    letter-spacing:-.8px
}

.brand div>span {
    font-size:11px;
    color:var(--muted)
}

.header-meta {
    display:flex;
    align-items:center;
    gap:22px
}

.term-badge {
    background:rgba(15, 118, 110, 0.1);
    border:1px solid rgba(15, 118, 110, 0.18);
    padding:5px 10px;
    border-radius:6px;
    font-size:12px;
    font-weight:600
}

#saveStatus {
    font-size:11px;
    color:var(--muted)
}

#saveStatus::before {
    content:"";
    display:inline-block;
    width:6px;
    height:6px;
    border-radius:50%;
    background:#059669;
    margin-right:6px
}

.nav-bar {
    border-bottom:1px solid var(--line);
    background:#fbfdff;
    padding:10px max(32px,calc((100vw - 1136px)/2))
}

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

.nav-bar nav button {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    min-height:46px;
    padding:10px 12px;
    border:1px solid #b6c9d8;
    border-radius:10px;
    background:#edf3f8;
    color:#334a5c;
    font-size:14px;
    font-weight:650
}

.nav-bar nav button svg {
    width:20px;
    height:20px;
    flex-shrink:0;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round
}

.nav-bar nav button:hover {
    border-color:var(--accent);
    background:#e1eeed
}

.nav-bar nav button[aria-current] {
    border-color:var(--accent);
    background:var(--gradient-primary);
    color:white;
    box-shadow:0 3px 10px rgba(15,118,110,.2)
}

main {
    max-width:1200px;
    margin:auto;
    padding:24px 32px;
    min-height:calc(100vh - 230px)
}

.page-heading {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:18px
}

.page-heading .muted {
    margin-top:6px;
    font-size:13px;
    max-width:660px
}

.page-heading .actions {
    flex-shrink:0
}

.page-heading .actions .button {
    font-size:12px;
    min-height:42px
}

.card {
    background:var(--paper);
    border:1px solid var(--line);
    border-radius:12px;
    box-shadow:0 2px 3px rgba(15, 23, 42, 0.02)
}

.weight-cards {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin:16px 0
}

.weight-card {
    padding:16px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--gradient-card)
}

.weight-tags {
    padding-left:18px;
    margin:8px 0 0;
    font-size:12px;
    color:var(--muted)
}

.grade-help {
    margin-top:16px;
    font-size:12px;
    color:var(--muted)
}

.grade-help summary {
    padding:13px 18px;
    cursor:pointer;
    font-weight:600;
    color:var(--accent)
}

.grade-help-content {
    padding:0 18px 18px
}

.grade-help-content>p+p {
    margin-top:8px
}

.card-toolbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:18px 20px;
    border-bottom:1px solid var(--line)
}

.card-toolbar h2 {
    font-size:14px
}

.search-input {
    width:275px;
    font-size:12px
}

input,select,textarea {
    border:1px solid var(--line);
    border-radius:7px;
    background:#fff;
    color:var(--ink);
    padding:9px 11px;
    min-width:0;
    width:100%
}

select {
    padding-right:26px
}

input::placeholder,textarea::placeholder {
    color:#7d8a9a
}

input[aria-invalid="true"] {
    border:2px solid var(--danger);
    background:rgba(239, 68, 68, 0.08)
}

textarea {
    resize:vertical
}

.grade-table-header,.grade-row {
    display:grid;
    grid-template-columns:minmax(160px,1.1fr) minmax(195px,1fr) minmax(195px,1fr) 118px;
    gap:20px;
    padding:18px 20px
}

.grade-view-toolbar {
    padding:12px 20px;
    border-bottom:1px solid var(--line)
}

.grade-view {
    width:fit-content;
    max-width:100%
}

.grade-view button {
    min-height:40px
}

.single-performance .grade-table-header,.single-performance .grade-row {
    grid-template-columns:minmax(160px,1.1fr) minmax(195px,1fr) 118px
}

.grade-table-header {
    font-size:9px;
    letter-spacing:.9px;
    color:var(--muted);
    font-weight:700;
    padding-top:12px;
    padding-bottom:12px;
    background:#eef3f8;
    border-bottom:1px solid var(--line)
}

.grade-row {
    align-items:center;
    border-bottom:1px solid var(--line)
}

.grade-row:last-child {
    border-bottom:0
}

.grade-row:hover {
    background:#f7fafd
}

.student-identity {
    display:flex;
    gap:12px;
    align-items:center;
    min-width:0
}

.student-identity>div {
    min-width:0
}

.student-identity strong {
    display:block;
    font-size:13px;
    overflow-wrap:anywhere;
    line-height:1.35
}

.student-identity .muted {
    display:block;
    font-size:10px;
    margin-top:5px
}

.student-avatar {
    font-size:11px;
    color:#0f766e;
    background:rgba(15, 118, 110, 0.1);
    border-radius:8px;
    padding:8px;
    flex-shrink:0
}

.grade-entry {
    display:flex;
    gap:8px;
    align-items:center
}

.grade-input {
    width:68px;
    flex-shrink:0;
    height:40px;
    text-align:center;
    font-size:18px;
    font-weight:600;
    font-variant-numeric:tabular-nums;
    background:#ffffff;
    padding:6px
}

.grade-input.filled {
    background:rgba(15, 118, 110, 0.1);
    color:var(--accent);
    border-color:rgba(15, 118, 110, 0.34)
}

.grade-input::-webkit-inner-spin-button,.grade-input::-webkit-outer-spin-button {
    -webkit-appearance:none
}

.grade-input {
    appearance:textfield;
    -moz-appearance:textfield
}

.grade-entry>.button {
    background:#eef3f8;
    padding:8px;
    font-size:10px
}

.grade-detail {
    margin-top:5px;
    display:flex;
    gap:8px;
    align-items:baseline;
    flex-wrap:wrap
}

.grade-note {
    font-size:9px;
    color:var(--muted)
}

.grade-detail .text-button {
    font-size:9px
}

.print-student {
    font-size:11px;
    padding:8px 12px
}

.grade-actions {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:7px
}

.grade-actions .edit-student {
    border-color:rgba(15, 118, 110, 0.34);
    color:var(--accent);
    background:rgba(15, 118, 110, 0.08)
}

.mobile-label {
    display:none
}

.no-results {
    padding:30px;
    color:var(--muted)
}

.empty-state {
    padding:24px;
    border-color:#b9d5d4;
    background:linear-gradient(120deg,#fff,#f2f8fc)
}

.empty-state h2 {
    font-size:20px
}

.empty-state .actions {
    margin-top:16px
}

.empty-state .button {
    min-height:44px
}

.quick-steps {
    display:flex;
    flex-wrap:wrap;
    gap:12px 24px;
    list-style:none;
    padding:18px 0 0;
    margin:24px 0 0;
    border-top:1px solid var(--line)
}

.quick-steps li {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12px;
    color:var(--muted)
}

.step-number {
    display:grid;
    place-items:center;
    width:24px;
    height:24px;
    border-radius:50%;
    background:#e0eeed;
    color:var(--accent);
    font-weight:700
}

.quick-steps li:first-child {
    color:var(--accent);
    font-weight:650
}

.app-footer {
    max-width:1200px;
    margin:auto;
    padding:16px 32px 24px;
    font-size:10px;
    color:var(--muted);
    border-top:1px solid var(--line);
    display:flex;
    gap:20px;
    justify-content:space-between
}

.app-footer span {
    max-width:470px;
    text-align:right
}

.rubric-controls {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:28px;
    padding:20px;
    margin-bottom:22px;
    align-items:end
}

.field {
    display:flex;
    flex-direction:column;
    gap:6px;
    font-size:12px;
    min-width:0
}

.field>span {
    color:var(--muted);
    font-size:11px
}

.student-picker {
    display:flex;
    gap:12px;
    align-items:end
}

.student-picker>.field {
    flex:1;
    min-width:0
}

.student-picker>.actions {
    flex-wrap:nowrap
}

.student-picker select {
    height:41px
}

.rubric-picker {
    display:flex;
    flex-direction:column;
    gap:10px;
    min-width:0
}

.segmented {
    display:flex;
    gap:4px;
    background:#eef3f8;
    border-radius:7px;
    padding:3px;
    align-self:start
}

.segmented button {
    border:0;
    border-radius:5px;
    background:transparent;
    padding:7px 14px;
    color:var(--muted);
    font-size:12px
}

.segmented button.active {
    background:white;
    color:var(--accent);
    box-shadow:0 1px 3px rgba(15, 23, 42, 0.08);
    font-weight:600
}

.rubric-heading {
    padding:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px
}

.rubric-heading h2 {
    font-size:20px
}

.rubric-heading p {
    font-size:11px;
    margin-top:5px
}

.rubric-heading>.button {
    font-size:12px
}

.rubric-summary {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
    padding:14px 20px;
    background:var(--gradient-primary);
    color:white;
    position:sticky;
    top:0;
    z-index:2
}

.rubric-summary>div {
    min-width:0
}

.rubric-summary span {
    font-size:10px;
    color:#ffffff;
    display:block
}

.rubric-summary strong {
    display:block;
    font-size:22px;
    font-weight:550;
    line-height:1.3;
    margin-top:4px;
    font-variant-numeric:tabular-nums
}

.rubric-notice {
    padding:10px 20px;
    background:rgba(15, 118, 110, 0.08);
    color:#526072;
    font-size:11px;
    line-height:1.6
}

.rubric-notice .text-button {
    margin-left:8px
}

.rubric-legend {
    display:flex;
    flex-wrap:wrap;
    gap:10px 20px;
    font-size:10px;
    color:var(--muted);
    padding:12px 20px;
    border-bottom:1px solid var(--line)
}

.rubric-legend span:last-child {
    margin-left:auto
}

.criterion-row {
    display:grid;
    grid-template-columns:26px minmax(0,1fr) 130px;
    gap:14px;
    align-items:center;
    padding:13px 20px;
    border-bottom:1px solid var(--line)
}

.criterion-row:last-child {
    border:0
}

.criterion-number {
    font-size:10px;
    color:#7d8a9a
}

.criterion-group {
    display:block;
    color:#0f766e;
    font-size:10px;
    margin-bottom:3px
}

.criterion-description p {
    font-size:12px;
    line-height:1.55;
    overflow-wrap:anywhere
}

.degree-buttons {
    display:flex;
    justify-content:flex-end;
    gap:6px
}

.degree-button {
    height:36px;
    width:36px;
    flex-shrink:0;
    border:1px solid var(--line);
    border-radius:7px;
    color:#526072;
    background:white;
    font-size:13px;
    font-weight:600
}

.degree-button:hover {
    background:#f7fafd
}

.degree-button.selected {
    background:var(--accent);
    color:white;
    border-color:var(--accent)
}

.rubric-bottom {
    padding:16px 20px;
    display:flex;
    gap:16px;
    justify-content:space-between;
    align-items:center;
    border-top:1px solid var(--line)
}

.rubric-bottom .muted {
    font-size:11px
}

.roster-row {
    display:grid;
    grid-template-columns:70px 1fr auto;
    gap:18px;
    padding:15px 20px;
    align-items:center;
    border-bottom:1px solid var(--line)
}

.roster-row:last-child {
    border:0
}

.roster-row strong {
    overflow-wrap:anywhere
}

.roster-no {
    color:var(--muted);
    font-variant-numeric:tabular-nums
}

dialog {
    width:min(590px,calc(100% - 28px));
    max-height:90vh;
    overflow:auto;
    border:1px solid var(--line);
    border-radius:14px;
    padding:24px;
    box-shadow:0 16px 80px rgba(15, 23, 42, 0.12);
    color:var(--ink)
}

dialog::backdrop {
    background:rgba(31, 41, 55, 0.18);
    backdrop-filter:blur(2px)
}

.dialog-heading {
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:center;
    margin-bottom:22px
}

.dialog-heading h2 {
    font-size:19px
}

.dialog-actions {
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:24px
}

.form-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px
}

.form-grid input {
    font-size:13px
}

.class-info-card {
    max-width:840px;
    padding:24px
}

dialog p {
    font-size:13px;
    line-height:1.7
}

dialog .hint {
    margin:8px 0 16px
}

dialog hr {
    border:0;
    border-top:1px solid var(--line);
    margin:24px 0
}

#toast {
    position:fixed;
    bottom:24px;
    left:50%;
    transform:translateX(-50%);
    padding:13px 20px;
    background:#0f766e;
    color:white;
    border-radius:10px;
    box-shadow:0 4px 22px rgba(15, 23, 42, 0.12);
    font-size:13px;
    max-width:min(620px,calc(100% - 30px));
    width:max-content;
    z-index:100
}

.notice {
    max-width:1136px;
    margin:16px auto;
    padding:14px;
    border-radius:8px;
    font-size:13px
}

.warning {
    background:rgba(245, 158, 11, 0.1);
    color:#d97706;
    border:1px solid rgba(217, 119, 6, 0.3)
}

/* The original rubric degree colors: red, amber, green. */
.degree-button.selected[data-degree="1"] {
    background:rgba(239, 68, 68, 0.15);
    border-color:#dc2626;
    color:#dc2626;
}
.degree-button.selected[data-degree="2"] {
    background:rgba(245, 158, 11, 0.15);
    border-color:#d97706;
    color:#d97706;
}
.degree-button.selected[data-degree="3"] {
    background:rgba(16, 185, 129, 0.15);
    border-color:#059669;
    color:#059669;
}
.rubric-legend span:nth-child(1) { color:#dc2626; }
.rubric-legend span:nth-child(2) { color:#d97706; }
.rubric-legend span:nth-child(3) { color:#059669; }

.preview-open {
    background:#eef3f8
}

.print-toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    position:sticky;
    top:0;
    z-index:3;
    background:#fbfdff;
    border-bottom:1px solid var(--line);
    padding:14px max(20px,calc((100vw - 940px)/2));
    font-size:12px
}

.report-pages {
    padding:28px 12px
}

.report-page {
    background:white;
    color:#171d18;
    max-width:210mm;
    width:100%;
    min-height:297mm;
    padding:12mm;
    margin:0 auto 24px;
    box-shadow:0 3px 18px #29412116;
    font:9pt/1.3 Arial,sans-serif
}

.report-header {
    text-align:center;
    border-bottom:2px solid #26382a;
    padding-bottom:8px;
    margin-bottom:8px
}

.report-header p {
    margin:3px 0
}

.report-header h1 {
    font:700 13pt/1.35 Arial,sans-serif;
    letter-spacing:0;
    margin:8px 0 5px
}

.report-subtitle {
    text-align:center;
    font-size:11pt;
    margin-bottom:10px
}

.report-student {
    display:flex;
    justify-content:space-between;
    gap:14px;
    margin:10px 0;
    flex-wrap:wrap
}

.report-student span {
    overflow-wrap:anywhere;
    min-width:0
}

.report-legend {
    font-size:8pt;
    margin:8px 0
}

.report-table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin:10px 0
}

.report-table th {
    background:#edf1e9;
    font-size:8pt;
    font-weight:700;
    padding:7px 4px;
    border:1px solid #9aa897
}

.report-table td {
    border:1px solid #b4bfb1;
    padding:5px 4px;
    text-align:center;
    font-size:8.3pt;
    vertical-align:middle
}

.report-table .report-description {
    text-align:left;
    overflow-wrap:anywhere
}

.report-description b {
    font-size:7.7pt;
    color:#4d5e47;
    font-weight:400
}

.report-degree.marked {
    background:#edf1e9;
    font-size:12pt
}

.report-totals {
    display:flex;
    justify-content:space-between;
    gap:10px;
    margin:10px 0
}

.report-breakdown {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:4px 15px;
    padding:8px 0;
    border-top:1px solid #b4bfb1
}

.report-page>p {
    margin:7px 0;
    font-size:8pt
}

.report-result {
    padding:8px 0;
    border-top:1px solid #7e9278
}

.report-note {
    font-style:italic
}

.report-signatures {
    display:flex;
    justify-content:space-between;
    gap:20px;
    margin-top:18px;
    font-size:8pt;
    break-inside:avoid
}

.summary-page .report-table th {
    overflow-wrap:anywhere;
}

.summary-final {
    background:#eef3f8;
}

.summary-weighted {
    display:block;
    font-size:7pt;
    color:#526072;
    margin-top:2px;
}

@media(min-width:1400px) {
    .grade-table-header,.grade-row {
        grid-template-columns:minmax(230px,1.15fr) minmax(195px,1fr) minmax(195px,1fr) 118px
    }
}

@media(max-width:1000px) {
    .page-heading {
        align-items:flex-start;
        flex-direction:column;
        gap:12px
    }
    .grade-table-header,.grade-row {
        grid-template-columns:minmax(130px,1fr) minmax(170px,1fr) minmax(170px,1fr) 112px;
        gap:12px;
        padding-left:16px;
        padding-right:16px
    }
    .student-avatar {
        display:none
    }
    .grade-input {
        width:60px
    }
    .grade-entry {
        gap:6px
    }
    .grade-entry>.button {
        font-size:9px;
        padding:7px
    }
    .print-student {
        padding:7px 9px
    }
    .header-meta {
        gap:14px
    }
    .rubric-controls {
        gap:20px
    }
}

@media(max-width:760px) {
    .app-header {
        height:68px;
        padding:0 20px
    }
    .header-meta {
        flex-direction:column;
        align-items:flex-end;
        gap:6px
    }
    .header-meta #saveStatus {
        font-size:9px
    }
    .brand strong {
        font-size:21px
    }
    .brand div>span {
        font-size:9px
    }
    .brand-symbol {
        width:36px;
        height:40px;
        font-size:30px
    }
    .term-badge {
        font-size:10px;
        padding:4px 7px
    }
    .nav-bar {
        padding:10px 20px
    }
    .nav-bar nav {
        gap:8px
    }
    .nav-bar nav button {
        font-size:12px;
        gap:6px;
        padding:10px 8px
    }
    main {
        padding:20px
    }
    .weight-cards {
        gap:12px
    }
    .grade-table-header {
        display:none
    }
    .grade-row {
        grid-template-columns:1fr 1fr;
        padding:16px;
        gap:14px
    }
    .single-performance .grade-row {
        grid-template-columns:minmax(0,1fr) auto
    }
    .single-performance .grade-actions {
        grid-column:2
    }
    .grade-view-toolbar {
        padding:12px 16px
    }
    .grade-view button {
        padding:7px 10px
    }
    .student-identity {
        grid-column:1/-1;
        padding-bottom:4px
    }
    .student-avatar {
        display:block
    }
    .student-identity strong {
        font-size:14px
    }
    .grade-row .grade-cell {
        min-width:0
    }
    .grade-input {
        width:64px
    }
    .grade-entry>.button {
        font-size:10px;
        max-width:108px
    }
    .mobile-label {
        display:block;
        font-size:10px;
        color:var(--muted);
        margin-bottom:6px
    }
    .grade-actions {
        grid-column:1/-1;
        justify-self:end
    }
    .grade-note,.grade-detail .text-button {
        font-size:10px
    }
    .grade-card .card-toolbar {
        padding:14px 16px
    }
    .card-toolbar h2 {
        font-size:12px
    }
    .search-input {
        width:220px;
        font-size:10px
    }
    .rubric-controls {
        grid-template-columns:1fr;
        padding:16px;
        gap:20px
    }
    .rubric-heading {
        padding:16px
    }
    .rubric-heading h2 {
        font-size:18px
    }
    .criterion-row {
        padding:12px 16px;
        grid-template-columns:20px minmax(0,1fr) 118px;
        gap:10px
    }
    .degree-buttons {
        gap:4px
    }
    .rubric-legend {
        gap:7px 14px
    }
    .rubric-legend span:last-child {
        margin:0
    }
    .app-footer {
        padding:16px 20px;
        display:block
    }
    .app-footer span {
        display:block;
        text-align:left;
        margin-top:5px
    }
    .report-page {
        padding:7mm;
        min-height:0
    }
    .report-header h1 {
        font-size:12pt
    }
    .report-table td {
        font-size:8pt
    }
    .print-toolbar {
        padding:12px;
        flex-wrap:wrap
    }
    .print-toolbar>span {
        font-size:10px
    }
    .print-toolbar .button {
        font-size:11px
    }
    .notice {
        margin:14px 20px
    }
}

@media(max-width:600px) {
    .nav-bar nav {
        grid-template-columns:repeat(2,minmax(0,1fr))
    }
    .nav-bar nav button {
        justify-content:flex-start;
        min-height:44px;
        padding:10px 12px;
        gap:8px
    }
}

@media(max-width:470px) {
    h1 {
        font-size:25px
    }
    .nav-bar {
        padding:8px 16px
    }
    .nav-bar nav button {
        font-size:12px;
        padding:10px 8px
    }
    main {
        padding:18px 16px
    }
    .weight-cards {
        grid-template-columns:1fr
    }
    .weight-card {
        padding:14px 16px
    }
    .page-heading {
        margin-bottom:16px
    }
    .page-heading .actions {
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr
    }
    .page-heading .actions .button:last-child:nth-child(odd) {
        grid-column:1/-1
    }
    .empty-state {
        padding:18px
    }
    .empty-state .actions {
        display:grid;
        grid-template-columns:1fr
    }
    .quick-steps {
        flex-direction:column;
        gap:10px;
        margin-top:18px;
        padding-top:16px
    }
    .card-toolbar {
        flex-direction:column;
        align-items:stretch;
        gap:10px
    }
    .search-input {
        width:100%
    }
    .grade-row {
        gap:14px 12px
    }
    .grade-input {
        width:58px;
        font-size:17px
    }
    .grade-entry {
        gap:5px
    }
    .grade-entry>.button {
        font-size:9px;
        padding:6px;
        min-height:38px
    }
    .grade-detail {
        gap:3px
    }
    .rubric-heading {
        align-items:flex-start;
        flex-direction:column
    }
    .rubric-summary {
        padding:12px 14px;
        gap:10px
    }
    .rubric-summary span {
        font-size:8px
    }
    .rubric-summary strong {
        font-size:18px
    }
    .rubric-notice {
        padding:10px 14px;
        font-size:10px
    }
    .criterion-row {
        grid-template-columns:16px minmax(0,1fr);
        gap:9px;
        padding:13px 14px
    }
    .criterion-description p {
        font-size:12px
    }
    .degree-buttons {
        grid-column:2;
        justify-content:flex-start;
        gap:8px
    }
    .degree-button {
        height:36px;
        width:42px
    }
    .criterion-number {
        align-self:start;
        padding-top:4px
    }
    .rubric-bottom {
        align-items:flex-start;
        flex-direction:column
    }
    .roster-row {
        grid-template-columns:45px 1fr;
        gap:12px;
        padding:14px
    }
    .roster-row .actions {
        grid-column:2
    }
    .form-grid {
        grid-template-columns:1fr
    }
    dialog {
        padding:20px
    }
    .print-toolbar>span {
        order:3;
        width:100%;
        text-align:center
    }
    .report-pages {
        padding:16px 6px
    }
    .report-page {
        padding:5mm
    }
    .report-header h1 {
        font-size:10pt
    }
    .report-table th {
        padding:4px 1px;
        font-size:7pt
    }
    .report-table td {
        padding:4px 2px;
        font-size:7pt
    }
    .report-description b {
        font-size:6.8pt
    }
    .report-student {
        gap:8px
    }
    .report-totals {
        flex-wrap:wrap
    }
    .report-breakdown {
        grid-template-columns:1fr
    }
}

@page {
    size:A4 portrait;
    margin:12mm
}

@media print {
    html,body {
        background:white!important;
        color:black!important
    }
    body>* {
        display:none!important
    }
    body>#printPreview {
        display:block!important
    }
    #printPreview[hidden] {
        display:none!important
    }
    .print-toolbar {
        display:none!important
    }
    .report-pages {
        padding:0
    }
    .report-page {
        width:auto;
        max-width:none;
        min-height:0;
        margin:0;
        padding:0;
        box-shadow:none;
        font-size:9pt;
        break-after:page
    }
    .report-page:last-child {
        break-after:auto
    }
    .report-header h1 {
        font-size:13pt
    }
    .report-table th {
        font-size:8pt;
        padding:6px 4px
    }
    .report-table td {
        font-size:8.3pt;
        padding:5px 4px
    }
    .report-description b {
        font-size:7.7pt
    }
    .report-table thead {
        display:table-header-group
    }
    .report-table tr {
        break-inside:avoid;
        page-break-inside:avoid
    }
    .report-header,.report-totals,.report-breakdown,.report-result {
        break-inside:avoid
    }
    .report-student {
        flex-wrap:wrap;
        gap:14px
    }
    .report-breakdown {
        grid-template-columns:1fr 1fr
    }
    .report-signatures {
        margin-top:16px
    }
    .report-table th,.report-degree.marked {
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact
    }
}

/* Keep the 18-criterion speaking scale on one A4 without shrinking text. */
.report-long .report-table td {
    padding: 3px 4px;
}

.grade-input.filled::placeholder {
    color: var(--accent);
    opacity: 1;
}
