:root {
  --ink: #1f2825;
  --muted: #68736e;
  --forest: #173f35;
  --forest-2: #24594b;
  --cream: #f4efe3;
  --paper: #fffdf7;
  --line: #d8d4c9;
  --red: #c84b3c;
  --yellow: #e4b84d;
  --shadow: 0 18px 60px rgba(24, 48, 41, 0.12);
  --radius: 22px;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(228, 184, 77, 0.15), transparent 22rem),
    var(--cream);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(244, 239, 227, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(31, 40, 37, 0.08);
}

.brand,
.icon-button,
.back-button,
.more-button,
.text-button,
.close-button,
.focus-chip,
.regenerate-button,
.pill-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  color: var(--paper);
  background: var(--forest);
  border-radius: 14px 14px 14px 4px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-style: italic;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.icon-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 700;
}

.icon-button:hover {
  background: rgba(23, 63, 53, 0.08);
}

.stack-icon,
.copy-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 18px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.stack-icon::after,
.copy-icon::after {
  content: "";
  position: absolute;
  inset: -5px 4px 4px -5px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.count-badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: white;
  background: var(--red);
  border-radius: 999px;
  font-size: 11px;
}

main {
  min-height: calc(100vh - 76px);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: reveal 0.35s ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.65fr);
  align-items: center;
  gap: clamp(32px, 7vw, 100px);
  max-width: 1180px;
  min-height: 575px;
  margin: 0 auto;
  padding: 68px clamp(22px, 5vw, 74px) 54px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7.2vw, 92px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.hero-copy h1 em {
  color: var(--forest-2);
  font-weight: 400;
}

.hero-intro {
  max-width: 590px;
  margin: 28px 0 30px;
  color: #505d58;
  font-family: Georgia, serif;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.classroom-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.primary-button {
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(23, 63, 53, 0.2);
}

.primary-button:hover,
.classroom-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 63, 53, 0.25);
}

.primary-button.large {
  min-height: 58px;
  padding: 16px 22px;
  border-radius: 18px;
}

.plus {
  font-size: 25px;
  font-weight: 400;
}

.secondary-button {
  border-color: #c7cbc5;
  background: var(--paper);
}

.secondary-button:hover {
  border-color: var(--forest);
  background: #f7faf8;
}

.small-button {
  min-height: 44px;
  padding: 8px 13px;
  color: var(--muted);
  background: #ede9df;
  border-radius: 12px;
}

.full {
  width: 100%;
}

.hero-sheet {
  position: relative;
  width: min(100%, 370px);
  aspect-ratio: 0.78;
  justify-self: center;
  padding: 78px 42px;
  background:
    linear-gradient(90deg, transparent 42px, rgba(200, 75, 60, 0.25) 43px, transparent 44px),
    repeating-linear-gradient(white 0 31px, #dce5e8 32px 33px);
  border-radius: 3px 16px 16px 3px;
  box-shadow: 0 32px 70px rgba(31, 40, 37, 0.19);
  transform: rotate(3deg);
}

.hero-sheet::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(31, 40, 37, 0.09);
  pointer-events: none;
}

.paper-clip {
  position: absolute;
  top: -14px;
  left: 62px;
  width: 24px;
  height: 70px;
  border: 4px solid #777f7c;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  transform: rotate(-4deg);
}

.sheet-line {
  width: 95%;
  height: 8px;
  margin: 0 0 24px 10px;
  background: #29322f;
  border-radius: 999px;
  opacity: 0.74;
}

.sheet-line.short {
  width: 44%;
}

.sheet-line.medium {
  width: 72%;
}

.ink-circle {
  position: absolute;
  right: -22px;
  bottom: 124px;
  display: grid;
  place-items: center;
  width: 112px;
  height: 58px;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 50%;
  font-family: "Bradley Hand", "Segoe Print", cursive;
  font-size: 18px;
  transform: rotate(-9deg);
}

.grade-mark {
  position: absolute;
  right: 44px;
  bottom: 32px;
  color: var(--red);
  font-family: "Bradley Hand", "Segoe Print", cursive;
  font-size: 48px;
  transform: rotate(-7deg);
}

.home-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px clamp(22px, 5vw, 74px) 90px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(31, 40, 37, 0.14);
}

.section-heading h2,
.card-heading h2,
.modal h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.text-button {
  padding: 8px 2px;
  color: var(--forest);
  border-bottom: 1px solid currentColor;
  font-weight: 800;
}

