:root {
  color-scheme: light;
  --bg: #f3f8fb;
  --surface: #ffffff;
  --surface-alt: #f7fbff;
  --ink: #12212f;
  --muted: #627083;
  --line: #d9e3eb;
  --teal: #0f766e;
  --teal-strong: #0a5c55;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --coral: #dc5a4a;
  --coral-soft: #fff0ed;
  --gold: #c28413;
  --gold-soft: #fff6dd;
  --green-soft: #e5f6f1;
  --lilac-soft: #f2efff;
  --shadow: 0 18px 42px rgba(32, 55, 78, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1), rgba(37, 99, 235, 0.08), rgba(220, 90, 74, 0.08)),
    linear-gradient(180deg, #f7fbff 0%, #f3f8fb 42%, #f7faf7 100%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

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

.login-screen[hidden],
.app-shell[hidden],
.identity-chip[hidden] {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(145deg, rgba(15, 118, 110, 0.22), rgba(37, 99, 235, 0.16), rgba(220, 90, 74, 0.14)) border-box;
  box-shadow: var(--shadow);
}

.login-panel .brand-mark {
  margin-bottom: 16px;
}

.login-panel h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.login-panel p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.login-field {
  display: block;
  margin: 22px 0 14px;
}

.login-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
}

.login-field input:focus {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-panel .primary-button {
  width: 100%;
}

.login-message {
  min-height: 20px;
  color: #8e392f;
}

.app-shell {
  width: min(1420px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.14), rgba(37, 99, 235, 0.12), rgba(220, 90, 74, 0.12));
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
  letter-spacing: 0;
}

.brand p,
.pane-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.identity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(229, 246, 241, 0.82);
  color: var(--teal-strong);
}

.identity-chip span {
  max-width: 18ch;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-status {
  flex: 0 1 auto;
  max-width: 46ch;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.model-status.ready {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(90deg, var(--green-soft), #f4fbff);
  color: var(--teal-strong);
}

.model-status.missing {
  border-color: rgba(201, 79, 66, 0.24);
  background: linear-gradient(90deg, var(--coral-soft), var(--gold-soft));
  color: #8e392f;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.pane {
  min-width: 0;
  min-height: calc(100vh - 142px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(145deg, rgba(15, 118, 110, 0.22), rgba(37, 99, 235, 0.12), rgba(220, 90, 74, 0.14)) border-box;
  box-shadow: var(--shadow);
}

.input-pane,
.output-pane {
  display: flex;
  flex-direction: column;
}

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

.output-head {
  align-items: center;
}

.pane-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.counter {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 13px;
  text-align: center;
}

.mode-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.mode-option {
  position: relative;
  display: block;
  min-height: 74px;
  padding: 12px 13px 12px 38px;
  border: 1px solid rgba(98, 112, 131, 0.18);
  border-radius: 8px;
  background: var(--surface-alt);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.mode-option input {
  position: absolute;
  top: 15px;
  left: 13px;
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.mode-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(135deg, var(--green-soft), var(--blue-soft));
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.14),
    0 10px 22px rgba(37, 99, 235, 0.1);
}

.mode-option:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.34);
}

.mode-option strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
}

.mode-option small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-locked .mode-field {
  display: none;
}

.locked-mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-soft), var(--lilac-soft));
}

.locked-mode-card[hidden] {
  display: none;
}

.locked-mode-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.locked-mode-card strong {
  color: #1d4ed8;
  font-size: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.key-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(201, 79, 66, 0.24);
  border-radius: 8px;
  background: var(--coral-soft);
}

.key-panel[hidden] {
  display: none;
}

.key-panel .field-label {
  margin-bottom: 4px;
}

