/* QBR builder and pay check demo. Page only styles. */
.page-head .back { margin: 0 0 1.75rem; font-size: .95rem; font-weight: 500; }
.page-head .back a { color: var(--cream); text-decoration-color: var(--gold); }
.page-head .madeup { margin: 1.5rem 0 0; font-size: .95rem; color: #CFC7B7; max-width: 40rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tools .wrap { max-width: 64rem; }

/* Tabs */
.tabs { display: inline-flex; gap: .25rem; padding: .3rem; background: rgba(23,18,14,.06); border-radius: 999px; margin: 0 0 clamp(2rem, 4vw, 3rem); max-width: 100%; }
.tabs button { font: inherit; font-weight: 600; font-size: 1rem; border: 0; background: transparent; color: var(--muted); padding: .7rem 1.4rem; border-radius: 999px; cursor: pointer; transition: background .2s ease, color .2s ease, box-shadow .2s ease; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(23,18,14,.08), 0 4px 14px -6px rgba(23,18,14,.25); }
[role="tabpanel"]:focus-visible { outline: none; }

.tool-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem 2.5rem; align-items: end; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.tool-intro h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin: 0 0 .75rem; }
.tool-intro p { margin: 0; max-width: 36rem; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: flex-end; }

/* Segmented quarter picker */
.seg { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: 999px; background: rgba(23,18,14,.06); }
.seg button { font: inherit; font-weight: 600; font-size: .95rem; border: 0; background: transparent; color: var(--muted); padding: .5rem 1.05rem; border-radius: 999px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.seg button[aria-checked="true"] { background: var(--teal); color: var(--cream); }
.seg button:hover:not([aria-checked="true"]) { color: var(--ink); }

.copy-btn { font: inherit; font-weight: 600; font-size: .95rem; padding: .6rem 1.15rem; border-radius: 999px; border: 1.5px solid rgba(23,18,14,.25); background: transparent; color: var(--ink); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.copy-btn:hover { border-color: var(--ink); background: var(--paper); }
.copied { font-size: .9rem; color: var(--muted); min-width: 4.5rem; }

/* Slides */
.slides { display: grid; gap: 1.25rem; counter-reset: s; }
.slide { background: var(--paper); border-radius: 1.5rem; padding: clamp(1.5rem, 3.5vw, 2.75rem); box-shadow: 0 1px 2px rgba(23,18,14,.04), 0 18px 40px -28px rgba(11,47,53,.35); }
.slide-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.slide-top .eyebrow { margin: 0; }
.slide-num { white-space: nowrap; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.slide h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: 0 0 1rem; max-width: 30ch; text-wrap: balance; }
.slide p { max-width: 42rem; }
.slide p:last-child { margin-bottom: 0; }
.slide.lead-slide { background: var(--teal); color: var(--cream); }
.slide.lead-slide .eyebrow { color: var(--gold); }
.slide.lead-slide .slide-num { color: #CFC7B7; }
.slide.lead-slide h3 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); max-width: 24ch; line-height: 1.1; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 1.5rem; margin: 1.75rem 0 0; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats div { border-top: 1px solid rgba(23,18,14,.15); padding-top: .8rem; }
.lead-slide .stats div { border-top-color: rgba(246,239,227,.25); }
.stats dt { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.lead-slide .stats dt { color: #CFC7B7; }
.stats dd { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font-family: var(--sans); font-weight: 400; font-size: .85rem; letter-spacing: 0; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
.lead-slide .stats dd small { color: #CFC7B7; }

/* Rep bars */
.reps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .7rem; }
.reps li { display: grid; grid-template-columns: 10rem minmax(0, 1fr) 7.5rem; gap: 1rem; align-items: center; font-size: .95rem; }
.reps .nm { font-weight: 500; }
.reps .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.reps .val b { color: var(--ink); font-weight: 600; margin-right: .35rem; }
.bar { position: relative; height: .6rem; background: rgba(23,18,14,.07); border-radius: 999px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--teal); }
.bar i.low { background: var(--ember); }
.bar::after { content: ""; position: absolute; top: -.3rem; bottom: -.3rem; left: var(--q, 66.6%); width: 2px; background: var(--gold); border-radius: 2px; }
.legend { font-size: .85rem; color: var(--muted); margin: .9rem 0 0; }
.legend span { display: inline-block; width: 2px; height: .9rem; background: var(--gold); vertical-align: -.15rem; margin-right: .45rem; }

/* Coverage meter */
.meter { margin: 1.5rem 0 .6rem; position: relative; height: .9rem; background: rgba(23,18,14,.07); border-radius: 999px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--teal); }
.meter i.low { background: var(--ember); }
.meter .tick { position: absolute; top: -.35rem; bottom: -.35rem; width: 2px; background: var(--gold); }
.meter-scale { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; font-variant-numeric: tabular-nums; }

/* Deals */
.deals { list-style: none; margin: .5rem 0 0; padding: 0; }
.deals li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1.5rem; padding: 1.1rem 0; border-top: 1px solid rgba(23,18,14,.12); }
.deals li:last-child { padding-bottom: 0; }
.deals .acct { font-weight: 600; }
.deals .who { color: var(--muted); font-size: .92rem; }
.deals .amt { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; text-align: right; font-variant-numeric: tabular-nums; }
.deals .why { grid-column: 1 / -1; margin: .15rem 0 0; color: var(--ink); max-width: 44rem; }

/* Forecast calls */
.calls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1.5rem 0 1.25rem; }
.calls div { background: var(--cream); border-radius: 1rem; padding: .9rem 1rem 1rem; }
.calls div.landed { background: var(--teal); color: var(--cream); }
.calls dt { font-size: .82rem; color: var(--muted); }
.calls .landed dt { color: #CFC7B7; }
.calls dd { margin: .2rem 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.numbered { list-style: none; margin: .5rem 0 0; padding: 0; counter-reset: n; }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); padding: 1rem 0; border-top: 1px solid rgba(23,18,14,.12); max-width: 46rem; }
.numbered li:last-child { padding-bottom: 0; }
.numbered li::before { content: counter(n); font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ember-deep); line-height: 1.4; }

