:root {
  color-scheme: light;
  --ink: #12212b;
  --ink-soft: #51606a;
  --navy: #122736;
  --navy-2: #193b4a;
  --paper: #fffef9;
  --canvas: #e8e9e4;
  --surface: #ffffff;
  --surface-soft: #f6f7f4;
  --line: #d9dedb;
  --line-strong: #c5ccc8;
  --green: #17765e;
  --green-soft: #e7f3ee;
  --amber: #a7650d;
  --amber-soft: #fff3dc;
  --red: #b54840;
  --red-soft: #fceae7;
  --blue: #2f6385;
  --blue-soft: #eaf2f7;
  --gray-soft: #eef0ed;
  --shadow: 0 16px 50px rgba(26, 40, 47, 0.11);
  --font: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1180px;
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 99, 133, 0.23);
  outline-offset: 1px;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--green);
}

input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 9px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f4f7f5;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}


.app-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.global-header {
  height: 58px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  background: var(--navy);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block,
.case-title-wrap,
.case-title-line,
.header-actions,
.case-actions,
.file-heading,
.preview-tools,
.section-title,
.drawer-header,
.drawer-context {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.brand-mark span {
  display: block;
  background: #77c5ab;
}

.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 12px; }

.brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.global-nav {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 4px;
}

.global-nav > button,
.global-nav > a[data-nav-view] {
  align-self: stretch;
}

.global-nav button,
.global-nav a[data-nav-view] {
  position: relative;
  min-width: 76px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  white-space: nowrap;
}

.global-nav a[data-nav-view] {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.global-nav button:hover,
.global-nav button.is-active,
.global-nav a[data-nav-view]:hover,
.global-nav a[data-nav-view].is-active {
  color: #fff;
}

.global-nav button.is-active::after,
.global-nav a[data-nav-view].is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  width: max(calc(100% - 36px), 24px);
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #6fc2a6;
  transform: translateX(-50%);
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.global-client-picker {
  min-width: 210px;
  max-width: 280px;
  display: grid;
  gap: 2px;
  margin-left: 12px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.global-client-picker[hidden] {
  display: none;
}

.global-client-picker > span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.global-client-picker select {
  width: 100%;
  height: 30px;
  padding: 0 28px 0 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: #213944;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
}

@media (max-width: 1180px) {
  .global-header {
    grid-template-columns: minmax(130px, 1fr) auto minmax(80px, 1fr);
    gap: 10px;
    padding-inline: 14px;
  }

  .global-client-picker {
    min-width: 170px;
    max-width: 200px;
    margin-left: 5px;
    padding-left: 8px;
  }

  .global-client-picker > span,
  .avatar-copy {
    display: none;
  }
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.avatar-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 118px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: white;
  cursor: pointer;
}

.avatar-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #d3a45b;
  color: #182933;
  font-weight: 800;
}

.avatar-copy {
  display: grid;
  text-align: left;
}

.avatar-copy strong {
  font-size: 12px;
}

.avatar-copy small {
  color: rgba(255, 255, 255, 0.57);
  font-size: 10px;
}

.case-header {
  min-height: 73px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 250px auto;
  align-items: center;
  gap: 28px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.case-title-wrap {
  gap: 12px;
  min-width: 0;
}

.back-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink-soft);
  cursor: pointer;
}

.back-button:hover,
.button-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.eyebrow {
  color: #758189;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.case-title-line {
  min-width: 0;
  gap: 8px;
}

.case-title-line h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  white-space: nowrap;
}

.storage-chip,
.small-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.storage-chip {
  padding: 3px 7px;
  border: 1px solid #d8e3da;
  background: #f3f8f4;
  color: #32704f;
}

.storage-chip svg,
.search-box svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.case-progress {
  min-width: 230px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.progress-copy strong {
  color: var(--ink);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e9e7;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.case-progress small {
  display: block;
  margin-top: 4px;
  color: #7a858c;
  font-size: 9px;
  text-align: right;
}

.case-actions {
  justify-content: flex-end;
  gap: 7px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 6px;
  color: #647078;
  font-size: 10px;
  white-space: nowrap;
}

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

.button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.button-ghost {
  border-color: var(--line);
  background: white;
}

.button-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 12px rgba(23, 118, 94, 0.19);
}

.button-primary:hover {
  background: #11644f;
}

.decision-strip {
  min-height: 88px;
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: stretch;
  gap: 10px;
  padding: 9px 18px 10px;
  background: #f4f5f1;
  border-bottom: 1px solid var(--line);
}

.decision-strip-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.decision-strip-title strong {
  margin-top: 4px;
  font-size: 15px;
}

.decision-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(155px, 1fr)) minmax(200px, 1.2fr);
  gap: 8px;
}

