:root {
  color-scheme: light;
  --canvas: #f3f0e9;
  --surface: #fffefa;
  --surface-muted: #f7f5ef;
  --ink: #18302d;
  --ink-soft: #52625f;
  --ink-faint: #5f6f6b;
  --line: #d9ded8;
  --line-strong: #bec8c2;
  --teal: #146d64;
  --teal-dark: #0c524b;
  --teal-soft: #dceee9;
  --mint: #b7ddcf;
  --lime: #dfe9a8;
  --amber: #eaa63b;
  --amber-dark: #8d5611;
  --amber-soft: #fff2d8;
  --red: #ad4439;
  --red-soft: #f8e4e0;
  --shadow: 0 18px 60px rgb(36 52 47 / 9%);
  --shadow-small: 0 8px 24px rgb(36 52 47 / 7%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --header-height: 72px;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgb(25 66 61 / 2.4%) 1px, transparent 1px),
    var(--canvas);
  background-size: 100% 28px;
  font-size: 16px;
  line-height: 1.65;
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgb(20 109 100 / 28%);
  outline-offset: 3px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgb(190 200 194 / 72%);
  background: rgb(255 254 250 / 94%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--teal-dark);
  border: 1px solid #bed5cd;
  border-radius: 11px;
  background: var(--teal-soft);
}

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

.brand-mark-accent {
  stroke: var(--amber-dark);
  stroke-width: 2.4;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.2;
}

.brand strong {
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.privacy-note {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--teal-dark);
  border: 1px solid #c7dcd4;
  border-radius: 999px;
  background: #eff8f4;
  font-size: 12px;
  font-weight: 800;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  place-items: center;
  transition: 150ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.progress-nav {
  padding: 20px clamp(18px, 4vw, 56px) 0;
  background: var(--surface);
}

.progress-nav ol {
  display: grid;
  grid-template-columns: max-content minmax(24px, 1fr) max-content minmax(24px, 1fr) max-content;
  align-items: center;
  width: min(850px, 100%);
  margin: 0 auto;
  padding: 0 0 20px;
  list-style: none;
}

.progress-step {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink-faint);
}

.progress-step > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
}

.progress-step > div {
  display: grid;
  line-height: 1.2;
}

.progress-step strong {
  font-size: 13px;
}

.progress-step small {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
}

.progress-step.is-active,
.progress-step.is-complete {
  color: var(--teal-dark);
}

.progress-step.is-active > span {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-soft);
}

.progress-step.is-complete > span {
  color: var(--teal-dark);
  border-color: #9dc9ba;
  background: var(--teal-soft);
}

.progress-line {
  height: 1px;
  margin: 0 15px;
  background: var(--line);
}

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

.screen {
  display: none;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.screen.is-active {
  display: block;
  animation: screen-in 260ms ease;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-heading {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.screen-heading h1 {
  max-width: 760px;
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(30px, 3.6vw, 47px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.055em;
}

.screen-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

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

.today-chip {
  display: grid;
  flex: 0 0 auto;
  min-width: 180px;
  padding: 14px 18px;
  border-left: 3px solid var(--teal);
  background: rgb(255 254 250 / 55%);
}

.today-chip span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.today-chip strong {
  margin-top: 2px;
  font-size: 14px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.upload-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
}

.upload-panel + .upload-panel {
  border-left: 1px solid var(--line);
}

.upload-panel-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: start;
  min-height: 64px;
}

.source-number {
  color: var(--teal);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.upload-panel h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.upload-panel-head p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}

.required-pill {
  padding: 3px 8px;
  color: var(--teal-dark);
  border: 1px solid #bfd7cf;
  border-radius: 999px;
  background: #eff8f4;
  font-size: 10px;
  font-weight: 900;
}

.drop-zone {
  display: grid;
  min-height: 270px;
  margin-top: 20px;
  padding: 26px;
  cursor: pointer;
  text-align: center;
  border: 1.5px dashed #9fb5ad;
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, rgb(20 109 100 / 2%) 1px, transparent 1px),
    linear-gradient(rgb(20 109 100 / 2%) 1px, transparent 1px),
    #fbfcf8;
  background-size: 22px 22px;
  place-content: center;
  transition: 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--teal);
  background-color: #f3faf7;
  box-shadow: inset 0 0 0 2px rgb(20 109 100 / 8%);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  color: var(--teal-dark);
  border: 1px solid #c8ded6;
  border-radius: 16px;
  background: var(--teal-soft);
  place-items: center;
}

.drop-icon svg {
  width: 29px;
  height: 29px;
}

.drop-zone strong {
  font-size: 15px;
}

.drop-zone > span:last-child {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}

.file-preview {
  position: relative;
  min-height: 270px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: hidden;
}

.file-preview img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--line);
  background: #e8ece8;
}

