:root {
  --bg: #f4f6f7;
  --ink: #202830;
  --muted: #697782;
  --line: #dfe5e8;
  --blue: #186da7;
  --green: #087e70;
  --sidebar: #17241f;
  --sidebar-2: #22392f;
}
body, button, input, select, textarea { letter-spacing: 0; }
body:not(.second-brain-mode) .sidebar { background: #17241f; }
.brand strong { font-size: 16px; line-height: 1.5; white-space: normal; }
.brand span { font-size: 10px; }
.brand::before { content: "臻"; background: #297660; color: #fff; }
.main { min-width: 0; }
.view-root { min-width: 0; }
.erp-record-tools {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.erp-record-tools label { display: grid; gap: 5px; font-size: 12px; min-width: 180px; }
.erp-record-tools input { min-height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.erp-record-tools button, .erp-bulk-bar button {
  border: 1px solid var(--line); background: white; color: var(--ink); min-height: 36px;
  border-radius: 4px; padding: 7px 12px; cursor: pointer;
}
.erp-record-tools button:disabled { opacity: .45; cursor: default; }
.erp-record-tools .segmented .active { background: var(--blue); color: white; }
.erp-record-tools span { align-self: center; margin-left: auto; font-size: 12px; color: var(--muted); }
.erp-bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; background: #edf5f2; border-bottom: 1px solid var(--line); }
.erp-check { width: 42px; min-width: 42px; text-align: center; }
[data-erp-select], [data-erp-all], #identityReviewed { width: 17px; height: 17px; accent-color: var(--green); }
.identity-review-check { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.draft-identity-review { border-block: 1px solid #ced9e1; padding: 16px 0; }
.draft-identity-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.draft-identity-heading [role="status"] { color: #5b6872; font-size: 13px; }
.draft-identity-traveler { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 0; overflow-wrap: anywhere; }
.draft-identity-traveler > span { max-width: 100%; }
.draft-identity-review .identity-review-check { cursor: pointer; font-weight: 600; }
.draft-identity-review input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; accent-color: #14678b; }
.draft-identity-review input:focus-visible { outline: 2px solid #14678b; outline-offset: 3px; }
.draft-identity-error { color: #a32c2c; margin: 8px 0 0; }
.erp-error { padding: 12px; border-left: 3px solid #b93c40; background: #fff0f0; color: #9b2930; }
.erp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.erp-metrics > * { border-radius: 0; box-shadow: none; border: 0; border-right: 1px solid var(--line); min-width: 0; }
.erp-band { padding: 18px 0; border-bottom: 1px solid var(--line); }
.erp-band h2 { font-size: 16px; margin: 0 0 16px; }
.erp-trend { display: grid; grid-template-columns: 100px minmax(40px,1fr) 100px 60px; align-items: center; gap: 14px; min-height: 38px; font-size: 12px; }
.erp-trend > div { height: 12px; background: #e8edef; }
.erp-trend i { height: 100%; display: block; background: #208b78; }
.erp-ai-status p { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.erp-ai-status span { overflow-wrap: anywhere; }
.erp-ai-result { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.table-wrap { max-width: 100%; }
.modal-root .modal { max-width: calc(100vw - 24px); }
.auto-wrap { max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.auto-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.auto-settings { display: grid; gap: 18px; padding: 16px 0; }
.auto-check { display: flex !important; align-items: center; gap: 10px; }
.auto-check input { width: 18px !important; height: 18px; min-height: 18px; }
#autoQuery { width: 420px; max-width: 100%; }
@media (max-width: 850px) {
  .erp-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .erp-record-tools label { flex: 1 1 180px; }
  .erp-record-tools span { margin-left: 0; }
  .erp-trend { grid-template-columns: 84px minmax(20px,1fr) 74px; gap: 8px; }
  .erp-trend > span:last-child { display: none; }
  .topbar { flex-wrap: wrap; }
  .topbar .account { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .view-root { padding-bottom: 110px; }
  .erp-metrics { grid-template-columns: minmax(0,1fr); }
  .erp-record-tools { align-items: stretch; }
  .erp-record-tools input { width: 100%; }
}
