:root {
  --ink: #253b39;
  --muted: #63716b;
  --green: #23594e;
  --line: #e3e6df;
  --cream: #f6f6f1;
  --yellow: #f3db79;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 7px;
  padding: 9px 12px;
  transition: background 0.15s;
}
button:hover {
  background: #e7ece6;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button[aria-busy="true"] {
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #619d89;
  outline-offset: 3px;
}
button.primary {
  background: var(--green);
  color: white;
  padding: 11px 16px;
}
button.primary:hover {
  background: #183e37;
}
a {
  color: var(--green);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px;
}
input {
  width: 100%;
}
label {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  margin: 20px 0 12px;
}
label input,
label textarea {
  display: block;
  margin-top: 7px;
  width: 100%;
}
.hidden {
  display: none !important;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 650;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  line-height: 1.8;
}
header {
  height: 78px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
  gap: 22px;
}
.brand {
  font:
    700 29px Georgia,
    serif;
  text-decoration: none;
  letter-spacing: -1.5px;
}
.brand span {
  font: 10px sans-serif;
  color: #b3bf68;
  margin-left: 4px;
}
.header-divider {
  width: 1px;
  height: 23px;
  background: var(--line);
}
#project-select {
  background: transparent;
  border: 0;
  max-width: 255px;
  font-size: 13px;
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}
.workspace-grid {
  position: relative;
  display: grid;
  height: calc(100vh - 78px);
}
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 30px 18px 12px;
  overflow: hidden;
}
.side-top {
  padding: 0 8px 24px;
}
.side-top h2 {
  font:
    22px/1.35 Georgia,
    serif;
  margin: 12px 0;
}
.status-dot {
  font-size: 10px;
  color: #6c8272;
}
.status-dot:before {
  content: "●";
  color: #8da77a;
  margin-right: 6px;
}
.nav-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
}
.nav-heading button {
  font-size: 20px;
  padding: 4px;
}
#files {
  max-height: 38vh;
  overflow: auto;
  padding: 8px 0 18px;
}
.file-item {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  margin: 3px 0;
  padding: 11px 10px;
  border-radius: 5px;
  color: #687870;
  font-size: 12px;
}
.file-item .file-num {
  font-size: 10px;
  color: #a1aca3;
  width: 20px;
}
.file-item.active {
  background: #e5ece2;
  color: #254e43;
  font-weight: 600;
  border-left: 3px solid #456d53;
  border-radius: 0 5px 5px 0;
}
.side-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 5px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.library-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font:
    16px Georgia,
    serif;
  margin-bottom: 12px;
}
.library-title button {
  padding: 2px 5px;
  font-size: 20px;
}
#search {
  font-size: 11px;
  background: #fcfcf8;
  padding: 10px;
  margin-bottom: 12px;
}
#sources {
  overflow: auto;
}
.source-item {
  width: 100%;
  text-align: left;
  padding: 18px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.4;
}
.source-item b {
  font:
    17px/1.5 Georgia,
    serif;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.source-item small {
  display: block;
  color: #89948b;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 5px;
}
.side-footer {
  font-size: 10px;
  color: #9aa397;
  padding: 16px 8px 0;
}
.manuscript {
  background: #fff;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.document-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 0 40px;
  padding: 28px 0 19px;
  gap: 12px;
}
.document-toolbar h1 {
  font:
    27px Georgia,
    serif;
  margin: 9px 0 0;
}
.view-tabs {
  background: #f2f4ef;
  padding: 3px;
  border-radius: 7px;
  display: flex;
}
.view-tabs button {
  font-size: 11px;
  padding: 7px 12px;
  color: #748177;
}
.view-tabs button.active {
  background: white;
  box-shadow: 0 1px 3px #0001;
  color: var(--ink);
}
.document-meta {
  margin: 0 40px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  font-size: 10px;
  color: #9aa299;
}
.document-meta button {
  margin-left: auto;
  padding: 0;
  font-size: 10px;
  color: #7e8d7d;
}
.document-meta #save-state {
  color: #709076;
}
.paper-scroll {
  overflow: auto;
  flex: 1;
}
.paper {
  padding: 30px 46px 70px;
  max-width: 880px;
  margin: auto;
  font:
    17px/1.85 Georgia,
    "Times New Roman",
    serif;
  color: #3c4540;
}
.paper > h1:first-child {
  display: none;
}
.paper h1,
.paper h2,
.paper h3 {
  font-size: 23px;
  line-height: 1.4;
  margin: 30px 0 16px;
  color: #253b39;
  font-weight: 500;
}
.paper h2 {
  font-size: 21px;
}
.paper h3 {
  font-size: 19px;
}
.paper p {
  margin: 0 0 22px;
}
.paper a[href^="ref:"] {
  font:
    10px -apple-system,
    sans-serif;
  padding: 3px 5px;
  background: #edf1e8;
  color: #527146;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
}
.paper a.selected-ref {
  background: #f7e9a4;
  outline: 1px solid #e1c569;
}
.paper table {
  font-size: 12px;
  border-collapse: collapse;
  display: block;
  overflow: auto;
  line-height: 1.5;
}
.paper td,
.paper th {
  padding: 8px;
  border: 1px solid var(--line);
}
.paper math {
  font-size: 15px;
}
.paper pre {
  white-space: pre-wrap;
}
.document-footer {
  padding: 15px 35px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #9ca69a;
}
.editor-help {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  padding: 20px 30px;
  color: var(--muted);
}
#editor {
  resize: none;
  border: 0;
  border-radius: 0;
  width: 100%;
  height: calc(100vh - 320px);
  padding: 0 32px 50px;
  font:
    13px/1.85 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: #41544a;
  outline: none;
  tab-size: 2;
}
.evidence {
  padding: 30px 24px 0;
  background: #f7f8f3;
  border-left: 1px solid var(--line);
  overflow: auto;
}
.evidence-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 25px;
}
.yellow-dot,
.green-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #dfc461;
  flex-shrink: 0;
}
.green-dot {
  background: #7d9c73;
}
#evidence-empty {
  padding: 65px 12px 0;
}
#evidence-empty h2 {
  font:
    29px/1.3 Georgia,
    serif;
  margin: 24px 0 17px;
}
#evidence-empty p {
  font-size: 12px;
  line-height: 1.85;
  color: #869083;
}
.legend {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: #87917e;
  margin-top: 18px;
}
.evidence-illustration {
  width: 102px;
  height: 125px;
  background: #fff;
  border: 1px solid #e0e4d9;
  border-radius: 4px;
  transform: rotate(-5deg);
  padding: 15px;
  position: relative;
  box-shadow: 7px 8px 0 #e9ede1;
}
.evidence-illustration span {
  font: 30px Georgia;
  color: #a0ae89;
}
.evidence-illustration i {
  display: block;
  height: 3px;
  background: #e0e6d5;
  margin: 8px 0;
}
.evidence-illustration mark {
  position: absolute;
  top: 72px;
  left: 12px;
  width: 80px;
  height: 12px;
  background: #f4db7280;
}
.source-heading h2 {
  font:
    20px/1.45 Georgia,
    serif;
  margin: 12px 0;
}
.source-heading p {
  font-size: 11px;
  color: #83917f;
  line-height: 1.6;
}
.pill {
  font-size: 9px;
  background: #e6eddf;
  color: #61804d;
  padding: 5px 7px;
  border-radius: 4px;
}
.pill.pending {
  background: #f2e9d6;
  color: #9b7936;
}
.evidence-card {
  border: 1px solid #e2e7d8;
  background: #fffef9;
  border-radius: 8px;
  margin: 18px 0;
  padding: 16px;
}
.evidence-card h3 {
  font-size: 11px;
  margin: 0 0 10px;
}
.evidence-card p {
  font-size: 12px;
  line-height: 1.75;
  color: #718068;
  margin: 0;
}
.anchor-text {
  font:
    13px/1.65 Georgia,
    serif;
  border-left: 2px solid #d8d9bd;
  padding: 0 0 0 10px;
  margin: 12px 0;
  color: #7a826c;
  max-height: 150px;
  overflow: auto;
}
.reason-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--line);
  margin: 10px 0;
}
.subtle {
  font-size: 10px;
  color: #869079;
}
.claim {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  padding: 13px;
  margin: 10px 0;
  border-radius: 7px;
}
.claim.selected {
  border-color: #d9bf61;
  background: #fffbeb;
}
.claim blockquote {
  font:
    13px/1.65 Georgia,
    serif;
  margin: 9px 0;
  color: #536047;
}
.claim .claim-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #929a84;
}
.claim small {
  font-size: 10px;
  line-height: 1.5;
  display: block;
  color: #8b937a;
}
.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  margin: 10px 0;
}
.pdf-controls button {
  padding: 5px 9px;
}
.pdf-page {
  position: relative;
  background: white;
  border: 1px solid #dfe2d6;
  border-radius: 5px;
  overflow: auto;
  max-height: 460px;
}
.pdf-page img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}
.pdf-warning {
  font-size: 10px;
  color: #977e38;
  line-height: 1.6;
}
.evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0;
}
.evidence-actions button,
.evidence-actions a {
  font-size: 10px;
  text-decoration: none;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.login {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fcfcf7;
}
.login form {
  width: 360px;
  max-width: 85%;
  margin: auto;
}
.brand-mark {
  font: 64px Georgia;
  letter-spacing: -6px;
}
.brand-mark span {
  color: #b3bf68;
}
.login h1 {
  font: 40px/1.2 Georgia;
  margin: 25px 0;
}
.login .primary {
  width: 100%;
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
}
#login-error {
  color: #b05c43;
  font-size: 12px;
}
.login-art {
  background: #e5eadb;
  padding: 100px 70px;
  position: relative;
  overflow: hidden;
}
.login-art > span {
  font-size: 10px;
  letter-spacing: 2px;
  color: #879576;
}
.login-art blockquote {
  margin: 100px 0 0;
  font: 47px/1.3 Georgia;
  color: #456345;
}
.login-art p {
  position: absolute;
  bottom: 50px;
  font-size: 12px;
  color: #7a8b6d;
}
.line-art {
  height: 300px;
  width: 500px;
  border: 1px solid #a9ba8c;
  border-radius: 50%;
  transform: rotate(-30deg);
  position: absolute;
  bottom: 100px;
  right: -100px;
}
.line-art:after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid #b3c299;
  border-radius: 50%;
}
.empty {
  padding: 80px 40px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  width: min(660px, 92vw);
  max-height: 85vh;
  overflow: auto;
  color: var(--ink);
  box-shadow: 0 30px 100px #0003;
}
dialog::backdrop {
  background: #203b3655;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font: 27px Georgia;
  margin: 5px 0 20px;
}
dialog p {
  line-height: 1.7;
  font-size: 13px;
  color: var(--muted);
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 24px;
}
dialog textarea {
  width: 100%;
  min-height: 100px;
}
dialog pre {
  font-size: 11px;
  white-space: pre-wrap;
  background: #f5f6f1;
  padding: 16px;
  max-height: 180px;
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #25483d;
  color: white;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 10;
  box-shadow: 0 5px 25px #0002;
  max-width: 90vw;
}
.history-row {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.wide-pdf {
  width: 100%;
}
.check-label {
  display: flex;
  gap: 10px;
}
.check-label input {
  width: auto;
}
@media (min-width: 1650px) {
  .paper {
    font-size: 18px;
    padding: 40px 65px;
  }
  .evidence {
    padding: 32px;
  }
  .document-toolbar,
  .document-meta {
    margin-left: 60px;
    margin-right: 60px;
  }
}
@media (max-width: 1150px) {
  header {
    gap: 10px;
    padding: 0 18px;
  }
  .header-actions button {
    font-size: 11px;
  }
  .document-toolbar,
  .document-meta {
    margin-left: 24px;
    margin-right: 24px;
  }
  .paper {
    padding: 25px;
    font-size: 16px;
  }
  .evidence {
    padding: 25px 16px;
  }
  .side-top h2 {
    font-size: 19px;
  }
}
@media (max-width: 850px) {
  header {
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    padding: 14px;
  }
  #project-select {
    max-width: 200px;
  }
  .header-actions {
    width: 100%;
    margin: 0;
  }
  .workspace-grid {
    height: auto;
  }
  .sidebar {
    min-height: 75vh;
  }
  .manuscript {
    min-height: 75vh;
  }
  .evidence {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    padding-bottom: 30px;
  }
  .paper-scroll {
    max-height: 65vh;
  }
  .document-toolbar {
    margin: 0 18px;
  }
  .document-toolbar h1 {
    font-size: 21px;
  }
  .document-meta {
    margin: 0 18px;
    gap: 8px;
  }
  .document-footer {
    padding: 12px;
    gap: 10px;
  }
  .login-art {
    display: none;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .evidence-illustration {
    display: none;
  }
  #evidence-empty {
    padding: 0 10px;
  }
  .evidence-heading {
    padding-bottom: 10px;
  }
  #evidence-empty h2 br {
    display: none;
  }
}
@media (max-width: 520px) {
  .sidebar {
    min-height: 0;
    padding: 12px;
  }
  .side-top,
  .side-bottom,
  .side-footer,
  .nav-heading {
    display: none;
  }
  #files {
    display: flex;
    padding: 0;
    overflow: auto;
    max-height: none;
  }
  .file-item {
    min-width: max-content;
    margin-right: 5px;
    width: auto;
  }
  .file-num {
    display: none;
  }
  .manuscript {
    min-height: 70vh;
  }
  .document-meta button {
    font-size: 9px;
  }
  .paper {
    font-size: 16px;
  }
  .header-divider {
    display: none;
  }
  .brand {
    font-size: 25px;
  }
  #project-select {
    max-width: 230px;
  }
  .document-toolbar {
    padding: 20px 0;
  }
  .evidence {
    grid-column: auto;
  }
  .header-actions button {
    padding: 9px;
  }
  .login h1 {
    font-size: 34px;
  }
}