.decision-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.decision-card:hover {
  border-color: #b9c4bf;
  box-shadow: 0 4px 12px rgba(35, 48, 54, 0.07);
}

.decision-card.success { border-left-color: var(--green); }
.decision-card.warning { border-left-color: var(--amber); }
.decision-card.error { border-left-color: var(--red); }
.decision-card.neutral { border-left-color: #849097; }
.decision-card.final { background: #fffaf0; }
.decision-card.final.success { background: #eef8f4; }
.decision-card.final.error { background: #fff0ed; }

.decision-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.success .decision-icon { background: var(--green-soft); color: var(--green); }
.warning .decision-icon { background: var(--amber-soft); color: var(--amber); }
.error .decision-icon { background: var(--red-soft); color: var(--red); }
.neutral .decision-icon { background: var(--gray-soft); color: #68747c; }

.decision-copy {
  min-width: 0;
}

.decision-copy span {
  display: block;
  color: #6a767d;
  font-size: 9px;
  font-weight: 700;
}

.decision-copy strong {
  display: block;
  overflow: hidden;
  margin: 1px 0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-copy small {
  display: block;
  overflow: hidden;
  color: #7a858b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-arrow {
  color: #889298;
  font-size: 15px;
}

.workspace {
  --queue-panel-width: 270px;
  --journal-panel-width: 470px;
  --evidence-panel-height: 210px;
  position: relative;
  height: calc(100vh - 219px);
  min-height: 650px;
  display: grid;
  grid-template-columns: var(--queue-panel-width) minmax(420px, 1fr) var(--journal-panel-width);
  grid-template-rows: minmax(390px, 1fr) var(--evidence-panel-height);
  gap: 1px;
  background: #cbd1cd;
  border-top: 0;
}

.resize-handle {
  position: absolute;
  z-index: 45;
  border: 0;
  background: transparent;
  touch-action: none;
}

.resize-handle::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: #aeb8b3;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.resize-handle:hover::after,
.resize-handle:focus-visible::after,
.resize-handle.is-active::after {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 118, 94, 0.14);
}

.resize-handle-journal {
  top: 0;
  right: var(--journal-panel-width);
  bottom: var(--evidence-panel-height);
  width: 10px;
  cursor: col-resize;
  transform: translateX(50%);
}

.resize-handle-journal::after {
  top: 10px;
  bottom: 10px;
  left: 4px;
  width: 2px;
}

.resize-handle-evidence {
  right: 0;
  bottom: var(--evidence-panel-height);
  left: 0;
  height: 10px;
  cursor: row-resize;
  transform: translateY(50%);
}

.resize-handle-evidence::after {
  top: 4px;
  right: 12px;
  left: 12px;
  height: 2px;
}

body.is-resizing {
  user-select: none;
}

body.is-resizing-horizontal { cursor: col-resize; }
body.is-resizing-vertical { cursor: row-resize; }

.panel {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.queue-panel,
.journal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-heading {
  min-height: 54px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.drawer-header h2 {
  margin: 0;
  font-size: 15px;
}

.queue-heading,
.preview-heading,
.journal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button.subtle {
  border-color: var(--line);
  color: #607078;
}

.queue-status-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.queue-status-filters button {
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.queue-status-filters button:hover {
  background: #edf3ef;
}

.queue-status-filters button.is-active {
  position: relative;
  z-index: 1;
  background: #e0eee7;
  color: var(--green-deep);
  box-shadow: inset 0 0 0 2px var(--green);
}

.queue-status-filters strong,
.queue-status-filters span {
  display: block;
}

.queue-status-filters strong {
  font-size: 14px;
}

.queue-status-filters span {
  color: #758087;
  font-size: 9px;
}

.queue-status-filters button.is-active span {
  color: var(--green-deep);
  font-weight: 700;
}

.queue-month-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 10px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.queue-month-filter select {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.queue-month-filter select:focus {
  border-color: var(--green);
  outline: 2px solid rgba(23, 118, 94, 0.12);
}

.queue-search-tools {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  margin: 0 10px 8px;
}

.queue-search-tools .search-box {
  margin: 0;
}

.queue-intake-filter-button {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #68777d;
  cursor: pointer;
}

.queue-intake-filter-button:hover,
.queue-intake-filter-button[aria-expanded="true"] {
  border-color: #7da996;
  background: #f0f7f3;
  color: var(--green-deep);
}

.queue-intake-filter-button.is-active {
  border-color: var(--green);
  background: #e0eee7;
  color: var(--green-deep);
}

.queue-intake-filter-button.is-active::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.queue-intake-filter-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.queue-intake-filter-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  padding: 10px;
  border: 1px solid #b8cbc3;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28, 48, 41, 0.2);
}

.queue-intake-filter-popover[hidden] {
  display: none;
}

.queue-intake-filter-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}

.queue-intake-filter-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.queue-intake-filter-heading span {
  color: #7a858b;
  font-size: 9px;
}

.queue-intake-filter-options {
  display: grid;
  gap: 3px;
  padding-top: 7px;
}

.queue-intake-filter-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
}

.queue-intake-filter-option:hover,
.queue-intake-filter-option.is-selected {
  background: #edf5f1;
}

.queue-intake-filter-option input {
  accent-color: var(--green);
}

.queue-intake-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-intake-filter-option strong {
  color: #6f7c82;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.search-box {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #7f898f;
  background: white;
}

.search-box:focus-within {
  border-color: #7da996;
  box-shadow: 0 0 0 3px rgba(23, 118, 94, 0.09);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 11px;
}

.queue-footer button,
.section-title button {
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #6c787e;
  font-size: 10px;
  cursor: pointer;
}


.queue-list {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.queue-empty {
  display: grid;
  place-items: center;
  height: 150px;
  color: #7a858b;
  font-size: 11px;
}

.queue-item {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  overflow: hidden;
  padding: 10px 10px 9px 12px;
  border: 0;
  border-bottom: 1px solid #e6e9e7;
  background: white;
  text-align: left;
  cursor: pointer;
}

.queue-bulk-final-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin: 0 7px 5px;
  padding: 6px;
  border: 1px solid #b9d5cb;
  border-radius: 7px;
  background: #f0f8f4;
}

.queue-bulk-final-actions[hidden] {
  display: none;
}

.queue-bulk-select-all {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green-deep);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.queue-bulk-select-all input,
.queue-bulk-item-checkbox {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--green);
}

.queue-bulk-final-actions .button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.queue-bulk-final-excluded {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 6px;
  border-radius: 5px;
  background: #fff4e5;
  color: #8a4b08;
  font-size: 9px;
  font-weight: 800;
}

.queue-bulk-final-excluded[hidden] {
  display: none;
}

.queue-item.is-bulk-selectable {
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
}

.queue-item.is-bulk-selectable .queue-bulk-item-checkbox {
  margin-top: 9px;
}

.queue-bulk-item-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.queue-item.is-bulk-selected {
  background: #edf5f1;
}

.queue-item.is-duplicate-cluster {
  background: #fffdf7;
}

.queue-item.is-duplicate-cluster[data-duplicate-cluster-role="keeper"] {
  box-shadow: inset 3px 0 #478875;
}

.queue-item.is-duplicate-cluster[data-duplicate-cluster-role="candidate"] {
  box-shadow: inset 3px 0 #d7b46a;
}

.queue-duplicate-cluster-label {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 1px 4px;
  border-radius: 999px;
  background: #fff0c8;
  color: #765018;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.queue-item.is-bulk-selectable .queue-bulk-item-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.queue-item.is-bulk-blocked {
  background: #fffaf2;
}

.queue-bulk-blocked-label {
  margin-left: auto;
  padding: 1px 4px;
  border-radius: 999px;
  background: #fff0d6;
  color: #8a4b08;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.bulk-final-approval-excluded {
  padding: 8px 10px;
  border: 1px solid #e3b66f;
  border-radius: 7px;
  background: #fff8eb;
  color: #7c470b;
}

.bulk-final-approval-results {
  max-height: min(360px, 48vh);
  margin: 12px 0;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  list-style: none;
}

.bulk-final-approval-results li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
}

.bulk-final-approval-results li + li {
  border-top: 1px solid var(--line);
}

.bulk-final-approval-results span {
  color: var(--red);
  font-size: 10px;
}

.queue-item:hover {
  background: #fafbf9;
}

.queue-item.is-active {
  background: #edf5f1;
}

.queue-item.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.queue-file-icon {
  width: 29px;
  height: 35px;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
  border: 1px solid #d2d8d5;
  border-radius: 3px;
  background: #f7f8f6;
  color: #a7433c;
  font-size: 7px;
  font-weight: 900;
}

.queue-item-main {
  min-width: 0;
}

.queue-item-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.queue-item-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-risk {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #89949a;
}

.queue-risk.success { background: var(--green); }
.queue-risk.warning { background: var(--amber); }
.queue-risk.error { background: var(--red); }

.queue-vendor {
  overflow: hidden;
  margin: 2px 0 4px;
  color: #647078;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-bottom {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8a9499;
  font-size: 9px;
}

.queue-item-bottom > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--gray-soft);
  color: #5d696f;
  font-weight: 700;
}

.queue-status.success { background: var(--green-soft); color: var(--green); }
.queue-status.warning { background: var(--amber-soft); color: var(--amber); }
.queue-status.error { background: var(--red-soft); color: var(--red); }

.queue-footer {
  height: 34px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  color: #7b868c;
  font-size: 9px;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-heading {
  min-height: 54px;
}

.file-heading {
  min-width: 0;
  gap: 8px;
}

.file-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 32px;
  border-radius: 3px;
  background: #b94c43;
  color: white;
  font-size: 7px;
  font-weight: 900;
}

.file-heading > div {
  min-width: 0;
}

.file-heading h2 {
  overflow: hidden;
  max-width: 360px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-heading p {
  margin: 1px 0 0;
  color: #818b91;
  font-size: 9px;
}

.preview-tools {
  flex: 0 0 auto;
  gap: 3px;
}

.preview-tools button {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #56656d;
  cursor: pointer;
}

.preview-tools button:hover {
  background: var(--gray-soft);
}

.preview-tools span {
  min-width: 34px;
  color: #66737a;
  font-size: 9px;
  text-align: center;
}

.preview-tools .tool-divider {
  min-width: 1px;
  width: 1px;
  height: 19px;
  margin: 0 3px;
  background: var(--line);
}

.preview-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 58px 1fr;
  overflow: hidden;
  background: #dfe2df;
}

.thumbnail-rail {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-right: 1px solid #cbd0cd;
  background: #f0f2ef;
}

.thumbnail {
  width: 45px;
  padding: 4px 4px 2px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.thumbnail.is-active {
  border-color: var(--green);
  background: white;
}

.thumbnail strong {
  display: block;
  margin-top: 2px;
  color: #69767d;
  font-size: 8px;
}

.mini-page {
  height: 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid #d3d8d5;
  background: white;
  box-shadow: 0 2px 4px rgba(30, 44, 52, 0.08);
}

.mini-page i {
  height: 2px;
  display: block;
  background: #d8dcda;
}

.mini-page i:first-child { width: 55%; background: #9aa4a0; }

.document-canvas {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px 30px 48px;
}

.paper {
  position: relative;
  width: min(520px, 92%);
  min-height: 680px;
  margin: 0 auto;
  padding: 45px 42px 38px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 7px 26px rgba(24, 38, 45, 0.18);
  color: #2c353a;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  transition: opacity 0.15s ease;
}

.paper.is-switching {
  opacity: 0.5;
}

.paper-watermark {
  position: absolute;
  right: -16px;
  bottom: 31px;
  color: #edf0ed;
  font-family: var(--font);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(-90deg);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid #26363f;
}

.invoice-header h3 {
  margin: 3px 0 5px;
  font-size: 18px;
}

.invoice-header p {
  margin: 0;
  color: #687378;
  font-size: 8px;
}

.invoice-vendor-kana {
  font-family: var(--font);
  letter-spacing: 0.08em;
}

.invoice-brand {
  padding-top: 5px;
  color: #1f6373;
  font-family: var(--font);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.invoice-brand span {
  display: block;
  color: #5c777f;
  font-size: 6px;
  letter-spacing: 0.25em;
  text-align: right;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 25px;
}

.invoice-meta-grid p {
  margin: 0 0 7px;
  color: #7e888c;
  font-size: 8px;
}

.invoice-meta-grid strong {
  font-size: 13px;
}

.invoice-meta-right dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 0;
  font-size: 8px;
}

.invoice-meta-right dt {
  color: #788388;
}

.invoice-meta-right dd {
  margin: 0;
  text-align: right;
}

.invoice-message {
  margin-top: 28px;
  font-size: 9px;
}

.invoice-total-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0 18px;
  padding: 10px 14px 8px;
  border-top: 1px solid #35454d;
  border-bottom: 1px solid #35454d;
}

.invoice-total-block span {
  font-size: 9px;
}

.invoice-total-block strong {
  font-family: var(--font);
  font-size: 20px;
  letter-spacing: 0.04em;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8px;
}

.invoice-table th,
.invoice-table td {
  padding: 8px 6px;
  border: 1px solid #bec5c2;
}

.invoice-table th {
  background: #eef1ee;
  font-weight: 700;
}

.invoice-table th:not(:first-child),
.invoice-table td:not(:first-child) {
  text-align: right;
}

.invoice-summary {
  width: 52%;
  margin: 18px 0 0 auto;
}

.invoice-summary dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  font-size: 8px;
}

.invoice-summary dt,
.invoice-summary dd {
  margin: 0;
  padding: 5px 7px;
  border-bottom: 1px solid #d3d7d5;
}

.invoice-summary dd {
  font-family: var(--font);
  text-align: right;
}

.invoice-summary .summary-total {
  border-bottom: 2px solid #2f3f47;
  font-weight: 800;
}

.invoice-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid #d1d6d3;
  color: #69747a;
  font-size: 8px;
}

.ocr-highlight {
  position: absolute;
  z-index: 5;
  padding: 0;
  border: 2px solid rgba(23, 118, 94, 0.65);
  background: rgba(60, 181, 145, 0.09);
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.ocr-highlight:hover,
.ocr-highlight.is-pulsing {
  box-shadow: 0 0 0 5px rgba(23, 118, 94, 0.16);
}

.ocr-highlight.is-warning {
  border-color: rgba(183, 111, 15, 0.8);
  background: rgba(255, 185, 64, 0.12);
}

.ocr-highlight.is-warning:hover,
.ocr-highlight.is-warning.is-pulsing {
  box-shadow: 0 0 0 5px rgba(183, 111, 15, 0.17);
}

.preview-stage.highlights-hidden .ocr-highlight {
  opacity: 0;
  pointer-events: none;
}

.vendor-highlight { top: 41px; left: 38px; width: 185px; height: 48px; }
.tnumber-highlight { top: 139px; right: 40px; width: 134px; height: 20px; }
.amount-highlight { top: 241px; right: 39px; width: 154px; height: 46px; }
.tax-highlight { top: 446px; right: 40px; width: 115px; height: 24px; }

.journal-panel {
  position: relative;
}

.alternatives-button {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #c8d5cf;
  border-radius: 6px;
  background: #f5f9f7;
  color: #2c6c55;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.alternatives-button span {
  min-width: 18px;
  display: inline-grid;
  place-items: center;
  padding: 1px 4px;
  border-radius: 999px;
  background: #d9ebe3;
}

.review-alert {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  margin: 9px 11px 0;
  padding: 8px 9px;
  border: 1px solid #f0d4a5;
  border-radius: 7px;
  background: var(--amber-soft);
}

.review-alert.success { border-color: #bcdccb; background: var(--green-soft); }
.review-alert.error { border-color: #edc1bc; background: var(--red-soft); }
.review-alert.neutral { border-color: var(--line); background: var(--gray-soft); }

.alert-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--amber);
  font-weight: 900;
}

.review-alert.success .alert-icon { color: var(--green); }
.review-alert.error .alert-icon { color: var(--red); }

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

.review-alert p {
  margin: 1px 0 0;
  color: #77623e;
  font-size: 9px;
}

.review-alert.success p { color: #45685a; }
.review-alert.error p { color: #80534f; }

.transaction-journal-toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 7px 11px;
  border-bottom: 1px solid #e3e7e4;
  background: #f8faf9;
}

.transaction-journal-toolbar[hidden] { display: none; }

.transaction-journal-toolbar label {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.transaction-journal-toolbar select,
.transaction-journal-toolbar button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.transaction-journal-toolbar select { width: 100%; padding: 0 7px; }
.transaction-journal-toolbar button {
  padding: 0 10px;
  color: var(--green-deep);
  font-weight: 700;
  white-space: nowrap;
}

.journal-form {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 11px 90px;
}

.form-section {
  padding: 12px 0;
  border-bottom: 1px solid #e3e7e4;
}

.section-title {
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h3 {
  margin: 0;
  font-size: 11px;
}

.section-title > span {
  color: #899299;
  font-size: 8px;
}

.section-title button {
  color: var(--blue);
}

.field-grid {
  display: grid;
  gap: 7px;
}

.field-grid.two-cols {
  grid-template-columns: 0.75fr 1.25fr;
}

.field {
  min-width: 0;
  display: block;
  margin-bottom: 7px;
}

.field > span {
  display: block;
  margin-bottom: 3px;
  color: #66737a;
  font-size: 8px;
  font-weight: 700;
}

.field input,
.field textarea,
.select-like,
.journal-form textarea {
  width: 100%;
  border: 1px solid #d4dad7;
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

.field input {
  height: 31px;
  padding: 5px 7px;
  font-size: 10px;
}

.field input:hover,
.field input:focus,
.journal-form textarea:focus {
  border-color: #7ca994;
  outline: 0;
}

.field.is-warning input {
  border-color: #d7a54e;
  background: #fffaf0;
}

.select-like {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  text-align: left;
  font-size: 9px;
  cursor: pointer;
}

.success-text { color: var(--green); }

.journal-grid {
  display: grid;
  grid-template-columns: 72px minmax(76px, 1.05fr) minmax(70px, 0.82fr) minmax(72px, 0.92fr);
  gap: 5px;
  align-items: center;
  margin-bottom: 6px;
}

.journal-grid-head {
  margin-bottom: 4px;
  color: #808b90;
  font-size: 8px;
}

.debit-label,
.credit-label {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
}

.debit-label { background: #e8f0f6; color: #35617d; }
.credit-label { background: #f6ecea; color: #96514c; }

.line-leading-control {
  min-width: 0;
  height: 31px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 4px;
}

.remove-line-button,
.side-toggle-button {
  min-width: 0;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.remove-line-button {
  background: #f5f5f3;
  color: #7d878c;
  font-size: 13px;
}

.remove-line-button:hover {
  background: #f7e8e6;
  color: #a23d35;
}

.side-toggle-button:hover {
  filter: brightness(0.97);
}

.journal-empty {
  padding: 12px;
  border: 1px dashed #ccd3cf;
  border-radius: 6px;
  color: #7b8781;
  font-size: 9px;
  text-align: center;
}

.section-actions {
  display: inline-flex;
  gap: 5px;
}

.cell-select,
.account-field,
.amount-field {
  min-width: 0;
  height: 31px;
  border: 1px solid #d4dad7;
  border-radius: 5px;
  background: white;
}

.cell-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.account-field {
  display: block;
}

.account-input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: inherit;
  padding: 4px 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  outline: 0;
}

.account-field:focus-within {
  border-color: #477d99;
  box-shadow: 0 0 0 2px rgba(71, 125, 153, 0.15);
}

.journal-account-hint {
  margin: -3px 0 7px;
  color: #68766f;
  font-size: 9px;
  line-height: 1.45;
}

.cell-select b {
  color: #94a099;
  font-weight: 400;
}

.account-select {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
}

.account-select span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-select b { flex: 0 0 auto; }

.warning-cell {
  border-color: #d4a34c;
  background: #fffaf1;
}

.amount-field {
  display: flex;
  align-items: center;
  padding: 0 6px;
}

.amount-field span {
  color: #8a959a;
  font-size: 9px;
}

.amount-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 9px;
  text-align: right;
}

.balance-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 7px;
  border-radius: 5px;
  font-size: 8px;
}

.balance-check.success { background: var(--green-soft); color: var(--green); }
.balance-check.error { background: var(--red-soft); color: var(--red); }

.balance-check span {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.small-badge {
  padding: 2px 5px;
}

.small-badge.warning { background: var(--amber-soft); color: var(--amber); }

.tax-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.calculation-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding: 6px 7px;
  border-radius: 5px;
  background: #f0f5f2;
  color: var(--green);
  font-size: 8px;
}

.calculation-line code {
  color: #40534b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.journal-form textarea {
  resize: vertical;
  padding: 7px;
  font-size: 9px;
}

.journal-form input:disabled,
.journal-form select:disabled,
.journal-form textarea:disabled {
  border-color: #dfe4e1;
  background: #f1f3f2;
  color: #66736d;
}

.journal-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 7px;
  padding: 10px 11px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -7px 20px rgba(27, 41, 48, 0.06);
}

.evidence-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--queue-panel-width) 1fr;
  min-height: 0;
}

.workspace.is-evidence-collapsed .evidence-panel {
  grid-template-columns: 1fr;
}

.workspace.is-evidence-collapsed .evidence-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  padding: 5px 42px 5px 7px;
  border-right: 0;
}

.workspace.is-evidence-collapsed .evidence-tabs button {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.evidence-collapse-toggle {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink-soft);
  cursor: pointer;
}

.evidence-tabs {
  display: grid;
  align-content: start;
  padding: 7px;
  border-right: 1px solid var(--line);
  background: #f5f6f3;
}

.evidence-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #647078;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.evidence-tabs button:hover,
.evidence-tabs button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(30, 43, 48, 0.07);
}

.evidence-tabs button.is-active {
  color: var(--green);
  font-weight: 700;
}

.evidence-tabs button span {
  min-width: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #e6ebe8;
  color: #67747a;
  font-size: 8px;
}

.evidence-tabs .tab-alert {
  background: var(--amber-soft);
  color: var(--amber);
}

.evidence-content {
  min-width: 0;
  overflow: auto;
  padding: 12px 16px;
  background: white;
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(240px, 1fr);
  gap: 18px;
}

.evidence-block h3 {
  margin: 0 0 7px;
  font-size: 10px;
}

.raw-text {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e0e4e1;
  border-radius: 6px;
  background: #f7f8f6;
  color: #43515a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  line-height: 1.65;
}

.evidence-page-note {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.raw-text mark {
  padding: 1px 2px;
  background: #ffe4ad;
  color: #7e4d07;
}

.external-source-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  align-items: center;
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px solid #d8e5df;
  border-radius: 6px;
  background: #f4f8f6;
  font-size: 11px;
}

.external-source-note strong {
  color: var(--ink-soft);
}

.external-source-note a {
  color: var(--green-deep);
  font-weight: 700;
}

.external-source-note small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 10px;
}

