:root {
  --ink: #17212b;
  --muted: #687586;
  --line: #dbe2ea;
  --soft: #f4f7fa;
  --paper: #ffffff;
  --nav: #172330;
  --blue: #2b66d9;
  --teal: #0e8b83;
  --green: #14815d;
  --amber: #b76b11;
  --red: #bd3b35;
  --violet: #6f55ad;
  --shadow: 0 14px 30px rgba(23, 35, 48, .08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  letter-spacing: 0;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: #edf4f8;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 42px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #9fb0bf;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  color: #d8e3eb;
  text-align: left;
}

.nav-item span {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  font-size: 11px;
  color: #fff;
}

.nav-item.active {
  background: #233141;
  color: #fff;
}

.side-note {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 14px;
  color: #cbd7e1;
  font-size: 12px;
  line-height: 1.55;
  background: rgba(255,255,255,.07);
}

.main {
  min-width: 0;
  padding-bottom: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}

h1, h2, p {
  margin-top: 0;
}

.topbar h1 {
  margin-bottom: 4px;
  font-size: 19px;
}

.topbar p,
.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary,
.secondary {
  border-radius: 8px;
  padding: 10px 13px;
  min-height: 40px;
  font-weight: 700;
  white-space: nowrap;
}

.primary {
  color: white;
  background: var(--blue);
}

.secondary {
  color: #0d6b55;
  background: #e6f5f0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 22px 0;
}

.metric {
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 27px;
  line-height: 1;
}

.metric small {
  color: var(--green);
  font-size: 12px;
}

.section {
  display: none;
  padding: 18px 22px 0;
}

.section.active {
  display: block;
}

.grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.grid.two {
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, .76fr);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.panel-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.upload {
  border: 1px dashed #aebbc8;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.upload p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.blue { color: #234e9b; background: #edf4ff; }
.badge.green { color: #0b704e; background: #e7f7f0; }
.badge.amber { color: #875106; background: #fff3de; }
.badge.red { color: #982d28; background: #fff0ef; }
.badge.violet { color: #58409a; background: #f2edff; }

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.step {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
  display: grid;
  gap: 6px;
  align-content: start;
}

.step span {
  width: 21px;
  height: 21px;
  border-radius: 999px;
  border: 2px solid #b8c4cf;
}

.step strong {
  font-size: 12px;
}

.step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.step.done {
  border-color: rgba(20, 129, 93, .35);
  background: #f0faf5;
}

.step.done span {
  background: var(--green);
  border-color: var(--green);
}

.step.active {
  border-color: rgba(43, 102, 217, .42);
  background: #f1f6ff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
}

th {
  background: #f7f9fb;
  color: #526273;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.advantage {
  display: grid;
  gap: 13px;
}

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.score-line strong {
  font-size: 18px;
}

.bar {
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--a) var(--b) var(--c);
  border: 1px solid rgba(0,0,0,.08);
}

.bar span {
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
}

.bar .a { background: var(--teal); }
.bar .b { background: var(--amber); }
.bar .c { background: #c8d2dd; color: #2f4050; }

.quote,
.evidence,
.review-row,
.route-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
  font-size: 13px;
  line-height: 1.55;
}

.evidence {
  border-left: 3px solid var(--blue);
}

.review-row {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form label {
  display: grid;
  gap: 7px;
  color: #4a5967;
  font-size: 12px;
  font-weight: 800;
}

.form input,
.form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
}

.form input[type="range"] {
  padding: 0;
  min-height: auto;
  accent-color: var(--blue);
}

.route-card {
  display: grid;
  gap: 12px;
}

.course-groups {
  display: grid;
  gap: 18px;
}

.course-group {
  display: grid;
  gap: 10px;
}

.course-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.course-group-head h3 {
  margin: 0;
  font-size: 14px;
}

.application-card {
  gap: 12px;
}

.application-history {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.application-history > strong {
  font-size: 12px;
}

.history-item {
  display: grid;
  gap: 3px;
  padding-left: 10px;
  border-left: 3px solid #cfe0ff;
}

.history-item span,
.history-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.history-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #27a77a);
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.task-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.task-item.done {
  opacity: .65;
}

.task-item.done strong {
  text-decoration: line-through;
}

.task-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.material-row {
  gap: 12px;
}

.material-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.material-upload input[type="file"] {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: white;
}

.section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.route-top h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.35;
}

.route-top p,
.route-card p {
  margin: 0;
  color: var(--muted);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fb;
  min-height: 70px;
}

.mini span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.mini strong {
  font-size: 16px;
}

.locked {
  border: 1px dashed #beafe0;
  background: #f8f4ff;
  color: #6045a0;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.plan-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #eef2f6;
  border-radius: 8px;
  overflow: hidden;
}

.plan {
  padding: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.plan.active {
  background: white;
  color: var(--ink);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.access-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
}

.access-grid strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.access-grid span {
  color: var(--muted);
  font-size: 12px;
}

.json {
  max-height: 620px;
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  padding: 14px;
  background: #111923;
  color: #e8f1f8;
  font-size: 12px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #17212b;
  color: white;
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.landing {
  min-height: 100vh;
  padding: 42px 24px;
  display: grid;
  align-content: center;
  gap: 30px;
  max-width: 1120px;
  margin: 0 auto;
}

.landing-hero {
  display: grid;
  gap: 18px;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.landing h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  max-width: 780px;
}

.landing p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.role-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: white;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.role-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #234e9b;
  background: #edf4ff;
  font-size: 12px;
  font-weight: 800;
}

.role-card strong {
  font-size: 21px;
  line-height: 1.25;
}

.role-card p {
  margin: 0;
  font-size: 13px;
}

.portal {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.portal-top {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-top h1 {
  margin-bottom: 4px;
  font-size: 22px;
}

.portal-top p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.portal-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--muted);
  font-weight: 900;
}

.portal-tabs button.active {
  border-color: var(--blue);
  background: #eaf2ff;
  color: var(--blue);
}

.portal-view {
  display: none;
  gap: 18px;
}

.portal-view.active {
  display: grid;
}

.back-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.inline-form,
.upload-form {
  display: grid;
  gap: 10px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 160px auto;
}

.upload-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-form input,
.upload-form input,
.upload-form textarea,
.upload-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.upload-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.upload-form label {
  display: grid;
  gap: 7px;
  color: #4a5967;
  font-size: 12px;
  font-weight: 800;
}

.upload-form .wide {
  grid-column: 1 / -1;
}

.upload-form button {
  grid-column: 1 / -1;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
  display: grid;
  gap: 8px;
}

.list-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.list-row h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.list-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.review-note {
  display: grid;
  gap: 7px;
  color: #4a5967;
  font-size: 12px;
  font-weight: 800;
}

.review-note textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.5;
  color: var(--ink);
  background: #ffffff;
}

.list-row p.warning-text {
  color: #982d28;
  font-weight: 800;
}

.list-row.compact {
  padding: 11px;
}

.extraction-review-list,
.extraction-route-groups {
  display: grid;
  gap: 12px;
}

.extraction-review,
.extraction-route-group,
.extraction-subsection {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.extraction-review > summary,
.extraction-route-group > summary,
.extraction-subsection > summary {
  cursor: pointer;
  list-style: none;
}

.extraction-review > summary::-webkit-details-marker,
.extraction-route-group > summary::-webkit-details-marker,
.extraction-subsection > summary::-webkit-details-marker {
  display: none;
}

.extraction-review > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: white;
}

.extraction-review > summary strong {
  display: block;
  margin: 3px 0;
  font-size: 15px;
  line-height: 1.35;
}

.extraction-review > summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.extraction-review-body {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 14px;
}

.extraction-check-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.extraction-check-strip span {
  min-height: 34px;
  border: 1px solid #d8e6f4;
  border-radius: 8px;
  padding: 8px;
  color: #234e9b;
  background: #edf4ff;
  font-size: 12px;
  font-weight: 800;
}

.extraction-issue-scope {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  display: grid;
  gap: 12px;
}

.extraction-issue-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.extraction-issue-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.35;
}

.extraction-issue-head p,
.extraction-issue-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.extraction-issue-list {
  display: grid;
  gap: 9px;
}

.extraction-issue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid #6f90d9;
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfe;
}

.extraction-issue-card .list-row-head {
  margin-bottom: 6px;
}

.extraction-issue-card .pill-row {
  margin-top: 8px;
}

.extraction-filter-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  display: grid;
  gap: 10px;
}

.extraction-filter-bar label {
  display: grid;
  gap: 7px;
  color: #4a5967;
  font-size: 12px;
  font-weight: 800;
}

.extraction-filter-bar input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fbfcfe;
}

.extraction-filter-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.small-action.active {
  color: white;
  background: var(--blue);
}

.extraction-subsection > summary,
.extraction-route-group > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: #f7f9fb;
  font-weight: 900;
}