.assessment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.assessment-tile {
  position: relative;
  min-height: 240px;
  padding: 24px;
  overflow: hidden;
  color: white;
  background: var(--forest);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.assessment-tile:nth-child(3n + 2) {
  color: var(--ink);
  background: #dfb54f;
}

.assessment-tile:nth-child(3n + 3) {
  color: var(--ink);
  background: #d9ddd7;
}

.assessment-tile:hover {
  transform: translateY(-5px) rotate(-0.4deg);
  box-shadow: 0 25px 65px rgba(24, 48, 41, 0.18);
}

.assessment-tile::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 145px;
  height: 145px;
  border: 26px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-tag {
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.tile-count {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.75;
}

.assessment-tile h3 {
  max-width: 88%;
  margin: 54px 0 8px;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1.05;
}

.assessment-tile p {
  margin: 0;
  font-size: 13px;
  opacity: 0.74;
}

.empty-state {
  padding: 44px;
  border: 1px dashed #aeb6af;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-number {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 30px;
}

.empty-state h3 {
  margin: 12px 0 4px;
  font-family: Georgia, serif;
  font-size: 24px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.review-view {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 54px) 100px;
}

.review-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.back-button {
  justify-self: start;
  padding: 10px 0;
  color: var(--forest);
  font-weight: 800;
}

.review-title {
  text-align: center;
}

.review-title span {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.review-title h1 {
  margin: 4px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
}

.more-button {
  justify-self: end;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #c6cbc5;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.progress-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 34px auto;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: #8b938f;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #afb7b1;
  border-radius: 50%;
}

.progress-step.is-active {
  color: var(--forest);
}

.progress-step.is-active span {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.progress-rail i {
  width: 80px;
  height: 1px;
  margin: 0 12px;
  background: #c5c9c3;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 22px;
}

.review-main {
  display: grid;
  gap: 22px;
}

.work-card,
.grade-card {
  position: relative;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid rgba(31, 40, 37, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(24, 48, 41, 0.07);
}

.work-card {
  padding: clamp(22px, 4vw, 42px);
}

.card-number {
  position: absolute;
  top: 22px;
  right: 26px;
  color: rgba(31, 40, 37, 0.12);
  font-family: Georgia, serif;
  font-size: 50px;
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.privacy-note,
.quality-chip {
  padding: 7px 10px;
  color: var(--forest);
  background: #e5eee9;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.field-label,
.field-group label,
.score-entry label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #3d4944;
  font-size: 12px;
  font-weight: 900;
}

.field-label span {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid #cbd0ca;
  border-radius: 12px;
  outline: 0;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

input,
select {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  padding: 13px 14px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(36, 89, 75, 0.12);
}

.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-bottom: 18px;
}

.capture-zone {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 63, 53, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 63, 53, 0.035) 1px, transparent 1px),
    #ecebe4;
  background-size: 22px 22px;
  border: 1.5px dashed #a6afa9;
  border-radius: 18px;
}

#camera-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.capture-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px;
  text-align: center;
}

.capture-empty strong {
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 400;
}

.capture-empty small {
  margin-bottom: 10px;
  color: var(--muted);
}

.camera-icon {
  position: relative;
  display: block;
  width: 58px;
  height: 42px;
  border: 3px solid var(--forest);
  border-radius: 12px;
}

.camera-icon::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 18px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--forest);
  border-radius: 50%;
}

.camera-icon::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 8px;
  width: 21px;
  height: 9px;
  background: var(--forest);
  border-radius: 4px 4px 0 0;
}

.document-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #d8d9d4;
}

.document-preview[hidden] {
  display: none;
}

.document-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(25, 35, 31, 0.22));
  transition: transform 0.25s ease;
}

.annotation-layer {
  position: absolute;
  inset: 18px;
  pointer-events: none;
}

.page-annotation {
  position: absolute;
  max-width: 160px;
  padding: 3px 6px;
  color: #c22f2f;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: "Bradley Hand", "Segoe Print", cursive;
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 700;
  line-height: 1;
  transform: rotate(-6deg);
  text-shadow: 0 1px white;
}

.preview-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 7px;
}

.pill-button {
  padding: 8px 11px;
  color: white;
  background: rgba(23, 63, 53, 0.88);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.scan-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.expectations-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  color: var(--forest);
  background: #e7eee9;
  border-radius: 14px;
}

.expectations-panel span,
.expectations-panel strong {
  display: block;
}