.evidence-facts,
.check-list {
  display: grid;
  gap: 5px;
}

.evidence-fact,
.check-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 26px;
  padding: 4px 7px;
  border-bottom: 1px solid #edf0ee;
  font-size: 9px;
}

.evidence-fact span:first-child,
.check-item span:first-child {
  color: #78848a;
}

.evidence-fact strong,
.check-item strong {
  font-weight: 700;
}

.fact-status {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
}

.fact-status.success { background: var(--green-soft); color: var(--green); }
.fact-status.warning { background: var(--amber-soft); color: var(--amber); }
.fact-status.error { background: var(--red-soft); color: var(--red); }
.fact-status.neutral { background: var(--gray-soft); color: #69757b; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.history-table th,
.history-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e8e6;
  text-align: left;
}

.history-table th {
  color: #737f85;
  background: #f7f8f6;
  font-size: 8px;
}

.history-table td:last-child,
.history-table th:last-child {
  text-align: right;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  visibility: hidden;
  background: rgba(10, 23, 31, 0.31);
  opacity: 0;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.drawer-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.alternatives-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: 480px;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: white;
  box-shadow: -18px 0 50px rgba(19, 34, 42, 0.2);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.alternatives-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  min-height: 68px;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-header .icon-button {
  border-color: var(--line);
  color: #627078;
}

.drawer-context {
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.candidate-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 13px 15px;
}

.candidate-card {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: white;
}

.candidate-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(23, 118, 94, 0.1);
}