.file-preview > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
}

.file-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 900;
}

.file-status i,
.draft-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.file-preview .file-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  padding: 5px 0;
  color: var(--teal-dark);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.text-button:hover {
  text-decoration: underline;
}

.upload-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6px 0;
}

.trust-copy {
  display: flex;
  gap: 10px;
  align-items: center;
}

.trust-copy svg {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  color: var(--teal);
}

.trust-copy p {
  display: grid;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.trust-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.upload-actions,
.message-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  cursor: pointer;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
  transition: 150ms ease;
}

.primary-button {
  color: white;
  border: 1px solid var(--teal);
  background: var(--teal);
  box-shadow: 0 8px 18px rgb(20 109 100 / 20%);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #9aa7a3;
  cursor: not-allowed;
  border-color: #d3d9d5;
  background: #e8ebe8;
  box-shadow: none;
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.secondary-button:hover {
  border-color: #97a9a2;
  background: #f7faf7;
}

.back-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 17px;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.back-button:hover {
  color: var(--teal-dark);
}

.back-button svg {
  width: 16px;
  height: 16px;
}

.review-heading,
.message-heading {
  align-items: center;
}

.review-heading h1,
.message-heading h1 {
  font-size: clamp(28px, 3.2vw, 42px);
}

.review-stats {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  overflow: hidden;
}

.review-stats > div {
  display: grid;
  min-width: 85px;
  padding: 13px 16px;
  text-align: center;
  line-height: 1.1;
}

.review-stats > div + div {
  border-left: 1px solid var(--line);
}

.review-stats strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.review-stats span {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
}

.review-stats .attention-stat {
  color: var(--amber-dark);
  background: var(--amber-soft);
}

.review-stats .attention-stat span {
  color: var(--amber-dark);
}

.review-toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.filter-tab {
  min-height: 36px;
  padding: 0 13px;
  color: var(--ink-soft);
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.filter-tab span {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #e7ebe8;
  font-size: 10px;
}

.filter-tab.is-active {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.filter-tab.is-active span {
  color: white;
  background: var(--teal);
}

.text-icon-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 0 8px;
  color: var(--teal-dark);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.text-icon-button:hover {
  text-decoration: underline;
}

.text-icon-button svg {
  width: 17px;
  height: 17px;
}

.student-list {
  display: grid;
  gap: 12px;
  padding-bottom: 90px;
}

.student-record {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 17px rgb(36 52 47 / 5%);
  overflow: hidden;
  transition: 180ms ease;
}

.student-record.has-attention {
  border-color: #e2bd74;
  box-shadow: 0 5px 20px rgb(141 86 17 / 8%);
}

.student-record.is-confirmed {
  border-color: #bfd7cf;
}

.student-record-head {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffefa;
}

.student-identity {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.student-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: var(--teal-dark);
  border: 1px solid #bed7ce;
  border-radius: 50%;
  background: var(--teal-soft);
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

.student-identity > div,
.message-editor-head > div > div {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.student-identity strong,
.message-editor-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-identity span,
.message-editor-head span:not(.student-avatar) {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
}

.trend-summary {
  display: flex;
  gap: 8px 17px;
  align-items: center;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.trend-summary > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.trend-summary b {
  color: var(--ink);
  font-size: 12px;
}

.trend-arrow {
  color: var(--teal);
}

.trend-arrow.is-down {
  color: var(--amber-dark);
}

.record-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--teal-dark);
  border: 1px solid #bfd7cf;
  border-radius: 999px;
  background: #eff8f4;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.record-status.attention {
  color: var(--amber-dark);
  border-color: #e7c783;
  background: var(--amber-soft);
}

.record-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
}

.record-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  align-content: start;
  border-right: 1px solid var(--line);
}

.field-block {
  position: relative;
  display: grid;
  min-height: 89px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field-block:nth-child(4n) {
  border-right: 0;
}

.field-block:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.field-block.is-wide {
  grid-column: span 2;
}

.field-block.is-attention {
  background: #fffaf0;
}

.field-block label {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.source-label {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 0 5px;
  color: var(--teal-dark);
  border-radius: 4px;
  background: var(--teal-soft);
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.source-label.paper {
  color: #66551a;
  background: #f1ebc4;
}

.field-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 4px 7px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  transition: 140ms ease;
}

.field-input:hover {
  border-color: var(--line);
  background: var(--surface);
}

.field-input:focus {
  border-color: var(--teal);
  background: var(--surface);
  outline: 3px solid rgb(20 109 100 / 13%);
}

.field-block.is-attention .field-input {
  border-color: #dcaa4c;
  background: var(--surface);
}

.attention-control {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
}

.attention-control span {
  color: var(--amber-dark);
  font-size: 9px;
  font-weight: 850;
}

.confirm-field-button {
  margin-left: auto;
  padding: 3px 7px;
  color: var(--amber-dark);
  cursor: pointer;
  border: 1px solid #dfb15a;
  border-radius: 5px;
  background: white;
  font-size: 9px;
  font-weight: 900;
}

.confirm-field-button:hover {
  background: var(--amber-soft);
}

.record-note {
  display: grid;
  align-content: start;
  padding: 15px 17px;
}

.record-note label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 900;
}

.record-note textarea {
  width: 100%;
  min-height: 83px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  padding: 10px 11px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
}

.record-note textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(20 109 100 / 13%);
}

.note-sharing {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
}

.share-toggle {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.share-toggle input,
.message-options input {
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #e5e9e6;
  transition: 150ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgb(0 0 0 / 16%);
  transition: 150ms ease;
}

.share-toggle input:checked + .toggle-track {
  border-color: var(--teal);
  background: var(--teal);
}

.share-toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.confirm-record-button {
  min-height: 31px;
  padding: 0 10px;
  color: var(--teal-dark);
  cursor: pointer;
  border: 1px solid #b9d3ca;
  border-radius: 7px;
  background: #eff8f4;
  font-size: 10px;
  font-weight: 900;
}

.confirm-record-button:hover {
  background: var(--teal-soft);
}

.confirm-record-button:disabled {
  color: var(--ink-faint);
  cursor: default;
  border-color: var(--line);
  background: var(--surface-muted);
}

.empty-filter {
  display: grid;
  min-height: 280px;
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgb(255 254 250 / 60%);
  place-content: center;
}

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

.empty-filter > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  color: var(--teal-dark);
  border-radius: 50%;
  background: var(--teal-soft);
  place-items: center;
  font-size: 22px;
}

.empty-filter strong {
  font-size: 15px;
}

.empty-filter p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.sticky-action-bar {
  position: fixed;
  z-index: 20;
  bottom: 18px;
  left: 50%;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  width: min(880px, calc(100% - 36px));
  min-height: 72px;
  padding: 11px 13px 11px 17px;
  border: 1px solid #c9d4ce;
  border-radius: 16px;
  background: rgb(255 254 250 / 95%);
  box-shadow: 0 17px 60px rgb(24 48 45 / 18%);
  backdrop-filter: blur(15px);
  transform: translateX(-50%);
}

.sticky-action-bar > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sticky-action-bar p {
  display: grid;
  margin: 0;
  line-height: 1.35;
}

.sticky-action-bar p strong {
  font-size: 12px;
}

.sticky-action-bar p span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
}

.completion-ring {
  --completion: 0%;
  position: relative;
  display: grid;
  flex: 0 0 41px;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--completion), #e4e8e5 0);
  place-items: center;
}

