:root {
  --bg: #eef3f1;
  --panel: #ffffff;
  --panel-soft: #f7faf9;
  --panel-tint: #edf6f3;
  --ink: #17232b;
  --muted: #62717a;
  --faint: #94a0a8;
  --border: #d7e0dc;
  --border-strong: #bbc9c4;
  --teal: #087c72;
  --teal-dark: #075f59;
  --sage: #d8ece5;
  --coral: #ca5148;
  --amber: #c18416;
  --blue: #2f6fa9;
  --violet: #6b5aa6;
  --shadow: 0 22px 60px rgba(22, 36, 31, 0.12);
  --small-shadow: 0 10px 28px rgba(22, 36, 31, 0.09);
  --hairline-shadow: 0 1px 2px rgba(22, 36, 31, 0.04);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(216, 236, 229, 0.72), rgba(238, 243, 241, 0) 330px),
    linear-gradient(90deg, rgba(47, 111, 169, 0.06), rgba(8, 124, 114, 0.04)),
    var(--bg);
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 68px 1fr;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--teal-dark);
  color: white;
  box-shadow: 0 10px 24px rgba(8, 124, 114, 0.18);
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.search-shell {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 660px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--muted);
  box-shadow: var(--hairline-shadow);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.search-shell:focus-within {
  border-color: rgba(8, 124, 114, 0.5);
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.11);
}

.search-shell svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
  margin-right: 6px;
}

.save-state svg {
  width: 14px;
  height: 14px;
}

.workspace {
  display: block;
  min-height: calc(100vh - 68px);
}

.rail,
.inspector {
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--border);
  min-width: 0;
}

.rail {
  padding: 18px 14px;
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--border);
  padding: 18px 16px;
}

.review-pane {
  min-width: 0;
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 20px;
}

.panel-title-row,
.section-title-row,
.document-head,
.compose-actions,
.history-row,
.comment-head,
.tag-edit-row,
.modal-head,
.student-row,
.quick-stats,
.rubric-row,
.filter-row {
  display: flex;
  align-items: center;
}

.panel-title-row,
.section-title-row,
.document-head,
.comment-head,
.modal-head,
.filter-row {
  justify-content: space-between;
  gap: 12px;
}

.eyeless-title {
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.rail-section + .rail-section,
.inspector-section + .inspector-section {
  margin-top: 20px;
}

.students-list,
.history-list,
.comment-list,
.tag-edit-list {
  display: grid;
  gap: 8px;
}

.student-row {
  width: 100%;
  text-align: left;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.student-row:hover {
  background: rgba(23, 126, 114, 0.07);
}

.student-row.is-active {
  background: white;
  border-color: var(--border-strong);
  box-shadow: var(--small-shadow);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: white;
  background: var(--avatar, var(--teal));
  font-weight: 760;
  font-size: 13px;
  flex: 0 0 auto;
}

.student-main {
  min-width: 0;
  flex: 1;
}

.student-name,
.history-title,
.comment-title {
  font-weight: 720;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-meta,
.history-meta,
.comment-meta,
.tiny-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.student-score {
  min-width: 42px;
  text-align: right;
  color: var(--teal-dark);
  font-weight: 760;
  font-size: 13px;
}

.history-row {
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.history-row.is-active {
  border-color: var(--teal);
  box-shadow: inset 3px 0 0 var(--teal);
}

.history-icon {
  color: var(--blue);
  flex: 0 0 auto;
}

.main-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  overflow: hidden;
}

.document-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(247, 250, 249, 0.96), rgba(255, 255, 255, 0.96)),
    white;
}

.document-title h1 {
  margin: 0;
  max-width: 760px;
  font-size: 25px;
  line-height: 1.16;
  font-weight: 820;
}

.document-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.history-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  max-width: 560px;
}

.history-control .field-label {
  flex: 0 0 auto;
}

.history-select {
  min-width: 260px;
}

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

.review-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(160px, 240px);
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.progress-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.review-progress strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
}

.progress-percent {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e4ece8;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: var(--progress, 0);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.review-toolbelt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-wrap: wrap;
}

.tool-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-strip:first-child {
  flex: 1 1 420px;
}

.tool-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-label svg {
  width: 16px;
  height: 16px;
}

