:root {
  color-scheme: light;
  --ink: #10201c;
  --muted: #66736f;
  --line: #dfe5df;
  --panel: #ffffff;
  --paper: #f7f8f4;
  --teal: #2f6f64;
  --teal-dark: #214f48;
  --amber: #c96d2c;
  --gold: #e4b74c;
  --red: #b84a46;
  --green: #397f54;
  --blue: #406a9b;
  --shadow: 0 18px 60px rgba(16, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(120deg, rgba(47, 111, 100, 0.08), transparent 34%),
    linear-gradient(310deg, rgba(201, 109, 44, 0.1), transparent 36%),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid rgba(16, 32, 28, 0.12);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(16, 32, 28, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 32, 28, 0.1);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.brand small,
.sidebar-band small,
.metric-stack span,
.eyebrow,
.metadata-grid span,
label span,
.drop-copy small {
  color: var(--muted);
}

.brand small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.workspace-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}

.nav-item span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink);
  background: #edf4ef;
}

.sidebar-band {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(47, 111, 100, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, #eef7f3, #fff8eb);
}

.band-label,
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-stack {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.metric-stack div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.main-surface {
  display: grid;
  gap: 22px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px;
}

.topbar,
.panel-heading,
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1,
.panel h2,
.results-panel h2 {
  margin: 0;
  line-height: 1.1;
}

.topbar h1 {
  font-size: 28px;
}

.panel h2,
.results-panel h2 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 6px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: grid;
  gap: 2px;
  min-height: 42px;
  min-width: 178px;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid rgba(64, 106, 155, 0.22);
  border-radius: 8px;
  background: #eef4fb;
}

.user-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-chip strong {
  max-width: 220px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.icon-button:hover:not(:disabled) {
  border-color: rgba(47, 111, 100, 0.5);
  background: #f0f7f3;
}

.icon-button:disabled {
  opacity: 0.45;
}

.icon-button svg,
.primary-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(320px, 0.72fr);
  gap: 22px;
  align-items: start;
}

.panel,
.results-panel {
  border: 1px solid rgba(16, 32, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.status-pill,
#resultState {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--teal-dark);
  border: 1px solid rgba(47, 111, 100, 0.22);
  border-radius: 999px;
  background: #eef7f3;
  font-size: 13px;
  font-weight: 700;
}

.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 22px;
  align-items: center;
  min-height: 182px;
  padding: 22px;
  border: 2px dashed rgba(47, 111, 100, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 111, 100, 0.12), rgba(228, 183, 76, 0.16)),
    #fbfcf8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.dropzone:hover {
  border-color: var(--teal);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 14px 34px rgba(47, 111, 100, 0.16);
  transform: translateY(-1px);
}

.dropzone.is-dragging {
  border-color: var(--amber);
  background: #fff8eb;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-visual {
  display: grid;
  width: 100%;
  place-items: center;
}

.sheet-visual {
  position: relative;
  display: grid;
  gap: 9px;
  width: 86px;
  min-height: 110px;
  padding: 18px 14px;
  border: 1px solid rgba(16, 32, 28, 0.22);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 32, 28, 0.16);
}

.sheet-visual::after {
  position: absolute;
  right: 11px;
  bottom: 12px;
  width: 20px;
  height: 20px;
  border: 3px solid var(--green);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  content: "";
}

.sheet-visual span {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #d9e3dd;
}

.sheet-visual span:nth-child(1) {
  width: 54px;
  background: var(--teal);
}

.sheet-visual span:nth-child(2) {
  width: 42px;
}

.sheet-visual span:nth-child(3) {
  width: 50px;
}

.sheet-visual span:nth-child(4) {
  width: 35px;
}

.drop-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.drop-copy strong {
  font-size: 25px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.upload-callout {
  display: block;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 750;
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.format-row span {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  padding: 0 9px;
  color: var(--ink);
  border: 1px solid rgba(47, 111, 100, 0.22);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.preview-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview-frame img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: #f3f5f0;
}

.pdf-preview {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: var(--muted);
}

.pdf-preview svg {
  width: 78px;
  height: 78px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auto-meta-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 111, 100, 0.16);
  border-radius: 8px;
  background: #f4faf6;
}

.auto-meta-heading .eyebrow {
  margin-bottom: 4px;
}

.auto-meta-heading strong {
  display: block;
}

.auto-meta-heading > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--blue);
  border: 1px solid rgba(64, 106, 155, 0.22);
  border-radius: 999px;
  background: #eef4fb;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.auto-filled-grid input,
.rubric-box textarea {
  background: #fbfcf8;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 111, 100, 0.12);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(47, 111, 100, 0.28);
}

.primary-action:hover:not(:disabled) {
  filter: brightness(1.04);
}

.primary-action:disabled {
  background: #aab5af;
  box-shadow: none;
}

.run-panel {
  position: sticky;
  top: 26px;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #aeb9b3;
}

.live-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(57, 127, 84, 0.16);
}

.timeline {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline li > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #cfd8d1;
  border-radius: 50%;
  background: #fff;
}

