/* quote-tool — calm, professional. One accent, lots of air, tabular numbers. */
:root {
  --navy: #1f3346; --navy-2: #2b4560; --accent: #2563a8; --accent-2: #1d4f88; --accent-soft: #e9f1fb;
  --ink: #17202b; --ink-2: #4a5563; --muted: #6b7684; --line: #e3e7ec; --line-2: #d3d9e0;
  --bg: #f5f7f9; --card: #ffffff; --ok: #1f6b45; --ok-bg: #eaf6ef; --err: #9a2b2b; --err-bg: #fdf0f0;
  --up: #9a2b2b; --down: #1f6b45; --comm: #c8d6e8;
  --r: 10px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
h1, h2 { margin: 0; }
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.h2 { font-size: 16px; font-weight: 600; color: var(--ink); }

/* ---- top bar */
.bar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16,24,40,.02); position: sticky; top: 0; z-index: 10; }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.mark { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.mark:hover { text-decoration: none; color: var(--navy); }
.mark-name { font-weight: 700; font-size: 16px; letter-spacing: -.1px; }
.mark-sep { width: 1px; height: 20px; background: var(--line-2); }
.mark-tool { font-size: 13px; color: var(--muted); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.who { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--bg); border: 1px solid var(--line);
       border-radius: 999px; padding: 3px 10px; margin: 0 6px 0 10px; }
.nav a.out { color: var(--muted); }

/* ---- page */
.page { padding-top: 28px; padding-bottom: 24px; min-height: calc(100vh - 62px - 64px); }
.head { margin-bottom: 20px; }
.head p { margin: 6px 0 0; max-width: 680px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions label.btn { cursor: pointer; }
.head-actions .busy { opacity: .6; pointer-events: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.foot { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; padding-top: 18px; padding-bottom: 28px; flex-wrap: wrap; }

/* ---- forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; }
.field.inline { margin-bottom: 0; }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
input, select { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,168,.15); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer;
  transition: background .12s, border-color .12s; text-decoration: none; }
.btn:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; padding: 12px 16px; font-size: 15px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.alert { background: var(--err-bg); color: var(--err); border: 1px solid #f3cccc; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cf; }
.tag { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }

/* ---- login */
.login-body { background: #fff; }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.login-brand { background: var(--navy); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 56px 56px 32px; }
.login-brand-in { max-width: 440px; margin-top: 12vh; }
.lb-name { font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.lb-tool { font-size: 14px; color: #b9c7d6; font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: 1.6px; }
.lb-lead { font-size: 20px; line-height: 1.4; margin: 36px 0 22px; color: #eef3f8; font-weight: 500; }
.lb-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #cfdae6; font-size: 15px; }
.lb-points li { display: flex; gap: 12px; align-items: baseline; }
.lb-points span { width: 6px; height: 6px; border-radius: 50%; background: #7fa6d3; flex: none; transform: translateY(-2px); }
.lb-foot { font-size: 12px; color: #8ea3b8; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 32px; }
.login-card h1 { font-size: 22px; font-weight: 700; }
.login-card .sub { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.login-card .help { color: var(--muted); font-size: 13px; text-align: center; margin: 16px 0 0; }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
@media (max-width: 820px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { padding: 28px 24px 22px; }
  .login-brand-in { margin-top: 0; }
  .lb-lead { font-size: 17px; margin: 18px 0 14px; }
  .lb-points { display: none; }
  .lb-foot { display: none; }
  .login-panel { align-items: flex-start; padding: 24px 16px 40px; }
}

/* ---- quote */
.quote-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: stretch; }
.quote-grid .card { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.chip { font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.result { display: flex; flex-direction: column; }
.result.empty { align-items: center; justify-content: center; text-align: center; border-style: dashed; box-shadow: none; background: #fbfcfd; }
.empty-title { font-weight: 600; font-size: 16px; color: var(--ink-2); }
.r-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.r-price { font-size: 52px; font-weight: 700; letter-spacing: -1.2px; line-height: 1.1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; color: var(--navy); }
.r-facts { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.r-facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.r-facts dt { color: var(--muted); font-size: 13px; }
.r-facts dd { margin: 0; font-weight: 500; }
.r-actions { margin-top: auto; padding-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.r-actions .btn:hover { text-decoration: none; }
@media (max-width: 640px) { .r-actions .btn { flex: 1 1 100%; } }
.compare { margin-top: 18px; }
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.cmp-item { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--ink);
  font-variant-numeric: tabular-nums; transition: border-color .12s, background .12s; }
.cmp-item:hover { border-color: var(--accent); text-decoration: none; color: var(--ink); background: #fbfdff; }
.cmp-item.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cmp-q { font-size: 13px; color: var(--muted); font-weight: 500; }
.cmp-p { font-size: 18px; font-weight: 700; }
.fine { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
@media (max-width: 860px) { .quote-grid { grid-template-columns: minmax(0, 1fr); } .r-price { font-size: 44px; } }

/* ---- transparency */
.why { margin-top: 18px; border-top: 3px solid var(--navy); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fbfcfd; }
.t-l { font-size: 12px; color: var(--muted); font-weight: 500; }
.t-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.t-of { font-size: 13px; color: var(--muted); font-weight: 500; }
.t-strong { background: var(--accent-soft); border-color: #cfe0f4; }
.t-strong .t-v { color: var(--navy); }
.tiles-lg .t-v { font-size: 26px; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: #fff; }
.s-base { background: var(--navy); }
.s-comm { background: var(--comm); }
.split-key { display: flex; gap: 18px; color: var(--ink-2); margin: 8px 0 6px; flex-wrap: wrap; }
.split-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.k-base { background: var(--navy); } .k-comm { background: var(--comm); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 18px 0 0; display: grid; gap: 0; }
.steps li { counter-increment: s; position: relative; padding: 16px 0 16px 44px; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 16px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.st-h { font-weight: 600; margin-bottom: 4px; }
.steps p { margin: 4px 0 8px; color: var(--ink-2); }
.formula { background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-variant-numeric: tabular-nums;
  font-size: 14px; display: grid; gap: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.formula strong { color: var(--ink); }
.mini { border-collapse: collapse; width: 100%; max-width: 520px; font-size: 14px; margin: 6px 0 10px; }
.mini th, .mini td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mini th { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini .num { text-align: right; }
.mini tr.hl td { background: var(--accent-soft); font-weight: 600; }

/* ---- tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th.num, .mini th.num { text-align: right; }
.tbl td.up { color: var(--up); font-weight: 600; } .tbl td.down { color: var(--down); font-weight: 600; }
.scroll-x { overflow-x: auto; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.two .card { margin-bottom: 18px; }
@media (max-width: 760px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* ---- rules editor */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 10px 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabpane { display: none; } .tabpane.on { display: block; }
.js-off .tabpane { display: block; }
.pane-lead { margin: 0 0 16px; max-width: 760px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.steps-grid .card { margin-bottom: 0; }
.step-card { padding: 18px; }
.sc-h { font-weight: 600; }
.sc-sum { margin: 2px 0 10px; font-variant-numeric: tabular-nums; min-height: 20px; }
.step-tbl td { padding: 5px 6px; }
.step-tbl input { padding: 7px 10px; font-variant-numeric: tabular-nums; }
.suffix { position: relative; display: block; }
.suffix input { padding-right: 26px; text-align: right; }
.suffix i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; }
.step-default { background: #fbfcfd; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { min-width: 260px; }
.matrix th.sticky, .matrix td.sticky { position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix tbody th { font-weight: 500; color: var(--ink); font-size: 13px; text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); min-width: 170px; white-space: normal; line-height: 1.3; }
.matrix td { padding: 4px; }
.cell { width: 98px; padding: 6px 7px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.cell:placeholder-shown { background: #fafbfc; }
.add-col { display: flex; gap: 14px; align-items: flex-end; margin-top: 16px; flex-wrap: wrap; }
.add-col .field { width: 220px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; max-width: 640px; }
@media (max-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.review { border-top: 3px solid var(--accent); }
.row-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.savebar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(4px); border-top: 1px solid var(--line);
  margin: 24px 0 0; padding: 12px 0; z-index: 5; }
.savebar-in.wrap { padding: 0; }
.savebar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.savebar-in > span:last-child { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .bar-in { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .mark-sep, .mark-tool { display: none; }
  .nav { flex-wrap: wrap; }
  .nav a { padding: 6px 8px; }
  .who { margin-left: 4px; }
  .h1 { font-size: 22px; }
  .card { padding: 18px; }
  .r-facts div { grid-template-columns: 90px minmax(0, 1fr); }
  .who { display: none; }
}

/* ---- print: a one-page quote sheet */
.print-only { display: none; }
@media print {
  @page { size: letter; margin: .6in; }
  body { background: #fff; font-size: 12pt; }
  .bar, .no-print, .foot, .chips, .savebar { display: none !important; }
  .print-only { display: block; }
  .print-head { border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 18px; }
  .ph-name { font-size: 20pt; font-weight: 700; color: var(--navy); }
  .ph-title { color: var(--muted); }
  .page { padding: 0; min-height: 0; }
  .quote-grid { display: block; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .cmp { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cmp-item { border: 1px solid #ccc; padding: 8px 10px; }
  a { color: inherit; }
}

/* ---- rules page v3: stacked table sections */
section[id] { scroll-margin-top: 80px; }
.jump { display: flex; gap: 16px; margin-top: 10px; }
.jump a { font-weight: 600; }
.sec-lead { margin: 4px 0 0; max-width: 760px; }
.sec-foot { display: flex; gap: 14px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap; }
.sec-foot .field { width: 220px; }
.h3 { font-size: 14px; font-weight: 600; margin: 8px 0 8px; color: var(--ink-2); }
.loc-pick { min-width: 240px; }
.grid { font-size: 13px; }
.grid thead th { vertical-align: bottom; }
.grid tbody th { font-weight: 500; color: var(--ink); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line);
  min-width: 190px; white-space: normal; line-height: 1.3; }
.grid td { padding: 4px 5px; }
.grid th.sticky, .grid td.sticky { position: sticky; left: 0; background: #fff; z-index: 1; }
.band { min-width: 88px; line-height: 1.25; }
.band-r { display: block; color: var(--ink-2); font-weight: 600; }
.band-x { display: block; margin-top: 4px; font-weight: 400; font-size: 11px; color: var(--muted); cursor: pointer; }
.band-x input { width: 12px; height: 12px; vertical-align: -1px; }
.cell.pct { width: 78px; }
.cell.money { width: 108px; padding-left: 20px; }
.comm td.step .cell { background: var(--accent-soft); border-color: #bcd3ee; font-weight: 600; }
td.chg .cell { box-shadow: 0 0 0 2px #e0a526; border-color: #e0a526; }
.prefix { position: relative; display: block; }
.prefix i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 12px; pointer-events: none; }
.suffix i { pointer-events: none; }
.wh-name { max-width: 340px; }
.add-row td { background: #fbfcfd; }
.add-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.add-line select, .add-line input { width: auto; min-width: 200px; padding: 7px 10px; }
@media (max-width: 640px) {
  .savebar { padding: 8px 0; }
  .savebar-in > .muted, .savebar-in .btn-ghost { display: none; }
  .savebar-in > span:last-child { width: 100%; }
  .savebar-in .btn-primary { width: 100%; }
  .grid tbody th { min-width: 130px; font-size: 12px; }
}

/* ---- spreadsheet grids (rules page) */
.sheet-bar { border-top: 3px solid var(--navy); }
.sb-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.sb-h { font-weight: 600; margin-bottom: 2px; }
.sb-text { max-width: 700px; }
.sb-upload { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.sb-upload .field { flex: 1 1 240px; }
.sb-upload em { font-style: normal; font-weight: 400; }
.file-pick input[type=file] { padding: 7px 8px; background: #fbfcfd; }
.upload-note { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.jump .muted { margin-left: auto; font-weight: 400; }
.jump { margin: 2px 0 14px; }

.sheet { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; background: #fff; }
.sheet th, .sheet td { border: 1px solid #dfe3e8; }
.sheet thead th { background: #f3f5f7; color: var(--ink-2); font-weight: 600; font-size: 12px; padding: 6px 8px; text-align: right;
  vertical-align: bottom; line-height: 1.25; white-space: nowrap; }
.sheet thead th.sticky { text-align: left; }
.sheet tbody th { background: #f8f9fb; font-weight: 500; color: var(--ink); text-align: left; padding: 5px 10px; min-width: 250px;
  white-space: nowrap; font-size: 13px; }
.sheet .sticky { position: sticky; left: 0; z-index: 1; }
.sheet .unit { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.sheet td { padding: 0; min-width: 92px; }
.sheet .cell { display: block; width: 100%; border: 0; border-radius: 0; background: transparent; padding: 6px 8px; text-align: right;
  font: inherit; font-size: 13px; color: var(--ink); box-shadow: none; }
.sheet .cell:hover { background: #f7faff; }
.sheet .cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fff; box-shadow: none; }
.sheet td.step { background: var(--accent-soft); }
.sheet td.step .cell { font-weight: 600; color: var(--navy); }
.sheet td.edited, .sheet td.chg { background: #fff4d6; }
.sheet td.chg .cell, .sheet td.edited .cell { box-shadow: inset 0 0 0 1px #e0a526; }
.sheet .band { min-width: 92px; }
.sheet .band-r { color: var(--ink-2); }
@media (max-width: 640px) { .sheet tbody th { min-width: 150px; white-space: normal; font-size: 12px; } .jump .muted { display: none; } }

/* ---- pricing studio */
.studio { position: relative; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.st-controls { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 16px 20px; align-items: end; }
.st-controls .field span em { font-style: normal; font-weight: 400; }
.with-btn { display: flex; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: #fff; color: var(--ink-2); padding: 9px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.st-chart { padding-bottom: 12px; }
.st-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.st-chart-head p { margin: 2px 0 6px; }
.st-second { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.st-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); padding-top: 4px; }
.st-legend i, .st-tip i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.st-svg { width: 100%; user-select: none; touch-action: none; }
.st-svg svg { display: block; overflow: visible; }
.st-svg .ax { font-size: 11px; fill: #6b7684; font-variant-numeric: tabular-nums; }
.st-svg .lbl { font-size: 12px; fill: #4a5563; font-weight: 500; }
.st-svg .rate { font-size: 12px; fill: #17202b; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-svg .pt { cursor: ns-resize; outline: none; }
.st-svg .pt:hover .dot, .st-svg .pt:focus .dot { r: 7.5; }
.st-svg .pt:focus .dot { stroke: #1f3346; }
.st-svg .seg-hit { cursor: pointer; outline: none; }
.st-svg .seg-hit:hover .rate, .st-svg .seg-hit:focus .rate { fill: #2563a8; text-decoration: underline; }
.st-svg .handle { cursor: ew-resize; outline: none; }
.st-svg .handle:hover path, .st-svg .handle:focus path { fill: #eb6834; }
.st-svg .hit { cursor: copy; }
#st-price { cursor: copy; }
.st-tip { position: absolute; z-index: 30; pointer-events: none; background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(16,24,40,.12); padding: 10px 12px; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 230px; }
.st-tip .tt-h { font-weight: 600; margin-bottom: 6px; }
.st-tip .tag-s { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.st-tip table { border-collapse: collapse; width: 100%; }
.st-tip td { padding: 2px 0; } .st-tip td + td { text-align: right; padding-left: 14px; }
.st-tip tr.tt-t td { border-top: 1px solid var(--line); padding-top: 5px; font-weight: 700; }
.pop { position: absolute; z-index: 40; width: 280px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16,24,40,.16); padding: 14px; }
.pop-h { font-weight: 600; }
.pop-s { font-size: 12px; margin: 2px 0 10px; }
.pop-f { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; color: var(--ink-2); }
.pop-f span:first-child { min-width: 34px; }
.pop-f input { text-align: right; font-variant-numeric: tabular-nums; }
.pop-note { font-size: 12px; margin: -2px 0 6px; }
.pop-err { color: var(--err); font-size: 12px; min-height: 0; }
.pop-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.pop-actions span { flex: 1; }
.st-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.st-tables .card { margin-bottom: 0; }
.st-tbl td, .st-tbl th { padding: 6px 8px; font-variant-numeric: tabular-nums; }
.tcell { width: 100px; padding: 5px 8px; text-align: right; font-size: 14px; }
.tcell.sm { width: 64px; } .tcell.wide { width: 100%; text-align: left; }
.tcell.bad { border-color: var(--err); }
.link.rm { color: var(--muted); font-weight: 500; }
.link.rm:hover { color: var(--err); }
.st-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.st-add input { max-width: 260px; }
.st-add select { width: auto; }
.modal { border: 0; border-radius: 12px; padding: 0; width: min(760px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(16,24,40,.25); }
.modal::backdrop { background: rgba(23,32,43,.35); }
.modal-in { padding: 22px; }
.toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 14px; z-index: 50; box-shadow: 0 6px 20px rgba(16,24,40,.2); max-width: calc(100vw - 32px); }
@media (max-width: 900px) { .st-tables { grid-template-columns: minmax(0, 1fr); } .st-tables .card { margin-bottom: 18px; } }
@media (max-width: 640px) { .st-controls { grid-template-columns: minmax(0, 1fr); } .st-tip { min-width: 200px; } }
.st-tbl td { white-space: nowrap; }

/* ---- pricing rules (central) */
.st-sec { margin: 26px 0 12px; }
.ru-applies { font-weight: 400; }
.ru-layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.ru-layer { scroll-margin-top: 80px; }
.ru-layer-h { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ru-h { margin: 0; font-size: 14px; font-weight: 600; }
.ru-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ru-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px 6px; background: #fbfcfd; }
.ru-card.has-err { border-color: #e2a9a9; background: var(--err-bg); }
.ru-card-h { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.ru-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.ru-row .tcell { width: 78px; padding: 5px 8px; } .ru-row .tcell.sm { width: 54px; }
.ru-row .tcell:disabled { background: var(--bg); color: var(--muted); }
.ru-l { font-size: 13px; color: var(--ink-2); }
.ru-to { flex: 1; min-width: 86px; padding-left: 8px; white-space: nowrap; }
.ru-rm { font-size: 18px; line-height: 1; padding: 2px 6px; }
.ru-none { margin: 0 0 6px; }
.ru-err { color: var(--err); font-size: 13px; font-weight: 500; }
.ru-err div { padding: 2px 0 6px; }
.ru-example { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 34px; }
.ru-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff8e8; color: #6b4e0f; border-color: #ecd9a6; }
.ru-banner[hidden] { display: none; }
.rv-groups { margin-bottom: 14px; }
.rv-rows { max-height: 46vh; overflow: auto; }
@media (max-width: 820px) { .ru-layers { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .ru-row { gap: 4px; flex-wrap: nowrap; }
  .ru-row .tcell { width: 62px; padding: 5px 6px; } .ru-row .tcell.sm { width: 44px; }
  .ru-to { min-width: 0; padding-left: 2px; font-size: 12px; }
  .ru-rm { padding: 2px 4px; }
}
.st-svg .band-lbl { font-size: 11px; font-weight: 600; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.st-legend i.band { width: 14px; min-width: 0; height: 10px; vertical-align: -1px; }
.st-svg .band, .st-svg .series, .st-svg .ghost { pointer-events: none; }
.st-tip tr.tt-s td { color: var(--ink-2); font-weight: 600; }

/* ---- quote page: release 2 */
.nav a.ext { white-space: nowrap; }
.chain .t-v { font-size: 20px; }
.t-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.s-l0, .k-l0 { background: #7a5cc2; } .s-l1 { background: #eb6834; } .s-l2 { background: #2f9e73; } .s-l3 { background: #b8860b; }

/* ---- bulk cost adjustment */
.st-bulk { margin-top: 18px; }
.bk-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bk-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bk-f select { width: auto; min-width: 220px; }
.bk-pct { display: flex; align-items: center; gap: 6px; }
.bk-pct .tcell { width: 96px; padding: 9px 10px; font-size: 15px; }
.bk-pct i { font-style: normal; color: var(--muted); }
.bk-wh { position: relative; }
.bk-wh summary { list-style: none; cursor: pointer; min-width: 190px; justify-content: space-between; }
.bk-wh summary::-webkit-details-marker { display: none; }
.bk-wh summary::after { content: "▾"; color: var(--muted); }
.bk-wh-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 300px; overflow: auto; background: #fff;
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.16); padding: 8px; }
.bk-wh-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-weight: 500; font-size: 14px; color: var(--ink); cursor: pointer; }
.bk-wh-list label:hover { background: var(--bg); }
.bk-wh-list label.all { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 4px; }
.bk-wh-list input { width: 16px; height: 16px; }
#bk-note.bad { color: var(--err); }
@media (max-width: 640px) { .bk-row { align-items: stretch; flex-direction: column; } .bk-f select, .bk-wh summary { width: 100%; } }
.toast { pointer-events: none; }   /* a message must never sit between the cursor and Undo / Review */
.btn:disabled { opacity: .5; cursor: default; }
