/* Tabler primitives, Ant Design-inspired console scale, local Lucide icons. */
:root {
  --ink: #1f2329;
  --muted: #646a73;
  --line: #e5e7eb;
  --canvas: #f5f6f8;
  --accent: #2563eb;
  --tblr-primary: #2563eb;
  --tblr-primary-rgb: 37, 99, 235;
  --tblr-font-sans-serif: var(--font-ui);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
:focus-visible {
  outline: 3px solid #93b4fc;
  outline-offset: 3px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  box-shadow: none;
  white-space: nowrap;
}
.btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: white;
}
.btn-white {
  background: white;
  border: 1px solid #d9dde3;
  color: #373c43;
}
.btn-white:hover {
  background: #f5f8ff;
  border-color: #b7cdfa;
  color: var(--accent);
}
.form-control,
.form-select {
  border-color: #d9dde3;
  border-radius: 6px;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  background-color: white;
  box-shadow: none;
}
.form-control::placeholder {
  color: #858b94;
}
.form-control:focus,
.form-select:focus {
  border-color: #709df7;
  box-shadow: 0 0 0 3px #2563eb12;
}
.form-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #4e5969;
}
.form-check-input[type="checkbox"] {
  border-radius: 4px;
  width: 16px;
  height: 16px;
  border-color: #c6cbd2;
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.eyebrow {
  display: none;
}
h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 {
  font-size: 24px;
  line-height: 1.4;
  margin: 0 0 6px;
}
h2 {
  font-size: 18px;
  margin: 0;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.65;
}
.card {
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 3px #1f232903;
  background: white;
  min-width: 0;
}
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: -3px;
  background-color: currentColor;
  mask: var(--icon-url) center / contain no-repeat;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
}
.app-header {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 38px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand:hover {
  color: var(--ink);
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: white;
  background: var(--accent);
}
.brand-icon .icon {
  width: 22px;
  height: 22px;
}
.brand-name {
  line-height: 1.1;
}
.brand small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-top: 5px;
}
.main-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 24px;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 3px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  color: #505660;
  white-space: nowrap;
}
.main-nav a.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.header-account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.header-account form {
  margin: 0;
}
.environment {
  padding: 1px 6px;
  color: #596579;
  border: 1px solid #dfe3ea;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.account-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: #3b66bd;
  font-size: 12px;
  font-weight: 600;
}
.account-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.account-logout:hover {
  color: var(--accent);
}
.account-logout .icon {
  width: 16px;
  height: 16px;
}
.workspace {
  padding: 20px 24px 24px;
  width: 100%;
  margin: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.page-heading p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.view-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.view-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 12px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
}
.view-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.view-tabs span {
  padding: 0 6px;
  border-radius: 5px;
  background: #f0f1f3;
  color: #636a75;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
}
.view-tabs .active span {
  background: #edf3ff;
  color: var(--accent);
}
.health-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding-top: 12px;
  flex-shrink: 0;
}
.health-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.connection-dot {
  width: 6px;
  height: 6px;
  background: #9299a2;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-bar a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.health-bar .icon {
  height: 14px;
  width: 14px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.search-control {
  position: relative;
  flex: 1;
  min-width: 220px;
  margin: 0;
}
.search-control .icon {
  position: absolute;
  left: 12px;
  top: 10px;
  color: #858b94;
  width: 16px;
  height: 16px;
}
.search-control input {
  padding-left: 36px;
}
.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.date-filter input {
  width: 144px;
}
.filters .form-select {
  width: 134px;
}
.refresh-button {
  width: 36px;
  padding: 8px;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  flex-shrink: 0;
}
.selection-toolbar {
  color: var(--muted);
  padding: 0 20px 10px;
  border-top: 0;
}
.table {
  margin: 0;
  --tblr-table-border-color: var(--line);
}
.table thead th {
  background: #f7f8fa;
  color: #646a73;
  font-size: 12px;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 14px;
  vertical-align: top;
  white-space: normal;
  border-color: var(--line);
}
.table tbody tr:hover {
  background: #fafcff;
}
.table tbody tr:has(.mail-select:checked) {
  background: #f0f5ff;
}
.mail-table > :not(caption) > * > :first-child {
  padding-left: 20px;
  padding-right: 8px;
  width: 44px;
}
.mail-table > :not(caption) > * > :last-child {
  padding-right: 20px;
}
.subject-cell {
  width: 33%;
  min-width: 220px;
  max-width: 450px;
}
.subject {
  font-size: 14px;
  font-weight: 600;
  display: block;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.subject-cell small,
.mail-leg-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.mail-sender {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}
.mail-snippet {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mail-file-count {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.mail-file-count .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}
.mail-leg-summary {
  min-width: 240px;
  max-width: 430px;
  width: 32%;
}
.mail-leg-summary strong {
  font-size: 14px;
  font-weight: 600;
}
.mail-leg-summary details {
  margin-top: 6px;
  font-size: 12px;
}
.mail-leg-summary summary {
  color: #5573a4;
}
.additional-leg {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.date-line {
  line-height: 1.6;
  margin: 4px 0;
  color: #4e5969;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.received-cell {
  min-width: 130px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}
.row-action .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}
.status-pill {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  background: #f0f1f3;
  color: #596170;
  white-space: nowrap;
}
.status-pill.green {
  background: #edf8f2;
  color: #218358;
}
.status-pill.amber {
  background: #fff6e8;
  color: #a5660c;
}
.status-pill.blue {
  background: #edf3ff;
  color: #3c6bc2;
}
.status-pill.red {
  background: #fff0ee;
  color: #bb5047;
}
.mail-table .d-block {
  margin-top: 5px;
  font-size: 12px;
}
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state h3 {
  margin: 14px 0 8px;
  font-size: 16px;
  color: #3c4149;
}
.empty-state p {
  max-width: 460px;
  margin: 0 auto 20px;
  font-size: 13px;
}
.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  background: #f1f4f8;
  border-radius: 16px;
  color: #8494ab;
}
.empty-icon .icon {
  width: 28px;
  height: 28px;
}
.inbox-page .workspace {
  height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
}
.inbox-page .mail-card {
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.inbox-page #mail-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.inbox-page #mail-list > .table-responsive {
  flex: 1;
  overflow: auto;
}
.notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(550px, 90vw);
  padding: 14px 18px;
  background: white;
  border: 1px solid #cfe2d6;
  color: #28734e;
  border-radius: 8px;
  box-shadow: 0 4px 24px #1f232918;
  z-index: 1000;
  white-space: pre-line;
}
.notice.error {
  border-color: #f4cbc7;
  color: #ad4943;
}
.icon-arrow-left {
  --icon-url: url("vendor/icons/arrow-left.svg");
}
.icon-arrow-right {
  --icon-url: url("vendor/icons/arrow-right.svg");
}
.icon-check {
  --icon-url: url("vendor/icons/check.svg");
}
.icon-chevron-down {
  --icon-url: url("vendor/icons/chevron-down.svg");
}
.icon-chevron-right {
  --icon-url: url("vendor/icons/chevron-right.svg");
}
.icon-circle-check {
  --icon-url: url("vendor/icons/circle-check.svg");
}
.icon-circle-help {
  --icon-url: url("vendor/icons/circle-help.svg");
}
.icon-download {
  --icon-url: url("vendor/icons/download.svg");
}
.icon-file-text {
  --icon-url: url("vendor/icons/file-text.svg");
}
.icon-history {
  --icon-url: url("vendor/icons/history.svg");
}
.icon-inbox {
  --icon-url: url("vendor/icons/inbox.svg");
}
.icon-log-out {
  --icon-url: url("vendor/icons/log-out.svg");
}
.icon-mail {
  --icon-url: url("vendor/icons/mail.svg");
}
.icon-panel-left {
  --icon-url: url("vendor/icons/panel-left.svg");
}
.icon-paperclip {
  --icon-url: url("vendor/icons/paperclip.svg");
}
.icon-plane {
  --icon-url: url("vendor/icons/plane.svg");
}
.icon-plus {
  --icon-url: url("vendor/icons/plus.svg");
}
.icon-refresh-cw {
  --icon-url: url("vendor/icons/refresh-cw.svg");
}
.icon-search {
  --icon-url: url("vendor/icons/search.svg");
}
.icon-settings-2 {
  --icon-url: url("vendor/icons/settings-2.svg");
}
.icon-sliders-horizontal {
  --icon-url: url("vendor/icons/sliders-horizontal.svg");
}
.icon-x {
  --icon-url: url("vendor/icons/x.svg");
}
.review-page .workspace {
  height: calc(100dvh - 64px);
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.review-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 36px;
  margin-bottom: 12px;
}
.review-topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.review-topbar h1 {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin: 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.review-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  position: relative;
}
.source-panel,
.editor-panel,
.queue-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.queue-panel {
  display: none;
}
.review-desk.show-queue .queue-panel {
  display: flex;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  z-index: 25;
  box-shadow: 0 10px 40px #1a334533;
}
.panel-heading {
  padding: 12px 16px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}
.mail-envelope {
  padding: 14px 18px;
  max-height: 145px;
  overflow: auto;
  flex-shrink: 0;
}
.mail-envelope h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.mail-envelope p,
.mail-envelope small {
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0;
  overflow-wrap: anywhere;
}
.source-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  overflow-x: auto;
}
.source-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 12px 0 10px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.source-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.source-tabs #show-body {
  order: -1;
}
.mail-preview {
  width: 100%;
  border: 0;
  flex: 1;
  min-height: 180px;
  background: white;
}
.source-meta {
  padding: 9px 16px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.attachments {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  overflow: auto;
  flex: 1;
}
.attachment-chip {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
  max-width: 100%;
  margin: 3px;
}
.mail-information {
  padding: 16px;
  overflow: auto;
  flex: 1;
}
.mail-information dd {
  overflow-wrap: anywhere;
  color: var(--muted);
  margin: 5px 0 15px;
}
.editor-scroll {
  padding: 14px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.save-state {
  font-size: 13px;
  color: #357c62;
}
.save-state.error {
  color: #b46625;
}
.review-instructions {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.ai-summary {
  font-size: 13px;
  color: #40577a;
  background: #f0f5ff;
  padding: 10px;
  border-radius: 6px;
}
.verification-card {
  padding: 10px 12px;
  background: #edf6f1;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}
.verification-card p {
  margin: 4px 0 0;
  color: var(--muted);
}
.verification-card.needs-attention {
  background: #fff5df;
}
.candidate-options {
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 12px;
  margin-bottom: 12px;
}
.candidate-controls {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.candidate-controls select {
  min-width: 0;
}
.candidate-controls button {
  flex-shrink: 0;
}
.comparison-table {
  table-layout: fixed;
  width: 100%;
  font-size: 13px;
}
.comparison-table td,
.comparison-table th {
  padding: 8px;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.comparison-table .different {
  background: #fff4d8;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 0 10px;
}
.section-heading h3 {
  margin: 0;
}
.leg-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.leg-header {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 12px 14px;
  background: #f7f9fc;
  gap: 5px;
  list-style: none;
  border-bottom: 1px solid var(--line);
}
.leg-header strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 15px;
  font-weight: 600;
}
.leg-header button {
  grid-column: 2;
  grid-row: 1/3;
}
.candidate-description {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.field-group {
  padding: 14px;
}
.field-group h4,
.field-group summary {
  font-size: 13px;
  color: #4e5969;
  margin: 0 0 8px;
}
.leg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.leg-grid label {
  min-width: 0;
}
.human-edited {
  border-left: 3px solid #cc9943 !important;
  background: #fffdf6;
}
.field-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin: 8px 0;
}
.date-windows {
  display: grid;
  gap: 10px;
}
.window-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.window-row label {
  min-width: 0;
}
.leg-evidence {
  padding: 12px;
  font-size: 13px;
  background: #f7f8fa;
}
.leg-evidence blockquote {
  margin: 8px 0;
  padding: 8px;
  border-left: 2px solid #91baff;
  overflow-wrap: anywhere;
}
.evidence-link {
  display: block;
  color: var(--accent);
}
.leg-decision {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.icon-button {
  border: 0;
  background: transparent;
  padding: 5px;
  color: var(--muted);
}
.icon-button.danger {
  color: #a55546;
}
.review-footer {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.review-footer > small {
  font-size: 12px;
  text-align: right;
  color: var(--muted);
}
.update-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff3d5;
  padding: 9px 12px;
  margin-bottom: 8px;
  border-radius: 5px;
  font-size: 13px;
}
.queue-panel > select {
  margin: 10px;
  width: calc(100% - 20px);
}
.queue-items {
  overflow: auto;
  flex: 1;
}
.queue-item {
  display: block;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.queue-item.active {
  background: #eff5ff;
  border-left: 3px solid var(--accent);
}
.queue-item > small,
.queue-item > strong,
.queue-route {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}
.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}
.queue-hint,
.queue-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.timeline-item {
  padding: 12px 0 12px 14px;
  border-left: 2px solid var(--line);
  margin: 8px 0;
}
.timeline-item strong,
.timeline-item small {
  display: block;
}
.timeline-item small,
.timeline-item p {
  font-size: 13px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  max-width: calc(100vw - 30px);
  max-height: 85dvh;
  box-shadow: 0 15px 70px #1d334533;
}
dialog::backdrop {
  background: #172c4055;
}
.collection-dialog {
  width: 560px;
}
.dialog-body {
  padding: 20px;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
.mode-grid p {
  font-size: 13px;
  color: var(--muted);
}
.relation-dialog,
.confirm-dialog {
  width: 950px;
}
.relation-intro,
.relation-search,
.relation-results,
.confirm-content,
.confirm-actions {
  padding: 16px;
}
.relation-search {
  display: flex;
  gap: 8px;
}
.relation-result {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.relation-result p {
  font-size: 13px;
}
.relation-table,
.diff-table {
  width: 100%;
  font-size: 13px;
}
.relation-table td,
.relation-table th,
.diff-table td,
.diff-table th {
  padding: 8px;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.relation-dialog pre {
  white-space: pre-wrap;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0 16px;
}
.settings-card {
  padding: 20px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.setting-row small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.setting-row input {
  appearance: none;
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: 20px;
  background: #c9cdd4;
  cursor: pointer;
  transition: background 0.15s;
}
.setting-row input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px #0002;
  transition: transform 0.15s;
}
.setting-row input:checked {
  background: var(--accent);
}
.setting-row input:checked::before {
  transform: translateX(16px);
}
.setting-row input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.configuration-list {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  margin: 20px 0;
}
.configuration-list dd {
  margin: 0;
  color: var(--muted);
}
.connection-status {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  overflow-wrap: anywhere;
}
.connection-status .status-pill {
  margin-left: 10px;
}
.event-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.event-row span,
.event-row small {
  color: var(--muted);
}
.inventory-tabs {
  margin: 0;
  padding: 0 20px;
}
.offer-filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 16px;
}
.offer-filters > label {
  font-size: 13px;
  color: var(--muted);
}
.advanced-filters {
  flex-basis: 100%;
  font-size: 13px;
}
.secondary-filters {
  padding: 12px 0;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-basis: 100%;
}
.filter-actions .field-hint {
  margin-right: auto;
}
.inventory-table {
  min-width: 950px;
}
.inventory-table td {
  max-width: 350px;
  overflow-wrap: anywhere;
}
.inventory-table small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.inventory-route {
  font-weight: 600;
  color: #1f2329;
}
.inventory-dates {
  min-width: 230px;
}
.offer-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.offer-section {
  padding: 22px;
  overflow-wrap: anywhere;
}
.offer-date {
  padding: 12px;
  border-left: 3px solid #91baff;
  background: #f0f5ff;
  margin: 12px 0;
}
.offer-facts {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
}
.offer-facts dd {
  margin: 0;
  white-space: pre-wrap;
}
.offer-facts dt {
  color: var(--muted);
}
.version-record,
.source-record {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.version-record summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.raw-excerpt {
  white-space: pre-wrap;
  color: var(--muted);
}
.login-workspace {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 25px;
}
.login-shell {
  width: min(440px, 100%);
}
.login-card {
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 32px #1f232908;
}
.login-brand {
  margin-bottom: 25px;
}
.login-card label {
  display: block;
  margin: 20px 0 6px;
}
.login-card h1 {
  margin-bottom: 10px;
}
.login-footnote {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
}
@media (min-width: 1800px) {
  .review-desk {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
  .workspace {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 1000px) {
  .mailbox-label {
    display: none;
  }
  .app-header {
    gap: 15px;
    padding: 0 12px;
  }
  .main-nav a {
    padding: 9px 10px;
  }
  .queue-heading {
    flex-wrap: wrap;
  }
  .workspace {
    padding: 12px;
  }
  .subject-cell {
    min-width: 210px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .event-row {
    grid-template-columns: 120px 1fr;
  }
  .event-row small {
    grid-column: 2;
  }
}
@media (max-width: 760px) {
  .inbox-page .workspace {
    height: auto;
    min-height: calc(100dvh - 110px);
  }
  .inbox-heading {
    flex-wrap: wrap;
  }
  .inbox-heading h1 {
    font-size: 22px;
  }
  .filters {
    padding: 12px;
  }
  .search-control {
    flex-basis: 100%;
  }
  .date-filter {
    flex: 1;
  }
  .date-filter input {
    width: 135px;
  }
  .view-tabs {
    gap: 20px;
    padding: 0 12px;
  }
  .main-nav {
    gap: 18px;
  }
  .health-bar {
    align-items: start;
  }
  .review-topbar > div:first-child {
    width: 100%;
  }
  .review-topbar h1 {
    min-width: 0;
  }

  .app-header {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .brand {
    font-size: 16px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    height: 38px;
  }
  .header-account {
    gap: 6px;
  }
  .review-page .workspace {
    height: auto;
    overflow: visible;
  }
  .review-desk {
    display: flex;
    flex-direction: column;
  }
  .source-panel {
    height: 60dvh;
  }
  .editor-panel {
    min-height: 65dvh;
  }
  .editor-scroll {
    max-height: 70dvh;
  }
  .review-footer {
    position: sticky;
    bottom: 0;
    background: white;
  }
  .review-topbar {
    flex-wrap: wrap;
  }
  .review-topbar h1 {
    max-width: 90vw;
  }
  .inbox-page #mail-list > .table-responsive {
    max-height: none;
  }
  .mail-card .table {
    min-width: 850px;
  }
  .offer-detail-grid {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    flex-wrap: wrap;
  }
  .leg-grid,
  .window-row {
    grid-template-columns: 1fr 1fr;
  }
  .view-tabs a {
    padding: 9px;
  }
  .queue-heading > .heading-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .page-heading {
    align-items: start;
  }
  .review-desk.show-queue .queue-panel {
    position: fixed;
    top: 120px;
    bottom: 10px;
    left: 12px;
  }
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 24px;
  }
}

.relation-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.relation-actions,
.confirmation-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px;
}
.decision-box {
  padding: 12px;
  background: #f7f8fa;
  border-top: 1px solid var(--line);
}
.target-reference {
  padding: 8px;
  background: #eff5ff;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.classification-row {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.classification-row .form-label {
  margin: 0;
}
.candidate-options .ai-summary {
  margin-top: 12px;
}

.login-heading {
  text-align: center;
  margin-bottom: 24px;
}
.login-heading .brand-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border-radius: 12px;
}
.login-heading h1 {
  font-size: 24px;
  margin-bottom: 8px;
}
.login-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.login-card .form-control {
  min-height: 42px;
}
.login-card .btn-primary {
  min-height: 42px;
  margin-top: 24px;
}
.editor-tabs {
  background: #fafbfc;
}

.offer-filters > .search-field {
  flex: 1;
  min-width: 220px;
}
/* Checkpoint JSON stays readable without inline styles (strict CSP). */
.checkpoint-json { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* Review complete flight facts without clipping long source text. */
.review-topbar h1 { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.5; }
.review-topbar, .review-instructions, .ai-summary { flex-shrink: 0; }
.ai-summary, .field-value, .field-evidence blockquote { white-space: pre-wrap; overflow-wrap: anywhere; }
.candidate-description, .leg-header strong { min-width: 0; overflow-wrap: anywhere; }
.leg-grid, .window-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.review-field, .flight-field { min-width: 0; }
.review-field > label { display: block; width: 100%; }
.field-wide { grid-column: 1 / -1; }
textarea.auto-grow { min-height: 72px; line-height: 1.65; resize: vertical; overflow-y: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
#issues { max-height: 200px; overflow-y: auto; }
.material-diagnostics { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.material-diagnostics summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.material-items { max-height: 280px; overflow: auto; overflow-wrap: anywhere; }
.material-item { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; margin: 0; font-size: 12px; border-bottom: 1px solid var(--line); }
.field-evidence { margin: 8px 0 0; padding: 8px 10px; background: #f4f7fc; border-radius: 5px; font-size: 12px; overflow-wrap: anywhere; }
.field-evidence blockquote { margin: 8px 0; padding: 0 0 0 10px; border-left: 2px solid #a5b9df; }
.evidence-link { white-space: normal; overflow-wrap: anywhere; }
.flight-summary { font-size: 13px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.flight-summary + .flight-summary { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.flight-price { color: var(--accent); font-weight: 600; }
.batch-flight-table { table-layout: fixed; width: 100%; }
.batch-flight-table th:first-child { width: 34%; }
.batch-flight-table th:last-child { width: 16%; }
.batch-flight-table td { vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.flight-review-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.flight-source { position: sticky; top: 16px; height: calc(100dvh - 100px); min-height: 420px; }
.flight-source .source-meta { margin: 0; }
.flight-results { min-width: 0; }
.flight-result-heading { padding: 16px; border-bottom: 1px solid var(--line); background: #f7f9fc; overflow-wrap: anywhere; }
.flight-result-heading h2 { font-size: 17px; margin: 0 0 8px; }
.flight-result-heading p { margin: 0; color: var(--accent); white-space: pre-wrap; }
.flight-field-section { padding: 16px; }
.flight-field-section + .flight-field-section { border-top: 1px solid var(--line); }
.flight-field-section h3 { font-size: 14px; margin: 0 0 12px; }
.flight-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.flight-field dt { font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.flight-field dd { margin-left: 0; margin-bottom: 0; }
.flight-field .field-value { min-height: 38px; padding: 9px 11px; background: #f8fafc; border: 1px solid var(--line); border-radius: 5px; line-height: 1.7; }
@media (max-width: 900px) {
  .flight-review-grid { grid-template-columns: 1fr; }
  .flight-source { position: static; height: 55dvh; min-height: 300px; }
  .batch-flight-table { min-width: 700px; }
}
@media (max-width: 520px) {
  .main-nav { flex-wrap: wrap; height: auto; gap: 0 12px; }
  .main-nav a { min-height: 36px; }
  .leg-grid, .window-row, .flight-field-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Automatic inbox: every candidate is visible, without per-flight expansion. */
.compact-flights .mail-table { min-width: 1050px; table-layout: auto; font-size:13px; }
.compact-flights .mail-table td, .compact-flights .mail-table th { padding:10px 12px; vertical-align:top; white-space:normal; }
.compact-flights .mail-table th { font-size:12px; }
.compact-flights .mail-group td { background:#f3f6fa; border-top:2px solid #e1e7ef; }
.mail-group-heading, .mail-group-status { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mail-group-heading > div:first-child { min-width:0; max-width:58%; }
.mail-group-heading .mail-sender { display:block; font-size:12px; margin-top:3px; }
.mail-group-status { flex-wrap:wrap; justify-content:flex-end; font-size:12px; }
.compact-leg small { display:block; font-size:12px; margin-top:3px; }
.compact-leg td:first-child { max-width:250px; min-width:150px; }
.compact-leg td { max-width:240px; overflow-wrap:anywhere; }
.compact-flights .mail-table > :not(caption) > * > :first-child { width:190px; }
.compact-flights .flight-table { table-layout:fixed; min-width:1280px; }
.compact-flights .flight-table > :not(caption) > * > :first-child { width:3%; min-width:0; padding-left:8px; padding-right:8px; }
.compact-flights .flight-table th:nth-child(2) { width:15%; }
.compact-flights .flight-table th:nth-child(3), .compact-flights .flight-table th:nth-child(4) { width:11%; }
.compact-flights .flight-table th:nth-child(5), .compact-flights .flight-table th:nth-child(6),
.compact-flights .flight-table th:nth-child(7), .compact-flights .flight-table th:nth-child(10) { width:10%; }
.compact-flights .flight-table th:nth-child(8) { width:12%; }
.compact-flights .flight-table th:nth-child(9) { width:8%; }
.inbox-page .workspace { height:auto; min-height:calc(100dvh - 64px); }
.inbox-page .mail-card, .inbox-page #mail-list { flex:none; }
.inbox-page #mail-list > .table-responsive { max-height:none; overflow-x:auto; }
.flight-fact { cursor:help; border-bottom:1px dotted #97a3b5; }
.flight-fact:focus-visible { outline:2px solid #2878dc; outline-offset:3px; }
.evidence-tooltip { position:fixed; z-index:10000; max-width:min(460px, calc(100vw - 16px)); max-height:65vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; background:#172338; color:white; padding:12px 14px; border-radius:8px; font-size:12px; line-height:1.6; box-shadow:0 6px 24px #0003; }
.email-flight-overview { flex:none; background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin-bottom:4px; }
.flight-overview-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px 8px; }
.flight-overview-heading h2 { font-size:17px; margin:0 0 8px; }
.flight-overview-heading p { margin:0; }
.flight-overview-summary, .flight-overview-note, .flight-overview-issues { margin:0; padding:10px 18px; }
.flight-overview-issues { background:#fff9ed; font-size:13px; }
.email-flight-overview .table-responsive { max-height:none; }
.flight-number { color:#4275ad; font-variant-numeric:tabular-nums; }
.flight-notes { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:5px 20px; white-space:pre-wrap; }
.compact-flights .flight-supplement td { padding-top:0; padding-bottom:12px; background:#fafbfd; }
.compact-leg small, .flight-fact { white-space:pre-wrap; overflow-wrap:anywhere; }
.flight-raw { color:var(--muted); font-size:11px; }
.field-proof { display:inline-block; margin:5px 0; color:var(--muted); font-size:12px; }
@media (max-width: 900px) {
  .review-page .review-desk { height:auto; }
  .flight-overview-heading { align-items:flex-start; flex-wrap:wrap; }
}

/* Compact inbox; the detail view owns flight data and evidence. */
.mail-summary-table { width:100%; min-width:920px; table-layout:fixed; }
.mail-summary-table th { font-size:12px; color:var(--muted); background:#f6f8fb; }
.mail-summary-table th:nth-child(1) { width:155px; }
.mail-summary-table th:nth-child(2) { width:190px; }
.mail-summary-table th:nth-child(4) { width:110px; }
.mail-summary-table th:nth-child(5) { width:60px; }
.mail-summary-table th:nth-child(6) { width:110px; }
.mail-summary-table th:nth-child(7) { width:85px; }
.mail-summary-table td { padding:14px 16px; vertical-align:middle; border-bottom:1px solid var(--line); }
.mail-summary-table tbody:hover { background:#f6f9ff; }
.mail-ellipsis { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-subject { font-weight:600; color:var(--ink); }
.mail-date { font-size:12px; white-space:nowrap; color:var(--muted); }
.mail-count { text-align:center; font-variant-numeric:tabular-nums; }
.review-page .workspace { height:calc(100dvh - 64px); min-height:650px; overflow:hidden; }
.review-page .review-desk { flex:1; height:auto; min-height:0; grid-template-columns:minmax(0, 42fr) minmax(0, 58fr); gap:12px; }
.review-page .editor-scroll { min-height:0; overflow:auto; }
.review-page .email-flight-overview { margin:0 0 18px; border-radius:8px; }
.review-page .flight-overview-heading { padding:12px; align-items:flex-start; }
.review-page .flight-overview-heading h2 { font-size:15px; }
.review-page .flight-overview-summary { font-size:13px; padding:8px 12px; }
.review-page .flight-overview-issues { padding:8px 12px; }
.review-page .flight-overview-note { font-size:11px; padding:8px 12px; }
.review-page .flight-table thead { position:sticky; top:0; z-index:1; }
.review-page .flight-table { min-width:1400px; }
.review-page .flight-table th:first-child { width:44px; }
.review-page .flight-number { white-space:nowrap; }
.review-page .flight-table th:nth-child(2) { width:170px; }
.review-page .flight-table th:nth-child(3), .review-page .flight-table th:nth-child(4) { width:145px; }
.review-page .flight-table th:nth-child(5), .review-page .flight-table th:nth-child(6) { width:135px; }
.review-page .flight-table th:nth-child(7) { width:120px; }
.review-page .flight-table th:nth-child(8) { width:270px; }
.review-page .flight-table th:nth-child(9) { width:110px; }
.review-page .flight-table th:nth-child(10) { width:135px; }
.review-page .flight-fact { border-bottom-color:transparent; }
.review-page .flight-fact:hover, .review-page .flight-fact:focus { border-bottom-color:#97a3b5; background:#f1f6ff; }
.review-page .flight-table td { font-size:12px; }
.review-page .review-footer { flex-shrink:0; background:#fff; border-top:1px solid var(--line); }
@media (max-width:900px) {
 .review-page .workspace { height:auto; min-height:calc(100dvh - 64px); overflow:visible; }
 .review-page .review-desk { grid-template-columns:minmax(0,1fr); height:auto; }
 .review-page .source-panel { min-height:420px; max-height:65vh; }
 .review-page .editor-scroll { overflow:visible; }
}

.mail-review-hint { display:block; margin-top:4px; font-size:11px; color:#946200; }

/* One selected flight, with all pending inputs retained in the same form. */
#legs > .leg-card[hidden] { display:none !important; }
.flight-editor-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; padding:10px 12px; background:#f4f7fc; border:1px solid var(--line); border-radius:6px; }
#email-flight-overview .compact-leg { cursor:pointer; }
#email-flight-overview .compact-leg.selected-flight td { background:#eaf2ff; box-shadow:inset 0 1px #b6cef4,inset 0 -1px #b6cef4; }
#email-flight-overview .compact-leg:focus { outline:2px solid #5287d4; outline-offset:-2px; }
.review-field.field-warning, [data-feedback].field-warning > .form-control { background:#fff8dd; }
.review-field.field-warning { border-radius:6px; padding:7px; }
.field-warning > label > .form-control, .field-warning > label > .form-select { background:#fffbed; border-color:#e1c878; }
.field-error > label > .form-control, .field-error > label > .form-select, label.field-error > .form-control { border:2px solid #c83f4b; background:#fff5f5; }
.field-feedback { display:block; text-align:left; border:0; background:transparent; color:#805c13; padding:6px 0; font-size:12px; line-height:1.6; cursor:pointer; }
.field-error .field-feedback { color:#ac2d3d; }
.field-feedback:hover, .field-feedback:focus { text-decoration:underline; }
.field-pending { display:block; color:#7a5b18; margin-top:4px; }
.field-inspection { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:13px; padding:12px; background:#f5f7fa; }
.metadata-choice { display:block; width:100%; margin:7px 0; text-align:left; white-space:normal; }
.mail-review-issues { margin:12px 0; font-size:13px; }
.leg-card > .leg-header { cursor:default; }
.registration-origin:empty { display:none; }

.field-group.field-warning { background:#fff8dd; border-radius:6px; padding:10px; }
label.field-warning > .form-control { background:#fffbed; border-color:#e1c878; }

#email-flight-overview .flight-table th:last-child, #email-flight-overview .flight-table td:last-child { position:sticky; right:0; background:#fff; border-left:1px solid var(--line); }
#email-flight-overview .flight-table th:last-child { background:#f6f8fb; z-index:2; }
#email-flight-overview .flight-table .selected-flight td:last-child { background:#eaf2ff; }

.field-locate { display:block; border:0; padding:4px 0; color:#805c13; background:transparent; font-size:11px; text-decoration:underline; text-align:left; }

/* Keep a wide flight table inside its scroller, including long mail subjects. */
.review-page .workspace { min-width:0; max-width:100%; box-sizing:border-box; }
.review-page .review-desk { width:100%; max-width:100%; min-width:0; align-self:stretch; }
.review-page .source-panel, .review-page .editor-panel, .review-page .editor-scroll,
.review-page [data-editor-panel], .review-page .email-flight-overview { min-width:0; max-width:100%; box-sizing:border-box; }
.review-page .mail-preview { display:block; min-width:0; max-width:100%; }
.review-page .compact-flights { width:100%; max-width:100%; overflow-x:auto; }
.preview-status-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; padding:8px 16px; font-size:12px; border-bottom:1px solid var(--line); background:#f6f8fb; flex-shrink:0; }
.preview-status-bar span { flex:1; min-width:0; overflow-wrap:anywhere; }
.preview-status-bar.needs-attention { color:#805c13; background:#fff8e6; }

/* Canonical five-module editor. Dropdowns remain within the review column. */
.compact-editor .field-group { margin: 0 0 10px; padding: 8px; }
.compact-editor .field-group h4 { margin: 0 0 6px; }
.compact-editor .leg-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.compact-editor .review-field { min-width:0; position:relative; }
.compact-editor .date-windows { grid-column:1/-1; }
.compact-editor .window-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:8px; }
.compact-editor .metadata-dropdown { position:absolute; top:100%; left:0; right:0; z-index:40; max-height:240px; overflow:auto; background:white; border:1px solid #ccd5df; box-shadow:0 4px 12px #0002; }
.compact-editor .metadata-choice { display:block; width:100%; border:0; background:white; padding:9px; text-align:left; white-space:normal; }
.compact-editor .metadata-choice:hover,.compact-editor .metadata-choice:focus { background:#edf4ff; }
.compact-remark .field-wide {grid-column:1/-1;}
.compact-editor input,.compact-editor select {min-width:0;max-width:100%;}
@media(max-width:540px){.compact-editor .leg-grid{grid-template-columns:minmax(0,1fr);}}

/* Seven columns: sequence + five business modules + combined remark. */
.review-page .compact-flights { max-height:230px; }
.review-page .compact-flights .flight-table { min-width:800px; table-layout:fixed; }
.review-page .compact-flights .flight-table th:first-child {width:36px;}
.review-page .compact-flights .flight-table th:nth-child(2) {width:125px;}
.review-page .compact-flights .flight-table th:nth-child(3) {width:180px;}
.review-page .compact-flights .flight-table th:nth-child(4) {width:100px;}
.review-page .compact-flights .flight-table th:nth-child(5) {width:115px;}
.review-page .compact-flights .flight-table th:nth-child(6) {width:90px;}
.review-page .compact-flights .flight-table th:nth-child(7) {width:150px;}
#email-flight-overview .flight-table th:last-child,#email-flight-overview .flight-table td:last-child {position:static;border-left:0;}

.compact-editor .leg-header {grid-template-columns:minmax(0,1fr) auto auto;}
.compact-editor .leg-header button {grid-column:auto;grid-row:1;}

/* Full flight overview and natural document height; no nested result scrollers. */
.review-page .workspace { height:auto; min-height:calc(100dvh - 64px); overflow:visible; }
.review-page .review-desk { flex:none; align-items:start; }
.review-page .all-flight-overview { grid-column:1/-1; min-width:0; }
.review-page .editor-panel, .review-page .editor-scroll { overflow:visible; }
.review-page .editor-scroll { flex:none; }
.review-page .compact-flights { max-height:none; overflow:visible; }
.review-page .compact-flights .flight-table { min-width:0; width:100%; table-layout:fixed; }
.review-page .compact-flights .flight-table th { width:auto; }
.review-page .compact-flights .flight-table th:first-child { width:42px; }
.review-page .compact-flights .flight-table td { max-width:none; white-space:normal; overflow-wrap:anywhere; }
.review-page .flight-remark { white-space:pre-wrap; overflow:visible; max-height:none; }
.compact-editor .location-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.compact-editor .window-bound { display:grid; gap:8px; }
.compact-editor textarea.auto-grow { max-height:none; overflow-y:hidden; resize:none; }
@media(min-width:1001px){.review-page .source-panel{position:sticky;top:12px;height:calc(100dvh - 90px);}}
@media(max-width:540px){.compact-editor .location-grid{grid-template-columns:minmax(0,1fr);}.review-page .compact-flights .flight-table{font-size:11px;}.review-page .compact-flights .flight-table td,.review-page .compact-flights .flight-table th{padding:6px 3px;}}

/* Show both database names beside the selected entity, including after reload. */
.compact-editor .entity-context:empty { display:none; }
.compact-editor .entity-context:not(:empty) { display:block; margin-top:4px; color:#526579; }

.review-page .compact-flights .flight-table td.flight-remark { white-space:pre-wrap; }

/* Mail on the left; flight picker and selected record together on the right. */
.review-page .review-right { min-width:0; display:flex; flex-direction:column; gap:12px; }
.review-page .review-right .all-flight-overview { min-width:0; grid-column:auto; }
.review-page .review-right .email-flight-overview { margin-bottom:0; }
.review-page .review-right .editor-panel { width:100%; min-width:0; }
.review-page .flight-picker td { vertical-align:middle; }
.review-page .flight-picker th:nth-child(2) { width:25%; }
.review-page .flight-picker th:nth-child(3) { width:29%; }
.review-page .flight-picker th:nth-child(4) { width:23%; }
.review-page .flight-picker th:last-child { width:17%; }
@media(min-width:901px){.review-page .source-panel{position:sticky;top:12px;height:calc(100dvh - 90px);max-height:none;}}
@media(max-width:1100px){.review-page .review-right .location-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:540px){.review-page .review-right .location-grid{grid-template-columns:minmax(0,1fr);}}

.saved-notice { margin: 16px; padding: 18px 20px; border: 2px solid #16804a; border-radius: 10px; background: #eaf8ef; color: #14532d; font-size: 16px; font-weight: 700; line-height: 1.6; }
.review-footer button:disabled, .leg-card button:disabled, #add-leg:disabled { background: #e5e7eb !important; color: #6b7280 !important; border-color: #d1d5db !important; opacity: 1; cursor: not-allowed; }
.leg-card.is-readonly input:disabled, .leg-card.is-readonly textarea:disabled, .leg-card.is-readonly select:disabled { color: #374151; background: #f3f4f6; opacity: 1; }
.flight-disposition { width: 96px; min-width: 84px; padding: 5px 24px 5px 10px; font-size: 12px; border-radius: 6px; }
.flight-disposition[data-state="use"] { color: #16723b; background-color: #eefbf2; border-color: #acd9bc; }
.flight-disposition[data-state="defer"] { color: #8a6111; background-color: #fff8e6; }
.flight-disposition[data-state="ignore"], .flight-disposition[data-state="reject"] { color: #8e3535; background-color: #fff0f0; }
.flight-state-cell { min-width: 96px; }
.metadata-choice { white-space: normal; text-align: left; line-height: 1.5; }

/* Result states and selected-flight review. */
.flight-picker th:first-child,.flight-select-cell{width:38px;min-width:38px;text-align:center}.flight-state-cell .status-pill{margin-bottom:5px}.rejection-reason{white-space:normal;overflow-wrap:anywhere;max-width:300px;color:#b42318;margin-top:6px}.status-pill.red{color:#b42318;background:#fff0f0}.mail-group-row{background:#f6f8fb}.workbench-flight small{display:block;color:#667085}.workbench-flight td{white-space:normal;overflow-wrap:anywhere}.flight-state-cell .flight-disposition{min-width:86px}.footer-actions{flex-wrap:wrap}

.source-message-id{display:block;margin-top:5px;overflow-wrap:anywhere}.flight-picker td:nth-child(4){min-width:125px}.flight-picker td:nth-child(6){white-space:nowrap}

/* Mail headers and flight results share columns; reserve space for price and reason. */
.mail-summary-table{min-width:1250px}.mail-summary-table th:nth-child(1){width:150px}.mail-summary-table th:nth-child(2){width:180px}.mail-summary-table th:nth-child(4){width:170px}.mail-summary-table th:nth-child(5){width:175px}.mail-summary-table th:nth-child(6){width:215px}.mail-summary-table th:nth-child(7){width:135px}.workbench-flight td:nth-child(5){white-space:nowrap;overflow-wrap:normal}.workbench-flight td:nth-child(4){overflow-wrap:normal}

/* Independent archive preview and per-flight submission feedback. */
.source-panel{position:relative}
.mail-image-dialog{position:absolute;inset:0;margin:0;width:100%;max-width:100%;height:100%;max-height:100%;box-sizing:border-box;padding:0;border:0;border-radius:8px;background:#17212d;color:#fff;z-index:5}
.mail-image-dialog[open]{display:flex;flex-direction:column}
.mail-image-dialog .image-stage{flex:1;min-height:0;height:auto}
.entity-previous{display:block;color:#b45309;margin-top:4px}
.image-toolbar{flex-wrap:wrap}
.mail-image-dialog::backdrop{background:rgba(0,0,0,.75)}
.image-toolbar{display:flex;align-items:center;gap:8px;padding:12px;flex-wrap:wrap}.image-toolbar span{margin-right:auto}
.image-stage{height:calc(100% - 75px);overflow:auto;padding:16px;cursor:grab;touch-action:none}.image-stage:active{cursor:grabbing}
.zoomed-mail-image{display:block;max-width:none;max-height:none;height:auto;margin:auto}
.submission-results{margin:12px;padding:12px;border:1px solid #cbd5e1;border-radius:8px;max-height:260px;overflow:auto}
.submission-row{display:grid;grid-template-columns:minmax(130px,1fr) 2fr;gap:10px;padding:7px 0;overflow-wrap:anywhere}.submission-row.success{color:#176b36}.submission-row.failed{color:#b42318}.submission-row.pending{color:#965800}
.aircraft-confirmation{grid-column:1/-1;padding:10px 10px 10px 32px;background:#fff7df;border-radius:6px}.field-feedback{display:block;color:#a04413;margin-top:4px}
.filters input[name=flight_id]{max-width:260px}

/* Database flight IDs remain readable and selectable at every viewport. */
.review-page .compact-flights .flight-table th:nth-child(2) {width:195px;}
.flight-id-cell {font-variant-numeric:tabular-nums;overflow-wrap:anywhere;user-select:text;}
.review-reasons{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0;max-width:250px}
.review-reason{font-size:12px;border:1px solid #ebc77d;border-radius:4px;padding:3px 6px;background:#fff8e6;color:#805000;text-align:left;cursor:pointer}
.review-reason.error{background:#fff0ef;border-color:#f0b0aa;color:#ad251c}
.review-reason.info{background:#eef4ff;border-color:#c7d7f8;color:#335680}
.review-ready{color:#1a653d}