.timeline p {
  margin: 1px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.timeline li.active > span {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(228, 183, 76, 0.18);
}

.timeline li.done > span {
  border-color: var(--green);
  background: var(--green);
}

.timeline li.done > span::after {
  width: 8px;
  height: 12px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  content: "";
}

.timeline li.active p,
.timeline li.done p {
  color: var(--ink);
  font-weight: 750;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metadata-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.metadata-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.results-panel {
  overflow: hidden;
}

.results-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.result-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f2;
}

.tab-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.tab-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 32, 28, 0.12);
}

.tab-button:disabled {
  opacity: 0.55;
}

.tab-button.assessment-glow {
  color: var(--ink);
  animation: assessmentGlow 1.15s ease-in-out infinite;
}

@keyframes assessmentGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(201, 109, 44, 0),
      0 6px 18px rgba(16, 32, 28, 0.12);
  }

  50% {
    box-shadow:
      0 0 0 5px rgba(201, 109, 44, 0.18),
      0 10px 24px rgba(201, 109, 44, 0.28);
  }
}

.markdown-body {
  min-height: 300px;
  padding: 26px;
  background: #fffefa;
  line-height: 1.62;
}

.markdown-body.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(47, 111, 100, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 100, 0.06) 1px, transparent 1px),
    #fffefa;
  background-size: 22px 22px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 1.15em 0 0.45em;
  line-height: 1.2;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body h1 {
  font-size: 28px;
}

.markdown-body h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 23px;
}

.markdown-body h3 {
  font-size: 18px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 16px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf4ef;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10201c;
  color: #f7f8f4;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-body table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: #edf4ef;
}

.error-banner {
  padding: 14px 16px;
  border: 1px solid rgba(184, 74, 70, 0.25);
  border-radius: 8px;
  background: #fff0ef;
  color: #6e2421;
}

.error-banner p {
  margin: 6px 0 0;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(340px, 0.72fr);
  gap: 22px;
  width: min(1040px, 100%);
}

.login-visual,
.login-card {
  border: 1px solid rgba(16, 32, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.login-visual {
  display: grid;
  gap: 28px;
  min-height: 590px;
  padding: 26px;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(47, 111, 100, 0.15), transparent 45%),
    linear-gradient(320deg, rgba(201, 109, 44, 0.14), transparent 42%),
    #fbfcf8;
}

.login-brand {
  align-self: start;
}

.campus-board {
  position: relative;
  align-self: center;
  min-height: 328px;
  border: 1px solid rgba(16, 32, 28, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(64, 106, 155, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(64, 106, 155, 0.08) 1px, transparent 1px),
    #ffffff;
  background-size: 34px 34px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.board-header {
  display: flex;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.board-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.board-header span:nth-child(1) {
  background: var(--red);
}

.board-header span:nth-child(2) {
  background: var(--gold);
}

.board-header span:nth-child(3) {
  background: var(--green);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.board-grid span {
  height: 74px;
  border: 1px solid rgba(47, 111, 100, 0.18);
  border-radius: 8px;
  background: #f4faf6;
}

.board-grid span:nth-child(2),
.board-grid span:nth-child(5) {
  background: #fff8eb;
}

.board-grid span:nth-child(3),
.board-grid span:nth-child(4) {
  background: #eef4fb;
}

.board-sheet {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: grid;
  gap: 9px;
  width: min(220px, 48%);
  padding: 20px;
  border: 1px solid rgba(16, 32, 28, 0.16);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 16px 42px rgba(16, 32, 28, 0.16);
}

.board-sheet span {
  height: 7px;
  border-radius: 999px;
  background: #dce7df;
}

.board-sheet span:nth-child(1) {
  width: 76%;
  background: var(--teal);
}

.board-sheet span:nth-child(2) {
  width: 88%;
}

.board-sheet span:nth-child(3) {
  width: 58%;
}

.board-sheet strong {
  justify-self: end;
  color: var(--amber);
  font-size: 30px;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.login-metrics div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

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

.login-metrics strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.login-card {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 30px;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

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

.login-state {
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcf8;
  line-height: 1.4;
}

.login-state:empty {
  display: none;
}

.login-state.success {
  color: var(--teal-dark);
  border-color: rgba(47, 111, 100, 0.22);
  background: #eef7f3;
}

.login-state.error {
  color: #6e2421;
  border-color: rgba(184, 74, 70, 0.25);
  background: #fff0ef;
}

.login-state.pending {
  color: var(--blue);
  border-color: rgba(64, 106, 155, 0.22);
  background: #eef4fb;
}

.login-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .workspace-nav,
  .metric-stack {
    display: none;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .run-panel {
    position: static;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .main-surface {
    padding: 16px;
  }

  .topbar,
  .panel-heading,
  .results-header {
    align-items: flex-start;
  }

  .results-header {
    flex-direction: column;
  }

  .result-controls,
  .result-tabs {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .user-chip {
    width: min(100%, 320px);
    justify-content: start;
  }

  .panel {
    padding: 16px;
  }

  .dropzone,
  .form-grid,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .dropzone {
    text-align: center;
  }

  .drop-copy strong {
    font-size: 18px;
  }

  .markdown-body {
    padding: 18px;
  }

  .login-page {
    padding: 16px;
  }

  .login-card,
  .login-visual {
    padding: 18px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .campus-board {
    min-height: 290px;
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-sheet {
    width: min(230px, 72%);
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }
}