.key-panel p {
  margin: 0;
  color: #8e392f;
  font-size: 12px;
  line-height: 1.35;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.key-row input {
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(201, 79, 66, 0.28);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
}

.key-row input:focus {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.task-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.task-grid label {
  display: block;
}

.task-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-grid input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
}

.task-grid input:focus {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.task-grid input[readonly],
.essay-editor textarea[readonly] {
  background: #f8fafc;
  color: var(--ink);
}

.essay-editor {
  position: relative;
  width: 100%;
  min-height: 430px;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.essay-editor:focus-within {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.essay-highlight-layer,
.essay-readonly-view,
.essay-editor textarea {
  width: 100%;
  min-height: 430px;
  padding: 15px 16px;
  border: 0;
  font: inherit;
  color: var(--ink);
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: break-word;
}

.essay-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  overflow: auto;
  pointer-events: none;
  color: transparent;
}

.essay-readonly-view {
  position: relative;
  z-index: 3;
  display: block;
  max-height: 560px;
  overflow: auto;
  background: #f8fafc;
  color: var(--ink);
}

.essay-readonly-view[hidden] {
  display: none;
}

.essay-editor textarea {
  position: relative;
  z-index: 2;
  display: block;
  resize: vertical;
  outline: none;
  background: transparent;
}

.essay-editor textarea[hidden] {
  display: none;
}

.essay-editor.has-highlights .essay-highlight-layer {
  display: none;
}

.essay-editor.has-highlights textarea {
  color: var(--ink);
  caret-color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.essay-editor.has-highlights textarea[readonly] {
  background: transparent;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.essay-editor.has-highlights textarea::selection {
  background: rgba(37, 99, 235, 0.18);
}

.essay-mark {
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 246, 221, 0.35), rgba(255, 226, 122, 0.72));
  box-shadow: inset 0 -2px 0 rgba(220, 90, 74, 0.55);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.essay-mark.direct-change {
  background: linear-gradient(180deg, rgba(255, 240, 237, 0.2), rgba(255, 189, 166, 0.72));
  box-shadow: inset 0 -2px 0 rgba(220, 90, 74, 0.78);
}

.essay-mark.direct-sentence {
  background: linear-gradient(180deg, rgba(255, 246, 221, 0.25), rgba(255, 226, 122, 0.62));
  box-shadow: inset 0 -2px 0 rgba(194, 132, 19, 0.65);
}

.essay-mark.indirect-focus {
  background: linear-gradient(180deg, rgba(232, 240, 255, 0.22), rgba(164, 193, 255, 0.72));
  box-shadow: inset 0 -2px 0 rgba(37, 99, 235, 0.72);
}

.essay-mark.indirect-sentence {
  background: linear-gradient(180deg, rgba(242, 239, 255, 0.22), rgba(206, 196, 255, 0.58));
  box-shadow: inset 0 -2px 0 rgba(122, 92, 205, 0.56);
}

.buttonbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.advanced-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.advanced-panel[hidden] {
  display: none;
}

.advanced-panel summary {
  min-height: 38px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.advanced-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.primary-button,
.secondary-button,
.quiet-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 750;
}

.primary-button {
  min-width: 124px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--teal-strong), #1d4ed8);
}

.secondary-button {
  border: 1px solid rgba(37, 99, 235, 0.24);
  background: #ffffff;
  color: #1d4ed8;
}

.secondary-button:hover:not(:disabled) {
  background: var(--blue-soft);
}

.secondary-button.compact {
  min-height: 36px;
  padding: 0 12px;
}

.quiet-button {
  background: transparent;
  color: var(--muted);
}

.quiet-button:hover:not(:disabled) {
  background: #f2f3ef;
  color: var(--ink);
}

.quiet-button.compact {
  min-height: 36px;
  padding: 0 10px;
}

.notice {
  min-height: 42px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--gold-soft);
  color: #694b12;
  font-size: 14px;
  line-height: 1.4;
}

.notice.success {
  border-left-color: var(--teal);
  background: var(--green-soft);
  color: var(--teal-strong);
}

.notice.error {
  border-left-color: var(--coral);
  background: var(--coral-soft);
  color: #8e392f;
}

.feedback-output {
  flex: 1 1 auto;
  min-height: 420px;
  max-height: calc(100vh - 296px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.feedback-output.empty {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.revision-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfffd, var(--green-soft));
}

.revision-panel[hidden] {
  display: none;
}

.revision-panel textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.58;
}

.revision-panel textarea:focus {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.record-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfdff, var(--blue-soft));
}

.record-panel[hidden] {
  display: none;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.record-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.record-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.record-head p.record-warning {
  color: #8e392f;
}

.record-head p.record-success {
  color: var(--teal-strong);
}

.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
  gap: 10px;
  align-items: end;
}

.record-grid label {
  display: block;
}

.record-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.record-grid input,
.record-grid select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
}