/* Pay check */
.plan-card { background: var(--paper); border-radius: 1.5rem; padding: clamp(1.4rem, 3vw, 2.25rem); margin-bottom: 1.5rem; }
.plan-card .eyebrow { margin-bottom: 1rem; }
.plan-terms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem 1.5rem; margin: 0 0 1.25rem; }
.plan-terms div { border-top: 1px solid rgba(23,18,14,.15); padding-top: .65rem; }
.plan-terms dt { font-size: .85rem; color: var(--muted); }
.plan-terms dd { margin: .15rem 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: -.01em; line-height: 1.15; }
.plan-terms dd small { display: block; font-family: var(--sans); font-weight: 400; font-size: .82rem; color: var(--muted); letter-spacing: 0; margin-top: .2rem; line-height: 1.35; }
.plan-card .note { margin: 0; }

.pay-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.25rem; margin: 2rem 0 1rem; }
.pay-summary h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0; }
.pay-summary p { margin: 0; color: var(--muted); }

.pay-table-box { background: var(--paper); border-radius: 1.5rem; padding: .5rem clamp(1rem, 2.5vw, 1.75rem); }
.pay-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pay-table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 1rem .6rem .7rem; border-bottom: 1px solid rgba(23,18,14,.15); white-space: nowrap; }
.pay-table td { padding: 1rem .6rem; vertical-align: top; }
.pay-table th:first-child, .pay-table td:first-child { padding-left: 0; }
.pay-table th:last-child, .pay-table td:last-child { padding-right: 0; }
.pay-table tbody tr.rep td { border-top: 1px solid rgba(23,18,14,.1); }
.pay-table tbody tr.rep:first-child td { border-top: 0; }
.pay-table tr.detail td { padding-top: 0; border-top: 0; }
.pay-table .num { text-align: right; }
.pay-table th.num { text-align: right; }
.pay-table .rname { font-weight: 600; }
.pay-table .money { font-weight: 500; }

