.version-history {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.version-history h3 {
  margin: 0 0 9px;
  font-size: 11px;
}
.version-history a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
}
.version-history span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border-radius: 4px;
  background: #f6e4e5;
  color: #b01720;
  font-size: 9px;
  font-weight: 800;
}
.version-history small {
  color: #777;
  font-size: 9px;
}

.asset-header {
  align-items: flex-start;
}
.asset-upload-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.asset-upload-actions input,
.attachment-picker input {
  display: none;
}
.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.material-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.material-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.material-card > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
}
.material-card b {
  font-size: 10px;
  color: var(--red);
}
.material-card span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-card small {
  font-size: 8px;
  color: var(--muted);
}
.material-card button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 9px;
  cursor: pointer;
}
.format-box {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.format-box legend {
  padding: 0 6px;
  font-weight: 800;
}
.format-modes {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}
.format-modes label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.format-modes input {
  width: auto;
}
.format-fields,
.inline-format {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.format-box > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}
.is-hidden {
  display: none !important;
}
.new-task-layout .sticky-actions {
  position: static;
}
.attachment-picker {
  position: relative;
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #c7bcae;
  border-radius: 9px;
  background: #fbfaf8;
  cursor: pointer;
}
.attachment-picker b {
  margin-top: 8px;
  color: var(--red);
}
.attachment-picker small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}
.attachment-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.attachment-list > div {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  border-radius: 6px;
  background: #f2eee8;
  font-size: 9px;
}
.attachment-list button {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
}
.image-review-stage {
  position: relative;
  width: 100%;
  line-height: 0;
  user-select: none;
}
.image-review-stage > img {
  display: block;
  width: 100%;
  height: auto;
}
.artwork-detail-button {
  position: absolute;
  z-index: 6;
  right: 14px;
  bottom: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(26, 18, 16, 0.82);
  color: #fff;
  font: 750 12px/1 inherit;
  cursor: zoom-in;
}
.annotation-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}
.text-hit-region {
  position: absolute;
  box-sizing: border-box;
  padding: 0;
  border: 2px dashed transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition:
    border-color 0.1s,
    background 0.1s,
    box-shadow 0.1s;
}
.text-hit-region:hover,
.text-hit-region:focus-visible {
  border-color: #2877ff;
  background: rgba(40, 119, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}
.text-hit-region.is-selected {
  border-color: #2877ff;
  background: rgba(40, 119, 255, 0.08);
  box-shadow: 0 0 0 1px #fff;
}
.text-hit-region b {
  position: absolute;
  top: -16px;
  left: -2px;
  display: grid;
  width: 18px;
  height: 16px;
  place-items: center;
  border-radius: 3px 3px 0 0;
  background: #2877ff;
  color: #fff;
  font: 800 9px/1 sans-serif;
}
.text-region-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border-radius: 7px;
  background: #f4f6f8;
  color: #60656d;
  font-size: 9px;
  line-height: 1.4;
}
.text-region-status i {
  width: 12px;
  height: 12px;
  border: 2px solid #ccd2da;
  border-top-color: #2877ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.text-region-status b {
  color: #24282e;
}
.text-region-status button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #b01720;
  font-weight: 800;
  cursor: pointer;
}
.annotation-drafts {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}
.annotation-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c9d8f9;
  border-radius: 7px;
  background: #f6f9ff;
  cursor: pointer;
}
.annotation-note > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 5px;
  background: #2877ff;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.annotation-note b {
  display: block;
  overflow: hidden;
  color: #145cc4;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.annotation-note p {
  margin: 4px 0 0;
  color: #646b75;
  font-size: 9px;
  line-height: 1.45;
}
.annotation-note button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 9px;
  cursor: pointer;
}
.region-editor-popover {
  position: absolute;
  z-index: 8;
  width: min(410px, 46%);
  min-width: 300px;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #cbd8f7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(25, 45, 84, 0.24);
  line-height: normal;
}
.region-editor-popover[hidden] {
  display: none;
}
.region-editor-popover header {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 7px;
}
.region-editor-popover header span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #2877ff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.region-editor-popover header b {
  overflow: hidden;
  color: #145cc4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.region-editor-popover header button {
  border: 0;
  background: transparent;
  color: #777;
  font-size: 18px;
  cursor: pointer;
}
.region-editor-popover textarea {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  font: 10px/1.55 sans-serif;
  resize: vertical;
}
.region-editor-popover footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.region-editor-popover footer > button:first-child {
  border: 0;
  background: transparent;
  color: #a33;
  font-size: 9px;
  cursor: pointer;
}
.region-editor-popover footer .button {
  padding: 8px 12px;
  font-size: 9px;
}
.action-panel label > span {
  display: block;
  margin: 12px 0 6px;
  color: #555;
  font-size: 9px;
  font-weight: 700;
}
.action-panel label > small {
  display: block;
  margin-top: 6px;
  color: #888;
  font-size: 8px;
  line-height: 1.5;
}
.inline-format {
  margin: 10px 0;
}
.inline-format label {
  display: block;
}
.inline-format input,
.inline-format select {
  width: 100%;
}
.version-history article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
}
.version-history article > a {
  display: grid;
  grid-template-columns: 72px 34px 1fr;
  align-items: center;
  gap: 10px;
}
.version-history img {
  width: 72px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}