.candidate-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: #f7f8f6;
  border-bottom: 1px solid #e4e8e5;
}

.candidate-rank {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
}

.candidate-rank i {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #dfe7e3;
  color: #435a50;
  font-style: normal;
}

.candidate-source {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 8px;
  font-weight: 700;
}

.candidate-source.history { background: var(--green-soft); color: var(--green); }
.candidate-source.rule { background: var(--amber-soft); color: var(--amber); }

.candidate-body {
  padding: 10px;
}

.candidate-journal {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border-radius: 6px;
  background: #f7f8f6;
  font-size: 10px;
}

.candidate-journal div {
  display: grid;
  gap: 2px;
}

.candidate-journal div:last-child {
  text-align: right;
}

.candidate-journal small {
  color: #7d888e;
  font-size: 8px;
}

.candidate-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.candidate-facts div {
  padding: 6px;
  border: 1px solid #e3e7e4;
  border-radius: 5px;
}

.candidate-facts span,
.candidate-facts strong {
  display: block;
}

.candidate-facts span {
  color: #808b91;
  font-size: 7px;
}

.candidate-facts strong {
  margin-top: 2px;
  font-size: 9px;
}

.candidate-diff {
  margin: 8px 0 0;
  color: #6c787e;
  font-size: 9px;
}