.bk { display: inline-flex; align-items: center; gap: .15rem; border: 1px solid rgba(23,18,14,.2); border-radius: .6rem; background: #fff; padding: 0 .6rem; transition: border-color .2s ease, box-shadow .2s ease; }
.bk:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,47,53,.12); }
.bk span { color: var(--muted); }
.bk input { font: inherit; font-variant-numeric: tabular-nums; border: 0; background: transparent; width: 6.5rem; padding: .45rem 0; color: var(--ink); text-align: right; }
.bk input:focus { outline: none; }
.bk.edited { border-color: var(--gold); background: #FFF6E2; }

.chk { display: inline-block; font-size: .85rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; white-space: nowrap; }
.chk.ok { background: rgba(11,47,53,.08); color: var(--teal); }
.chk.under { background: rgba(228,87,46,.14); color: var(--ember-deep); }
.chk.over { background: rgba(242,177,52,.28); color: #6B4A00; }

.flag { margin: 0 0 .5rem; padding: .7rem .9rem; border-radius: .8rem; background: rgba(228,87,46,.08); border-left: 3px solid var(--ember); font-size: .95rem; max-width: 44rem; }
.flag.over { background: rgba(242,177,52,.14); border-left-color: var(--gold); }
.flag b { font-weight: 600; }
.math { font-size: .9rem; color: var(--muted); }
.math summary { cursor: pointer; width: fit-content; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(23,18,14,.25); text-underline-offset: .2em; }
.math summary:hover { text-decoration-color: var(--ember); }
.math p { margin: .4rem 0 0; max-width: 44rem; }

.reset-row { margin: 1rem 0 0; }
.link-btn { font: inherit; font-size: .95rem; border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: .2em; cursor: pointer; }

@media (max-width: 54rem) {
  .tool-intro { grid-template-columns: 1fr; align-items: start; }
  .controls { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 46rem) {
  /* Table reflows into one card per rep */
  .pay-table-box { padding: .25rem 1.1rem; }
  .pay-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; width: 100%; }
  .pay-table tbody tr.rep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .65rem 1rem; padding: 1.2rem 0 .75rem; border-top: 1px solid rgba(23,18,14,.12); }
  .pay-table tbody tr.rep:first-child { border-top: 0; }
  .pay-table tbody tr.rep td { border: 0; padding: 0; text-align: left; }
  .pay-table td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); margin-bottom: .1rem; }
  .pay-table td.rname { grid-column: 1 / 2; font-size: 1.1rem; align-self: center; }
  .pay-table td.rname::before { display: none; }
  .pay-table td.chkcell { grid-column: 2 / 3; grid-row: 1; text-align: right; align-self: center; }
  .pay-table td.chkcell::before { display: none; }
  .pay-table td.bkcell { grid-column: 1 / -1; }
  .pay-table .num { text-align: left; }
  .pay-table tr.detail td { padding: 0 0 1.1rem; }
  .bk { width: 100%; }
  .bk input { width: 100%; text-align: left; }
}

@media (max-width: 40rem) {
  :root { --gutter: 16px; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; padding: .7rem .5rem; font-size: .95rem; }
  .controls { width: 100%; }
  .seg { flex: 1; }
  .seg button { flex: 1; padding: .5rem .4rem; }
  .copy-btn { flex: 1; }
  .copied { min-width: 0; }
  .stats, .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .reps li { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; }
  .reps .bar { grid-column: 1 / -1; grid-row: 2; }
  .deals .amt { font-size: 1.15rem; }
  .slide { border-radius: 1.25rem; }
}