.completion-ring::before {
  position: absolute;
  width: 31px;
  height: 31px;
  content: "";
  border-radius: 50%;
  background: var(--surface);
}

.completion-ring i {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.message-progress {
  display: grid;
  flex: 0 0 auto;
  min-width: 105px;
  text-align: right;
  line-height: 1.1;
}

.message-progress > span {
  color: var(--teal-dark);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.message-progress i {
  font-style: normal;
}

.message-progress small {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 850;
}

.message-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.recipient-panel {
  border-right: 1px solid var(--line);
  background: #f8f7f2;
}

.recipient-panel-head {
  display: grid;
  padding: 19px 18px 14px;
  border-bottom: 1px solid var(--line);
}

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

.recipient-panel-head span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
}

.recipient-button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 15px;
  text-align: left;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.recipient-button:hover {
  background: #f1f5f2;
}

.recipient-button.is-active {
  background: var(--teal-soft);
}

.recipient-button.is-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  content: "";
  background: var(--teal);
}

.recipient-button .student-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 11px;
}

.recipient-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.recipient-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-copy small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
}

.recipient-state {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 900;
}

.recipient-state.is-copied {
  color: var(--teal-dark);
}

.message-editor {
  padding: clamp(22px, 3vw, 34px);
}

.message-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.message-editor-head > div {
  display: flex;
  gap: 11px;
  align-items: center;
}

