/* 报价审核工作台（界面示例）。共享主题见 assets/demo-theme.css 的 .demo-quote-review 部分。 */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #5b6b78;
  --line: #d9e0ea;
  --soft: #eef3f7;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #b54708;
  --red: #b42318;
  --green: #067647;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* ---------- 顶部导航（浅色，文字对比度 ≥ 4.5:1） ---------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 15;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px 24px;
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  color: #33495a;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--ink);
  background: #f0f5f8;
}

.nav-item.active {
  color: #075f79;
  background: #e6f2f7;
  font-weight: 600;
}

.nav-item b {
  min-width: 22px;
  border-radius: 999px;
  padding: 1px 7px;
  background: #c62828;
  color: #ffffff;
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 13px;
}

.sidebar-footer a {
  color: #075f79;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

.demo-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: #33495a;
  background: #f4f8fa;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 页面框架 ---------- */
.app {
  min-width: 0;
  padding: 22px 28px 44px;
}

.topbar,
.toolbar,
.queue-head,
.review-actions,
.drawer-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h1:focus,
h2:focus {
  outline: none;
}

.topbar p,
.metric span,
.muted {
  color: var(--muted);
}

.top-actions,
.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  font-weight: 650;
}

.primary-button {
  color: #ffffff;
  background: var(--teal);
}

.ghost-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.ghost-button:hover {
  background: #f4f8fa;
}

.danger-button {
  color: #ffffff;
  background: var(--red);
}

.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metrics[hidden] {
  display: none;
}

.metric {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric span {
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ---------- 报价库 ---------- */
.toolbar {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 360px;
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--muted);
}

.searchbox:focus-within {
  border-color: #178cb9;
  box-shadow: 0 0 0 3px rgba(23, 140, 185, 0.18);
}

.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
}

select,
.date-filter input,
.field input,
.field select,
.field textarea {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.column-menu {
  position: fixed;
  top: 132px;
  right: 28px;
  z-index: 30;
  display: none;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.column-menu.open {
  display: block;
}

.column-menu-head,
.column-menu-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.column-menu-head strong {
  display: block;
  font-size: 15px;
}

.column-menu-head span {
  color: var(--muted);
  font-size: 12px;
}

.column-menu-actions {
  justify-content: flex-start;
  background: #f8fafc;
}

.column-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px 14px 14px;
  list-style: none;
}

.column-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #344054;
  background: #ffffff;
}

.column-check.active {
  border-color: #8fd6cc;
  background: #f0fdfa;
  color: #134e4a;
}

.column-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.column-check input {
  margin: 0;
}

.column-check label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-check em {
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: #f2f4f7;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.column-move {
  display: inline-flex;
  gap: 2px;
}

.column-move button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #ffffff;
  line-height: 1;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: auto;
  box-shadow: var(--shadow);
}

.quote-table {
  width: 100%;
  min-width: 4200px;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f5;
  text-align: center;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 4px;
  padding: 2px 4px;
  color: inherit;
  background: transparent;
  font-weight: 700;
  white-space: nowrap;
}

.sort-button:hover {
  color: var(--ink);
  background: #eef3f7;
}

.sort-mark {
  min-width: 0.7em;
}

tbody tr:hover {
  background: #fbfdff;
}

.search-empty {
  padding: 32px;
  text-align: left;
  color: var(--muted);
  font-size: 15px;
}

.quote-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}

.price {
  font-weight: 750;
}

.price.low {
  color: var(--green);
}

.remark-cell {
  display: -webkit-box;
  width: 260px;
  margin: 0 auto;
  max-height: 40px;
  overflow: hidden;
  color: #344054;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.remark-cell.compact {
  width: 180px;
}

.status,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

button.chip {
  cursor: pointer;
}

.status.ok,
.chip.ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: var(--green);
}

.status.warn,
.chip.warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: var(--amber);
}

