:root {
  --ink: #17211b; --muted: #627069; --paper: #f6f7f2; --surface: #fff;
  --line: #dce2dc; --green: #176b4d; --green-dark: #0e4a34;
  --green-soft: #dff3e8; --blue-soft: #e0eef8; --red-soft: #fae3df;
  --gray-soft: #eef0ed; --amber-soft: #fff3cf; --amber: #8a5d00;
  --shadow: 0 10px 30px rgba(24, 52, 39, .07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--green); }
.site-header { min-height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: #123d2d; color: white; }
.site-header a { color: white; text-decoration: none; }
.brand { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
nav { display: flex; align-items: center; gap: 20px; font-size: .92rem; }
nav span { color: #b9d2c7; }
.container { max-width: 1180px; margin: 0 auto; padding: 56px 24px 80px; }
h1, h2, h3 { margin-top: 0; line-height: 1.15; }
h1 { margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; letter-spacing: -.035em; }
h2 { margin-bottom: 8px; font-size: 1.3rem; }
h3 { margin-bottom: 6px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { margin: 0; color: var(--muted); }
.page-heading { margin-bottom: 36px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.card { margin-bottom: 24px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.auth-card { max-width: 440px; margin: 8vh auto; padding: 40px; }
.auth-card h1 { font-size: 2.4rem; }
.auth-card form { margin-top: 28px; }
.form-card { max-width: 760px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.student-layout { grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); }
.section-heading { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button, button { display: inline-flex; min-height: 42px; padding: 10px 17px; align-items: center; justify-content: center; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--green-dark); }
.button.secondary, button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.small, button.small { min-height: 34px; padding: 6px 11px; font-size: .85rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
.text-link { font-weight: 700; text-decoration: none; }
form { display: grid; gap: 18px; }
.form-stack { display: grid; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 700; }
input, textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #bbc6bf; border-radius: 7px; background: white; color: var(--ink); font: inherit; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(23, 107, 77, .14); border-color: var(--green); }
textarea { resize: vertical; }
.optional { color: var(--muted); font-weight: 400; }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 8px; font-size: .9rem; font-weight: 700; }
.check-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.check-row { padding: 11px 13px; display: flex; gap: 10px; border-bottom: 1px solid var(--line); font-weight: 400; word-break: break-word; }
.check-row:last-child { border-bottom: 0; }
.check-row input { width: auto; }
.standalone-check { border: 0; padding: 0; align-items: center; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.classroom-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
.classroom-card p { color: var(--muted); }
.list { border-top: 1px solid var(--line); }
.list-row { padding: 14px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.list-row small { display: block; margin-top: 4px; color: var(--muted); }
.assignment-list { border-top: 1px solid var(--line); }
.assignment-row { padding: 16px 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); }
.assignment-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: .8rem; font-weight: 800; }
.assignment-row small { display: block; margin-top: 5px; color: var(--muted); }
.assignment-row .warning-text { color: #8a5d00; }
.copy-status { min-height: 24px; margin: -12px 0 6px; color: var(--green); font-size: .85rem; font-weight: 700; }
.truncate { min-width: 0; overflow-wrap: anywhere; }
.empty-state { padding: 28px; border: 1px dashed #bac4bd; border-radius: 9px; color: var(--muted); text-align: center; }
.flash { margin: -24px 0 28px; padding: 12px 16px; border-radius: 8px; }
.flash.success { background: var(--green-soft); color: var(--green-dark); }
.flash.error { background: var(--red-soft); color: #7a2d25; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { max-width: 100%; padding: 12px; overflow: auto; border-radius: 7px; background: #f3f5f2; white-space: pre-wrap; word-break: break-word; }
.legend { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: .85rem; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.pending { background: var(--blue-soft); }
.correct { background: var(--green-soft); }
.incorrect { background: var(--red-soft); }
.missing { background: var(--gray-soft); }
.blocked { background: var(--amber-soft); }
.deadline { flex: none; padding: 6px 9px; border-radius: 6px; background: #fff3cf; color: #705700; font-size: .8rem; }
.assignment-kicker { margin-bottom: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.assignment-kicker .eyebrow { margin: 0; }
.assignment-kicker .deadline { padding: 7px 11px; font-size: 1rem; line-height: 1.2; }
.deadline-upcoming { border: 1px solid #e7c85c; }
.deadline-urgent { border: 2px solid #c13f32; background: var(--red-soft); color: #7a2d25; font-weight: 900; }
.deadline-overdue { background: var(--gray-soft); color: var(--muted); text-decoration: none; }
.deadline-none { background: var(--gray-soft); color: var(--muted); }
.student-assignment { border-left: 5px solid var(--green); }
.student-assignment.assignment-closed { border-left-color: #9aa49e; opacity: .86; }
.question-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.question-status { padding: 12px 14px; display: grid; gap: 2px; border: 1px solid rgba(23, 33, 27, .08); border-radius: 9px; }
.question-status span { font-size: .85rem; }
.score-cell { min-width: 76px; padding: 0; text-align: center; }
.score-cell > span { display: block; padding: 14px; }
.score-cell details { position: relative; }
.score-cell summary { padding: 14px; cursor: pointer; font-weight: 800; list-style: none; }
.score-cell summary::-webkit-details-marker { display: none; }
.submission-detail { position: absolute; z-index: 2; top: calc(100% + 6px); left: 0; width: min(420px, 80vw); padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 18px 50px rgba(0,0,0,.18); text-align: left; }
.submission-detail h4 { margin: 12px 0 4px; }
.submission-detail form { margin-top: 14px; }
.inline-form { margin-bottom: 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.submission-list { display: grid; gap: 12px; }
.submission-item { padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.submission-meta { display: flex; justify-content: space-between; gap: 12px; }
.status { padding: 4px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.grader-output { color: var(--muted); }
@media (max-width: 760px) {
  .container { padding: 34px 16px 60px; }
  .site-header { padding: 0 16px; }
  nav span { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .two-column { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .submission-detail { left: auto; right: 0; }
}
