:root {
  --ink: #17211d;
  --muted: #64706a;
  --paper: #f5f1e7;
  --surface: #fffdf8;
  --line: #d8d2c5;
  --green: #175c46;
  --green-soft: #dcebe3;
  --orange: #df6c3b;
  --yellow: #f2c14e;
  --red: #a83a32;
  --shadow: 0 18px 50px rgb(37 49 43 / 9%);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, select { font: inherit; }
button, select, input[type="file"] { cursor: pointer; }
.hidden { display: none !important; }
.topbar { min-height: 72px; padding: 0 4vw; display: flex; align-items: center; gap: 32px; color: #f9f6ee; background: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand small { display: block; color: #aab8b1; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #718078; border-radius: 50% 50% 46% 54%; color: var(--yellow); font-family: Georgia, serif; }
.topbar nav { display: flex; gap: 24px; margin-left: auto; }
.topbar nav a { color: #bdc7c2; text-decoration: none; font-size: 14px; }
.topbar nav a { flex-shrink: 0; white-space: nowrap; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; }
.header-action { padding: 6px 0; border: 0; color: #bdc7c2; background: transparent; font-size: 13px; }
.header-action:hover { color: white; }
.safe-pill { padding: 7px 11px; border: 1px solid #3d7561; border-radius: 999px; color: #c8e8da; font-size: 12px; }
.layout { width: min(1480px, 94vw); margin: 36px auto 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.account-card { width: 100%; max-width: 640px; margin-inline: auto; padding: 25px; border: 1px solid var(--line); border-radius: 4px 28px 4px 4px; background: #ebe5d7; }
.header-teacher-name { font-size: 14px; font-weight: 600; max-width: 260px; overflow-wrap: anywhere; }
.account-card h2 { margin: 5px 0 24px; font-family: Georgia, serif; font-size: 25px; }
.account-card h3 { margin: 27px 0 11px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.credit-block { padding: 18px; color: white; background: var(--green); border-radius: 3px 18px 3px 3px; }
.credit-block span, .credit-block small { display: block; color: #cfe1d9; font-size: 12px; }
.credit-block strong { display: block; margin: 5px 0; font-family: Georgia, serif; font-size: 24px; }
.workspace { min-width: 0; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.hero h1 { max-width: 820px; margin: 4px 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(34px, 4.5vw, 62px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.eyebrow { margin: 0; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.timing { display: flex; gap: 20px; white-space: nowrap; }
.timing span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.timing strong { display: block; margin-top: 3px; color: var(--ink); font-family: Georgia, serif; font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 0; margin: 0 0 18px; list-style: none; overflow: hidden; border: 1px solid var(--line); border-radius: 3px; }
.steps li { padding: 13px 18px; color: var(--muted); background: #ece7da; font-size: 13px; }
.steps li span { display: inline-grid; width: 24px; height: 24px; margin-right: 8px; place-items: center; border: 1px solid #a9aaa1; border-radius: 50%; }
.steps li.active { color: white; background: var(--green); }
.steps li.complete { color: var(--green); background: var(--green-soft); }
.panel { margin-bottom: 20px; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 4px 24px 4px 4px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.panel h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.support-copy { color: var(--muted); font-size: 13px; }
.segmented { width: fit-content; display: flex; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 10px 22px; background: #f2eee4; }
.segmented input:checked + span { color: white; background: var(--green); }
.segmented:has(input[value="uniform"]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; text-align: center; }
.segmented:has(input[value="uniform"]) label:last-child { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; }
.field-help { color: var(--muted); font-size: 14px; line-height: 1.4; margin: 10px 0; }
.field select, .review-table input, .review-table select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #bcb9b0; border-radius: 3px; color: var(--ink); background: white; }
.field input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #bcb9b0; border-radius: 3px; background: white; }
.dropzone { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 28px; border: 1px dashed #8e9e95; border-radius: 4px 28px 4px 4px; background: #f7f8f2; text-align: center; }
.dropzone input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.dropzone small { color: var(--muted); }
.drop-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--orange); font-size: 26px; }
.primary, .secondary { min-height: 43px; margin-top: 20px; padding: 0 20px; border-radius: 3px; font-weight: 750; }
.primary { border: 1px solid var(--green); color: white; background: var(--green); }
.primary:hover { background: #0e4635; }
.secondary { border: 1px solid var(--green); color: var(--green); background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
.destination-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.detected-note { display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; margin-top: 20px; padding: 14px; border-left: 3px solid var(--yellow); background: #faf3dc; font-size: 13px; }
.detected-note small { grid-column: 1 / -1; color: var(--muted); }
.source-badge, .status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.source-badge { color: #744012; background: #fae3bd; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 14px; }
.summary-strip span { padding: 8px 11px; border: 1px solid var(--line); background: #f6f2e9; font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.review-table th { position: sticky; top: 0; padding: 11px; color: #e3ece7; background: #274039; text-align: left; white-space: nowrap; }
.review-table td { padding: 10px 11px; border-bottom: 1px solid #e3ded3; vertical-align: middle; }
.review-table tr.pending-row { background: #fff6df; }
.review-table tr.replacement-row { background: #fff0eb; }
.status.unchanged { color: #476058; background: #e5ebe8; }
.status.new { color: #19553f; background: #d9efe4; }
.status.replacement { color: #8a382d; background: #f9d9d1; }
.status.pending { color: #7b5410; background: #f7e5aa; }
.status.excluded { color: #555; background: #e5e2dc; }
.record-number { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-ref { color: var(--muted); font-size: 11px; white-space: nowrap; }
.actions { display: flex; justify-content: flex-end; gap: 12px; }
.notice { margin-bottom: 16px; padding: 13px 16px; border-left: 4px solid var(--orange); background: #fff1e6; }
.notice.error { color: #7d2822; border-color: var(--red); background: #fbe5e2; }
.warning-list { margin: 16px 0; padding: 12px 15px; border: 1px solid #e1c76f; background: #fff8dc; }
.simulation-seal { width: fit-content; margin: 25px 0 16px; padding: 12px 18px; border: 2px solid var(--green); transform: rotate(-1deg); color: var(--green); font-family: Georgia, serif; font-size: 25px; }
.confirmation-copy { max-width: 760px; font-size: 17px; line-height: 1.55; }
.final-grid, .metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 23px 0; }
.final-grid div, .metric-card { padding: 17px; border: 1px solid var(--line); background: #f4f0e6; }
.final-grid strong, .metric-card strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 24px; }
.stack-list { display: grid; gap: 9px; }
.stack-item { padding: 11px; border-left: 2px solid var(--green); background: rgb(255 255 255 / 60%); font-size: 12px; }
.stack-item strong, .stack-item small { display: block; }
.stack-item small, .fine-print { color: var(--muted); }
.fine-print { margin-top: 20px; font-size: 11px; line-height: 1.5; }
.account-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-details summary { cursor: pointer; color: var(--green); font-size: 12px; font-weight: 800; }
.compact-form { display: grid; gap: 10px; margin-top: 12px; }
.compact-form .field { font-size: 11px; }
.compact-form .secondary { margin-top: 3px; }
.history-panel { box-shadow: none; }
.empty-state { padding: 25px; color: var(--muted); border: 1px dashed var(--line); text-align: center; }
.admin-shell { width: min(1240px, 94vw); margin: 38px auto 80px; }
.account-create-panel { max-width: 640px; margin-inline: auto; }
.account-create-panel h1 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.account-create-panel .field { font-size: 13px; }
.account-create-panel .field input, .account-create-panel .field select { font-size: 16px; }
.credit-adjust-form { max-width: 540px; }
.credit-adjust-form h3 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 23px; }
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; margin: 20px 0; }
.audit-filters .field { margin: 0; }
.audit-filters input, .audit-filters select { min-width: 0; }
#access-audit-status { margin: 12px 0; }
#access-audit-status.error { color: var(--red); }
#access-audit-rows td:nth-child(2) small { display: block; color: var(--muted); margin-top: 4px; }
#access-audit-rows td:last-child { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
.audit-pages { margin-top: 14px; }
.audit-scroll { max-height: 420px; }
@media (max-width: 900px) { .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .audit-filters { grid-template-columns: minmax(0, 1fr); } }
.admin-hero p:last-child { max-width: 420px; color: var(--muted); line-height: 1.55; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.admin-form-grid h3 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 23px; }
.receipt-actions { display: grid; grid-template-columns: 1fr 90px; gap: 7px; margin-top: 10px; }
.receipt-actions .secondary, .receipt-actions .primary { min-height: 36px; margin: 0; padding: 0 10px; font-size: 11px; }
.login-page { min-height: 100svh; display: grid; place-items: center; background: radial-gradient(ellipse at top, #274c3d, var(--ink) 65%); }
.login-shell { width: min(400px, calc(100% - 28px)); margin: 20px 0; }
.login-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { justify-content: center; margin-bottom: 20px; }
.login-brand small { color: var(--muted); }
.login-brand .brand-mark { border-color: var(--green); color: var(--green); }
.login-card h1 { margin: 0 0 20px; font-size: 25px; font-weight: 700; letter-spacing: -.03em; text-align: center; }
.login-card form { display: grid; gap: 14px; }
.login-card .field { gap: 5px; }
.login-card .field input { font-size: 16px; min-height: 46px; }
.login-card .primary { margin-top: 0; min-height: 46px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; inset: 1px 1px 1px auto; display: grid; place-items: center; width: 44px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--green); }
.password-toggle svg { width: 22px; height: 22px; }
.password-toggle[aria-pressed="false"] .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.platform-settings-fields { display: grid; gap: 12px; padding: 0; margin: 12px 0 0; min-width: 0; border: 0; }
.settings-error { color: var(--red); }
.remember-choice { display: flex; align-items: center; gap: 9px; min-height: 38px; font-size: 13px; cursor: pointer; }
.remember-choice input { width: 18px; height: 18px; accent-color: var(--green); }
.remember-choice small { color: var(--muted); font-size: 12px; }
.access-link { display: block; padding: 9px 0; color: var(--green); text-align: center; font-size: 13px; }
.access-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.password-help { font-size: 12px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-actions .secondary { margin-top: 0; }
#access-link-result, #activation-link-result, #account-access-link-result { overflow-wrap: anywhere; margin-top: 16px; }
.login-card .notice { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .topbar { padding: 14px 4vw; flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; min-width: 0; flex-wrap: wrap; gap: 12px 16px; }
  .safe-pill { margin-left: auto; }
  .layout { grid-template-columns: 1fr; margin-top: 24px; }
  .account-card { position: static; }
  .hero { align-items: start; flex-direction: column; }
  .destination-grid { grid-template-columns: 1fr 1fr; }
  .final-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .layout, .admin-shell { width: 94vw; }
  .steps li { padding: 10px; font-size: 0; }
  .steps li span { margin: 0; font-size: 12px; }
  .destination-grid, .admin-columns, .admin-form-grid { grid-template-columns: 1fr; }
  .panel-heading, .actions { align-items: stretch; flex-direction: column; }
  .actions button { width: 100%; }
  .final-grid, .metric-grid { grid-template-columns: 1fr; }
  .timing { width: 100%; justify-content: space-between; }
}

.review-reason { display: block; max-width: 270px; margin-top: 6px; color: #7b5410; font-size: 12px; }
.review-tools { flex-wrap: wrap; justify-content: flex-start; margin-bottom: 14px; }

html.processing-modal-open { overflow: hidden; overscroll-behavior: none; }
dialog.processing-status { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 30px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / 25%); text-align: center; }
dialog.processing-status:not([open]) { display: none; }
dialog.processing-status[open] { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.processing-status::backdrop { background: rgb(15 30 24 / 65%); backdrop-filter: blur(3px); }
.processing-status img { flex: 0 0 72px; }
.processing-status h2 { margin: 0; color: var(--green); font-size: 23px; outline: none; }
.processing-status p { margin: 0; color: var(--muted); line-height: 1.5; }
#upload-form[aria-busy="true"] button { cursor: wait; opacity: .7; }
#back-to-simulation { margin-top: 20px; }

dialog.comparison-feedback { position: fixed; inset: auto 0 0; width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto auto 16px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / 25%); }
.comparison-feedback::backdrop { background: rgb(15 30 24 / 65%); }
.comparison-feedback h2 { margin: 10px 0; font-size: 23px; outline: none; }
.comparison-feedback p { margin: 0 0 18px; line-height: 1.5; }
.comparison-feedback button { width: 100%; }
html.comparison-modal-open { overflow: hidden; overscroll-behavior: none; }

#destination-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#destination-status img { flex: 0 0 28px; }

.activity-panel, .import-preview { margin: 22px 0; }
.uniform-entry .mapping-include input { display: none; }
.activity-panel h3, .import-preview h3 { margin: 0 0 10px; }
.activity-panel > p { color: var(--muted); }
.column-mappings { display: grid; gap: 10px; }
.mapping-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr); align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; }
.mapping-include { display: flex; align-items: center; gap: 10px; }
.mapping-include input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--green); }
.mapping-include small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.mapping-row .field { margin: 0; }
.mapping-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mapping-actions { display: flex; gap: 4px; }
.activity-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--green); font-size: 26px; line-height: 1; }
.activity-icon:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.remove-activity { color: var(--muted); }
.import-preview-scroll { max-height: 380px; }
.cell-destination { display: block; font-weight: 400; margin-top: 5px; }
.grade-cell { min-width: 145px; }
.grade-cell small { display: block; color: var(--muted); margin: 4px 0; }
.grade-cell.pending-cell { background: #fff0c6; }
.grade-cell.replacement-cell { background: #fff0eb; }
@media (max-width: 560px) { .mapping-row { grid-template-columns: 1fr; gap: 10px; } }