.status.bad,
.chip.bad {
  border-color: #fecdca;
  background: #fef3f2;
  color: var(--red);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.compare-bar {
  position: sticky;
  bottom: 12px;
  display: none;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px 8px 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.compare-bar.visible {
  display: flex;
}

/* ---------- 审核中心 ---------- */
.review-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
}

.review-queue,
.review-detail,
.spec-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.review-queue {
  overflow: hidden;
  align-self: start;
}

.queue-head {
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.queue-head h2 {
  font-size: 16px;
}

.queue-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

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

.queue-item.active {
  background: #f0fdfa;
  box-shadow: inset 3px 0 var(--teal);
}

.queue-empty {
  display: grid;
  gap: 8px;
  padding: 16px 14px;
  color: var(--muted);
}

.queue-empty strong {
  color: var(--ink);
}

.review-detail {
  padding: 16px;
  min-height: 620px;
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 540px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state > .icon {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  color: #8a96a8;
}

.empty-state h2 {
  margin-bottom: 6px;
  color: var(--ink);
}

.empty-state p {
  max-width: 560px;
  margin-bottom: 14px;
}

.review-split {
  display: grid;
  grid-template-columns: minmax(380px, 46%) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  width: 100%;
  min-width: 0;
}

.mail-document,
.parsed-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.mail-body {
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
}

.source-panel {
  min-width: 0;
  align-self: start;
}

.source-tabs {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  overflow-x: auto;
}

.source-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffffff;
  color: var(--muted);
  white-space: nowrap;
}

.source-tab.active {
  border-color: #8fd6cc;
  background: #f0fdfa;
  color: #0b5f58;
  font-weight: 750;
}

.modal-tabs {
  padding: 12px 18px;
}

.source-preview {
  max-height: calc(100vh - 310px);
  min-height: 420px;
  overflow: auto;
  background: #ffffff;
  cursor: grab;
  overscroll-behavior: contain;
  user-select: none;
}

.source-preview.dragging,
.source-modal-body.dragging {
  cursor: grabbing;
}

.source-body.compact {
  font-size: 13px;
}

.image-evidence,
.html-evidence,
.sheet-evidence {
  padding: 12px;
}

.image-evidence.compact {
  background: #f8fafc;
}

.html-evidence table,
.sheet-evidence table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: #ffffff;
}

.html-evidence th,
.html-evidence td,
.sheet-evidence th,
.sheet-evidence td {
  position: static;
  border: 1px solid #d0d5dd;
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
}

.html-evidence th,
.sheet-evidence th {
  background: #f8fafc;
  font-weight: 800;
}

.image-frame {
  max-height: min(62vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.image-frame img {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}

.image-evidence.full .image-frame {
  max-height: calc(100vh - 220px);
}

.image-evidence.full .image-frame img {
  width: auto;
  max-width: none;
  min-width: 0;
}

.source-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.evidence-file-name {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.parsed-form {
  width: 100%;
  min-width: 0;
  padding: 12px;
}

.analysis-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  width: 100%;
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  background: #f8fafc;
}

.analysis-head h3 {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.analysis-notes {
  margin: 0;
  padding: 10px 12px 10px 28px;
  border-bottom: 1px solid #edf1f5;
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-table-wrap {
  overflow: auto;
}

.analysis-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.analysis-table th,
.analysis-table td {
  padding: 8px 9px;
  text-align: center;
}

.analysis-table th {
  position: static;
}

.analysis-table tbody tr {
  cursor: pointer;
}

.analysis-table tbody tr.has-error {
  background: #fff7f7;
}

.analysis-table tbody tr.has-warning {
  background: #fffcf2;
}

.analysis-table tbody tr.is-excluded td {
  color: var(--muted);
  text-decoration: line-through;
}

.analysis-table tbody tr.is-excluded td:first-child,
.analysis-table tbody tr.is-excluded td:nth-child(2) {
  text-decoration: none;
}

.analysis-table tbody tr:hover {
  background: #f0fdfa;
}

.analysis-table tbody tr.active {
  background: #ecfdf3;
  outline: 2px solid #0f766e;
  outline-offset: -2px;
}

.row-pick {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--ink);
  background: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

.row-pick[aria-pressed="true"] {
  border-color: #0f766e;
  color: #0b5f58;
  font-weight: 700;
}

.row-context {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
}

.row-context h3 {
  font-size: 15px;
}

.issue-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.row-banner {
  border-left: 3px solid #8a96a8;
  border-radius: 6px;
  padding: 8px 10px;
  color: #344054;
  background: #f4f6f8;
  font-size: 13px;
}

.row-banner.ok {
  border-left-color: var(--green);
  background: #ecfdf3;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-size: 12px;
}

.label-main {
  color: var(--ink);
  font-weight: 750;
}

.required-mark {
  margin-left: 3px;
  color: var(--red);
  font-size: 13px;
}

.field.required input,
.field.required select {
  font-weight: 700;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.field.attention input,
.field.attention select,
.field.attention textarea {
  border-color: #dc8a0b;
  box-shadow: 0 0 0 3px rgba(220, 138, 11, 0.14);
}

.hint-group {
  display: grid;
  gap: 4px;
}

.hint-group:empty {
  display: none;
}

.hint {
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.hint.warn {
  color: var(--amber);
}

.hint.neutral {
  color: var(--muted);
}

.input-affix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.input-affix span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-section {
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  width: 100%;
}

.form-section + .form-section {
  margin-top: 10px;
}

.form-section h3 {
  margin-bottom: 10px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.notes-section textarea {
  height: auto;
  min-height: 82px;
  padding-top: 8px;
  resize: vertical;
}

.review-actions {
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.parsed-form .review-actions {
  margin: 12px -12px -12px;
  background: #fbfcfd;
}

.mail-meta {
  color: var(--muted);
  font-size: 12px;
}

.spec-panel {
  padding: 18px;
}

.spec-panel p {
  margin-top: 6px;
  color: var(--muted);
}

.spec-panel pre {
  overflow: auto;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #101828;
  color: #e5edf5;
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- 弹层：抽屉、原文件、确认框 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  background: rgba(15, 23, 42, 0);
  transition: background 0.2s ease, visibility 0s linear 0.2s;
}

.drawer.open {
  visibility: visible;
  background: rgba(15, 23, 42, 0.28);
  transition: background 0.2s ease;
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(760px, 100vw);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

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

.source-modal,
.confirm-modal {
  position: fixed;
  inset: 0;
  display: none;
  padding: 28px;
}

.source-modal {
  z-index: 40;
  background: rgba(15, 23, 42, 0.42);
}

.confirm-modal {
  z-index: 50;
  background: rgba(15, 23, 42, 0.48);
}

.source-modal.open {
  display: block;
}

.confirm-modal.open {
  display: grid;
  place-items: center;
}

.confirm-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 56px);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.confirm-panel.narrow {
  width: min(520px, calc(100vw - 40px));
}

.confirm-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px;
}

.confirm-warning {
  border: 1px solid #fedf89;
  border-radius: 8px;
  padding: 10px 12px;
  color: #93370d;
  background: #fffaeb;
  line-height: 1.6;
}

.confirm-warning ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-weight: 400;
}

.confirm-warning.bad {
  border-color: #fecdca;
  color: #912018;
  background: #fef3f2;
}

.confirm-warning.ok {
  border-color: #abefc6;
  color: #05603a;
  background: #ecfdf3;
}

.confirm-section-title {
  font-size: 14px;
  font-weight: 800;
}

.confirm-diff-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.confirm-diff-block h3 {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 14px;
}

.confirm-diff-block > p {
  padding: 10px 12px;
}

.confirm-diff-block table {
  width: 100%;
  border-collapse: collapse;
}

.confirm-diff-block th,
.confirm-diff-block td {
  position: static;
  padding: 8px 10px;
  white-space: normal;
}

.source-modal-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.source-modal-body {
  overflow: auto;
  padding: 18px;
  cursor: grab;
  overscroll-behavior: contain;
  user-select: none;
}

.source-modal-body .mail-body {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
}

.source-modal-body .html-evidence table,
.source-modal-body .sheet-evidence table {
  min-width: 900px;
}

.drawer-head {
  position: sticky;
  top: 0;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  z-index: 3;
}

.drawer-body {
  padding: 16px;
}

.quote-edit-summary {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  text-align: center;
}

.quote-edit-summary strong {
  font-size: 18px;
}

.quote-edit-summary span {
  color: var(--muted);
  font-size: 12px;
}

.quote-edit-form .form-section {
  margin-top: 10px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  position: static;
  white-space: normal;
  vertical-align: middle;
}

.compare-table tbody th {
  width: 84px;
  color: #475467;
  background: #f8fafc;
  text-align: left;
}

.compare-table thead .quote-id {
  font-size: 12px;
  word-break: break-all;
}

.best-mark {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 6px;
  color: var(--green);
  background: #ecfdf3;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(460px, calc(100vw - 32px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 12px 14px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  transition: 0.2s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer.open,
  .drawer-panel,
  .toast {
    transition: none;
  }
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-layout,
  .review-split {
    grid-template-columns: 1fr;
  }

  .source-preview {
    min-height: 0;
    max-height: 420px;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 16px;
  }

  .sidebar-footer {
    gap: 10px;
    font-size: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .app {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 0;
    padding: 10px 12px;
  }

  .metric strong {
    font-size: 18px;
  }

  .metric:first-child {
    grid-column: 1 / -1;
  }

  .review-detail {
    padding: 12px;
  }

  .review-detail > .panel-head {
    flex-direction: column;
  }

  .searchbox {
    min-width: 100%;
  }

  .toolbar select,
  .date-filter {
    flex: 1 1 140px;
  }

  .date-filter input {
    min-width: 0;
    flex: 1;
  }

  .column-menu {
    top: 16px;
    right: 16px;
    max-height: calc(100vh - 32px);
  }

  .column-menu-grid {
    grid-template-columns: 1fr;
  }

  .compare-bar {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 14px;
  }

  .source-modal,
  .confirm-modal {
    padding: 10px;
  }

  .confirm-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .review-actions {
    justify-content: stretch;
  }

  .review-actions > button {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .sidebar-footer {
    width: 100%;
    order: 2;
    justify-content: space-between;
  }
}