.record-grid input:focus,
.record-grid select:focus {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.record-grid input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.feedback-output pre,
.prompt-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.feedback-output pre {
  padding: 16px;
}

.rendered-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.45;
}

.rendered-table th,
.rendered-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
  word-break: break-word;
}

.rendered-table th:last-child,
.rendered-table td:last-child {
  border-right: 0;
}

.rendered-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--green-soft), var(--blue-soft));
  color: #0f4f73;
  text-align: left;
}

.rendered-table tr:last-child td {
  border-bottom: 0;
}

.diff-old,
.diff-new,
.problem-focus-cell {
  border-radius: 4px;
  padding: 1px 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.diff-old {
  background: rgba(255, 189, 166, 0.5);
  color: #8e392f;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(142, 57, 47, 0.72);
}

.diff-new {
  background: rgba(166, 229, 199, 0.72);
  color: #075f45;
  font-weight: 750;
}

.problem-focus-cell {
  background: linear-gradient(90deg, rgba(232, 240, 255, 0.95), rgba(242, 239, 255, 0.95));
  color: #1d4ed8;
  font-weight: 750;
}

.prompt-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.prompt-panel summary {
  min-height: 40px;
  padding: 10px 13px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.prompt-panel pre {
  max-height: 220px;
  overflow: auto;
  padding: 0 13px 13px;
  color: #2d3c38;
}

.admin-shell {
  width: min(1260px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.admin-pane {
  min-height: calc(100vh - 142px);
}

.admin-login {
  width: min(520px, 100%);
}

.admin-login h2,
.admin-toolbar h2 {
  margin: 0;
  font-size: 20px;
}

.admin-login p,
.admin-toolbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.admin-login-row input,
.admin-filters input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
}

.admin-login-row input:focus,
.admin-filters input:focus {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-records[hidden] {
  display: none;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-filters span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--green-soft), var(--blue-soft));
  color: #0f4f73;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-empty {
  color: var(--muted);
  text-align: center;
}

.detail-row td {
  background: #fbfdff;
}

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

.record-detail-grid section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.record-detail-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.record-detail-grid pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 24px, 720px);
    padding-top: 16px;
  }

  .topbar,
  .workspace {
    display: block;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .model-status {
    max-width: none;
  }

  .pane {
    min-height: auto;
    margin-bottom: 14px;
    padding: 16px;
  }

  .mode-field {
    grid-template-columns: 1fr;
  }

  .key-panel,
  .key-row,
  .task-grid {
    grid-template-columns: 1fr;
  }

  .essay-editor,
  .essay-highlight-layer,
  .essay-readonly-view,
  .essay-editor textarea {
    min-height: 310px;
  }

  .feedback-output {
    min-height: 330px;
    max-height: 65vh;
  }

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

  .admin-toolbar,
  .admin-login-row {
    display: block;
  }

  .admin-toolbar .secondary-button,
  .admin-login-row .primary-button {
    margin-top: 10px;
  }

  .admin-filters,
  .record-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .pane-head,
  .output-head {
    display: block;
  }

  .counter,
  .output-head .compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
  }

  .buttonbar > button {
    flex: 1 1 100%;
  }

  .advanced-content {
    align-items: stretch;
    flex-direction: column;
  }
}
