:root {
    color-scheme: light;
    --ink: #1f2933;
    --muted: #5b6775;
    --line: #d8dee6;
    --paper: #ffffff;
    --wash: #f5f7fa;
    --accent: #1f7a6d;
    --accent-dark: #155f55;
    --warning: #9f1239;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--wash);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--accent-dark);
}

.shell {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.upload-panel,
.history,
.detail {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.upload-panel {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 380px);
    gap: 32px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.12;
}

h1 {
    font-size: 34px;
}

h2 {
    font-size: 22px;
}

.lede,
.empty {
    color: var(--muted);
    line-height: 1.55;
}

.upload-form {
    display: grid;
    gap: 14px;
}

input[type="file"] {
    width: 100%;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fbfcfd;
}

input[type="password"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fbfcfd;
    font: inherit;
}

button,
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.actions a:hover {
    background: var(--accent-dark);
}

.actions .danger-link,
.danger-button {
    background: var(--warning);
}

.actions .danger-link:hover,
.danger-button:hover {
    background: #7f102e;
}

.messages {
    margin-bottom: 16px;
}

.message {
    margin: 0;
    border: 1px solid #b7dfd7;
    border-radius: 8px;
    padding: 12px 14px;
    background: #eaf8f5;
    color: #155f55;
}

.errors {
    color: var(--warning);
    font-size: 14px;
}

.history {
    margin-top: 24px;
}

.document-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.document-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--ink);
    text-decoration: none;
}

.document-row:hover {
    border-color: var(--accent);
}

.document-row time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 14px;
}

.status {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--muted);
    font-size: 13px;
}

.top-link {
    margin-bottom: 18px;
}

.detail header {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.grade-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.grade-summary div {
    min-width: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fbfcfd;
}

.label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.summary {
    margin: 0 0 20px;
    color: var(--ink);
    line-height: 1.6;
}

.progress-card {
    display: grid;
    gap: 16px;
    margin-top: 10px;
}

.progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.progress-copy strong {
    color: var(--ink);
}

.progress-track {
    height: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #e9edf2;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 220ms ease;
}

.feedback-list {
    display: grid;
    gap: 14px;
}

.question-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.question-details {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.question-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--accent-dark);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.question-details summary::-webkit-details-marker {
    display: none;
}

.chevron {
    transition: transform 160ms ease;
}

.question-details[open] .chevron {
    transform: rotate(180deg);
}

.question-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.question-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.question-heading strong {
    color: var(--accent-dark);
}

.question-item p {
    margin: 10px 0 0;
    line-height: 1.55;
}

.feedback-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fbfcfd;
}

.feedback-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.grade-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.grade-badges span {
    border: 1px solid #b7dfd7;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eaf8f5;
    color: var(--accent-dark);
    font-weight: 700;
    white-space: nowrap;
}

.feedback-item p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.improvement {
    color: var(--ink);
}

.grade-error {
    margin-top: 18px;
    color: var(--warning);
}

.error-output {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfd;
    color: var(--warning);
    white-space: pre-wrap;
}

.delete-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 24px, 960px);
        padding: 24px 0;
    }

    .upload-panel {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    h1 {
        font-size: 28px;
    }

    .document-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .feedback-heading {
        display: grid;
    }

    .progress-copy {
        display: grid;
    }
}