.extraction-subsection > summary {
  border-bottom: 1px solid var(--line);
}

.extraction-route-group[open] > summary,
.extraction-subsection[open] > summary {
  border-bottom: 1px solid var(--line);
}

.extraction-route-group .table-wrap,
.extraction-subsection .table-wrap {
  border: 0;
  border-radius: 0;
}

.extraction-route-group table {
  min-width: 1160px;
}

.event-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.event-row.done {
  opacity: .62;
}

.question {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
  display: grid;
  gap: 10px;
}

.question.correct {
  border-color: #bfe6d3;
  background: #f3fbf7;
}

.question.wrong {
  border-color: #fed7aa;
  background: #fff8ed;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.legal-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 28px 20px 44px;
  display: grid;
  gap: 16px;
}

.legal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: white;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.legal-panel h1,
.legal-panel h2,
.legal-panel p {
  margin: 0;
}

.legal-panel h1 {
  color: var(--ink);
  font-size: 26px;
}

.legal-panel h2 {
  margin-top: 8px;
  color: var(--blue-deep);
  font-size: 16px;
}

.legal-panel p {
  color: var(--muted);
  line-height: 1.72;
}

.legal-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
}

.legal-links a {
  color: var(--blue-deep);
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: white;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.login-form {
  display: grid;
  gap: 13px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fb;
}

.auth-mode-tab {
  min-height: 38px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
}

.auth-mode-tab.active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 35, 48, .08);
}