.mini-select {
  min-height: 34px;
  min-width: 142px;
  padding: 6px 9px;
  font-size: 13px;
}

.inline-tag-manager {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.stat {
  min-width: 0;
  padding: 12px 14px;
  background: transparent;
  border-right: 1px solid var(--border);
}

.stat:first-child {
  padding-left: 0;
}

.stat:last-child {
  border-right: 0;
  padding-right: 0;
}

.stat strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.essay-stage {
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(247, 250, 249, 0.75), rgba(238, 243, 241, 0.92)),
    var(--bg);
}

.review-canvas {
  display: grid;
  grid-template-columns: minmax(0, 880px) minmax(300px, 382px);
  align-items: start;
  justify-content: center;
  gap: 28px;
}

.essay-paper {
  width: 100%;
  max-width: 880px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow:
    0 26px 50px rgba(24, 37, 31, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  padding: 46px 56px 28px;
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.essay-body {
  margin-top: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18.5px;
  line-height: 1.86;
  white-space: pre-wrap;
  color: #25313a;
  user-select: text;
}

.essay-body mark {
  background: var(--mark);
  border-bottom: 2px solid var(--mark-border);
  color: inherit;
  padding: 2px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.essay-body mark:hover,
.essay-body mark.is-focused {
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.16);
}

.comment-index {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 2px;
  transform: translateY(-0.42em);
  border-radius: 999px;
  background: var(--tag);
  color: white;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.paper-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 12px;
}

.comment-margin {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
  align-self: start;
}

.margin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 2px;
}

.comment-thread {
  display: grid;
  gap: 10px;
}

.inline-composer,
.margin-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--hairline-shadow);
}

.compact-compose {
  min-height: 84px;
  margin-top: 10px;
}

.margin-comment {
  position: relative;
  border-left: 3px solid var(--tag, var(--teal));
  box-shadow: var(--hairline-shadow);
  transition:
    margin-top 180ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.comment-number {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--tag, var(--teal));
  color: white;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
  cursor: pointer;
}

.selection-note {
  margin-top: 18px;
  padding: 10px 12px;
  color: var(--teal-dark);
  background: rgba(8, 124, 114, 0.08);
  border: 1px solid rgba(8, 124, 114, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
}

.inspector-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.inspector-card + .inspector-card {
  margin-top: 12px;
}

.quote-box {
  min-height: 52px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag-picker,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-chip,
.tag-button,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--tag, var(--border));
  background: var(--tag-bg, white);
  color: var(--tag-ink, var(--ink));
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.15;
}

.tag-button {
  cursor: pointer;
}

.tag-button.is-selected {
  color: white;
  background: var(--tag, var(--teal));
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tag, var(--teal));
  flex: 0 0 auto;
}

.compose-box {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  padding: 10px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 14px;
  line-height: 1.45;
}

.compose-box:focus,
.field:focus,
.select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.14);
}

.compose-actions {
  gap: 8px;
  justify-content: space-between;
  margin-top: 10px;
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.comment-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 3px;
}

.comment-card {
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  padding: 13px;
}

.comment-card.is-focused {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.13);
}

.comment-card.is-resolved {
  opacity: 0.68;
}

.comment-body {
  margin: 9px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.comment-quote {
  margin-top: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  border-left: 3px solid var(--tag, var(--border-strong));
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.45;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.rubric {
  display: grid;
  gap: 10px;
}

.rubric-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
}

.rubric-row label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.rubric-row input {
  width: 100%;
  accent-color: var(--teal);
}

.rubric-row output {
  width: 24px;
  text-align: right;
  font-weight: 760;
  color: var(--teal-dark);
}

.report-lines {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.report-lines strong {
  color: var(--ink);
}

.tag-manager {
  display: grid;
  gap: 10px;
}

.tag-edit-row {
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.tag-edit-row input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
}

.tag-edit-row input[type="text"] {
  min-width: 0;
  flex: 1;
}

.field,
.select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 8px 10px;
  outline: 0;
  font-size: 14px;
}

.field-stack {
  display: grid;
  gap: 8px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 12px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.btn,
.icon-btn,
.ghost-btn,
.primary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.btn svg,
.icon-btn svg,
.ghost-btn svg,
.primary-btn svg,
.danger-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.btn:hover,
.icon-btn:hover,
.ghost-btn:hover {
  border-color: var(--border-strong);
  box-shadow: var(--hairline-shadow);
  transform: translateY(-1px);
}

.btn.is-active {
  border-color: rgba(8, 124, 114, 0.36);
  background: rgba(8, 124, 114, 0.1);
  color: var(--teal-dark);
}

.primary-btn {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  box-shadow: 0 8px 18px rgba(8, 124, 114, 0.14);
}

.primary-btn:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  box-shadow: 0 10px 24px rgba(8, 124, 114, 0.18);
}

.ghost-btn {
  background: transparent;
}

.danger-btn {
  color: #a13d36;
  background: #fff7f5;
  border-color: #f0c7c1;
}

.danger-btn:hover {
  background: #ffece8;
}

.btn:disabled,
.primary-btn:disabled,
.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  background: var(--panel-soft);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 29, 25, 0.42);
}

