:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --surface: #fff;
  --paper: #fffdf8;
  --ink: #1c211e;
  --ink-soft: #4f5752;
  --muted: #737b75;
  --line: #deded6;
  --line-strong: #c9cac1;
  --accent: #b86c13;
  --accent-dark: #94540d;
  --accent-pale: #fff3de;
  --green: #46735d;
  --green-pale: #e9f3ed;
  --red: #a94236;
  --red-pale: #faece9;
  --blue: #376a83;
  --blue-pale: #e9f2f6;
  --shadow: 0 16px 45px rgba(32, 34, 30, 0.08);
  --shadow-small: 0 4px 18px rgba(32, 34, 30, 0.07);
  --radius: 10px;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-reading: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 4% -8%, rgba(211, 168, 106, 0.12), transparent 28rem),
    var(--bg);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(184, 108, 19, 0.35);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(201, 202, 193, 0.8);
  background: rgba(255, 255, 252, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent);
}

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

.brand > span {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav > a:not(.button) {
  padding: 9px 11px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.topnav > a:not(.button):hover,
.topnav > a.active {
  background: #f1eee7;
  color: var(--ink);
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 3px 10px rgba(148, 84, 13, 0.15);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(20, 24, 21, 0.03);
}

.button-secondary:hover:not(:disabled) {
  border-color: #aeb0a7;
  background: #fcfbf8;
  color: var(--ink);
}

.button-large {
  min-height: 46px;
  padding: 11px 20px;
}

.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 19px;
  text-decoration: none;
}

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

.user-button {
  display: flex;
  height: 40px;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding: 4px 7px 4px 5px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.user-button:hover,
.user-button[aria-expanded="true"] {
  background: #f1eee7;
}

.user-button svg {
  width: 14px;
}

.user-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eae3d6;
  color: #735631;
  font-size: 11px;
  text-transform: uppercase;
}

.user-menu {
  position: absolute;
  z-index: 70;
  top: 48px;
  right: 0;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.user-menu span {
  display: block;
  overflow: hidden;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.user-menu button {
  width: 100%;
  padding: 10px 14px;
  background: white;
  cursor: pointer;
  text-align: left;
}

.user-menu button:hover {
  background: #f6f4ef;
}

.loading-screen {
  display: grid;
  min-height: 80vh;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.loading-screen p {
  margin: 12px 0;
  font-size: 13px;
}

.loading-mark {
  width: 32px;
  height: 32px;
  margin: auto;
  border: 2px solid #ded8ca;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px 20px;
  background:
    linear-gradient(rgba(247, 244, 237, 0.82), rgba(247, 244, 237, 0.97)),
    repeating-linear-gradient(90deg, transparent 0, transparent 47px, rgba(97, 85, 65, 0.06) 48px),
    repeating-linear-gradient(0deg, transparent 0, transparent 47px, rgba(97, 85, 65, 0.06) 48px);
}

.login-brand {
  position: absolute;
  top: 28px;
  left: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand p {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.login-card {
  width: min(100%, 410px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 252, 0.97);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 7px;
  font-size: 29px;
  letter-spacing: -0.035em;
}

.login-card > .muted {
  margin-bottom: 25px;
}

.login-foot {
  position: absolute;
  bottom: 22px;
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.115em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

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

.stack-form .button {
  margin-top: 12px;
}

label,
legend {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select {
  height: 43px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9b9e98;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(184, 108, 19, 0.12);
}

.form-error {
  margin: 4px 0 0;
  padding: 9px 11px;
  border-radius: 6px;
  background: var(--red-pale);
  color: var(--red);
  font-size: 13px;
}

.page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 70px;
}

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

.page-heading h1,
.new-heading h1 {
  margin-bottom: 5px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.13;
}

.page-heading p:last-child {
  margin-bottom: 0;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 19px;
}

.search-field {
  position: relative;
  width: min(330px, 100%);
}

.search-field svg {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  color: var(--muted);
}

.search-field input {
  padding-left: 39px;
}

.library-tools select {
  width: 160px;
}

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

.project-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(22, 24, 21, 0.025);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.project-card:hover {
  border-color: #c1b8a8;
  box-shadow: var(--shadow-small);
  transform: translateY(-2px);
}

.project-card-link {
  display: block;
  padding: 20px;
  text-decoration: none;
}

.project-card-top,
.project-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card-top time,
.project-card-bottom {
  color: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.status > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #949991;
}

.status[data-status="drafting"] > span:first-child,
.status[data-status="running"] > span:first-child {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-pale);
}

.status[data-status="ready"] > span:first-child,
.status[data-status="complete"] > span:first-child {
  background: var(--green);
}

.status[data-status="error"] > span:first-child {
  background: var(--red);
}

.status[data-status="paused"] > span:first-child {
  background: #8a8175;
}

.status[data-status="archived"] > span:first-child {
  background: var(--blue);
}

.project-card h2 {
  display: -webkit-box;
  min-height: 52px;
  overflow: hidden;
  margin: 24px 0 6px;
  font-family: var(--font-reading);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-stage {
  min-height: 39px;
  margin-bottom: 27px;
  color: var(--muted);
  font-size: 13px;
}

.model-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 72px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.5);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-pale);
  color: var(--accent);
  font-size: 22px;
}

.empty-state h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.empty-state p {
  max-width: 500px;
  margin: 0 auto 19px;
  color: var(--muted);
}

.page-new {
  max-width: 850px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 33px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.new-heading {
  max-width: 680px;
  margin-bottom: 29px;
}

.new-heading > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
}

.intake-form {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.form-section {
  margin: 0;
  padding: 24px 27px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.form-section > label:first-child,
.form-section > .label-row,
.form-section > legend {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.label-row label {
  font-size: 13px;
}

.label-row span {
  color: var(--muted);
  font-size: 11px;
}

.optional {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.intake-form #project-disclosure {
  min-height: 230px;
  padding: 16px;
  font-family: var(--font-reading);
  font-size: 16px;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.drop-zone {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #fbfaf6;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff9ee;
}

.drop-zone > svg {
  width: 37px;
  flex: none;
  color: var(--accent);
}

.drop-zone > span:nth-child(2),
.drop-zone > span:first-child {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.drop-zone small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.drop-zone .button {
  flex: none;
}

.file-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.file-list:empty {
  display: none;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5f3ed;
  color: var(--ink-soft);
  font-size: 12px;
}

.file-list li span:first-child {
  width: 27px;
  height: 27px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6ded0;
}

.file-list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-list li strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list li button {
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.draft-settings {
  border-bottom: 1px solid var(--line);
}

.draft-settings > summary {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 27px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.draft-settings > summary::-webkit-details-marker {
  display: none;
}

.draft-settings > summary::before {
  content: "+";
  order: 3;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}

.draft-settings[open] > summary::before {
  content: "−";
}

.settings-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 4px 27px 25px;
}

.settings-grid fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-grid legend {
  margin-bottom: 7px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: #d89b51;
  background: var(--accent-pale);
}

.choice-card input {
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.choice-card span,
.toggle-row > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-card small,
.toggle-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-right: 1px solid var(--line);
  background: white;
  font-size: 12px;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.toggle-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

input[role="switch"] {
  width: 38px;
  height: 22px;
  appearance: none;
  border: 1px solid #b8bbb3;
  border-radius: 20px;
  background: #d3d4cf;
  cursor: pointer;
}

input[role="switch"]::before {
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 120ms ease;
}

input[role="switch"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

input[role="switch"]:checked::before {
  transform: translateX(16px);
}

.intake-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 19px 27px;
  background: #fbfaf6;
}

.intake-actions p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.quick-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.draft-screen {
  min-height: calc(100vh - 66px);
  background: #f0eee8;
}

.draft-toolbar {
  position: sticky;
  z-index: 40;
  top: 66px;
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.97);
}

.draft-identification,
.draft-actions,
.title-row {
  display: flex;
  align-items: center;
}

.draft-identification {
  min-width: 0;
  gap: 12px;
}

.draft-identification > div {
  min-width: 0;
}

.title-row {
  gap: 11px;
}

.title-row h1 {
  max-width: 45vw;
  overflow: hidden;
  margin: 0;
  font-family: var(--font-reading);
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-identification p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.draft-subline {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.draft-subline a {
  flex: none;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.draft-actions {
  flex: none;
  gap: 8px;
}

.save-indicator {
  color: var(--muted);
  font-size: 11px;
}

.menu-wrap {
  position: relative;
}

.export-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  right: 0;
  width: 285px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: var(--shadow);
}

.export-menu button,
.export-menu a {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 5px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: white;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.export-menu button:last-child,
.export-menu a:last-child {
  border-bottom: 0;
}

.export-menu button:hover,
.export-menu a:hover {
  background: #f7f5f0;
}

.export-menu strong {
  font-size: 12px;
}

.export-menu small {
  color: var(--muted);
  font-size: 10px;
}

.draft-layout {
  display: grid;
  min-height: calc(100vh - 133px);
  grid-template-columns: 222px minmax(480px, 1fr) 350px;
  align-items: stretch;
}

.section-sidebar,
.context-panel {
  position: sticky;
  top: 133px;
  height: calc(100vh - 133px);
  overflow-y: auto;
  background: #f8f7f3;
}

.section-sidebar {
  border-right: 1px solid var(--line);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-sidebar nav {
  display: grid;
  padding: 0 8px;
}

.section-link {
  display: grid;
  min-height: 42px;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
}

.section-link:hover {
  background: #efede7;
}

.section-link.active {
  background: #e9e4d9;
  color: var(--ink);
  font-weight: 700;
}

.section-number {
  color: #9b9d96;
  font-family: var(--font-reading);
  font-size: 10px;
  text-align: center;
}

.section-link.active .section-number {
  color: var(--accent-dark);
}

.section-state {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8cac3;
}

.section-state.complete {
  background: var(--green);
}

.section-state.writing {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-pale);
}

.sidebar-meter {
  height: 2px;
  margin: 13px 18px 16px;
  overflow: hidden;
  border-radius: 2px;
  background: #dfded8;
}

.sidebar-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 300ms ease;
}

.sidebar-review {
  display: flex;
  width: calc(100% - 20px);
  align-items: center;
  gap: 9px;
  margin: 0 10px 15px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  text-align: left;
}

.sidebar-review:hover {
  background: #efede7;
}

.review-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  color: var(--green);
}

.sidebar-review > span:last-child {
  display: flex;
  flex-direction: column;
}

.sidebar-review strong {
  font-size: 11px;
}

.sidebar-review small {
  color: var(--muted);
  font-size: 9px;
}

.manuscript-area {
  min-width: 0;
  padding: 30px clamp(24px, 4vw, 58px) 75px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.7), transparent 30rem),
    #f0eee8;
}

.manuscript-paper {
  width: min(100%, 780px);
  min-height: 780px;
  margin: 0 auto;
  padding: clamp(37px, 6vw, 70px);
  border: 1px solid #e0ddd4;
  background: var(--paper);
  box-shadow: 0 8px 25px rgba(37, 37, 32, 0.08);
}

.paper-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 35px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dedbd2;
}

.paper-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paper-heading h2 {
  margin: 0;
  font-family: var(--font-reading);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.paper-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
}

.paper-actions > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 10px;
}

.prose {
  color: #292c29;
  font-family: var(--font-reading);
  font-size: 16px;
  line-height: 1.8;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 1.7em 0 0.65em;
  font-family: var(--font-reading);
  font-weight: 600;
  line-height: 1.3;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose p:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose ol,
.prose ul {
  padding-left: 1.7em;
}

.prose li {
  margin: 0.5em 0;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 16px;
  border-left: 2px solid #d7be95;
  color: var(--ink-soft);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 12px;
}

.prose th,
.prose td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
}

.section-empty {
  padding: 90px 15px;
  color: var(--muted);
  text-align: center;
}

.section-empty h3 {
  margin: 14px 0 4px;
  color: var(--ink-soft);
  font-family: var(--font-reading);
  font-size: 18px;
  font-weight: 500;
}

.section-empty p {
  font-size: 12px;
}

.writing-pulse {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.writing-pulse i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite ease-in-out;
}

.writing-pulse i:nth-child(2) { animation-delay: 120ms; }
.writing-pulse i:nth-child(3) { animation-delay: 240ms; }

@keyframes pulse {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.section-editor > label {
  display: block;
  margin-bottom: 8px;
}

.section-editor textarea {
  min-height: 520px;
  padding: 18px;
  border-color: #c7b89f;
  background: #fffefa;
  font-family: var(--font-reading);
  font-size: 15px;
  line-height: 1.7;
}

.editor-meta,
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-meta {
  margin: 6px 1px 18px;
  color: var(--muted);
  font-size: 10px;
}

.editor-actions {
  justify-content: flex-end;
  gap: 8px;
}

.conflict-notice {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 17px;
  padding: 12px;
  border: 1px solid #e0b674;
  border-radius: 7px;
  background: var(--accent-pale);
}

.conflict-notice strong {
  font-size: 12px;
}

.conflict-notice p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.context-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fcfbf8;
}

.panel-tabs {
  display: flex;
  min-height: 47px;
  flex: none;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.panel-tabs button {
  position: relative;
  flex: 1;
  padding: 0 8px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.panel-tabs button:hover,
.panel-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.panel-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.panel-tabs span:empty {
  display: none;
}

.panel-tabs span:not(:empty) {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 2px;
  place-items: center;
  border-radius: 10px;
  background: var(--red-pale);
  color: var(--red);
  font-size: 9px;
}

.panel-content {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 17px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 13px;
}

.panel-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-section-label {
  margin: 18px 0 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.panel-section-label:empty {
  display: none;
}

.workspace-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 14px;
}

.workspace-settings select {
  min-width: 0;
  height: 34px;
  padding: 0 7px;
  background: white;
  font-size: 9px;
}

.text-button {
  padding: 3px;
  background: transparent;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 750;
}

.active-job {
  margin-bottom: 17px;
  padding: 13px;
  border: 1px solid #e8cfaa;
  border-radius: 8px;
  background: var(--accent-pale);
}

.job-error {
  position: relative;
  margin-bottom: 12px;
  padding: 11px 44px 11px 11px;
  border: 1px solid #e4bab4;
  border-radius: 7px;
  background: var(--red-pale);
}

.job-error strong {
  color: var(--red);
  font-size: 10px;
}

.job-error p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
}

.job-error > button {
  position: absolute;
  top: 9px;
  right: 8px;
}

.proposed-patches {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dfb777;
  border-radius: 8px;
  background: var(--accent-pale);
}

.proposed-patches > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 11px;
}

.proposed-patches > p {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.proposed-patch-list {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}

.proposed-patch {
  padding: 9px;
  border: 1px solid rgba(184, 108, 19, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.proposed-patch h3 {
  margin: 0 0 7px;
  font-size: 10px;
}

.patch-label {
  display: block;
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proposed-patch pre {
  max-height: 110px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  border-radius: 4px;
  background: white;
  color: var(--ink-soft);
  font-family: var(--font-reading);
  font-size: 9px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.proposed-patch .patch-old {
  background: #fbefed;
}

.proposed-patch .patch-new {
  background: #edf5f0;
}

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

.active-job strong {
  font-size: 11px;
}

.active-job time {
  color: var(--muted);
  font-size: 9px;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: #e4d1b2;
}

.progress-track span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: working 1.8s ease-in-out infinite;
}

@keyframes working {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(270%); }
}

.job-stats {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.activity-list,
.source-list,
.check-list,
.question-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 0 0 17px;
}

.activity-item:not(:last-child)::before {
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 10px;
  width: 1px;
  background: var(--line);
  content: "";
}

.event-icon {
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--green);
  font-size: 9px;
}

.activity-item p {
  margin: 1px 0 2px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.activity-item time {
  color: var(--muted);
  font-size: 9px;
}

.panel-empty {
  padding: 35px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.source-card {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.source-card:first-child {
  padding-top: 0;
}

.source-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 5px;
}

.source-number {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.source-score {
  padding: 2px 5px;
  border-radius: 10px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
}

.source-card h3 {
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.source-card h3 a {
  text-decoration: none;
}

.source-card h3 a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.source-card p {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--font-reading);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.source-card blockquote {
  margin: 7px 0 0;
  padding-left: 8px;
  border-left: 2px solid #dbc49f;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.sketch-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.sketch-preview {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background: #eeece6;
  color: var(--muted);
  font-family: var(--font-reading);
  font-size: 20px;
}

.sketch-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sketch-card p {
  overflow: hidden;
  margin: 0;
  padding: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sketch-caption-edit {
  display: block;
  margin: -4px 4px 5px auto;
  font-size: 8px;
}

.caption-form {
  padding: 6px;
}

.caption-form input {
  height: 31px;
  padding: 0 6px;
  font-size: 9px;
}

.caption-form > div {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.check-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 15px;
}

.stale-review {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 10px;
  border: 1px solid #dfb777;
  border-radius: 7px;
  background: var(--accent-pale);
}

.stale-review strong {
  color: var(--accent-dark);
  font-size: 10px;
}

.stale-review p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.4;
}

.support-map {
  margin-bottom: 14px;
}

.support-map.is-stale {
  opacity: 0.72;
}

.support-map-heading,
.support-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-map-heading {
  margin-bottom: 7px;
}

.support-map-heading h3 {
  margin: 0;
  font-size: 11px;
}

.support-map-heading > span {
  color: var(--muted);
  font-size: 8px;
}

.support-card {
  margin-bottom: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: white;
}

.support-card[data-status="partial"] {
  border-left-color: var(--accent);
}

.support-card[data-status="missing"] {
  border-left-color: var(--red);
}

.support-card-top strong {
  font-size: 9px;
}

.support-status {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  text-transform: capitalize;
}

.support-card[data-status="partial"] .support-status {
  color: var(--accent-dark);
}

.support-card[data-status="missing"] .support-status {
  color: var(--red);
}

.support-limitation {
  margin: 6px 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
}

.support-card blockquote {
  margin: 0;
  padding: 6px 7px;
  border-radius: 4px;
  background: #f6f4ef;
  color: var(--muted);
  font-family: var(--font-reading);
  font-size: 9px;
  line-height: 1.45;
}

.support-source {
  margin-top: 5px;
  font-size: 8px;
}

.check-summary div {
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-align: center;
}

.check-summary strong,
.check-summary span {
  display: block;
}

.check-summary strong {
  font-size: 16px;
}

.check-summary span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.check-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.severity-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 10px;
}

.check-item[data-severity="error"] .severity-icon {
  background: var(--red-pale);
  color: var(--red);
}

.check-item[data-severity="warning"] .severity-icon {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.check-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.check-item small {
  color: var(--muted);
  font-size: 8px;
  text-transform: capitalize;
}

.check-disclaimer {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.question-card {
  margin-bottom: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.question-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.assistant-box {
  flex: none;
  margin: 0 12px 12px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  box-shadow: var(--shadow-small);
}

.assistant-box > label {
  display: block;
  margin: 0 0 5px 2px;
  font-size: 10px;
}

.assistant-box textarea {
  min-height: 57px;
  padding: 5px 2px;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  resize: none;
}

.assistant-box textarea:focus {
  outline: 0;
}

.assistant-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-footer select {
  width: auto;
  max-width: 220px;
  height: 29px;
  padding: 0 24px 0 7px;
  border: 0;
  background-color: #f3f1eb;
  color: var(--ink-soft);
  font-size: 9px;
}

.send-button {
  width: 29px;
  height: 29px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-size: 15px;
}

.draft-mobile-nav {
  display: none;
}

.toast-region {
  position: fixed;
  z-index: 150;
  right: 20px;
  bottom: 20px;
  display: grid;
  max-width: min(390px, calc(100vw - 40px));
  gap: 8px;
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 7px;
  background: white;
  box-shadow: var(--shadow-small);
  color: var(--ink-soft);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-left-color: var(--red);
}

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

dialog {
  width: min(620px, calc(100% - 30px));
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  box-shadow: 0 24px 70px rgba(25, 25, 22, 0.22);
}

dialog::backdrop {
  background: rgba(36, 35, 31, 0.36);
  backdrop-filter: blur(2px);
}

dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

dialog > header p,
dialog > header h2 {
  margin: 0;
}

dialog > header h2 {
  font-size: 18px;
}

.history-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 6px 20px 20px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.history-item h3 {
  margin: 0 0 3px;
  font-size: 12px;
}

.history-item .history-meta {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 9px;
}

.history-item .history-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-reading);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.upload-dialog form {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.upload-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .draft-layout {
    grid-template-columns: 205px minmax(430px, 1fr) 310px;
  }

  .manuscript-area {
    padding-right: 25px;
    padding-left: 25px;
  }

  .manuscript-paper {
    padding: 45px;
  }

  .paper-heading {
    flex-direction: column;
  }
}

@media (max-width: 970px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-toolbar {
    top: 61px;
  }

  .draft-mobile-nav {
    position: sticky;
    z-index: 39;
    top: 128px;
    display: grid;
    height: 43px;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--line);
    background: white;
  }

  .draft-mobile-nav button {
    border-right: 1px solid var(--line);
    background: white;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
  }

  .draft-layout {
    display: block;
    min-height: calc(100vh - 171px);
  }

  .section-sidebar,
  .context-panel {
    position: fixed;
    z-index: 60;
    top: 171px;
    bottom: 0;
    height: auto;
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  .section-sidebar {
    left: 0;
    width: min(290px, 88vw);
    transform: translateX(-105%);
  }

  .section-sidebar.mobile-open {
    transform: translateX(0);
  }

  .context-panel {
    right: 0;
    width: min(370px, 94vw);
    transform: translateX(105%);
  }

  .context-panel.mobile-open {
    transform: translateX(0);
  }

  .manuscript-area {
    min-height: calc(100vh - 171px);
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 61px;
    padding: 0 15px;
  }

  .brand small,
  .topnav > a:not(.button),
  .user-button > #user-name,
  .user-button > svg {
    display: none;
  }

  .topnav {
    gap: 4px;
  }

  .topnav > .button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .user-button {
    margin-left: 0;
  }

  .page {
    width: min(100% - 28px, 1240px);
    padding-top: 31px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .page-heading .button {
    width: 100%;
  }

  .library-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field,
  .library-tools select {
    width: 100%;
  }

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

  .login-brand {
    top: 20px;
    left: 20px;
  }

  .login-card {
    padding: 28px 23px;
  }

  .new-heading h1,
  .page-heading h1 {
    font-size: 31px;
  }

  .form-section,
  .intake-actions {
    padding-right: 18px;
    padding-left: 18px;
  }

  .drop-zone {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .drop-zone .button {
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

  .draft-settings > summary {
    padding-right: 18px;
    padding-left: 18px;
  }

  .settings-summary {
    display: none;
  }

  .intake-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .intake-actions .button {
    width: 100%;
  }

  .draft-toolbar {
    top: 61px;
    min-height: 76px;
    padding: 9px 12px;
  }

  .draft-identification > .icon-button {
    width: 33px;
    height: 33px;
  }

  .title-row h1 {
    max-width: 46vw;
    font-size: 14px;
  }

  .title-row .status {
    display: none;
  }

  .draft-identification p {
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .save-indicator {
    display: none;
  }

  #pause-button,
  #resume-button {
    min-height: 35px;
    padding: 7px;
    font-size: 0;
  }

  #pause-button::after {
    content: "Pause";
    font-size: 11px;
  }

  #resume-button::after {
    content: "Resume";
    font-size: 11px;
  }

  .draft-identification p,
  .title-row h1 {
    max-width: 30vw;
  }

  #export-button {
    min-height: 35px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .export-menu {
    position: fixed;
    top: 142px;
    right: 10px;
    width: min(300px, calc(100vw - 20px));
  }

  .draft-mobile-nav {
    top: 137px;
  }

  .section-sidebar,
  .context-panel {
    top: 180px;
  }

  .manuscript-area {
    min-height: calc(100vh - 180px);
    padding: 15px 10px 50px;
  }

  .manuscript-paper {
    min-height: calc(100vh - 210px);
    padding: 28px 20px;
  }

  .paper-heading {
    gap: 14px;
    margin-bottom: 26px;
  }

  .paper-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .paper-actions > span {
    margin-right: auto;
  }

  .prose {
    font-size: 15px;
  }

  .section-editor textarea {
    min-height: 55vh;
  }

  .conflict-notice {
    grid-template-columns: 1fr 1fr;
  }

  .conflict-notice > div {
    grid-column: 1 / -1;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