.version-preview {
  display: block;
  width: 72px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: zoom-in;
}
.version-preview img { display: block; }
.version-history article > .button {
  white-space: nowrap;
}
.task-record dd {
  line-height: 1.6;
}
.text-danger {
  padding: 8px;
  border: 0;
  background: transparent;
  color: #a33;
  font-size: 9px;
  cursor: pointer;
}
.task-context > small {
  display: block;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #e4cfd0;
  font-size: 9px;
  line-height: 1.65;
}
@media (max-width: 900px) {
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .asset-header {
    display: block;
  }
  .asset-upload-actions {
    margin: 12px 0 0;
  }
  .format-fields,
  .inline-format {
    grid-template-columns: 1fr 1fr;
  }
  .task-workspace {
    grid-template-columns: 1fr;
  }
  .action-panel {
    position: static;
  }
  .region-editor-popover {
    width: 72%;
    min-width: 260px;
  }
}

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

.account-menu {
  position: relative;
  margin-left: 12px;
}
.account-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.account-trigger i {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #2b2d30;
  color: #fff;
  font: 800 10px Georgia;
}
.account-trigger span {
  font-size: 10px;
  font-weight: 800;
}
.account-trigger b {
  color: #999;
  font-size: 10px;
}
.account-popover {
  position: absolute;
  z-index: 30;
  right: 0;
  top: 46px;
  width: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(30, 24, 21, 0.16);
}
.account-popover small,
.account-popover strong {
  display: block;
}
.account-popover small {
  color: #999;
  font-size: 8px;
}
.account-popover strong {
  margin-top: 4px;
  font-size: 11px;
}
.account-popover button {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid #ead8d9;
  border-radius: 5px;
  background: #fff7f7;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.is-login .app-header {
  border-bottom-color: transparent;
  background: #f4f2ee;
}
.is-login .brand {
  margin: auto;
}
.is-login .app-main {
  max-width: none;
  padding: 0;
}
.login-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  background:
    radial-gradient(
      circle at 15% 28%,
      rgba(176, 23, 32, 0.12),
      transparent 30%
    ),
    linear-gradient(135deg, #f4f2ee 0 58%, #7d1017 58% 100%);
}
.login-story {
  align-self: center;
  padding: 10vw;
}
.login-story > span,
.login-card > span {
  color: var(--red);
  font: 800 9px Georgia;
  letter-spacing: 0.18em;
}
.login-story h1 {
  max-width: 680px;
  margin: 20px 0;
  font:
    900 clamp(46px, 6vw, 84px)/0.98 Georgia,
    "Songti SC",
    serif;
}
.login-story p {
  max-width: 560px;
  color: #69645f;
  font-size: 14px;
  line-height: 1.8;
}
.login-card {
  align-self: center;
  justify-self: center;
  width: min(360px, 72%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 34px 80px rgba(45, 5, 9, 0.28);
}
.login-card h2 {
  margin: 10px 0 26px;
  font:
    900 27px Georgia,
    "Songti SC",
    serif;
}
.login-card label {
  display: block;
  margin-top: 14px;
}
.login-card label b {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}
.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d5d0ca;
  border-radius: 7px;
  background: #fbfaf8;
  outline: none;
}
.login-card input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px #f9e8e9;
}
.login-card .button {
  width: 100%;
  margin-top: 22px;
}
.login-card p {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 9px;
}
.workspace-status {
  display: grid;
  gap: 3px;
  text-align: right;
}
.workspace-status b {
  font-size: 9px;
  color: #7d1017;
}
.version-history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}
.version-history-head h3 {
  margin: 0;
}
.version-history-head small {
  color: #999;
  font-size: 8px;
}
.version-history article {
  grid-template-columns: 72px 58px minmax(0, 1fr) auto;
  padding: 9px;
  border: 1px solid #ebe7e1;
  border-radius: 8px;
  background: #fff;
}
.version-history article.current-version {
  border-color: #d8b9bb;
  background: #fff7f7;
}
.version-history article > span {
  width: auto;
  padding: 0 7px;
  white-space: nowrap;
}
.version-history article > div > b,
.version-history article > div > small {
  display: block;
}
.version-history article > div > b {
  font-size: 9px;
  line-height: 1.55;
}
.version-history article > div > small {
  margin-top: 4px;
  color: #999;
}
.version-actions {
  display: flex !important;
  gap: 6px;
}
.version-actions .button {
  padding: 8px 10px;
}
.version-compare-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 42px;
  background: rgba(22, 18, 17, 0.72);
  backdrop-filter: blur(6px);
}
.version-compare-dialog {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px;
  background: #f5f3ef;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}
.version-compare-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.version-compare-dialog > header span {
  color: var(--red);
  font: 800 8px Georgia;
  letter-spacing: 0.16em;
}
.version-compare-dialog > header h2 {
  margin: 6px 0 0;
  font:
    900 22px Georgia,
    "Songti SC",
    serif;
}
.version-compare-dialog > header button {
  border: 0;
  background: transparent;
  font-size: 27px;
  cursor: pointer;
}
.version-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}
.version-compare-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.version-compare-grid b {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
}
.version-compare-grid img {
  display: block;
  width: 100%;
  max-height: 54vh;
  object-fit: contain;
  background: #ebe8e2;
}
.version-compare-preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ebe8e2;
  cursor: zoom-in;
  overflow: hidden;
}
.version-compare-preview span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(24, 16, 16, .76);
  color: #fff;
  font-size: .75rem;
  font-weight: 750;
  opacity: 0;
  transition: opacity .2s ease;
}
.version-compare-preview:hover span, .version-compare-preview:focus-visible span { opacity: 1; }
.version-compare-grid p {
  min-height: 36px;
  margin: 10px 0 0;
  color: #666;
  font-size: 10px;
  line-height: 1.6;
}
.version-compare-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.version-compare-dialog > footer strong {
  font-size: 10px;
}
.version-compare-dialog > footer p {
  margin: 4px 0 0;
  color: #777;
  font-size: 9px;
}
.format-box.compact {
  margin: 12px 0;
}
.format-selects {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}
.format-selects label {
  display: block;
}
.format-selects span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 750;
}
.format-selects select,
.format-fields select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d0ccc5;
  border-radius: 6px;
  background: #fbfaf8;
  font-size: 10px;
}
.format-box.compact .format-fields {
  margin-top: 10px;
}
.format-mode-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.format-mode-choice label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px;
  border: 1px solid #ded9d2;
  border-radius: 8px;
  background: #fbfaf8;
  cursor: pointer;
}
.format-mode-choice label:has(input:checked) {
  border-color: #b01720;
  background: #fff5f5;
  box-shadow: inset 3px 0 #b01720;
}
.format-mode-choice input {
  width: auto !important;
  margin: 2px 0 0;
  accent-color: #b01720;
}
.format-mode-choice span,
.format-mode-choice b,
.format-mode-choice small {
  display: block;
}
.format-mode-choice b {
  font-size: 10px;
}
.format-mode-choice small {
  margin-top: 3px;
  color: #8a8580;
  font-size: 8px;
  line-height: 1.4;
}
.format-mode-panel > label > span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 750;
}
.format-mode-panel select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d0ccc5;
  border-radius: 6px;
  background: #fbfaf8;
  font-size: 10px;
}
.format-mode-panel .format-fields {
  grid-template-columns: 1fr 1fr;
}
.revision-draft-banner {
  margin: 10px 0;
  padding: 9px 10px;
  border-left: 3px solid #b01720;
  background: #fff1f1;
  color: #7b2429;
  font-size: 9px;
  line-height: 1.5;
}
.version-compare-dialog > header p {
  margin: 6px 0 0;
  color: #777;
  font-size: 9px;
}
.version-request {
  margin-top: 11px;
  padding: 11px;
  border-radius: 7px;
  background: #f4f1ec;
}
.version-request.secondary {
  background: #faf7f2;
}
.version-request > span {
  display: block;
  color: #9c2229;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
}
.version-request p {
  min-height: 0 !important;
  margin: 6px 0 0 !important;
  color: #494642 !important;
}
.version-request ul {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.version-request li {
  padding-top: 7px;
  border-top: 1px solid #ded8cf;
}
.version-request li:first-child {
  padding-top: 0;
  border-top: 0;
}
.version-request li b {
  margin: 0 !important;
  color: #3d3935;
  font-size: 9px;
}
.version-request li p {
  margin-top: 3px !important;
}
.requirements-revision-banner {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e2d0b5;
  border-radius: 8px;
  background: #fff9ee;
}
.requirements-revision-banner b {
  display: block;
  color: #8c1f26;
  font-size: 10px;
}
.requirements-revision-banner p {
  min-height: 0 !important;
  margin: 5px 0 0 !important;
  color: #62584d !important;
  font-size: 9px !important;
  line-height: 1.55;
}
.upload-constraint {
  display: block;
  max-width: 620px;
  margin-top: 7px;
  color: #786c5c;
  font-size: 10px;
  line-height: 1.5;
}

/* Workbench-wide reading baseline: supporting information must stay legible. */
.version-history h3 { font-size: 15px; }
.version-history span { width: 36px; height: 30px; font-size: 11px; }
.version-history small { font-size: 12px; }
.version-history article > a { grid-template-columns: 86px 40px 1fr; }
.version-history img { width: 86px; height: 58px; }
.material-card > div { gap: 10px; padding: 13px; }
.material-card b { font-size: 13px; }
.material-card span { font-size: 12px; }
.material-card small, .material-card button { font-size: 11px; }
.format-box { padding: 20px; }
.format-box legend { font-size: 15px; }
.format-modes label, .format-box > small { font-size: 13px; }
.attachment-picker { padding: 20px; }
.attachment-picker b { font-size: 15px; }
.attachment-picker small { font-size: 12px; }
.attachment-list > div { padding: 11px 13px; font-size: 12px; }
.attachment-list button { font-size: 12px; font-weight: 800; }
.text-region-status { padding: 13px; font-size: 12px; }
.annotation-note { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
.annotation-note > span { width: 28px; height: 28px; font-size: 11px; }
.annotation-note b { font-size: 13px; }
.annotation-note p, .annotation-note button { font-size: 12px; }
.region-editor-popover { padding: 16px; }
.region-editor-popover header b { font-size: 13px; }
.region-editor-popover textarea { padding: 13px; font-size: 13px; }
.region-editor-popover footer > button:first-child, .region-editor-popover footer .button { font-size: 12px; }
.action-panel label > span { font-size: 13px; }
.action-panel label > small { font-size: 11px; }
.text-danger { padding: 10px; font-size: 12px; font-weight: 750; }
.task-context > small { font-size: 12px; }
.format-selects span, .format-mode-panel > label > span { font-size: 13px; }
.format-selects select, .format-fields select, .format-mode-panel select { padding: 12px; font-size: 14px; }
.format-mode-choice b { font-size: 13px; }
.format-mode-choice small { font-size: 11px; }
.revision-draft-banner { padding: 13px 14px; font-size: 12px; }
.version-compare-dialog > header p, .version-compare-dialog > footer p { font-size: 12px; }
.version-compare-grid b, .version-compare-grid p, .version-compare-dialog > footer strong { font-size: 13px; }
.version-request > span { font-size: 11px; }
.version-request li b, .requirements-revision-banner b, .upload-constraint { font-size: 12px; }
.requirements-revision-banner p { font-size: 12px !important; }

/* Candidate batches are a parallel decision surface, not a version timeline. */
.candidate-batch { padding: 28px; background: radial-gradient(circle at 12% 0%, rgba(191, 24, 38, .1), transparent 35%), #fff; }
.candidate-batch > header { margin-bottom: 22px; }
.candidate-batch > header > span { color: var(--red); font: 800 .72rem/1.2 Georgia, serif; letter-spacing: .16em; }
.candidate-batch h2 { margin: 8px 0 6px; font-size: 1.85rem; }
.candidate-batch p { margin: 0; color: var(--muted); font-size: 1rem; }
.candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.candidate-card { display: grid; grid-template-rows: auto auto auto; overflow: hidden; border: 1px solid #ded6cf; background: #fffdfa; box-shadow: 0 10px 26px rgba(52, 31, 22, .08); }
.candidate-card > header { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; padding: 13px 14px; }
.candidate-card > header span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; }
.candidate-card > header b { font-size: 1rem; }
.candidate-card > header small { grid-column: 2; color: var(--muted); }
.candidate-preview, .candidate-history-preview { position: relative; display: grid; place-items: center; padding: 0; border: 0; background: #251616; cursor: zoom-in; overflow: hidden; }
.candidate-preview { aspect-ratio: var(--candidate-ratio, 4 / 3); }
.candidate-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #251616; transition: transform .2s ease; }
.candidate-preview span, .candidate-history-preview span { position: absolute; right: 10px; bottom: 10px; padding: 6px 8px; border-radius: 5px; background: rgba(24, 16, 16, .76); color: #fff; font-size: .75rem; font-weight: 750; opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease; }
.candidate-preview:hover img, .candidate-preview:focus-visible img { transform: scale(1.018); }
.candidate-preview:hover span, .candidate-preview:focus-visible span, .candidate-history-preview:hover span, .candidate-history-preview:focus-visible span { opacity: 1; transform: translateY(0); }
.candidate-card .button { margin: 12px; justify-content: center; }
.candidate-placeholder { display: grid; place-items: center; align-content: center; gap: 12px; min-height: 260px; padding: 24px; background: #f4efea; color: var(--muted); text-align: center; }
.candidate-placeholder i { width: 32px; height: 32px; border: 3px solid #d6ccc4; border-top-color: var(--red); border-radius: 50%; animation: candidate-spin 1s linear infinite; }
.candidate-card.failed .candidate-placeholder { color: #9c1823; background: #fff4f3; }
@keyframes candidate-spin { to { transform: rotate(360deg); } }
@media (max-width: 920px) { .candidate-grid { grid-template-columns: 1fr; } }
.candidate-history { margin: 28px 0; padding: 20px; border: 1px solid #e5ddd7; background: #fffdfa; }
.candidate-history > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.candidate-history h3 { margin: 0; font-size: 1.1rem; }
.candidate-history > header span, .candidate-history small { color: var(--muted); font-size: .82rem; }
.candidate-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.candidate-history-grid article { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 12px; min-width: 0; padding: 10px; border: 1px solid #ebe4de; background: #fff; }
.candidate-history-grid article > div { display: grid; align-content: center; gap: 4px; min-width: 0; }
.candidate-history-preview { grid-row: 1 / span 2; width: 128px; aspect-ratio: 4 / 3; }
.candidate-history-preview img { width: 100%; height: 100%; object-fit: contain; background: #251616; }
.candidate-history-grid .button { justify-content: center; align-self: end; font-size: .82rem; }
.ai-review-card { margin: 18px 0; padding: 16px; border: 1px solid #ddd3ca; background: #fffaf5; }
.ai-review-card > header, .adopted-suggestions > header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ai-review-card > header span, .adopted-suggestions > header span { color: var(--muted); font-size: .78rem; }
.ai-review-card > p { margin: 7px 0 0; color: var(--muted); font-size: .86rem; }
.ai-review-card.pending { border-style: dashed; }
.ai-review-card.failed { border-color: #e7c7c5; background: #fff6f5; }
.ai-review-list { display: grid; gap: 10px; margin-top: 14px; }
.ai-review-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e9dfd6; background: #fff; }
.ai-review-list article p { margin: 4px 0 0; color: #5e5149; font-size: .86rem; line-height: 1.5; }
.ai-review-list .button { align-self: center; padding: 8px 10px; font-size: .78rem; }
.adopted-suggestions { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border-left: 3px solid var(--red); background: #fff8f3; }
.adopted-suggestions label { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.adopted-suggestions label > span { font-weight: 750; }
.adopted-suggestions textarea { grid-column: 1 / -1; }
.adopted-suggestions .text-danger { justify-self: end; }
.revision-context-unavailable { display: grid; gap: 7px; margin: 16px 0; padding: 14px; border: 1px solid #e4c7c2; background: #fff4f2; color: #6d2a25; }
.revision-context-unavailable span { color: #75534e; font-size: .86rem; line-height: 1.5; }
/* Review workspace: the artwork and the decision panel scroll independently on desktop. */
.app-main:has(.review-action-panel) { max-width: 1760px; }
.task-workspace:has(.review-action-panel) {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(420px, 28vw, 480px);
  gap: 24px;
}
.task-workspace:has(.review-action-panel) .artifact-panel:has(.image-review-stage) {
  display: block;
  min-height: 0;
  padding: 18px;
  border-color: #d7d0c8;
  background: #272523;
}
.review-action-panel {
  position: sticky;
  top: 96px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: calc(100dvh - 112px);
  max-height: 900px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.review-panel-header { padding: 24px 24px 16px; border-bottom: 1px solid #eee7e0; }
.review-panel-header > span { color: var(--red); font: 800 10px/1 Georgia, serif; letter-spacing: .16em; }
.review-panel-header h2 { margin: 9px 0 6px; font-size: 25px; }
.review-panel-header p { margin: 0; font-size: 12px; }
.review-panel-body {
  min-height: 0;
  padding: 18px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.review-panel-body > p:first-child { margin-top: 0; }
.review-panel-footer {
  z-index: 2;
  gap: 9px;
  margin: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid #e7ded6;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -10px 24px rgba(45, 30, 22, .05);
}
.review-panel-footer .button { width: 100%; min-height: 44px; justify-content: center; }
.review-panel-footer .primary.is-empty { background: #786e68; }
.review-tertiary-action {
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #756b65;
  font-size: 12px;
  cursor: pointer;
}
.review-tertiary-action:hover { color: var(--red); text-decoration: underline; }
.ai-review-card { margin: 18px 0; padding: 16px; }
.ai-review-list { gap: 12px; margin-top: 16px; }
.ai-review-list article {
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px;
}
.ai-review-list article b { font-size: 15px; line-height: 1.4; }
.ai-review-list article p { margin-top: 6px; font-size: 13px; line-height: 1.65; }
.ai-review-list .button {
  justify-self: end;
  min-width: 116px;
  min-height: 40px;
  padding: 9px 12px;
  white-space: nowrap;
}
.ai-review-list .button:disabled::before { content: "✓ "; }

@media (max-width: 1180px) {
  body { min-width: 0; }
  .task-workspace:has(.review-action-panel) { grid-template-columns: 1fr; }
  .review-action-panel {
    position: static;
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .review-panel-body { overflow: visible; }
  .review-panel-footer { position: sticky; bottom: 0; }
}

@media (max-width: 720px) {
  .app-main { padding-right: 16px; padding-left: 16px; }
  .task-workspace:has(.review-action-panel) .artifact-panel:has(.image-review-stage) { padding: 8px; }
  .review-panel-header, .review-panel-body { padding-right: 18px; padding-left: 18px; }
  .review-panel-footer { padding-right: 18px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); padding-left: 18px; }
  .ai-review-list .button { width: 100%; min-height: 44px; justify-self: stretch; }
}
.image-preview-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(20, 16, 14, .82); }
.image-preview-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1680px, calc(100vw - 28px)); height: calc(100dvh - 28px); border-radius: 14px; overflow: hidden; background: #fffdfa; box-shadow: 0 24px 80px rgba(0, 0, 0, .42); }
.image-preview-dialog > header, .image-preview-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.image-preview-dialog > header { border-bottom: 1px solid #eee5df; }
.image-preview-dialog > header span { color: var(--red); font: 800 .7rem/1.2 Georgia, serif; letter-spacing: .15em; }
.image-preview-dialog h2 { margin: 4px 0 0; font-size: 1.1rem; }
.image-preview-tools { display: flex; align-items: center; gap: 7px; }
.image-preview-tools button, .image-preview-tools output { display: grid; place-items: center; min-width: 36px; height: 32px; padding: 0 9px; border: 1px solid #ded5cf; border-radius: 5px; background: #fff; color: #3c302b; font: 700 .78rem/1 inherit; cursor: pointer; }
.image-preview-tools output { min-width: 54px; color: var(--muted); cursor: default; }
.image-preview-tools [data-close-image-preview] { width: 36px; min-width: 36px; padding: 0; border-radius: 50%; background: #f2ece7; font-size: 1.55rem; }
.image-preview-canvas { min-width: 0; min-height: 0; padding: 18px; background: #201918; overflow: auto; overscroll-behavior: contain; touch-action: none; cursor: grab; }
.image-preview-canvas:active { cursor: grabbing; }
.image-preview-surface { position: relative; display: grid; place-items: center; min-width: 100%; min-height: 100%; }
.image-preview-canvas img { display: block; max-width: none; max-height: none; box-shadow: 0 14px 40px rgba(0, 0, 0, .28); }
.image-preview-dialog > footer { color: var(--muted); font-size: .82rem; border-top: 1px solid #eee5df; }
@media (max-width: 720px) { .candidate-history-grid { grid-template-columns: 1fr; } .candidate-history-grid article { grid-template-columns: 112px minmax(0, 1fr); } .candidate-history-preview { width: 112px; } .candidate-history > header { display: grid; } .image-preview-overlay { padding: 0; } .image-preview-dialog { width: 100vw; height: 100dvh; border-radius: 0; } .image-preview-dialog > header { align-items: flex-start; flex-direction: column; } .image-preview-tools { width: 100%; overflow-x: auto; } .image-preview-dialog > footer { align-items: flex-start; flex-direction: column; } }

/* Version thumbnails are discovery controls, so their hit area follows the rendered thumbnail. */
.version-history .version-preview { width: 86px; height: 58px; }
.version-history .version-preview img { width: 86px; height: 58px; }
