:root { font-family: Arial, Helvetica, sans-serif; color: #17212c; background: #f3f5f7; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #65a4da; outline-offset: 2px; }
.shell { max-width: 1260px; margin: auto; padding: 34px 24px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-bottom: 28px; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.header-actions .secondary { border-color: transparent; background: transparent; color: #315879; font-size: 13px; }
.header-actions #save-scenario { border-color: #c8d0d8; background: white; }
.header-actions .secondary:hover { background: #e8edf2; }
.scenario-status { color: #315879; margin: -15px 0 14px; min-height: 0; font-size: 13px; }
.scenario-status:empty { display: none; }
.share-link-text { display: block; width: 100%; padding: 9px; margin: 0 0 14px; border: 1px solid #c7d0d8; border-radius: 7px; }
.share-link-text[hidden] { display: none; }
.eyebrow { color: #b24720; letter-spacing: .13em; font-size: 12px; font-weight: 800; margin: 0 0 10px; }
h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; margin: 0; }
.brand-title { display: flex; align-items: center; gap: 16px; }
.brand-title img { display: block; width: 190px; height: auto; flex: none; }
.brand-title span { border-left: 1px solid #c7d0d8; padding-left: 16px; }
h2 { margin: 0 0 7px; font-size: 20px; }
.intro { max-width: 720px; color: #516071; line-height: 1.5; margin: 12px 0 0; }
.secondary { border: 1px solid #c8d0d8; background: white; border-radius: 8px; padding: 10px 15px; white-space: nowrap; }
.card { background: white; border: 1px solid #dce2e8; border-radius: 12px; box-shadow: 0 5px 18px #17212c09; padding: 24px; }
.section-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 19px; }
.waterfall-product-name { display: grid; gap: 6px; width: min(100%, 300px); flex: none; color: #516071; font-size: 13px; font-weight: 700; }
.waterfall-product-name input { width: 100%; border: 1px solid #c7d0d8; border-radius: 7px; padding: 9px 10px; background: white; color: #17212c; }
.muted, .footnote { color: #647384; line-height: 1.45; }
.muted { margin: 0; }
.footnote { font-size: 13px; margin: 17px 0 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid #e8ecf0; }
thead th { color: #657588; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #f8fafb; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { min-width: 170px; }
.channel-name { display: block; }
.row-tag { display: block; font-size: 11px; color: #b24720; font-weight: 700; margin-top: 3px; min-height: 12px; }
.anchor-row { background: #fff9f3; }
.waterfall-connector td { border-bottom: 0; padding: 3px 12px 3px 23px; background: #f8fafb; }
.connector-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; width: fit-content; border-left: 2px solid #bdc9d4; padding: 3px 0 3px 12px; color: #516071; font-size: 12px; font-variant-numeric: tabular-nums; }
.connector-from { color: #516071; }
.price-input { width: 134px; padding: 9px 10px; border: 1px solid #c7d0d8; border-radius: 7px; background: white; text-align: right; }
.price-input[aria-invalid="true"] { border-color: #b24720; }
.price-input:disabled { background: #f3f5f7; text-align: left; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { min-width: 150px; white-space: nowrap; }
.row-action { background: transparent; color: #315879; border: 0; padding: 6px; font-size: 13px; font-weight: 700; }
.row-action:not(:disabled):hover { text-decoration: underline; }
.bundle-builder { margin-bottom: 20px; }
.bundle-builder summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; font-size: 20px; font-weight: 700; list-style: none; }
.bundle-builder summary::-webkit-details-marker { display: none; }
.bundle-builder summary small { display: block; margin-top: 5px; color: #647384; font-size: 13px; font-weight: 400; }
.summary-action { color: #315879; font-size: 13px; white-space: nowrap; }
.bundle-builder[open] .summary-action { visibility: hidden; }
.bundle-content { border-top: 1px solid #e8ecf0; margin-top: 18px; padding-top: 18px; }
.bundle-content h3 { font-size: 15px; margin: 22px 0 10px; }
.bundle-fields { display: grid; grid-template-columns: minmax(140px, 1.5fr) minmax(110px, 1fr) minmax(150px, 1fr); gap: 12px; }
.bundle-fields label, .bundle-offer label { display: grid; gap: 6px; color: #516071; font-size: 13px; font-weight: 700; }
.bundle-fields input { width: 100%; min-width: 0; border: 1px solid #c7d0d8; border-radius: 7px; padding: 9px 10px; background: white; color: #17212c; }
.bundle-items { display: grid; gap: 12px; }
.bundle-item { grid-template-columns: minmax(130px, 1.5fr) repeat(3, minmax(105px, 1fr)) auto; align-items: end; }
.bundle-item-actions { display: flex; align-items: center; gap: 5px; min-height: 39px; white-space: nowrap; }
.bundle-add-action { border: 1px solid #c8d0d8; background: white; color: #315879; border-radius: 7px; padding: 9px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bundle-add-action:not(:disabled):hover { background: #f3f7fa; }
.bundle-item-wrap { border-bottom: 1px solid #e8ecf0; padding-bottom: 9px; }
.item-economics { margin: 7px 0 0; color: #647384; font-size: 13px; }
.bundle-margin-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 20px; }
.bundle-margin-setting { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #516071; font-size: 13px; font-weight: 700; }
.bundle-result-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.bundle-result-group { min-width: 0; padding: 13px 15px 4px; border: 1px solid #e4eaf0; border-left: 3px solid #8aa5bb; border-radius: 8px; background: #fbfcfd; }
.bundle-result-keltec { border-left-color: #b24720; background: #fffbf8; }
.bundle-result-channel { border-left-color: #527f9f; }
.bundle-result-retail { border-left-color: #6e8e73; background: #fbfdfb; }
.bundle-result-group h4 { margin: 0 0 5px; color: #334557; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.bundle-results > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e8ecf0; font-size: 13px; }
.bundle-results > div:last-child { border-bottom: 0; }
.bundle-results span { color: #516071; }
.bundle-results strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.primary { margin-top: 18px; border: 1px solid #a93f1b; background: #b24720; color: white; padding: 10px 15px; border-radius: 8px; font-weight: 700; }
.primary:hover:not(:disabled) { background: #94391b; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 20px; margin-top: 20px; }
.rules { display: grid; gap: 11px; }
.rule-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(105px, 1fr) 100px 95px 12px; gap: 8px; align-items: center; }
.rule-row strong { font-size: 14px; }
.rule-row select, .rule-row input, .percent-input input { border: 1px solid #c7d0d8; border-radius: 7px; padding: 8px 9px; width: 100%; background: white; min-width: 0; }
.economics { display: grid; gap: 14px; margin-top: 17px; }
.metric-group { padding: 12px 15px 4px; border: 1px solid #e4eaf0; border-left: 3px solid #8aa5bb; border-radius: 8px; background: #fbfcfd; }
.metric-group-keltec { border-left-color: #b24720; background: #fffbf8; }
.metric-group-distributor { border-left-color: #527f9f; }
.metric-group-dealer { border-left-color: #6e8e73; background: #fbfdfb; }
.metric-group h3 { margin: 0 0 5px; color: #334557; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.metric { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid #e8ecf0; font-size: 14px; }
.metric:last-child { border-bottom: 0; }
.metric span { color: #516071; }
.metric strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.distributor-setting { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.percent-input { display: flex; align-items: center; gap: 5px; width: 90px; }
footer { text-align: center; color: #516071; font-size: 12px; margin-top: 22px; }
@media (max-width: 850px) { .lower-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .bundle-item { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bundle-result-groups { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .table-scroll { overflow: visible; }
  table, tbody { display: block; width: 100%; min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tbody tr:not(.waterfall-connector) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 10px; padding: 12px; border: 1px solid #dce2e8; border-radius: 9px; }
  tbody tr:not(.waterfall-connector) > * { min-width: 0; padding: 3px 0; border: 0; }
  tbody tr:not(.waterfall-connector) > th { grid-column: 1 / -1; font-size: 16px; }
  .price-cell { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .price-cell::before, .numeric::before { content: attr(data-label); color: #516071; font-size: 12px; font-weight: 700; }
  .numeric { display: grid; gap: 4px; }
  tbody tr[data-channel="Export"] .numeric, tbody tr[data-channel="MSRP"] .numeric { display: none; }
  .actions { grid-column: 1 / -1; min-width: 0; white-space: normal; }
  .actions:empty { display: none; }
  .waterfall-connector { display: block; margin: -4px 0 7px; }
  .waterfall-connector td { display: block; padding-left: 18px; }
}
@media (max-width: 600px) { .shell { padding: 22px 12px; } .card { padding: 17px; } .topbar, .section-header { flex-direction: column; gap: 14px; } .brand-title { display: block; } .brand-title img { width: 165px; margin-bottom: 7px; } .brand-title span { display: block; border: 0; padding: 0; } .header-actions { justify-content: flex-start; } .rule-row { grid-template-columns: 1fr 1fr; } .rule-row strong { grid-column: 1 / -1; } .rule-row > span { display: none; } .bundle-fields, .bundle-item, .bundle-margin-settings { grid-template-columns: 1fr; } }