#claim-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 3px;
}
.evidence-card {
  margin: 14px 0;
}
/* Writing, library and collaboration surfaces. */
.top-nav {
  display: flex;
  gap: 3px;
}
.top-nav button {
  font-size: 12px;
  color: #7b897d;
}
.top-nav button.active {
  color: #245c4e;
  background: #e9eee4;
}
.header-actions {
  gap: 1px;
}
.header-actions button {
  font-size: 11px;
  padding: 9px;
}
.library-launch {
  text-align: left;
  border: 1px solid #dce4d2;
  padding: 16px;
  background: #eff2e8;
}
.library-launch span {
  display: block;
  font:
    17px Georgia,
    serif;
}
.library-launch small {
  display: block;
  margin: 10px 0;
  color: #8a967c;
  font-size: 10px;
}
.library-launch b {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #537344;
}
.panel-switches {
  display: flex;
  gap: 5px;
  padding: 10px 24px;
  border-bottom: 1px solid #eef0e9;
  background: #fcfdf9;
  align-items: center;
}
.panel-switches button {
  font-size: 10px;
  padding: 6px 9px;
  color: #7d8c73;
}
.panel-switches #toggle-right {
  margin-left: auto;
}
.panel-switches button.active {
  background: #e9eee1;
  color: #385d3e;
}
.document-toolbar {
  padding-top: 22px;
}
.document-toolbar .view-tabs button {
  padding: 7px 10px;
}
#insert-toolbar {
  display: flex;
  padding: 8px 28px;
  align-items: center;
  border-bottom: 1px solid #edf0e8;
  gap: 2px;
}
#insert-toolbar button {
  font-size: 11px;
  padding: 7px 9px;
}
#insert-position {
  font-size: 9px;
  color: #91a082;
  margin-left: auto;
}
.workspace-grid.left-closed .sidebar {
  display: none;
}
.workspace-grid.right-closed .evidence {
  display: none;
}
.focus-mode .paper {
  max-width: 900px;
  padding: 40px 70px 90px;
}
.focus-mode .document-toolbar,
.focus-mode .document-meta {
  width: calc(100% - 80px);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
.focus-mode .manuscript {
  background: #fffefa;
}
.focus-mode .paper-scroll {
  background: #fffefa;
}
.evidence-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  gap: 5px;
}
.evidence-heading button {
  font-size: 11px;
  padding: 6px;
}
.evidence-heading .active {
  color: #496947;
  border-bottom: 2px solid #a9b682;
  border-radius: 0;
}
.evidence-heading #close-right {
  margin-left: auto;
  font-size: 21px;
}
.evidence {
  padding-top: 15px;
}
.library-view > .sidebar,
.library-view > .manuscript {
  display: none;
}
.library-view > #library-page {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.library-view > .evidence {
  display: block !important;
  padding: 30px 38px;
}
.library-view .source-heading h2 {
  font-size: 26px;
}
.library-view .source-heading p {
  font-size: 13px;
}
.library-view .reason-input {
  font-size: 14px;
}
.library-view .claim blockquote {
  font-size: 15px;
}
.library-view #claim-list {
  max-height: 300px;
}
.library-view .pdf-page {
  max-height: 75vh;
}
.library-view .anchor-text {
  font-size: 14px;
}
.library-page-top {
  padding: 32px 30px 22px;
  border-bottom: 1px solid var(--line);
}
.library-page-top h1 {
  font:
    32px Georgia,
    serif;
  margin: 12px 0;
}
.library-page-top p:not(.eyebrow) {
  font-size: 12px;
  color: #8b977f;
  line-height: 1.7;
}
.library-tools {
  display: flex;
  gap: 8px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}
