:root {
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  color:#0f172a;
  background:#f8fafc;
  font-size:14px;
  font-synthesis:none
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input,select {
  font:inherit
}
button,a,input[type=checkbox] {
  cursor:pointer
}
button {
  background:#fff;
  color:#475569;
  border:1px solid #e2e8f0;
  padding:8px 12px;
  border-radius:8px;
  font-size:12px;
  white-space:nowrap
}
button:hover {
  background:#f1f5f9
}
button:disabled {
  opacity:.55;
  cursor:default
}
.primary {
  background:#2563eb;
  color:#fff;
  border-color:#2563eb
}
.primary:hover {
  background:#1d4ed8
}
a {
  color:#2563eb;
  text-decoration:none
}
a:hover {
  text-decoration:underline
}
.topbar {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:16px;
  padding:11px 20px;
  background:white;
  border-bottom:1px solid #e2e8f0;
  min-width:0
}
.current-company {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
  flex:1
}
.current-company strong {
  overflow-wrap:anywhere
}
.pill {
  font-size:11px;
  color:#2563eb;
  background:#eff6ff;
  border-radius:5px;
  padding:4px 8px;
  white-space:nowrap
}
.pill:empty {
  display:none
}
.header-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap
}
select {
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:white;
  padding:8px;
  color:#334155;
  font-size:12px
}
.workbench {
  display:flex;
  min-height:calc(100vh - 96px)
}
#page-nav {
  width:160px;
  background:white;
  border-right:1px solid #e2e8f0;
  padding:16px 12px;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  gap:5px
}
#page-nav button {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:0;
  text-align:left;
  white-space:nowrap
}
#page-nav button.active {
  color:#2563eb;
  background:#eff6ff;
  font-weight:600
}
#page-nav span:last-child {
  color:#94a3b8;
  font-size:11px
}
.content {
  padding:16px;
  min-width:0;
  flex:1;
  max-width:1600px
}
h2 {
  font-size:14px;
  margin:0
}
p {
  font-size:12px;
  color:#64748b;
  line-height:1.7;
  margin:6px 0 0
}
.sync {
  color:#16a34a;
  font-size:12px;
  white-space:nowrap
}
.sync.error {
  color:#dc2626
}
.table-card {
  background:white;
  border:1px solid #e2e8f0;
  border-radius:12px;
  overflow:hidden;
  margin-bottom:16px
}
.table-heading {
  background:#f8fafc;
  border-bottom:1px solid #e2e8f0;
  padding:8px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  font-size:12px;
  font-weight:600
}
.table-heading small {
  font-weight:400;
  color:#64748b
}
.table-scroll {
  overflow-x:auto
}
table {
  border-collapse:collapse;
  width:100%;
  font-size:12px;
  white-space:nowrap
}
th {
  background:#f8fafc;
  color:#64748b;
  font-weight:500;
  text-align:left;
  padding:10px 12px;
  white-space:nowrap
}
td {
  border-top:1px solid #f1f5f9;
  padding:9px 12px;
  vertical-align:top
}
tbody tr:hover {
  background:#f8fafc
}
td input[type=text] {
  background:transparent;
  color:#334155;
  border:1px solid transparent;
  border-radius:4px;
  padding:5px;
  width:100%;
  min-width:85px;
  max-width:300px
}
td input[type=text]:hover {
  border-color:#cbd5e1
}
td input[type=text]:focus {
  border-color:#60a5fa;
  background:#fff;
  outline:2px solid #dbeafe
}
td input.numeric {
  color:#2563eb;
  min-width:65px;
  max-width:130px
}
input[type=checkbox] {
  accent-color:#2563eb
}
td .source {
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  align-items:flex-start;
  max-width:260px;
  white-space:normal;
  word-break:break-word
}
td .source :is(a,.source-page-button) {
  font-size:11px;
  white-space:nowrap
}
.empty {
  padding:40px 12px;
  text-align:center;
  color:#64748b
}
.note {
  font-size:11px;
  color:#b45309;
  margin-left:6px
}
.row-disabled {
  opacity:.6
}
button:focus-visible,a:focus-visible {
  outline:2px solid #60a5fa;
  outline-offset:2px
}
@media(max-width:900px) {
  .topbar {
    padding:12px;
    gap:10px
  }
  .workbench {
    flex-direction:column
  }
  #page-nav {
    width:100%;
    flex-direction:row;
    overflow-x:auto;
    border-right:0;
    border-bottom:1px solid #e2e8f0;
    padding:8px
  }
  #page-nav button {
    flex-shrink:0
  }
  .content {
    padding:12px
  }
}
@media(max-width:520px) {
  .current-company {
    flex-basis:100%
  }
  .header-actions {
    margin-left:0
  }
  .table-heading small {
    white-space:normal
  }
  .topbar {
    align-items:flex-start
  }
}

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.view-tabs { display: flex; gap: 16px; padding: 0 20px; border-bottom: 1px solid #e2e8f0; background: #fff; overflow-x: auto; }
.view-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 4px; }
.view-tabs button[aria-selected="true"] { color: #1d4ed8; font-weight: 650; border-bottom-color: #2563eb; }
.tab-count { display: inline-block; margin-left: 3px; padding: 1px 5px; border-radius: 9px; color: #854d0e; background: #fef3c7; font-size: 10px; }
.workbench-alerts > .reminder-card, #active-progress > .progress-card { margin: 8px 16px 0; }
.header-actions { align-items: center; }
.sync { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }
.review-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.review-toolbar h2 { flex: 1 0 auto; font-size: 14px; }
.project-stats { display:flex; flex-wrap:wrap; align-items:center; gap:5px 9px; font-size:11px; color:#475569; }
.project-stats > * { white-space:nowrap; }
.project-stats small { color:#64748b; }
.standalone-view { width: 100%; margin-inline: auto; }
#view-materials { max-width: 1080px; }
.material-section { padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; min-width: 0; }
.checklist { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.checklist span { color: #475569; font-size: 13px; }
.checklist textarea { flex: 1 0 100%; width: 100%; resize: vertical; }
#precheck-audit { margin: 12px 0; }
#precheck-title { cursor: pointer; }
#precheck-content li { margin-block: 6px; }
#tab-outlets { margin-inline-start: auto; font-size: 12px; }
#tab-outlets:not([aria-selected="true"]) { color: #64748b; }
.material-notes { color: #64748b; font-size: 12px; }
.material-notes p, #permit-note { margin-block: 6px; }
.figure-section h2 { margin: 0 0 6px; font-size: 14px; }
.figure-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 0; }
.figure-row + .figure-row { border-top: 1px solid #eef2f6; }
.figure-content { min-width: 0; }
.figure-row-title, .figure-actions, .figure-choice { display: flex; align-items: center; gap: 8px; }
.figure-row-title, .figure-choice { flex-wrap: wrap; }
.figure-actions { white-space: nowrap; }
.figure-state { padding: 1px 7px; border-radius: 8px; color: #5b6472; background: #f1f5f9; font-size: 11px; white-space: nowrap; }
.figure-state.is-ok { color: #166534; background: #ecfdf3; }
.figure-description { display: block; margin-top: 3px; color: #64748b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-action { padding: 6px 4px; font-size: 12px; }
.figure-actions button, .figure-choice button, .figure-clear { padding: 4px 8px; }
#figure-preview { width: min(1080px, calc(100% - 32px)); max-height: 90vh; padding: 0; border: 1px solid #cbd5e1; border-radius: 10px; }
#figure-preview::backdrop { background: rgb(15 23 42 / 58%); }
.figure-preview-header, .figure-preview-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.figure-preview-header { border-bottom: 1px solid #e2e8f0; }
.figure-preview-header h2 { margin: 0; font-size: 16px; }
.figure-preview-tools { justify-content: flex-end; }
.figure-preview-body { overflow: auto; max-height: 70vh; background: #f1f5f9; }
#figure-preview-image { display: block; max-width: none; height: auto; margin: auto; }
#figure-preview-image[hidden] { display: none; }
.source-page-button { color: #24528d; }
.figure-preview-tools label { display: flex; align-items: center; gap: 6px; }
#figure-preview-status { margin: 8px 16px; color: #475569; }
.figure-choice, .figure-clear { margin-top: 5px; }
.figure-choice select { min-width: 0; max-width: min(100%, 30ch); padding: 3px 5px; font-size: 12px; }
@media (max-width: 560px) {
  .figure-row { grid-template-columns: 1fr; gap: 5px; }
}
.stat-ready { color:#15803d; }
.stat-conflict { color:#b45309; }
.stat-missing { color:#a16207; }
.filter-bar { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.filter-bar button, .filter-bar select { padding: 4px 7px; }
.filter-bar button.active { color:#1d4ed8; border-color:#93c5fd; background:#eff6ff; }
.value-editor { min-width:100px; max-width:380px; }
td input.is-missing { border:1px dashed #d97706; background:#fffbeb; }
td input.is-missing::placeholder { color:#a16207; font-size:11px; }
.input-hint { display:block; color:#a16207; font-size:10px; margin-top:3px; }
.input-hint:empty { display:none; }
.conflict-panel { background:#fff7ed; border:1px solid #fed7aa; border-radius:7px; padding:4px 6px; margin-top:4px; width:100%; max-width:380px; white-space:normal; color:#9a3412; font-size:11px; }
.conflict-panel[hidden] { display:none; }
.candidate-values { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; max-height:190px; overflow-y:auto; }
.candidate-value { border-color:#fdba74; color:#9a3412; padding:4px 8px; font-size:11px; max-width:100%; white-space:normal; word-break:break-word; text-align:left; line-height:1.35; }
.source small { font-size:10px; color:#64748b; }
.progress-card { display:flex; flex-direction:column; gap:6px; padding:12px 14px; margin-bottom:12px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:10px; color:#1e3a8a; font-size:12px; }
.progress-card[hidden] { display:none; }
.progress-card.is-done { background:#f0fdf4; border-color:#bbf7d0; color:#166534; }
.progress-card.is-error { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.progress-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.progress-track { width:100%; height:7px; background:rgba(148,163,184,0.28); border-radius:999px; overflow:hidden; }
.progress-fill { height:100%; background:#2563eb; transition:width 0.25s ease; border-radius:999px; }
.progress-card.is-done .progress-fill { background:#16a34a; }
.progress-card.is-error .progress-fill { background:#dc2626; }
.blueprint-chip { display:inline-block; margin-top:3px; padding:2px 6px; background:#eff6ff; border:1px solid #bfdbfe; color:#1d4ed8; border-radius:999px; font-size:10px; white-space:nowrap; }
.reminder-card { display:flex; flex-direction:column; gap:6px; padding:12px 14px; margin-bottom:10px; background:#fffbeb; border:1px solid #fde68a; border-radius:10px; font-size:12px; color:#92400e; }
.reminder-card.is-info { background:#f8fafc; border-color:#cbd5e1; color:#334155; }
.reminder-card.is-all-ok { background:#f0fdf4; border-color:#bbf7d0; color:#166534; }
.reminder-card[hidden] { display:none; }

.filter-bar select {
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
}
.review-annotation { margin-top: 5px; max-width: 24ch; font-size: .81rem; color: #475569; overflow-wrap: anywhere; }
.review-annotation-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 2px; }
.review-badge { border-radius: 5px; padding: 2px 5px; font-size: .75rem; background: #eef2f7; color: #334155; }
.review-badge.source_missing { background: #fef3c7; color: #854d0e; }
.review-badge.source_choice { background: #ffedd5; color: #9a3412; }
.review-badge.portal_protected { background: #e0f2fe; color: #075985; }
.review-badge.portal_prerequisite { background: #ede9fe; color: #5b21b6; }
.review-excerpt { margin-top: 3px; line-height: 1.35; }
.review-excerpt a { white-space: nowrap; }
.review-ai-assessment { margin-top: 6px; padding-left: 7px; border-left: 2px solid #94a3b8; line-height: 1.4; }
.review-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 8px; margin-bottom: 16px; }
.review-details h3 { grid-column: 1 / -1; margin: 0; font-size: 1rem; }
.review-detail { border: 1px solid #dbe3ee; background: #fff; border-radius: 8px; padding: 9px; min-width: 0; }
.review-detail .review-annotation { max-width: none; }
.review-detail > small { display: block; margin-top: 5px; color: #475569; }

.outlet-audit { margin: 0 0 14px; padding: 10px 13px; border: 1px solid #dbe3ee; border-radius: 9px; background: #fff; }
.outlet-audit > summary, .outlet-audit-card > summary { cursor: pointer; font-weight: 600; }
.outlet-audit-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 9px 0; }
.outlet-audit-top select { max-width: 100%; padding: 5px; font: inherit; }
.outlet-audit-card { margin: 7px 0; padding: 8px; border: 1px solid #dbe3ee; border-radius: 7px; }
.outlet-audit-card > summary { line-height: 1.85; }
.audit-badge { display: inline-block; border-radius: 5px; padding: 1px 6px; color: #334155; background: #eef2f7; font-size: .78rem; font-weight: 500; }
.audit-badge.registered, .audit-badge.complete { color: #166534; background: #dcfce7; }
.audit-badge.conflict, .audit-badge.duplicate, .audit-badge.not_registered, .audit-badge.prerequisite { color: #92400e; background: #fef3c7; }
.audit-warnings { margin: 8px 0; padding: 5px 8px 5px 25px; border-left: 3px solid #d97706; background: #fffbeb; color: #78350f; }
.outlet-audit-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 8px; margin: 8px 0; }
.outlet-audit-columns > section { padding: 7px; background: #f8fafc; border-radius: 5px; }
.outlet-audit-columns h4 { margin: 0 0 2px; }
.outlet-audit-fields { display: grid; grid-template-columns: auto 1fr; gap: 3px 6px; margin: 6px 0; font-size: .85rem; }
.outlet-audit-fields dt { color: #475569; }
.outlet-audit-fields dd { margin: 0; overflow-wrap: anywhere; }
.outlet-audit-basis { margin-top: 8px; }
.outlet-audit-basis p, .audit-value { margin: 3px 0; font-size: .83rem; }

#tables table :is(th, td):first-child { width: 44px; min-width: 44px; text-align: center; padding-inline: 6px; }
#tables table :is(th, td):last-child { width: 110px; min-width: 90px; }
#tables table :is(th, td):nth-child(2) { white-space: normal; min-width: 100px; }
#tables table :is(th, td) { padding-block: 7px; }
#tables tbody input[type=text] { border-color: #e2e8f0; background: #fff; }
#tables tbody input.is-missing { border-color: #d8bd91; background: #fffbeb; }
.source .source-page { display: inline-block; padding: 2px 6px; border-radius: 9px; background: #f1f5f9; }
.review-object-label { display: block; color: #64748b; }
.review-evidence { margin: 2px 0; color: #64748b; }
.review-evidence summary { cursor: pointer; }
.excerpt-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.candidate-values { gap: 4px; margin-top: 2px; }
.review-evidence summary { display: flex; align-items: baseline; gap: 4px; list-style: none; }
.review-evidence summary::before { content: "›"; flex: none; color: #64748b; }
.review-evidence[open] summary::before { transform: rotate(90deg); }
#tables table th:nth-child(n) { white-space: nowrap; }
.review-annotation { white-space: normal; }
#tables .blueprint-chip { white-space: nowrap; align-self: flex-start; }
.source-more summary { cursor: pointer; white-space: nowrap; font-size: 11px; }
.source-more-pages { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.conflict-evidence[open] .review-excerpt {
  background: #f5f6f8;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  line-height: 1.55;
}
@media (max-width: 1200px) {
  .project-stats small { display: none; }
  .filter-bar select { max-width: 155px; }
  #tables table :is(th, td) { padding-inline: 6px; }
  #tables .value-editor { min-width: 77px; }
  #tables td input[type=text] { min-width: 65px; }
}

.analysis-resume { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.analysis-resume p, .analysis-resume-error { flex-basis: 100%; margin: 0; }
.analysis-resume-error { margin-top: 8px; color: #991b1b; font-weight: 600; }

#tables td input.facility-code-editor { min-width: 145px; }

.portal-outbound-note { color: #475569; margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }

.confirmation-card { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #fff8ed; border: 1px solid #e5bd82; }
.confirmation-card h2 { margin: 0; font-size: 15px; }
.confirmation-list { margin-top: 6px; max-height: min(33vh, 260px); overflow: auto; }
.confirmation-item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0; }
.confirmation-item + .confirmation-item { border-top: 1px solid #eadfce; }
.confirmation-item > span { flex: 1 1 240px; overflow-wrap: anywhere; }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.confirmation-actions button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.confirmation-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
#semantic-evidence-dialog {
  width: min(calc(100% - 32px), 760px); max-height: min(82vh, 760px);
  padding: 0; border: 1px solid #dce5ef; border-radius: 14px; color: #172b42;
  box-shadow: 0 18px 48px #0f294438;
}
#semantic-evidence-dialog::backdrop { background: #122e4966; }
.semantic-evidence-header {
  position: sticky; top: 0; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px;
}
.semantic-evidence-header h2 { margin: 0; font-size: 16px; }
#semantic-evidence-content { padding: 16px 20px 22px; overflow-wrap: anywhere; }
.semantic-quote { padding: 10px 12px; margin-top: 9px; background: #f5f8fb; border-radius: 8px; }
.semantic-quote p { white-space: pre-wrap; line-height: 1.65; margin: 6px 0 0; }
.semantic-item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }

.header-account[hidden] { display:none; }
.connecting { padding:24px; color:#475569; }
.header-account { display:flex; align-items:center; gap:10px; color:#475569; font-size:12px; }
.retention-note { padding: 14px 20px; border-top: 1px solid #e2e8f0; color: #526276; font-size: 12px; line-height: 1.6; }
.account-dialog { width: min(calc(100% - 28px), 420px); padding: 0; border: 1px solid #dce8ee; border-radius: 14px; color: #0f172a; }
.account-dialog::backdrop { background: #122e4966; }
.account-dialog-body { padding: 22px; }
.account-dialog h2 { margin: 0 0 16px; }
.account-dialog label { display: block; margin: 12px 0 6px; }
.account-dialog input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 64px 10px 10px; }
.account-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#confirm-delete-job, #change-password-status.error { color: #991b1b; }

.retention-note button { margin-inline-start: 6px; }
#feedback-message { width: 100%; box-sizing: border-box; resize: vertical; }
