:root {
    color-scheme: light;
    --ink: #182026;
    --muted: #65717c;
    --line: #d9e0e5;
    --paper: #ffffff;
    --wash: #f4f7f8;
    --blue: #1e5b8a;
    --green: #1f7a5a;
    --red: #a73535;
    --gold: #a56a16;
    --shadow: 0 18px 55px rgba(24, 32, 38, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--wash);
    color: var(--ink);
}

a {
    color: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 800;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}

.topbar nav a {
    text-decoration: none;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 34px auto 72px;
}

.shell.narrow {
    width: min(820px, calc(100% - 32px));
}

.intro-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 28px;
    align-items: end;
    padding: clamp(24px, 5vw, 46px) 0 24px;
}

.eyebrow {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    margin: 0 0 10px;
}

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

h1 {
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.02;
    margin-bottom: 18px;
}

h2 {
    font-size: 21px;
}

.intro-band p:not(.eyebrow),
.summary {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
    max-width: 760px;
}

.status-panel,
.upload-panel,
.criteria-preview,
.result-panel,
.criterion-card,
.admin-panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.status-panel {
    padding: 18px;
}

.status-panel span,
.score-block span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-panel strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.upload-layout {
    display: block;
}

.upload-layout .upload-panel {
    width: 100%;
}

.upload-panel button {
    width: 100%;
}

.upload-panel,
.criteria-preview,
.admin-panel,
.result-panel,
.criterion-card {
    padding: 24px;
}

.file-picker,
.stack-form label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

textarea {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
}

button,
.button-secondary {
    appearance: none;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: white;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button-secondary {
    background: #eef3f6;
    color: var(--ink);
    border: 1px solid var(--line);
}

.upload-panel button {
    margin-top: 18px;
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.form-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    margin: 12px 0 0;
}

.hidden-field {
    position: absolute;
    left: -9999px;
}

.processing-panel {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    border: 1px solid rgba(30, 91, 138, 0.24);
    border-radius: 8px;
    padding: 16px;
    background: #f7fbfd;
}

.processing-panel[hidden] {
    display: none;
}

.processing-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.processing-head strong {
    display: block;
    margin-bottom: 3px;
}

.processing-head p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #c9dbe8;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.progress-track {
    height: 16px;
    overflow: hidden;
    border: 1px solid #bfd3df;
    border-radius: 999px;
    background: #dbe8ef;
}

.progress-bar {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
    transition: width 0.55s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.progress-meta strong {
    color: var(--blue);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.criteria-preview ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.criteria-preview li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.criteria-preview li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.criteria-preview span {
    color: var(--gold);
    font-weight: 800;
}

.notice {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.notice.error {
    border-color: rgba(167, 53, 53, 0.35);
    color: var(--red);
}

.notice.success {
    border-color: rgba(31, 122, 90, 0.35);
    color: var(--green);
}

.result-panel {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-top: 26px;
}

.score-block {
    border-right: 1px solid var(--line);
    padding-right: 24px;
}

.score-block strong {
    display: block;
    font-size: 36px;
    margin: 8px 0 4px;
}

.score-block em {
    color: var(--green);
    font-style: normal;
    font-weight: 900;
}

.criteria-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.criterion-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.criterion-head h3 {
    font-size: 20px;
    margin-bottom: 0;
}

.criterion-head strong {
    color: var(--blue);
    white-space: nowrap;
}

.criterion-card p {
    color: var(--muted);
    line-height: 1.55;
}

.feedback-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.feedback-grid h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.feedback-grid ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.55;
}

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

.admin-panel + .admin-panel {
    margin-top: 18px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.attachment-list {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafb;
}

.attachment-list h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.attachment-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-weight: 600;
}

.attachment-row input {
    width: auto;
}

.attachment-row em {
    color: var(--red);
    font-size: 13px;
    font-style: normal;
}

.metric-pill {
    display: grid;
    gap: 2px;
    min-width: 130px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fafb;
}

.metric-pill span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-pill strong {
    font-size: 28px;
}

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

.submission-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.submission-table th,
.submission-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.submission-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.footer {
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding: 24px clamp(18px, 4vw, 56px);
    font-size: 13px;
}

@media (max-width: 820px) {
    .intro-band,
    .upload-layout,
    .result-panel,
    .feedback-grid {
        grid-template-columns: 1fr;
    }

    .score-block {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 18px;
    }
}

@media (max-width: 560px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    h1 {
        font-size: 36px;
    }

    .criterion-head,
    .admin-heading {
        flex-direction: column;
    }
}