.library-tools input {
  flex: 1;
  min-width: 180px;
  font-size: 12px !important;
  margin: 0 !important;
}
.library-tools select {
  max-width: 150px;
  font-size: 11px;
}
.library-tools button {
  font-size: 11px;
}
.library-page-top #source-total {
  font-size: 10px;
  color: #8d9981;
}
#library-page > #sources {
  overflow: auto;
  padding: 8px 24px 30px;
}
.source-item:hover,
.source-item.active {
  background: #f3f6ed;
}
.source-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}
.source-row-head .pill {
  font-size: 9px;
}
.source-item .doi-text {
  display: block;
  font-size: 10px;
  color: #839779;
  margin-top: 9px;
  word-break: break-word;
}
.source-row-head .pdf-badge {
  margin-left: auto;
  font-size: 9px;
  color: #8ca071;
}
.paper figure {
  margin: 25px 0;
  padding: 18px;
  border: 1px solid #e0e6d8;
  border-radius: 8px;
  background: #fbfcf7;
}
.paper figure img {
  max-width: 100%;
  max-height: 550px;
  display: block;
  margin: auto;
}
.paper figcaption {
  font:
    13px/1.6 Georgia,
    serif;
  text-align: center;
  margin: 13px 0 3px;
}
.component-edit {
  font:
    10px -apple-system,
    sans-serif;
  display: block;
  margin: 10px auto 0;
  color: #879876;
}
.paper .table-overflow {
  overflow: auto;
}
.paper .table-overflow table {
  display: table;
  min-width: 70%;
  margin: auto;
  font-size: 13px;
  border: 0;
}
.paper .table-overflow th {
  background: #eef2e6;
  font-weight: 600;
}
.asset-missing {
  font: 12px sans-serif;
  color: #a17b44;
  padding: 15px;
  background: #fff9ed;
}
.visual-block {
  position: relative;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 12px 15px;
  margin: 0 -15px 10px;
  cursor: default;
}
.visual-block:hover,
.visual-block:focus-within,
.visual-block.selected {
  border-color: #e3e9d9;
  background: #fbfcf6;
}
.visual-block .block-tools {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  font: 10px sans-serif;
}
.block-tools button {
  font-size: 10px;
  padding: 5px 8px;
}
.visual-block p {
  margin-bottom: 10px;
}
.visual-block h1 {
  display: block !important;
}
.visual-block h1,
.visual-block h2 {
  margin: 10px 0;
}
.prose-editor {
  font:
    18px/1.85 Georgia,
    serif;
  min-height: 170px;
  max-height: 45vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  background: #fffef9;
}
.prose-editor a {
  background: #e9eddf;
  font: 11px sans-serif;
  text-decoration: none;
  padding: 3px;
}
.format-bar {
  display: flex;
  gap: 4px;
  margin: 12px 0;
}
.format-bar button {
  border: 1px solid var(--line);
  padding: 7px 13px;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.form-error {
  color: #a15436;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.component-form label {
  margin-top: 12px;
}
.component-kind {
  display: flex;
  gap: 6px;
  margin: 15px 0;
}
.component-kind button {
  border: 1px solid var(--line);
  font-size: 12px;
}
.component-kind .active {
  background: #e6eddd;
  border-color: #adb994;
}
.figure-code {
  min-height: 230px;
  font:
    12px/1.7 ui-monospace,
    monospace !important;
}
.figure-result {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
}
.figure-result img {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin: auto;
}
.table-options {
  display: flex;
  gap: 12px;
  align-items: center;
}
.table-options label {
  font-size: 11px;
  margin: 8px 0;
}
.table-options input[type="number"] {
  width: 75px;
}
.table-editor-scroll {
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.table-editor {
  border-collapse: collapse;
  min-width: 100%;
}
.table-editor td {
  border: 1px solid var(--line);
  padding: 0;
}
.table-editor input {
  border: 0;
  min-width: 110px;
  width: 100%;
  border-radius: 0;
  padding: 10px;
  font-size: 12px;
}
.table-editor tr:first-child input {
  background: #eff3e8;
  font-weight: 600;
}
.discuss-title {
  font:
    24px Georgia,
    serif;
  margin: 18px 0;
}
.comment-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  padding: 15px;
}
.comment-card.resolved {
  opacity: 0.6;
}
.comment-author {
  font-size: 11px;
  color: #52694b;
  font-weight: 600;
}
.comment-date {
  font-size: 11px;
  color: var(--muted);
  margin-left: 7px;
}
.comment-body {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.comment-anchor {
  font:
    13px/1.6 Georgia,
    serif;
  color: #859373;
  border-left: 2px solid #d8d4a7;
  padding-left: 10px;
  margin: 12px 0;
  max-height: 130px;
  overflow: auto;
}
.comment-reply {
  border-top: 1px solid #edf0e5;
  margin-top: 10px;
  padding-top: 12px;
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.comment-actions button {
  font-size: 12px;
  padding: 6px;
}
.comment-compose {
  width: 100%;
  min-height: 100px;
  font-size: 13px;
  line-height: 1.6;
}
.member-row {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.member-row .member-name {
  flex: 1;
  font-size: 13px;
}
.member-row small {
  display: block;
  color: #8f9a82;
  font-size: 10px;
  margin-top: 5px;
}
.member-row select {
  font-size: 11px;
  max-width: 150px;
}
.invite-link {
  display: flex;
  gap: 8px;
  background: #eff4e9;
  border: 1px solid #dce6cd;
  padding: 12px;
  border-radius: 7px;
  margin: 15px 0;
}
.invite-link input {
  font-size: 11px;
  min-width: 0;
}
.invitation-note {
  padding: 14px;
  background: #edf3e3;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.7;
}
.no-edit .edit-only,
.no-edit .component-edit,
.no-edit #history {
  display: none !important;
}
.no-comment .comment-write {
  display: none !important;
}
.not-owner .owner-only {
  display: none !important;
}
#modal:has(.component-form),
#modal:has(.prose-editor) {
  width: min(860px, 94vw);
}
.paper table th,
.paper table td {
  white-space: normal;
}
.paper .table-overflow {
  max-width: 100%;
}
.toast-in-dialog {
  color: #a15436;
  padding: 10px 0;
  font-size: 12px;
}
@media (max-width: 1200px) {
  .header-actions #new-project {
    max-width: 70px;
    font-size: 10px;
  }
  .top-nav button {
    padding: 7px;
    font-size: 11px;
  }
  .library-view > .evidence {
    padding: 20px;
  }
  .document-toolbar .view-tabs button {
    padding: 6px 8px;
  }
}
@media (max-width: 850px) {
  .workspace-grid.library-view {
    height: auto;
  }
  .library-view > .evidence {
    grid-column: 1;
    min-height: 300px;
  }
  .library-view #sources {
    max-height: 50vh;
  }
  .library-page-top {
    padding: 20px;
  }
  .header-actions #new-project {
    max-width: none;
  }
  .panel-switches {
    padding: 8px;
    flex-wrap: wrap;
  }
  .document-toolbar .view-tabs {
    flex-wrap: wrap;
  }
  .focus-mode .paper {
    padding: 30px;
  }
  .paper-scroll {
    max-height: 70vh;
  }
  #insert-position {
    display: none;
  }
  .top-nav {
    margin-left: auto;
  }
  .workspace-grid.library-view .evidence {
    display: block !important;
  }
  .workspace-grid.right-closed > .evidence {
    display: none;
  }
  .paper .component-edit {
    font-size: 10px;
  }
  .sidebar .side-top h2 {
    font-size: 18px;
  }
}
@media (max-width: 520px) {
  .header-actions {
    flex-wrap: wrap;
  }
  .document-toolbar h1 {
    font-size: 20px;
  }
  .view-tabs button {
    font-size: 12px !important;
  }
  .panel-switches button {
    padding: 8px;
    font-size: 11px;
    min-height: 40px;
  }
  .document-toolbar {
    gap: 12px;
  }
  .focus-mode .document-toolbar,
  .focus-mode .document-meta {
    width: calc(100% - 36px);
  }
  .library-tools select {
    max-width: 120px;
  }
  .library-view .source-heading h2 {
    font-size: 22px;
  }
  .figure-code {
    min-height: 180px;
  }
  .table-options {
    flex-wrap: wrap;
  }
  .paper {
    padding: 22px;
  }
  .document-footer span:last-child {
    max-width: 130px;
    text-align: right;
  }
}
.focus-mode #insert-toolbar,
.focus-mode #history,
.focus-mode .view-tabs {
  display: none;
}
/* Passage evidence and a keyboard-accessible adjustable right pane. */
.passage-context {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.passage-context-title {
  font-size: 11px;
  font-weight: 600;
  color: #718567;
  margin-bottom: 10px;
}
.passage-context > button,
#selection-library {
  font-size: 11px;
  color: var(--green);
  padding-left: 0;
}
.passage-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}
.passage-source-tabs button {
  font-size: 11px;
  border: 1px solid var(--line);
  background: white;
  padding: 6px 9px;
}
.passage-source-tabs button.active {
  background: #e5ecdc;
  border-color: #a4b690;
}
.source-heading h2 {
  overflow-wrap: anywhere;
}
::highlight(active-passage) {
  background: #f6e9ac;
  color: #253b39;
}
.paper ::selection {
  background: #f6e9ac;
  color: #253b39;
}
#evidence-resizer {
  display: none;
}
@media (min-width: 851px) {
  .workspace-grid {
    --sidebar-width: 238px;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(
        --evidence-width,
        380px
      );
  }
  .workspace-grid.left-closed {
    grid-template-columns: minmax(0, 1fr) var(--evidence-width, 380px);
  }
  .workspace-grid.right-closed {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .workspace-grid.left-closed.right-closed {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-grid.library-view {
    grid-template-columns: minmax(0, 1fr) var(--evidence-width, 50%);
  }
  #evidence-resizer {
    display: block;
    position: absolute;
    z-index: 4;
    top: 0;
    bottom: 0;
    right: calc(var(--evidence-width, 380px) - 6px);
    width: 12px;
    cursor: col-resize;
    touch-action: none;
    outline-offset: -3px;
  }
  #evidence-resizer::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ccd5c4;
    opacity: 0;
    transition: opacity 0.15s;
  }
  #evidence-resizer span {
    position: absolute;
    left: 3px;
    top: 46%;
    width: 6px;
    height: 48px;
    border-radius: 5px;
    background: #aebca2;
    box-shadow: 0 0 0 3px #f7f8f3;
    opacity: 0.7;
  }
  #evidence-resizer:hover::before,
  #evidence-resizer:focus-visible::before,
  .resizing-panel #evidence-resizer::before {
    opacity: 1;
  }
  #evidence-resizer:hover span,
  #evidence-resizer:focus-visible span {
    background: #537e63;
    opacity: 1;
  }
  .workspace-grid.right-closed:not(.library-view) #evidence-resizer {
    display: none;
  }
  .resizing-panel,
  .resizing-panel * {
    cursor: col-resize !important;
    user-select: none !important;
  }
}
@media (min-width: 1650px) {
  .workspace-grid {
    --sidebar-width: 260px;
  }
}
@media (min-width: 851px) and (max-width: 1200px) {
  .workspace-grid {
    --sidebar-width: 200px;
  }
}