.register-fields {
  display: grid;
  gap: 13px;
}

.register-fields[hidden] {
  display: none;
}

.login-form label,
.profile-submit-form label {
  display: grid;
  gap: 7px;
  color: #4a5967;
  font-size: 12px;
  font-weight: 800;
}

.login-form input,
.login-form select,
.profile-submit-form input,
.profile-submit-form textarea,
.profile-submit-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
}

.login-form .consent-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.login-form .consent-line input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 1px;
  padding: 0;
}

.profile-submit-form {
  display: grid;
  gap: 14px;
}

.profile-submit-form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 0;
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-submit-form legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.small-action {
  border-radius: 8px;
  min-height: 32px;
  padding: 7px 9px;
  color: var(--ink);
  background: #eef2f6;
  font-weight: 800;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-note {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .top-actions button {
    width: 100%;
  }

  .extraction-review > summary {
    flex-direction: column;
  }

  .extraction-check-strip {
    grid-template-columns: 1fr;
  }

  .extraction-issue-head,
  .extraction-issue-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .metrics,
  .form,
  .steps,
  .mini-grid,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .metrics,
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .upload,
  .panel-head,
  .route-top {
    flex-direction: column;
  }

  .review-row {
    grid-template-columns: 1fr;
  }

  .portal {
    padding: 14px;
  }

  .portal-top,
  .inline-form,
  .material-upload {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .portal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .task-item {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-submit-form fieldset {
    grid-template-columns: 1fr;
  }
}

/* Launch polish */
:root {
  --ink: #152331;
  --muted: #657386;
  --line: #d9e2ec;
  --soft: #eef3f7;
  --paper: #ffffff;
  --nav: #101b29;
  --blue: #2f6feb;
  --teal: #0f8f86;
  --green: #167a5b;
  --amber: #a76516;
  --red: #b83b35;
  --violet: #6c55b8;
  --accent: var(--blue);
  --accent-2: var(--teal);
  --accent-soft: #eaf3ff;
  --shadow: 0 12px 28px rgba(18, 31, 45, .08);
  --shadow-strong: 0 20px 50px rgba(18, 31, 45, .12);
}

body {
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, 0) 300px),
    linear-gradient(135deg, #edf3f7 0, #f8fafc 52%, #eef6f2 100%);
  -webkit-font-smoothing: antialiased;
}

body[data-page="student"] {
  --accent: #2f6feb;
  --accent-2: #0f8f86;
  --accent-soft: #eaf3ff;
}

body[data-page="teacher"] {
  --accent: #167a5b;
  --accent-2: #2f6feb;
  --accent-soft: #e9f7f1;
}

body[data-page="admin"] {
  --accent: #6c55b8;
  --accent-2: #b83b35;
  --accent-soft: #f2efff;
}

body[data-page]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

button,
a.small-action,
.role-card,
.portal-tabs button,
input,
select {
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 2px;
}

input:focus,
select:focus {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

button:disabled,
.small-action:disabled {
  cursor: default;
  opacity: .58;
  transform: none;
}

.primary,
.secondary,
.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 78%, var(--accent)));
  box-shadow: 0 12px 22px color-mix(in srgb, var(--accent) 22%, transparent);
}