.candidate-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.candidate-actions button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: #3f5968;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.candidate-card.is-selected .candidate-actions button {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.drawer-note {
  margin: 0 15px 15px;
  padding: 10px;
  border-left: 3px solid #6c8490;
  background: #f3f6f7;
}

.drawer-note strong {
  font-size: 10px;
}

.drawer-note p {
  margin: 3px 0 0;
  color: #65727a;
  font-size: 9px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #65b99c;
  color: #102d23;
  font-size: 11px;
  font-weight: 900;
}

.toast p {
  margin: 0;
  font-size: 10px;
}

@media (max-height: 800px) {
  .decision-strip {
    min-height: 76px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .workspace {
    height: calc(100vh - 207px);
    --evidence-panel-height: 170px;
    grid-template-rows: minmax(360px, 1fr) var(--evidence-panel-height);
  }

  .paper {
    width: min(465px, 90%);
    min-height: 630px;
    padding-top: 38px;
  }
}

@media (max-width: 1320px) {
  .case-header {
    grid-template-columns: minmax(380px, 1fr) 210px auto;
    gap: 16px;
  }

  .workspace {
    --queue-panel-width: 250px;
    --journal-panel-width: 430px;
  }

  .evidence-panel {
    grid-template-columns: 250px 1fr;
  }

  .decision-strip {
    grid-template-columns: 95px 1fr;
  }

  .decision-copy small {
    display: none;
  }
}

.pdf-page-image {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
  background: white;
  box-shadow: 0 7px 26px rgba(24, 38, 45, 0.2);
  transform-origin: center center;
  transition: width 0.16s ease, transform 0.16s ease, opacity 0.15s ease;
}

.pdf-page-image[hidden] {
  display: none;
}

.preview-stage.real-pdf .document-canvas {
  padding: 18px 24px 48px;
  background: #dfe2df;
}

.mini-page.real {
  padding: 0;
  overflow: hidden;
}

.mini-page.real img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

/* Readable accounting panel */
.journal-panel .journal-heading h2 { font-size: 17px; }
.journal-panel .eyebrow { font-size: 9px; }
.journal-panel .alternatives-button { min-height: 34px; font-size: 11px; }
.journal-panel .review-alert { grid-template-columns: 32px 1fr; gap: 9px; padding: 10px; }
.journal-panel .alert-icon { width: 28px; height: 28px; font-size: 13px; }
.journal-panel .review-alert strong { font-size: 13px; }
.journal-panel .review-alert p { margin-top: 2px; font-size: 11px; line-height: 1.45; }
.journal-panel .journal-form { padding-right: 14px; padding-left: 14px; }
.journal-panel .form-section { padding: 14px 0; }
.journal-panel .section-title h3 { font-size: 13px; }
.journal-panel .section-title > span { font-size: 10px; }
.journal-panel .section-actions button,
.journal-panel .section-title button { font-size: 11px; }
.journal-panel .field > span { margin-bottom: 4px; font-size: 10px; }
.journal-panel .field input,
.journal-panel .select-like { height: 36px; padding: 7px 9px; font-size: 12px; }
.journal-panel .journal-grid {
  grid-template-columns: 78px minmax(82px, 1.05fr) minmax(78px, 0.82fr) minmax(84px, 0.92fr);
  gap: 6px;
  margin-bottom: 8px;
}
.journal-panel .journal-grid-head { margin-bottom: 5px; font-size: 10px; }
.journal-panel .line-leading-control,
.journal-panel .cell-select,
.journal-panel .account-field,
.journal-panel .amount-field { height: 36px; }
.journal-panel .line-leading-control { grid-template-columns: 28px minmax(0, 1fr); }
.journal-panel .side-toggle-button { font-size: 10px; }
.journal-panel .remove-line-button { font-size: 15px; }
.journal-panel .cell-select { padding: 5px 8px; font-size: 11px; }
.journal-panel .account-input { padding: 5px 8px; font-size: 11px; }
.journal-panel .journal-account-hint { font-size: 10px; }
.journal-panel .amount-field { padding: 0 8px; }
.journal-panel .amount-field span,
.journal-panel .amount-field input { font-size: 11px; }
.journal-panel .balance-check { padding: 8px 9px; font-size: 10px; }
.journal-panel .small-badge { padding: 3px 7px; font-size: 10px; }
.journal-panel .calculation-line { padding: 8px 9px; font-size: 10px; }
.journal-panel .journal-form textarea { padding: 9px; font-size: 11px; line-height: 1.45; }
.journal-panel .journal-actions { padding: 11px 14px; }
.journal-panel .journal-actions .button { min-height: 38px; font-size: 12px; }

.document-canvas:fullscreen {
  padding: 24px;
  overflow: auto;
  background: #202624;
}

.document-canvas:fullscreen .pdf-page-image {
  max-width: 1200px;
}

.section-title > label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
}