.expectations-panel span {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.expectations-panel strong {
  font-size: 13px;
}

.focus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.focus-chip {
  min-height: 38px;
  padding: 8px 13px;
  color: var(--muted);
  border: 1px solid #c7ccc6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.focus-chip.is-active {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.feedback-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.feedback-label-row .field-label {
  margin: 0;
}

.regenerate-button {
  padding: 5px 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.feedback-editor {
  min-height: 205px;
  font-family: Georgia, serif;
  font-size: 16px;
}

.editor-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dash-check {
  color: var(--forest-2);
}

.dash-check.has-dash {
  color: var(--red);
}

.correction-builder {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.correction-builder .field-label {
  margin-bottom: 8px;
}

.correction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.correction-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: #8d3027;
  background: #f7e7e2;
  border-radius: 9px;
  font-family: "Bradley Hand", "Segoe Print", cursive;
  font-size: 13px;
}

.correction-tag button {
  width: 20px;
  height: 20px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
}

.grade-card {
  position: sticky;
  top: 98px;
  overflow: hidden;
  color: white;
  background: var(--forest);
  border: 0;
}

.grade-sticky {
  padding: 28px;
}

.grade-card .eyebrow {
  color: #efc45f;
}

.grade-display {
  min-height: 94px;
  margin: 4px 0 20px;
  font-family: Georgia, serif;
  font-size: 82px;
  line-height: 1;
}

.grade-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.level-button {
  min-height: 35px;
  padding: 5px 3px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.level-button.is-active {
  color: var(--forest);
  background: #efc45f;
  border-color: #efc45f;
}

.score-entry label {
  color: rgba(255, 255, 255, 0.72);
}

.score-entry > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-entry input {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  font-size: 27px;
  font-weight: 800;
}

.score-entry span {
  white-space: nowrap;
  font-size: 18px;
}

.grade-divider {
  height: 1px;
  margin: 26px 0;
  background: rgba(255, 255, 255, 0.16);
}

.action-stack {
  display: grid;
  gap: 9px;
}

.grade-card .primary-button {
  color: var(--forest);
  background: #efc45f;
  box-shadow: none;
}

.grade-card .secondary-button {
  color: white;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
}

.classroom-button {
  min-height: 52px;
  margin-top: 4px;
  color: #24322d;
  background: white;
}

.classroom-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: white;
  background: #24a56a;
  border-radius: 5px;
  font-weight: 900;
}

.save-status {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-align: center;
}

.modal {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(23, 38, 33, 0.32);
}

.modal::backdrop {
  background: rgba(18, 37, 31, 0.62);
  backdrop-filter: blur(4px);
}

.modal form,
.saved-modal {
  padding: clamp(24px, 5vw, 42px);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.close-button {
  width: 42px;
  height: 42px;
  color: var(--muted);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.close-button:hover {
  background: #ece9e0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-group.wide {
  grid-column: 1 / -1;
}

.field-group small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.grading-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.grading-choice legend {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 900;
}

.grading-choice > label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px;
  border: 1px solid #c9cec8;
  border-radius: 13px;
  cursor: pointer;
}

.grading-choice input[type="radio"] {
  width: 19px;
  min-height: auto;
  height: 19px;
  accent-color: var(--forest);
}

.grading-choice strong,
.grading-choice small {
  display: block;
}

.grading-choice small {
  margin-top: 2px;
  color: var(--muted);
}

.max-points {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.max-points label {
  font-weight: 800;
}

.max-points input {
  width: 100px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.saved-modal {
  width: min(760px, calc(100% - 28px));
}

.saved-list {
  display: grid;
  gap: 10px;
  min-height: 120px;
}

.saved-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  border: 1px dashed #b8bdb7;
  border-radius: 16px;
  text-align: center;
}

.saved-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px;
  background: #f2f0e9;
  border-radius: 14px;
}

.saved-item strong,
.saved-item small {
  display: block;
}

.saved-item small {
  margin-top: 4px;
  color: var(--muted);
}

.saved-grade {
  display: grid;
  place-items: center;
  min-width: 50px;
  height: 50px;
  color: white;
  background: var(--forest);
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 22px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 17px;
  color: white;
  background: var(--ink);
  border-radius: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#print-root {
  display: none;
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr 300px;
    gap: 25px;
  }

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

  .review-layout {
    grid-template-columns: minmax(0, 1fr) 275px;
  }

  .grade-sticky {
    padding: 22px;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 66px;
  }

  .brand small,
  .button-label {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 46px;
  }

  .hero-copy h1 {
    font-size: clamp(48px, 15vw, 72px);
  }

  .hero-sheet {
    display: none;
  }

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

  .assessment-tile {
    min-height: 190px;
  }

  .assessment-tile h3 {
    margin-top: 34px;
  }

  .review-view {
    padding-top: 18px;
  }

  .review-topbar {
    grid-template-columns: auto 1fr auto;
  }

  .back-button {
    width: 42px;
    height: 42px;
    overflow: hidden;
    font-size: 0;
  }

  .back-button span {
    font-size: 24px;
  }

  .more-button {
    width: 42px;
    height: 42px;
    overflow: hidden;
    font-size: 0;
  }

  .more-button::after {
    content: "↗";
    font-size: 18px;
  }

  .progress-rail {
    margin: 22px auto;
  }

  .progress-step {
    font-size: 0;
  }

  .progress-step span {
    font-size: 11px;
  }

  .progress-rail i {
    width: min(17vw, 75px);
  }

  .review-layout {
    display: flex;
    flex-direction: column;
  }

  .review-main,
  .grade-card {
    width: 100%;
  }

  .grade-card {
    position: relative;
    top: auto;
  }

  .grade-scale {
    grid-template-columns: repeat(7, 1fr);
  }

  .capture-zone {
    min-height: 460px;
  }

  .card-heading {
    padding-right: 42px;
  }

  .privacy-note,
  .quality-chip {
    display: none;
  }

  .scan-actions {
    display: grid;
  }

  .scan-actions .primary-button {
    grid-row: 1;
  }

  .correction-builder {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding-inline: 14px;
  }

  .home-hero,
  .home-section {
    padding-inline: 16px;
  }

  .hero-copy h1 {
    letter-spacing: -0.06em;
  }

  .home-section {
    padding-bottom: 50px;
  }

  .section-heading h2,
  .card-heading h2 {
    font-size: 29px;
  }

  .work-card {
    padding: 22px 17px;
    border-radius: 18px;
  }

  .capture-zone {
    min-height: 420px;
  }

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

  .name-row .small-button {
    display: none;
  }

  .field-label {
    display: block;
  }

  .field-label span {
    display: block;
    margin-top: 3px;
  }

  .expectations-panel strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .grade-scale {
    grid-template-columns: repeat(5, 1fr);
  }

  .form-grid,
  .grading-choice {
    grid-template-columns: 1fr;
  }

  .field-group.wide,
  .max-points {
    grid-column: 1;
  }

  .modal form,
  .saved-modal {
    padding: 24px 18px;
  }

  .modal-actions {
    gap: 10px;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 9mm;
  }

  body {
    background: white;
  }

  body > *:not(#print-root) {
    display: none !important;
  }

  #print-root {
    display: block;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-sheet {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    gap: 8mm;
    height: 178mm;
    break-after: page;
  }

  .print-sheet:last-child {
    break-after: auto;
  }

  .print-document {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #ececec;
    border: 1px solid #aaa;
  }

  .print-document img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .print-placeholder {
    width: 88%;
    height: 88%;
    padding: 18mm 15mm;
    background: white;
    box-shadow: 0 2mm 5mm rgba(0, 0, 0, 0.14);
    font-family: Georgia, serif;
    line-height: 1.7;
  }

  .print-annotation {
    position: absolute;
    max-width: 46mm;
    padding: 1mm 2mm;
    color: #c12b24;
    border: 0.7mm solid #c12b24;
    border-radius: 50%;
    font-family: "Bradley Hand", "Segoe Print", cursive;
    font-size: 12pt;
    font-weight: 700;
    transform: rotate(-5deg);
  }

  .print-feedback {
    display: flex;
    flex-direction: column;
    padding: 7mm;
    border: 1px solid #999;
  }

  .print-kicker {
    margin: 0 0 2mm;
    color: #555;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .print-feedback h1 {
    margin: 0;
    font-size: 21pt;
  }

  .print-feedback h2 {
    margin: 1mm 0 6mm;
    font-size: 12pt;
    font-weight: 400;
  }

  .print-feedback-text {
    font-size: 11pt;
    line-height: 1.45;
    white-space: pre-wrap;
  }

  .print-expectations {
    margin-top: 6mm;
    padding-top: 4mm;
    border-top: 1px solid #bbb;
    color: #444;
    font-size: 8.5pt;
    line-height: 1.35;
  }

  .print-grade {
    margin-top: auto;
    padding-top: 5mm;
    border-top: 1.2mm solid #222;
    font-size: 13pt;
    font-weight: 700;
  }

  .print-grade strong {
    display: block;
    margin-top: 1mm;
    font-size: 32pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