@media (max-width: 850px) {
  .workspace-grid,
  .workspace-grid.right-closed {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .workspace-grid.left-closed,
  .workspace-grid.library-view {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .workspace-grid,
  .workspace-grid.right-closed,
  .workspace-grid.left-closed {
    grid-template-columns: 1fr;
  }
}

/* Comments retain their exact text selection without changing manuscript markup. */
::highlight(comment-passages) {
  background: #f7edc5;
  text-decoration: underline #cbb35e;
}
::highlight(active-comment),
::highlight(comment-draft) {
  background: #f0d984;
  color: #253b39;
}
.selection-comment {
  position: fixed;
  z-index: 15;
  background: var(--green);
  color: white;
  padding: 10px 14px;
  box-shadow: 0 4px 18px #173a3326;
  border: 1px solid #ffffffaa;
  font-size: 12px;
}
.comment-card.active {
  border-color: #b7a254;
  box-shadow: 0 0 0 2px #eee4ba;
}
.comment-jump {
  display: block;
  width: 100%;
  text-align: left;
  background: #fbfaf3;
  border-radius: 0;
  color: #55634d;
}
.comment-jump small {
  display: block;
  font: 10px/1.6 sans-serif;
  margin-top: 6px;
  color: #7b805f;
}
.comment-jump:focus-visible {
  outline: 2px solid var(--green);
}
#comment-composer {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.reading-view .component-edit {
  display: none;
}
.document-toolbar > div {
  min-width: 0;
}
#file-label {
  overflow-wrap: anywhere;
}
#toggle-left[aria-expanded="true"],
#toggle-right[aria-expanded="true"],
#comments[aria-expanded="true"] {
  color: var(--green);
  background: #e9eee5;
}
.discard-confirm {
  position: sticky;
  top: -1px;
  z-index: 2;
  background: #fff8e7;
  border: 1px solid #dbc58e;
  border-radius: 8px;
  padding: 18px;
  margin: 20px 0;
  box-shadow: 0 4px 18px #253b3912;
}
.discard-confirm p {
  margin: 8px 0;
}
.comment-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 12px;
}
.comment-filters button {
  font-size: 12px;
  border: 1px solid var(--line);
  background: white;
}
.comment-filters button[aria-pressed="true"] {
  background: #e5ecdf;
  border-color: #99ac8d;
  color: var(--green);
}
.comment-filters span {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
.empty-search {
  padding: 24px 12px;
}
.empty-search h2 {
  font:
    22px Georgia,
    serif;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