.section-title > label strong {
  font-size: 13px;
}

.section-title > label small {
  color: #68766f;
  font-size: 10px;
  font-weight: 500;
}

.field-hint,
.field-error {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.field-hint { color: #68766f; }

.field-error { color: #a83a2d; font-weight: 700; }
.field-error[hidden] { display: none; }

#reviewComment[aria-invalid="true"] {
  border-color: #b94334;
  box-shadow: 0 0 0 2px rgba(185, 67, 52, 0.16);
}

.confirmation-dialog > p {
  margin: 0;
  line-height: 1.7;
  color: var(--ink);
}

.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

/* Navigation remains usable as admin-only destinations are added. */
.global-nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.global-nav > button[hidden],
.global-nav > a[hidden] {
  display: none;
}

@media (max-width: 1000px) {
  .global-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .brand-name {
    display: none;
  }

  .global-nav button,
  .global-nav a[data-nav-view] {
    min-width: 64px;
    font-size: 11px;
  }

  .global-client-picker {
    min-width: 150px;
    max-width: 170px;
  }

  .avatar-button {
    min-width: 0;
    padding-right: 4px;
  }
}

@media (max-width: 620px) {
  .global-header {
    gap: 6px;
    padding-inline: 8px;
  }

  .global-nav button,
  .global-nav a[data-nav-view] {
    min-width: 58px;
  }

  .global-client-picker {
    min-width: 140px;
  }
}
.processing-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  max-width: min(820px, 68vw);
}

.process-document-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
  max-width: 560px;
}

.process-document-strip button,
.processing-actions button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  padding: 5px 7px;
  white-space: nowrap;
}

.process-document-strip button.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, white);
}

.process-document-strip button small {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.processing-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.preview-process-position {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .processing-toolbar {
    align-items: flex-start;
    flex-direction: column;
    max-width: 52vw;
  }

  .processing-actions {
    margin-left: 0;
  }
}
.queue-pagination {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.queue-pagination button {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  padding: 4px 6px;
}

.queue-pagination span {
  min-width: 44px;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
}