.draft-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--teal-dark) !important;
  border: 1px solid #c5d9d2;
  border-radius: 99px;
  background: #eff8f4;
  font-size: 9px !important;
  font-weight: 900 !important;
}

.source-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  overflow: hidden;
}

.summary-item {
  display: grid;
  min-width: 0;
  padding: 10px 12px;
  line-height: 1.25;
}

.summary-item + .summary-item {
  border-left: 1px solid var(--line);
}

.summary-item span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.summary-item strong {
  overflow: hidden;
  margin-top: 5px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 900;
}

.message-label small {
  color: var(--ink-faint);
  font-size: 9px;
}

#message-text {
  width: 100%;
  min-height: 265px;
  resize: vertical;
  padding: 16px 17px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefb;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.85;
}

#message-text:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(20 109 100 / 13%);
}

.message-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.message-options label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px 0 30px;
  color: var(--ink-soft);
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 800;
}

.message-options label::before {
  position: absolute;
  left: 10px;
  display: grid;
  width: 14px;
  height: 14px;
  content: "";
  color: white;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: white;
  place-items: center;
}

.message-options label:has(input:checked) {
  color: var(--teal-dark);
  border-color: #b5d1c7;
  background: #eff8f4;
}

.message-options label:has(input:checked)::before {
  content: "✓";
  border-color: var(--teal);
  background: var(--teal);
  font-size: 9px;
  font-weight: 900;
}

.message-actions {
  justify-content: space-between;
  margin-top: 22px;
}

.message-actions p {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
}

.message-actions p svg {
  width: 16px;
  height: 16px;
}

.copy-button svg {
  width: 17px;
  height: 17px;
}

.analysis-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 20px;
  background: rgb(18 36 33 / 58%);
  backdrop-filter: blur(7px);
  place-items: center;
}

.analysis-overlay[hidden] {
  display: none;
}

.analysis-dialog {
  width: min(420px, 100%);
  padding: 34px;
  text-align: center;
  border: 1px solid #d5ded8;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(10 24 22 / 30%);
}

.analysis-dialog h2 {
  margin: 6px 0 22px;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.scan-visual {
  position: relative;
  width: 112px;
  height: 132px;
  margin: 0 auto 24px;
}

.paper-sheet {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 10px;
  align-content: center;
  padding: 18px;
  border: 1px solid #aec3bb;
  border-radius: 8px;
  background: #fbfcf8;
  box-shadow: 7px 8px 0 var(--teal-soft);
  transform: rotate(-2deg);
}

.paper-sheet span {
  height: 7px;
  border-radius: 2px;
  background: #d6e1dc;
}

.paper-sheet span:nth-child(2) {
  width: 70%;
}

.paper-sheet span:nth-child(4) {
  width: 84%;
}

.scan-line {
  position: absolute;
  right: -8px;
  left: -8px;
  height: 2px;
  background: var(--amber);
  box-shadow: 0 0 12px rgb(234 166 59 / 70%);
  animation: scan 1.4s ease-in-out infinite alternate;
}

@keyframes scan {
  from { top: 12px; }
  to { top: 120px; }
}

.analysis-dialog ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 0 0;
  text-align: left;
  border-top: 1px solid var(--line);
  list-style: none;
}

.analysis-dialog li {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 750;
}

.analysis-dialog li i {
  width: 11px;
  height: 11px;
  border: 2px solid #c4cdc8;
  border-radius: 50%;
}

.analysis-dialog li.is-complete {
  color: var(--teal-dark);
}