.modal {
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal.small {
  width: min(460px, 100%);
}

.modal-head,
.modal-foot {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-body {
  padding: 16px;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.editor-textarea {
  min-height: 360px;
  resize: vertical;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.62;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .review-canvas {
    grid-template-columns: minmax(0, 760px) minmax(280px, 330px);
    gap: 18px;
  }

  .essay-paper {
    padding: 36px 40px;
  }

  .comment-margin {
    top: 74px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 10px 12px;
    gap: 9px;
  }

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

  .brand-title {
    font-size: 16px;
  }

  .search-shell {
    max-width: none;
    height: 42px;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace {
    display: block;
  }

  .review-pane {
    border: 0;
    padding: 8px;
  }

  .main-card {
    min-height: auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .document-head {
    display: grid;
    padding: 14px 16px;
    gap: 12px;
  }

  .document-title h1 {
    font-size: 22px;
  }

  .review-progress {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
    gap: 10px;
  }

  .progress-track {
    grid-column: 1 / -1;
  }

  .history-control {
    display: grid;
    grid-template-columns: 1fr 44px;
    max-width: none;
  }

  .history-control .field-label {
    grid-column: 1 / -1;
  }

  .history-select {
    min-width: 0;
  }

  .document-actions {
    justify-content: flex-start;
  }

  .quick-stats {
    padding: 0 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
  }

  .stat {
    min-width: 0;
    padding: 9px 5px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .stat:first-child {
    padding-left: 0;
  }

  .stat:last-child {
    padding-right: 0;
    border-bottom: 0;
    border-right: 0;
  }

  .stat strong {
    font-size: 17px;
  }

  .stat span {
    font-size: 10px;
    line-height: 1.2;
  }

  .review-toolbelt {
    padding: 10px 16px;
    align-items: stretch;
  }

  .tool-strip,
  .tool-strip:first-child {
    flex: 1 1 100%;
  }

  .tag-picker.compact {
    width: 100%;
  }

  .mini-select {
    min-width: 0;
  }

  .inline-tag-manager {
    padding: 10px 16px;
  }

  .essay-stage {
    padding: 12px 8px 18px;
    overflow: visible;
  }

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

  .essay-paper {
    padding: 24px 18px 18px;
  }

  .essay-body {
    font-size: 16px;
    line-height: 1.76;
    overflow-wrap: anywhere;
  }

  .paper-meta,
  .paper-foot {
    display: grid;
    gap: 6px;
  }

  .comment-margin {
    position: static;
  }

  .rubric-row {
    grid-template-columns: 96px minmax(0, 1fr) 26px;
  }

  .comment-card,
  .inline-composer,
  .margin-section {
    box-shadow: none;
  }

  .btn,
  .icon-btn,
  .ghost-btn,
  .primary-btn,
  .danger-btn,
  .select,
  .field {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
  }

  .comment-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .comment-actions span {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

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

@media print {
  body {
    background: white;
  }

  .topbar,
  .rail,
  .inspector,
  .review-toolbelt,
  .comment-margin,
  .document-actions,
  .review-progress,
  .quick-stats {
    display: none;
  }

  .workspace,
  .review-pane,
  .main-card {
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .essay-paper {
    max-width: none;
    border: 0;
    box-shadow: none;
  }
}