.secondary {
  color: color-mix(in srgb, var(--accent) 82%, #123);
  background: color-mix(in srgb, var(--accent-soft) 84%, #ffffff);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.primary:hover,
.secondary:hover,
.small-action:hover,
.portal-tabs button:hover,
.role-card:hover {
  transform: translateY(-1px);
}

.primary:active,
.secondary:active,
.small-action:active,
.portal-tabs button:active {
  transform: translateY(0);
}

.small-action {
  min-height: 34px;
  color: var(--ink);
  background: #f2f5f8;
  border-color: #dce4ed;
}

.small-action:hover {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.portal {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
  gap: 20px;
}

.portal-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(217, 226, 236, .9);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.portal-title {
  min-width: 0;
}

.portal-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-top h1 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.18;
}

.portal-top p {
  max-width: 760px;
  font-size: 13px;
}

.back-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 31, 45, .05);
}

.back-link:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  color: var(--accent);
}

.top-actions {
  align-items: center;
}

.portal .metrics {
  padding: 0;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.metric {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  border-color: rgba(217, 226, 236, .95);
  box-shadow: var(--shadow);
}

.metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.metric:nth-child(2)::before {
  background: var(--accent-2);
}

.metric:nth-child(3)::before {
  background: var(--amber);
}

.metric:nth-child(4)::before {
  background: var(--violet);
}

.metric span {
  font-weight: 800;
}

.metric strong {
  font-size: 30px;
  letter-spacing: 0;
}

.metric small {
  color: color-mix(in srgb, var(--green) 82%, var(--ink));
  font-weight: 800;
}

.portal-tabs {
  position: sticky;
  top: 5px;
  z-index: 12;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(217, 226, 236, .95);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.portal-tabs::-webkit-scrollbar {
  height: 0;
}

.portal-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: #526273;
}

.portal-tabs button.active {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 86%, #123);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.portal-view {
  gap: 20px;
}

.grid {
  gap: 20px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
}

.panel {
  overflow: hidden;
  border-color: rgba(217, 226, 236, .95);
  box-shadow: var(--shadow);
}

.panel-head {
  background: linear-gradient(180deg, #ffffff 0, #f8fafc 100%);
}

.panel-head h2 {
  font-size: 17px;
  line-height: 1.24;
}

.panel-body {
  gap: 14px;
}

.quote,
.evidence,
.review-row,
.route-card,
.list-row,
.task-item,
.mini,
.access-grid div,
.question,
.upload,
.profile-submit-form fieldset {
  border-color: #dce4ed;
  background: #fbfdff;
}

.list-row,
.task-item,
.quote,
.question,
.route-card {
  position: relative;
  box-shadow: 0 8px 18px rgba(18, 31, 45, .04);
}

.list-row::before,
.task-item::before,
.route-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 62%, #b7c4d2);
}

.list-row,
.task-item,
.route-card {
  padding-left: 16px;
}

.list-row-head h3,
.route-top h3 {
  color: #17212b;
}

.list-row p,
.route-card p,
.task-item p {
  font-size: 12px;
}

.mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.mini {
  min-height: 74px;
  background: linear-gradient(180deg, #ffffff 0, #f6f9fc 100%);
}

.mini strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.badge {
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
}

.table-wrap {
  box-shadow: 0 8px 18px rgba(18, 31, 45, .04);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.form input,
.form select,
.inline-form input,
.upload-form input,
.upload-form textarea,
.upload-form select,
.login-form input,
.profile-submit-form input,
.profile-submit-form textarea,
.profile-submit-form select,
.material-upload input[type="file"] {
  border-color: #d8e2ec;
  background: #ffffff;
}

.upload-form,
.inline-form,
.profile-submit-form {
  align-items: end;
}

.profile-submit-form fieldset {
  gap: 13px;
}

.progress-track {
  background: #e7edf4;
}

.progress-track span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.json {
  border: 1px solid #233242;
  background: #101923;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.toast {
  border: 1px solid rgba(255, 255, 255, .12);
  background: #111923;
  box-shadow: var(--shadow-strong);
}

.landing {
  width: min(1180px, 100%);
  padding: 48px 24px;
}

.landing h1 {
  font-size: 52px;
  line-height: 1.05;
}

.landing p {
  color: #5d6b7b;
}

.role-card {
  border-color: rgba(217, 226, 236, .95);
  box-shadow: var(--shadow);
}

.role-card:nth-child(2) span {
  color: #0f674f;
  background: #e9f7f1;
}

.role-card:nth-child(3) span {
  color: #5d459f;
  background: #f2efff;
}

.role-card:hover {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  box-shadow: var(--shadow-strong);
}

.login-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, .72) 46%, rgba(255, 255, 255, .2) 100%),
    linear-gradient(135deg, #edf3f7 0, #f8fafc 56%, #eef6f2 100%);
}

.login-panel {
  box-shadow: var(--shadow-strong);
}

@media (max-width: 1180px) {
  .portal .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .landing h1 {
    font-size: 44px;
  }
}

@media (max-width: 760px) {
  body[data-page]::before {
    height: 4px;
  }

  .portal {
    padding: 14px;
    gap: 14px;
  }

  .portal-top {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .portal-top .back-link {
    width: fit-content;
  }

  .portal-top h1 {
    font-size: 22px;
  }

  .portal .metrics,
  .mini-grid,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .portal-tabs {
    display: flex;
    margin-left: -2px;
    margin-right: -2px;
    padding: 7px;
  }

  .portal-tabs button {
    min-width: 108px;
    white-space: nowrap;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-body {
    padding: 15px;
  }

  .inline-form,
  .upload-form,
  .material-upload,
  .profile-submit-form fieldset {
    grid-template-columns: 1fr;
  }

  .landing {
    min-height: auto;
    padding: 30px 16px;
  }

  .landing h1 {
    font-size: 36px;
  }

  .landing p {
    font-size: 15px;
  }

  .role-card {
    min-height: 176px;
  }
}

@media (max-width: 460px) {
  .portal {
    padding: 10px;
  }

  .portal-top,
  .panel,
  .portal-tabs,
  .role-card,
  .login-panel {
    border-radius: 8px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .landing h1 {
    font-size: 32px;
  }
}

/* TABITO brand alignment */
:root {
  --tabito-blue: #3B82F6;
  --tabito-blue-deep: #2563EB;
  --tabito-orange: #F97316;
  --tabito-orange-deep: #EA580C;
  --tabito-cream: #FFF7ED;
  --tabito-sky: #EFF6FF;
  --ink: #132033;
  --muted: #66758A;
  --line: #DCE5F0;
  --soft: #F3F7FB;
  --blue: var(--tabito-blue);
  --teal: #0EA5A4;
  --amber: var(--tabito-orange);
  --accent: var(--tabito-blue);
  --accent-2: var(--tabito-orange);
  --accent-soft: var(--tabito-sky);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, 0) 320px),
    linear-gradient(135deg, #F3F8FF 0, #FFFFFF 48%, #FFF7ED 100%);
}

body[data-page="student"],
body[data-page="admin"] {
  --accent: var(--tabito-blue);
  --accent-2: var(--tabito-orange);
  --accent-soft: var(--tabito-sky);
}

body[data-page="teacher"] {
  --accent: var(--tabito-orange);
  --accent-2: var(--tabito-blue);
  --accent-soft: var(--tabito-cream);
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 26px rgba(19, 32, 51, .16);
}

.landing {
  max-width: 1200px;
  min-height: 100vh;
  align-content: start;
  padding-top: 28px;
}

.landing-hero {
  min-height: 430px;
  border-radius: 8px;
  padding: 34px;
  align-content: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(13, 29, 52, .88) 0, rgba(37, 99, 235, .58) 48%, rgba(249, 115, 22, .32) 100%),
    url("/assets/tabito-campus.jpg") center 34% / cover;
  box-shadow: var(--shadow-strong);
}

.landing-hero .brand-row span,
.landing-hero p {
  color: rgba(255, 255, 255, .86);
}

.landing-hero h1 {
  max-width: 760px;
  color: #fff;
  text-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

.landing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.landing-tags span {
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.landing-actions .primary,
.landing-actions .secondary {
  min-width: 150px;
  text-decoration: none;
}

.landing-hero .landing-actions .secondary {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .34);
  backdrop-filter: blur(10px);
}

.landing-workflows .role-card {
  cursor: default;
}

.landing-workflows .role-card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.role-card span {
  color: var(--tabito-blue-deep);
  background: var(--tabito-sky);
}

.role-card:nth-child(2) span {
  color: var(--tabito-orange-deep);
  background: var(--tabito-cream);
}

.role-card:nth-child(3) span {
  color: #1d4ed8;
  background: #eef2ff;
}

.login-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .84) 0, rgba(255, 255, 255, .7) 100%),
    linear-gradient(90deg, rgba(37, 99, 235, .2), rgba(249, 115, 22, .12)),
    url("/assets/tabito-campus.jpg") center / cover;
}

.login-panel .brand-row {
  align-items: center;
}

.login-panel .brand-logo {
  width: 58px;
  height: 58px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .16);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.secondary {
  color: color-mix(in srgb, var(--accent) 82%, #142033);
  background: color-mix(in srgb, var(--accent-soft) 88%, #fff);
}

.portal-eyebrow {
  color: color-mix(in srgb, var(--accent) 86%, var(--tabito-orange));
}

.metric:nth-child(3)::before {
  background: var(--tabito-orange);
}

.metric:nth-child(4)::before {
  background: linear-gradient(90deg, var(--tabito-blue), var(--tabito-orange));
}

@media (max-width: 760px) {
  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .landing {
    padding-top: 16px;
  }

  .landing-hero {
    min-height: 410px;
    padding: 24px;
    background:
      linear-gradient(180deg, rgba(13, 29, 52, .88) 0, rgba(37, 99, 235, .6) 58%, rgba(249, 115, 22, .34) 100%),
      url("/assets/tabito-campus.jpg") center / cover;
  }

  .landing-tags span {
    padding: 7px 10px;
  }

  .landing-actions .primary,
  .landing-actions .secondary {
    width: 100%;
  }
}