.analysis-dialog li.is-complete i {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 2px white;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 0 17px;
  color: white;
  border-radius: 10px;
  background: var(--teal-dark);
  box-shadow: 0 16px 40px rgb(12 82 75 / 28%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
  font-size: 12px;
  font-weight: 850;
}

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

.toast svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 960px) {
  .screen {
    width: min(100% - 28px, 760px);
    padding-top: 34px;
  }

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

  .record-fields {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .record-note {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
  }

  .record-note label,
  .record-note textarea {
    grid-column: 1 / -1;
  }

  .note-sharing {
    grid-column: 1 / -1;
  }

  .message-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

  .summary-item:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .summary-item:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 62px;
  }

  body {
    background-size: 100% 24px;
  }

  .app-header {
    padding: 8px 15px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

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

  .brand small,
  .privacy-note {
    display: none;
  }

  .progress-nav {
    padding: 14px 15px 0;
  }

  .progress-nav ol {
    grid-template-columns: auto 1fr auto 1fr auto;
    padding-bottom: 14px;
  }

  .progress-step > div {
    display: none;
  }

  .progress-step > span {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }

  .progress-line {
    margin: 0 8px;
  }

  .screen {
    width: calc(100% - 24px);
    padding: 28px 0 80px;
  }

  .screen-heading {
    display: block;
    margin-bottom: 23px;
  }

  .screen-heading h1,
  .review-heading h1,
  .message-heading h1 {
    margin-top: 3px;
    font-size: 29px;
    line-height: 1.28;
  }

  .screen-heading p:not(.eyebrow) {
    font-size: 13px;
  }

  .today-chip {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    margin-top: 16px;
    padding: 8px 0 0 12px;
    background: transparent;
  }

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

  .upload-panel + .upload-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .upload-panel {
    padding: 21px 17px;
  }

  .drop-zone,
  .file-preview {
    min-height: 220px;
  }

  .file-preview img {
    height: 145px;
  }

  .upload-footer {
    display: grid;
    padding-top: 18px;
  }

  .upload-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    order: -1;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
    padding: 0 14px;
  }

  .trust-copy {
    padding: 2px 4px;
  }

  .review-stats {
    width: 100%;
    margin-top: 18px;
  }

  .review-stats > div {
    flex: 1;
  }

  .review-toolbar {
    align-items: flex-start;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tab {
    flex: 1;
    padding: 0 5px;
  }

  .text-icon-button {
    display: none;
  }

  .student-record-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 13px;
  }

  .trend-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    padding-left: 49px;
  }

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

  .field-block:nth-child(2n) {
    border-right: 0;
  }

  .field-block:nth-child(4n):not(:nth-child(2n)) {
    border-right: 1px solid var(--line);
  }

  .field-block:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .field-block:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .record-note {
    display: grid;
    padding: 14px;
  }

  .note-sharing {
    flex-wrap: wrap;
  }

  .sticky-action-bar {
    bottom: 8px;
    width: calc(100% - 16px);
    min-height: 66px;
    padding: 8px 8px 8px 11px;
    border-radius: 13px;
  }

  .sticky-action-bar p span {
    display: none;
  }

  .completion-ring {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .message-progress {
    margin-top: 18px;
    text-align: left;
  }

  .message-workspace {
    display: block;
    border-radius: var(--radius-md);
  }

  .recipient-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recipient-panel-head {
    display: none;
  }

  #recipient-list {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .recipient-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 150px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .recipient-button.is-active::before {
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 3px;
  }

  .message-editor {
    padding: 20px 15px;
  }

  .source-summary {
    margin: 16px 0;
  }

  #message-text {
    min-height: 300px;
  }

  .message-actions {
    display: grid;
    gap: 12px;
  }

  .message-actions p {
    order: 2;
    justify-content: center;
  }

  .copy-button {
    width: 100%;
  }

  .analysis-dialog {
    padding: 28px 22px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .brand strong {
    font-size: 15px;
  }

  .screen-heading h1,
  .review-heading h1,
  .message-heading h1 {
    font-size: 26px;
  }

  .upload-panel-head {
    grid-template-columns: auto 1fr;
  }

  .required-pill {
    display: none;
  }

  .review-stats > div {
    min-width: 0;
    padding-inline: 8px;
  }

  .filter-tab {
    font-size: 10px;
  }

  .sticky-action-bar p {
    display: none;
  }

  .sticky-action-bar {
    justify-content: stretch;
  }

  .sticky-action-bar > div {
    flex: 0 0 auto;
  }

  .sticky-action-bar .primary-button {
    flex: 1;
  }

  .summary-item {
    padding-inline: 9px;
  }
}

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