:root {
  --ink: #202b29; --muted: #626d69; --paper: #fff; --ground: #f4f6f4;
  --line: #dce2df; --accent: #174e43; --hover: #103e35; --tint: #e9f1ed;
  --warning: #785014; --warning-bg: #fbf3e4; --error: #a13333; --error-bg: #fbeeee;
  --radius: 8px; font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink); font-size: 14px; line-height: 1.5; background: var(--ground);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #398e79; outline-offset: 3px; }
::selection { background: #d2e5db; color: #123c33; }
input, textarea { caret-color: var(--accent); }
button:disabled { cursor: not-allowed; opacity: .48; }
.skip-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); left: 16px; background: white; z-index: 10; }
.skip-link:focus { top: 8px; width: auto; height: auto; padding: 12px; clip-path: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: 76px 1fr; }
.topbar { grid-column: 1 / -1; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 30px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 24px; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: .05em; }
.brand-name { font-size: 15px; border-left: 1px solid var(--line); padding-left: 24px; }
.actions, .toolbar, .footer-actions, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-status { color: var(--muted); font-size: 12px; margin-right: 8px; }
.sidebar { background: #edf1ee; padding: 30px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; }
.nav-title { margin: 0 14px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.step { width: 100%; border: 0; padding: 10px 12px; display: flex; gap: 12px; align-items: center; border-radius: 6px; background: transparent; color: #52615a; text-align: left; margin: 3px 0; }
.step:hover { background: #e3eae4; }
.step.active { color: var(--accent); background: #dce9e0; font-weight: 600; }
.step-num { font-size: 12px; border: 1px solid #becbc2; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.step.active .step-num { color: white; background: var(--accent); border-color: var(--accent); }
.step-count { margin-left: auto; font-size: 11px; }
.sidebar-note { padding: 16px 12px; margin-top: auto; border-top: 1px solid #d4ddd6; color: #56645c; font-size: 12px; }
.sidebar-note p { margin: 0 0 10px; }
.link-button { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; text-underline-offset: 3px; }
main { min-width: 0; padding: 34px 36px 24px; }
.heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
h1 { font-size: 28px; letter-spacing: -.025em; font-weight: 600; margin: 0 0 7px; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 14px; }
.lede, .muted { color: var(--muted); }
.lede { max-width: 70ch; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px; background: white; border: 1px solid #cdd6d0; border-radius: 6px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 150ms ease-out; }
.btn:hover:not(:disabled) { background: #edf2ee; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--hover); }
.btn.danger { color: var(--error); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-header { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 24px; }
.section-note { font-size: 12px; color: var(--muted); }
.pill { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--tint); padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.pill.warning { color: var(--warning); background: var(--warning-bg); }
.pill.error { color: var(--error); background: var(--error-bg); }
.data-info { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.status-filter { border: 1px solid transparent; border-radius: 5px; padding: 5px 8px; background: transparent; color: var(--muted); font-weight: 600; }
.status-filter:hover { background: var(--ground); color: var(--ink); }
.status-filter[aria-pressed=true] { border-color: #becdc1; background: var(--tint); color: var(--accent); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.editor-layout.has-editor { grid-template-columns: minmax(360px, 1fr) minmax(280px, 340px); align-items: start; }
.toolbar { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search { flex: 1 1 160px; position: relative; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.search input[type=search] { padding-left: 35px; width: 100%; }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid #cdd6d0; background: white; border-radius: 5px; min-height: 36px; padding: 7px 10px; }
input::placeholder, textarea::placeholder { color: #68756c; opacity: 1; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.filter-select { max-width: 180px; }
.table-wrap { overflow: auto; max-height: 64vh; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; font-weight: 600; color: #5f6d64; background: #f8faf8; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #edf1ee; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8faf8; }
tbody tr.selected-row { background: #edf4ef; }
.check-cell { width: 42px; padding-right: 0; }
.option-name { background: none; border: 0; padding: 0; text-align: left; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.option-name:hover { color: var(--accent); text-decoration-color: var(--accent); }
.code { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; overflow-wrap: anywhere; max-width: 320px; }
.requirements { max-width: 180px; font-size: 11px; color: var(--muted); }
.requirements span { display: block; }
.price-cell { width: 98px; }
.price-cell input { min-width: 76px; padding: 5px 8px; text-align: right; min-height: 31px; font-size: 13px; border-color: transparent; background: transparent; }
.price-cell input:hover, .price-cell input:focus { background: white; border-color: #becdc1; }
.price-cell input[aria-invalid=true] { border-color: var(--error); background: var(--error-bg); }
.row-warning { border: 0; color: var(--warning); background: transparent; padding: 5px; }
.row-warning.error { color: var(--error); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.row-actions [data-discard-row] { white-space: nowrap; }
.confirmation { width: min(460px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.confirmation::backdrop { background: rgba(32, 43, 41, .35); }
.confirmation h2 { margin-bottom: 12px; font-size: 20px; }
.confirmation-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.inline-validation { display: block; margin-top: 7px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.inline-validation [role=listitem] { display: block; margin-top: 4px; }
.inline-validation .warning { color: var(--warning); }
.inline-validation .error { color: var(--error); }
.option-cell .inline-validation { max-width: 48ch; min-width: 160px; }
[data-table-validation]:not(:empty) { margin-bottom: 20px; }
.field [aria-invalid=true] { border-color: var(--error); background: var(--error-bg); }
.table-foot { display: flex; justify-content: space-between; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; gap: 10px; }
.bulk-bar { background: var(--tint); padding: 14px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #d5e3d9; }
.bulk-bar strong { margin-right: auto; }
.bulk-bar input { width: 85px; }
.bulk-bar select { width: auto; }
.editor { position: sticky; top: 20px; }
.editor .panel-body { padding: 20px; max-height: 69vh; overflow: auto; }
.field { display: block; margin-bottom: 15px; }
.field > span:first-child { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.field textarea { min-height: 80px; resize: vertical; }
.field.code-field input { font-size: 12px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid .field { min-width: 0; }
.subtype-matches { max-height: 220px; overflow-y: auto; border: 1px solid #cdd6d0; border-radius: 5px; margin-top: 5px; }
.subtype-matches [role=option] { display: block; width: 100%; border: 0; border-radius: 0; padding: 9px 10px; background: var(--paper); color: var(--ink); text-align: left; font-size: 12px; overflow-wrap: anywhere; }
.subtype-matches [role=option]:hover, .subtype-matches [aria-selected=true] { background: var(--tint); color: var(--accent); }
.requirement-dropdown { margin: 0; border: 1px solid #cdd6d0; border-radius: 5px; }
.requirement-dropdown summary { padding: 8px 10px; margin: 0; font-weight: 400; overflow-wrap: anywhere; }
.requirement-dropdown[open] summary { border-bottom: 1px solid var(--line); }
.requirement-dropdown [role=group] { padding: 10px; display: grid; gap: 10px; }
.requirement-dropdown small { padding: 0 10px 10px; }
.field .field-grid label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.check-label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.check-label input { flex-shrink: 0; margin-top: 2px; }
details { margin-top: 16px; }
summary { font-size: 12px; font-weight: 600; cursor: pointer; margin-bottom: 14px; }
.form-actions { padding: 16px 20px; border-top: 1px solid var(--line); }
.form-actions .primary { flex: 1; }
.shared-prices { width: 100%; }
.shared-prices summary { margin-bottom: 10px; }
.matching-options { padding-left: 18px; max-height: 200px; overflow: auto; }
.matching-options li { margin: 0 0 10px; }
.matching-options small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.bulk-scope { flex-basis: 100%; margin: 0; }
.bulk-bar .shared-prices { margin-top: 0; }
.editor-delete { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 20px; }
.editor-delete strong { font-size: 13px; font-weight: 600; }
.editor-delete p { margin: 4px 0 0; }
.form-error { color: var(--error); font-size: 12px; margin: 0 0 14px; }
.footer-actions { margin-top: 28px; justify-content: space-between; }
.alert { padding: 14px 16px; background: var(--warning-bg); color: var(--warning); border-radius: 6px; font-size: 13px; margin-bottom: 20px; }
.alert.error { background: var(--error-bg); color: var(--error); }
.alert.info { background: var(--tint); color: var(--accent); }
.upload-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.upload-row:last-child { border: 0; }
.file-symbol { width: 34px; height: 42px; border: 1px solid #c5d3c8; background: #f0f6f2; border-radius: 4px; display: grid; place-items: center; color: var(--accent); font-size: 10px; font-weight: 700; }
.upload-row strong { display: block; }
.upload-row small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.intro-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 28px; align-items: start; }
.aside-copy { padding: 14px 2px; }
.aside-copy ol { padding-left: 20px; color: var(--muted); }
.aside-copy li { margin: 12px 0; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.preview-context { display: grid; grid-template-columns: minmax(120px, 1.4fr) repeat(4, minmax(75px, 1fr)); gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.preview-context .field { margin-bottom: 0; }
.path-row { padding: 18px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px minmax(0, 1fr) 70px; align-items: center; gap: 14px; }
.path-row:last-child { border: 0; }
.path-num { width: 26px; height: 26px; background: var(--tint); color: var(--accent); border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.path-row label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.path-price { text-align: right; font-weight: 600; }
.receipt { padding: 24px; background: #ecf3ee; border-radius: var(--radius); }
.receipt h2 { margin-bottom: 22px; }
.receipt-line { display: flex; justify-content: space-between; padding: 10px 0; gap: 12px; font-size: 13px; }
.receipt-line.total { font-size: 16px; font-weight: 600; border-top: 1px solid #c7d9cb; margin-top: 10px; padding-top: 18px; }
.receipt .section-note { margin: 22px 0 0; }
.issues { max-height: 440px; overflow: auto; }
.issue-row { display: flex; gap: 12px; align-items: start; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.issue-row:last-child { border: 0; }
.issue-content { flex: 1; min-width: 0; font-size: 13px; }
.issue-content small { display: block; color: var(--muted); margin-bottom: 3px; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.path-audit { margin-bottom: 24px; }
.path-audit .issue-content strong { display: block; overflow-wrap: anywhere; }
.path-audit .issue-content p { margin: 6px 0; }
.path-audit details { margin: 0; }
.path-audit .range-routes, .path-audit .optical-totals { margin-top: 14px; }
.path-audit .range-routes .issue-row { padding: 12px 0; flex-wrap: wrap; }
.path-audit .optical-totals { margin-bottom: 14px; }
.path-audit .panel-body > .section-note { margin-bottom: 14px; }
.export-table td { overflow-wrap: anywhere; }
.export-table code { font-size: 11px; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.export-actions { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.change-row { padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; }
.change-row small { color: var(--muted); display: block; }
.loading { max-width: 800px; margin: 60px auto; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #233f32; color: white; padding: 12px 20px; border-radius: 7px; max-width: min(90vw, 600px); z-index: 5; opacity: 0; pointer-events: none; transition: opacity 160ms ease-out; }
#toast.visible { opacity: 1; }
.hidden { display: none !important; }
@media (max-width: 1200px) {
  main { padding: 28px 24px; }
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .editor-layout.has-editor { grid-template-columns: minmax(0, 1fr); }
  .editor { position: static; }
  .editor .panel-body { max-height: none; }
  .preview-layout { grid-template-columns: minmax(0, 1fr); }
  .receipt { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .receipt h2, .receipt .section-note, .receipt .alert { grid-column: 1 / -1; }
  .preview-context { grid-template-columns: repeat(4, 1fr); }
  .preview-context .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .topbar { min-height: 74px; padding: 14px 16px; flex-wrap: wrap; gap: 14px; }
  .brand { gap: 12px; } .wordmark { font-size: 17px; } .brand-name { padding-left: 12px; font-size: 13px; }
  .topbar .actions { width: 100%; justify-content: space-between; }
  .draft-status { margin-right: auto; }
  .sidebar { display: block; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-title, .sidebar-note { display: none; }
  .step-list { display: flex; overflow: auto; gap: 5px; }
  .step { width: auto; flex: 0 0 auto; white-space: nowrap; font-size: 12px; padding: 8px; gap: 7px; }
  .step-count { display: none; }
  main { padding: 24px 16px; }
  h1 { font-size: 24px; }
  .heading { flex-wrap: wrap; margin-bottom: 20px; }
  .heading .actions { width: 100%; }
  .toolbar { padding: 12px; }
  .filter-select { max-width: 100%; flex: 1; }
  .table-wrap { max-height: 60vh; }
  th, td { padding: 12px 10px; }
  .requirements { display: none; }
  .code { max-width: 160px; }
  .price-cell { width: 78px; }
  .price-cell input { min-width: 65px; }
  .table-foot { padding: 12px; flex-wrap: wrap; }
  .intro-split, .review-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .upload-row { padding: 16px; grid-template-columns: 30px minmax(0, 1fr); }
  .upload-row .btn { grid-column: 2; justify-self: start; }
  .preview-context { grid-template-columns: repeat(2, 1fr); padding: 16px; }
  .path-row { padding: 16px; gap: 8px; grid-template-columns: 24px minmax(0, 1fr) 58px; }
  .receipt { display: block; }
  .export-table td:first-child { min-width: 180px; }
  .issue-row { padding: 12px; }
  .issue-row .btn { padding: 4px 7px; }
  .panel-body { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
