.settings-page { max-width: 1440px; margin: 0 auto; }
.settings-heading, .inventory-card header, .circuit-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.settings-heading h2 { font-size: 28px; letter-spacing: -.03em; margin: 4px 0; }
.settings-heading > button { background: var(--orange); font-weight: 600; border-color: var(--orange); flex-shrink: 0; }
.eyebrow { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.settings-heading p, .settings-block .section-heading p { color: var(--muted); max-width: 760px; }
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-nav a { color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 7px; background: var(--bg); font-weight: 600; }
.settings-nav a:hover { background: #fff0e2; color: var(--orange-dark); }
.settings-block { margin-top: 28px; scroll-margin-top: 24px; }
.settings-block > .section-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; gap: 14px; }
.settings-block h3 { font-size: 19px; margin: 0 0 4px; }
.settings-block p { font-size: 13px; }
.cable-library, .circuit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.inventory-card, .circuit-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 22px; }
.inventory-card h3 { font-size: 18px; margin: 3px 0 0; overflow-wrap: anywhere; }
.inventory-card .installation-label { margin: 18px 0; font-size: 15px; font-weight: 600; }
.installation-label span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.inventory-metrics, .initial-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inventory-metrics span, .initial-pair span { display: block; font-size: 12px; color: var(--muted); }
.inventory-metrics strong { display: block; font-size: 19px; font-weight: 600; }
.initial-pair { margin: 16px 0; background: #f5f7f8; border-radius: 8px; padding: 12px 14px; }
.initial-pair strong { font-variant-numeric: tabular-nums; }
.inventory-card footer, .circuit-card footer, .circuit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.inventory-card footer { border-top: 1px solid var(--line); padding-top: 16px; }
.inventory-card footer button, .circuit-actions button { font-size: 12px; padding: 6px 10px; }
.sorter-map-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.sorter-map { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.sorter-map th, .sorter-map td { border: 0; padding: 0; text-align: center; background: transparent; }
.sorter-map th { font-size: 11px; color: var(--muted); }
.sorter-map th:first-child { width: 72px; text-align: left; }
.sorter-cell { display: grid; place-items: center; width: 100%; height: 34px; padding: 0; font-size: 11px; border-radius: 5px; font-weight: 600; }
.sorter-cell.is-circuit { background: #e8f2fb; color: #245c86; border-color: #c7dfef; }
.sorter-cell.is-manual { background: #fff0e2; color: var(--orange-dark); border-color: #f4d9bf; }
.sorter-cell.is-empty { background: #f3f5f6; color: #8998a3; }
.sorter-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin: 10px 0 16px; }
.sorter-assignments { display: flex; gap: 10px; flex-wrap: wrap; }
.sorter-assignments button { text-align: left; padding: 10px 14px; }
.sorter-assignments span { display: block; font-size: 11px; color: var(--muted); }
.circuit-card h4 { font-size: 22px; margin: 4px 0 0; }
.circuit-summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 16px 0; margin: 12px 0; border-bottom: 1px solid var(--line); }
.circuit-summary dt { color: var(--muted); font-size: 12px; }
.circuit-summary dd { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.circuit-summary small { display: block; font-weight: 400; color: var(--muted); }
.circuit-conductors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.circuit-conductors h5 { font-size: 14px; margin: 0 0 12px; }
.circuit-conductors dl { display: grid; gap: 4px; margin: 0 0 12px; }
.circuit-conductors dt { font-size: 12px; color: var(--muted); }
.circuit-conductors dd { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.calibration-meta { color: var(--muted); overflow-wrap: anywhere; min-height: 40px; }
.installation-history { padding: 12px; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cable-name, .editor-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cable-name > div, .editor-identity > div { min-width: 0; }
.cable-type-thumbnail { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 9px; background: #f1f5f8; border: 1px dashed #bcc8d0; color: #788b99; }
.cable-type-thumbnail svg { width: 28px; height: 28px; }
.cable-type-thumbnail.has-image { flex-basis: 64px; width: 64px; height: 44px; background: #fff; border: 1px solid var(--line); overflow: hidden; font-size: 9px; text-align: center; }
.cable-type-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cable-comparison { margin: 18px 0; }
.comparison-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.comparison-heading h4 { margin: 0; font-size: 14px; }
.comparison-heading span, .cable-comparison small { color: var(--muted); font-size: 11px; }
.cable-comparison table { width: 100%; margin-top: 8px; }
.cable-comparison th, .cable-comparison td { text-align: left; padding: 8px; font-size: 12px; vertical-align: top; overflow-wrap: anywhere; }
.cable-comparison small { display: block; margin-top: 4px; font-weight: 400; }
.cable-goal { background: #f5f7f8; border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.cable-goal > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.cable-goal span, .cable-goal small { color: var(--muted); font-size: 12px; }
.cable-goal small { display: block; margin-top: 6px; }
.cable-goal progress { width: 100%; height: 8px; margin-top: 10px; accent-color: var(--orange); }
.cable-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cable-goal-grid article { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.cable-goal-grid h4 { margin: 0; overflow-wrap: anywhere; }
.cable-goal-grid small { display: block; color: var(--muted); }
.cable-editor { min-width: 0; }
.editor-identity h3 { margin: 3px 0; overflow-wrap: anywhere; }
.editor-identity p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.editor-save-note { background: #fff7ed; color: #765029; border-radius: 8px; padding: 12px; font-size: 12px; }
.cable-editor-section { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
.cable-editor-section > summary { cursor: pointer; padding: 14px 16px; }
.cable-editor-section > summary span { display: block; color: var(--muted); font-size: 12px; margin: 5px 0 0 18px; }
.cable-editor-section[open] > summary { border-bottom: 1px solid var(--line); background: #f5f7f8; border-radius: 10px 10px 0 0; }
.editor-section-body { padding: 16px; }
.editor-section-body .cable-form + .cable-form { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.editor-section-body label { display: block; margin: 12px 0; }
.editor-section-body input:not([type="hidden"]), .editor-section-body select, .editor-section-body textarea { width: 100%; box-sizing: border-box; }
.editor-section-body button { margin: 6px 8px 0 0; }
.editor-section-body button[type="submit"] { background: var(--orange); border-color: var(--orange); font-weight: 600; }
.editor-section-body p, .past-installation summary { font-size: 12px; overflow-wrap: anywhere; }
.type-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 14px; }
.type-card h3 { margin: 0; overflow-wrap: anywhere; }
.type-card p { color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 850px) { .cable-library, .circuit-grid { grid-template-columns: 1fr; } }
@media (max-width: 500px) {
  .cable-goal-grid { grid-template-columns: 1fr; }
  .editor-section-body { padding: 12px; }
  .editor-section-body .form-grid { grid-template-columns: 1fr; }
  .settings-heading { flex-direction: column; }
  .inventory-card, .circuit-card { padding: 16px; }
  .circuit-conductors { grid-template-columns: 1fr; }
  .circuit-conductors section + section { border-top: 1px solid var(--line); padding-top: 16px; }
  .settings-nav a { padding: 7px 10px; font-size: 12px; }
}
