.review-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fbfcfa;
  color: var(--ink);
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
}
.review-page .top {
  flex: none;
}
.review-page .top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.back-link {
  margin-left: auto;
  color: var(--mint);
  text-decoration: none;
  white-space: nowrap;
}
.review-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.version-rail,
.discussion-rail {
  min-height: 0;
  padding: 20px 14px;
  overflow: auto;
  background: white;
}
.version-rail {
  border-right: 1px solid var(--line);
}
.discussion-rail {
  border-left: 1px solid var(--line);
}
.rail-heading,
.version-line,
.tag-row,
.thread-title,
.thread-actions,
.form-actions,
.tags-line,
#tags,
.review-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-heading {
  justify-content: space-between;
  margin: 0 2px 16px;
}
.rail-heading h2 {
  font-size: 17px;
  letter-spacing: -0.03em;
}
.counter {
  color: #536d69;
  background: #edf2ed;
  padding: 2px 7px;
  border-radius: 12px;
  font:
    12px ui-monospace,
    monospace;
}
.review-page .solid {
  background: #096c60;
  color: white;
  border: 1px solid #096c60;
}
.solid:hover {
  background: #08584f;
}
.version-rail > .solid,
.version-rail input {
  width: 100%;
  margin-bottom: 10px;
}
.version-rail input {
  padding: 9px;
  font-size: 13px;
}
.version-item {
  display: block;
  position: relative;
  padding: 12px 10px 12px 17px;
  margin: 3px 0;
  text-decoration: none;
  border-radius: 6px;
  border-left: 3px solid transparent;
}
.version-item[aria-current='page'] {
  background: #e4f3ec;
  border-left-color: #087467;
}
.version-item:hover {
  background: #eef5f1;
}
.version-item strong {
  display: block;
  overflow-wrap: anywhere;
}
.subtle,
.version-item small,
#version-meta {
  color: #586c72;
  font-size: 12px;
  line-height: 1.5;
}
.version-item small {
  display: block;
  margin: 4px 0;
}
.review-center {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.review-heading {
  justify-content: space-between;
  padding: 18px 22px 7px;
  background: #fff;
}
.version-line {
  flex-wrap: wrap;
}
.version-line h1 {
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.review-heading button {
  white-space: nowrap;
}
#version-meta {
  margin: 5px 0;
}
.pill,
.tag {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}
.pill.review {
  background: #e1ebfa;
  color: #344e76;
}
.pill.approved {
  background: #d7f1e3;
  color: #176044;
}
.pill.changes {
  background: #fff0d9;
  color: #884b10;
}
.tag {
  background: #ebeaf7;
  color: #514581;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tags-line {
  padding: 0 22px 12px;
  background: white;
}
.tags-line #tags {
  flex-wrap: wrap;
}
.tags-line button,
.thread-actions button,
.rail-heading button {
  font-size: 12px;
  padding: 4px 8px;
}
.thread-filters button[aria-pressed='true'] {
  background: #e2f2eb;
  color: #075e52;
  border-color: #79af9f;
}
.thread-filters {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.thread-filters button {
  padding: 5px 7px;
  font-size: 12px;
}
.thread-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.thread-card.active {
  border-left: 3px solid #c47835;
  padding-left: 9px;
}
.thread-title {
  font-weight: 650;
  width: 100%;
  text-align: left;
  border: none;
  padding: 0;
  background: none;
}
.pin-num {
  font:
    700 12px ui-monospace,
    monospace;
  background: #a65220;
  color: white;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
}
.thread-card.done .pin-num {
  background: #56746d;
}
.thread-message {
  margin: 9px 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}
.thread-actions {
  flex-wrap: wrap;
  margin-top: 10px;
}
.thread-actions .accept {
  background: #dff3e7;
  color: #126044;
}
.thread-empty {
  padding: 22px 3px;
  line-height: 1.55;
  font-size: 14px;
  color: #596e70;
}
.thread-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #233e45;
}
.reply {
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin: 12px 0;
}
.proposal-name {
  font-weight: 650;
  font-size: 14px;
  color: #805121;
  margin-top: 8px;
}
#review-dialog {
  width: min(440px, 94vw);
}
#review-form {
  display: grid;
  gap: 13px;
}
#review-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
#review-form input,
#review-form textarea,
#review-form select {
  width: 100%;
  padding: 8px 10px;
}
#review-form textarea {
  min-height: 86px;
  resize: vertical;
}
.form-actions {
  justify-content: flex-end;
}
.form-error {
  font-size: 13px;
  color: #a13720;
}
.tag-row {
  justify-content: space-between;
}
.tag-row button {
  font-size: 12px;
  padding: 4px 8px;
}
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: #1a373c;
  color: white;
  border-radius: 8px;
  z-index: 8;
  max-width: 90vw;
}
@media (max-width: 1050px) {
  .review-workspace {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .version-rail,
  .discussion-rail {
    padding: 14px 9px;
  }
  .review-heading {
    padding: 12px;
  }
  .review-heading button {
    white-space: normal;
  }
}
@media (max-width: 760px) {
  .review-page {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  .review-workspace {
    display: flex;
    flex-direction: column;
  }
  .version-rail {
    max-height: 180px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .version-rail .rail-heading,
  .version-rail input,
  .version-rail > .solid {
    margin: 0;
  }
  .version-rail nav {
    grid-column: 1/-1;
    display: flex;
    overflow: auto;
  }
  .version-item {
    flex: 0 0 auto;
    padding: 5px 8px;
  }
  .version-rail input {
    grid-column: 1/-1;
  }
  .review-center {
    min-height: 58dvh;
  }
  .discussion-rail {
    border-left: 0;
  }
  .review-page .top .crumb,
  .review-page .top .slash {
    display: none;
  }
  .review-page .top {
    gap: 8px;
  }
}
.form-fields {
  display: grid;
  gap: 12px;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.diff-list {
  max-height: 58vh;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.diff-list details {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
}
.diff-list summary {
  cursor: pointer;
}
.diff-list summary b {
  color: var(--accent);
}
.diff-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.5 ui-monospace,
    monospace;
  background: #f5f7f5;
  padding: 6px;
}
.diff-list details > strong {
  display: block;
  margin-top: 12px;
}
@media (max-width: 760px) {
  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.message-by {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.message-by strong {
  color: #243f46;
}
.message-by time {
  margin-left: auto;
  font-size: 11px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #dcebe8;
  color: #326257;
  font-size: 11px;
  font-weight: 700;
}
.reply .avatar {
  background: #e9e6f2;
  color: #655380;
}
.thread-view {
  margin: 4px 0 0 31px;
  color: #60757b;
  font-size: 11px;
}
.message-item {
  margin-top: 13px;
}
.message-item .thread-message {
  margin: 6px 0 0;
}
.version-rail > .solid {
  font-size: 12px;
  padding: 8px 5px;
}

#dialog #reviewer-name {
  width: 100%;
}
#dialog-body form .primary {
  justify-self: end;
}
#leave-review {
  padding: 6px 9px;
}
#leave-review {
  border-color: transparent;
  background: transparent;
  color: #45605a;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#board-notes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.board-note {
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  width: min(180px, 92%);
  border: 1px solid #d9be68;
  border-radius: 2px 9px 2px 2px;
  background: linear-gradient(165deg, #fff3b7, #ffeb97);
  color: #483918;
  box-shadow: 1px 3px 8px #3e341825;
  overflow-wrap: anywhere;
}
.board-note::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #dfc369 49%, #fff8db 51%);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.board-note.selected {
  z-index: 1;
  outline: 2px solid #9d7325;
  outline-offset: 1px;
}
.board-note.resolved {
  background: #edf3e5;
  border-color: #adbea4;
}
.board-note .note-body {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px 12px 8px;
  background: none;
  border: 0;
  font-weight: 400;
  color: inherit;
}
.note-by,
.note-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.note-by {
  font-size: 11px;
  line-height: 1.4;
  color: #5a4b29;
  min-width: 0;
}
.note-by strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.note-number {
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.note-block {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}
.note-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 6px;
}
.note-footer {
  justify-content: flex-end;
  margin: 0 10px;
  padding: 3px 0 5px;
  border-top: 1px solid #856a252c;
}
.note-link {
  padding: 2px;
  border: 0;
  background: transparent;
  color: #5c4a23;
  font-size: 11px;
}
.note-composer {
  z-index: 3;
  width: min(224px, 97%);
  padding: 10px 12px;
  display: grid;
  gap: 7px;
  max-height: 100%;
  overflow: auto;
  touch-action: auto;
}
.note-composer label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: #655125;
}
.note-composer textarea,
.note-composer input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #fff9df;
  padding: 6px;
  color: #3b321e;
  font-size: 14px;
  line-height: 1.4;
}
.note-composer textarea {
  min-height: 55px;
  resize: none;
}
.note-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.note-compose-actions button {
  padding: 4px 7px;
  font-size: 12px;
}
.note-context {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-leaders {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.editing:not(.reviewing) .review-only,
.reviewing #manage,
.reviewing .history,
.reviewing .inspector-foot,
.reviewing #inspector:not([hidden]) ~ #editor-discussions {
  display: none !important;
}
.reviewing .solid {
  background: #096c60;
  color: white;
  border-color: #096c60;
}
.review-bar-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.review-bar-actions button {
  font-size: 12px;
  padding: 5px 8px;
}
#editor-discussions {
  width: min(310px, 28vw);
  flex: none;
}
.reviewing .board-note {
  user-select: text;
}
.reviewing .zoom {
  z-index: 3;
}
.reviewing #stage[data-tool='comment'],
.reviewing #stage[data-tool='block'] {
  cursor: crosshair;
}
.reviewing #save {
  color: #c9f4df;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reviewing .toolset button:disabled {
  opacity: 0.45;
}
.review-center {
  align-self: start;
  background: white;
  border-bottom: 1px solid var(--line);
}
.review-page .review-center {
  margin: clamp(12px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: min(620px, calc(100% - 2 * clamp(12px, 4vw, 50px)));
  min-height: 0;
}
@media (max-width: 900px) {
  #editor-discussions {
    position: absolute;
    top: var(--sheet-bar-height);
    right: 0;
    bottom: 0;
    z-index: 4;
    width: min(300px, 85vw);
    box-shadow: 0 4px 12px #152b381c;
  }
}
@media (max-width: 650px) {
  .reviewing .sheet-bar {
    height: auto;
    min-height: var(--sheet-bar-height);
    flex-wrap: wrap;
  }
  .reviewing #view {
    max-width: 42vw;
  }
  .reviewing #save {
    max-width: 100%;
  }
  .review-bar-actions {
    margin-left: 0;
  }
  .review-page .review-center {
    align-self: center;
  }
}
.previewing-version #review-palette,
.previewing-version #leave-review {
  display: none;
}
#start-review {
  background: #edf5f1;
  color: #174f45;
  padding: 5px 12px;
}
.version-picker select {
  max-width: min(17vw, 175px);
}
@media (max-width: 650px) {
  .sheet-bar {
    height: auto;
    min-height: var(--sheet-bar-height);
    flex-wrap: wrap;
  }
  .version-picker select {
    max-width: 24vw;
  }
}

#latest-version {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: white;
  border-bottom: 1px solid var(--line);
}
#latest-version[aria-current='page'] {
  background-color: #e4f3ec;
}
@media (max-width: 760px) {
  #latest-version {
    left: 0;
    top: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  #publications {
    display: flex;
  }
}
