/* Chair math (/barbershops/calculator/): this page's styles only. Tokens come from barbers.css (the ink family).
   No opacity animation; the split and range bars may ease their width, and only when motion is welcome. */

:root { --bad: #ff9a86; --bone: #e9e9e4; }
html.ink :focus-visible { outline: 2px solid var(--hi); outline-offset: 3px; }
.calc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.calc { padding-top: clamp(28px, 4vh, 48px); padding-bottom: clamp(64px, 9vh, 112px); }
.calc-noscript { margin: 0 0 24px; padding: 16px 20px; border-radius: var(--r); border: 1.5px dashed #34343a; color: var(--soft); }
.calc-err { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: var(--bad); }
.calc-err:empty { display: none; }

/* the chair sentence: real inputs set as blanks in a line of type */
.calc-eg { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--soft); }
.calc-line { margin: 0; max-width: 20em; font-size: clamp(26px, 3.6vw, 40px); font-weight: 600; line-height: 1.55; letter-spacing: -.025em; text-wrap: pretty; }
.nb { white-space: nowrap; }
.dollar { color: var(--hi); }
.blank, .inl { field-sizing: content; min-width: 3ch; min-height: 44px; color: var(--hi); font-variant-numeric: tabular-nums; text-align: center; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.blank { padding: 0 .08em; border: 0; border-bottom: 3px solid var(--hi); background: none; font: inherit; }
.blank { vertical-align: baseline; }
.blank:hover, .inl:hover { border-bottom-color: #c9ceff; background: rgb(139 152 255 / .08); }
.blank:active, .inl:active { background: rgb(139 152 255 / .16); }
.blank[aria-invalid="true"], .inl[aria-invalid="true"] { border-bottom-color: var(--bad); color: var(--bad); }
.blank { height: 1.2em; line-height: 1.2; padding-top: max(0px, calc((44px - 1.2em) * .85)); }   /* the underline sits near the type; min-height keeps the 44px tap */
/* on the cards the fields are small boxes, the same as the week/month select beside them */
.inl { min-width: 3.2ch; height: 44px; min-height: 44px; margin: 2px 2px; padding: 0 10px; border: 1.5px solid #34343a; border-radius: 10px; background: #1c1c20; font: 600 17px/1 var(--font); vertical-align: middle; }
.inl:hover { border-color: #55555e; border-bottom-color: #55555e; background: #1c1c20; }
.inl:active { background: #222228; }
.inl:focus-visible { border-color: var(--hi); }
.inl[aria-invalid="true"] { border-color: var(--bad); }
.chair .terms .nb { white-space: nowrap; }
.sel { vertical-align: middle; }

/* the smaller row, with visible labels */
.calc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 640px; margin-top: 36px; }
.calc-f { display: grid; gap: 8px; align-content: start; }
.calc-f label { font-size: 14px; font-weight: 600; color: var(--soft); }
.box { field-sizing: fixed; width: 100%; min-width: 0; height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid #34343a; background: #1c1c20; color: var(--ink); font: 600 18px/1 var(--font); font-variant-numeric: tabular-nums; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.box:hover { border-color: #55555e; }
.box:active { background: #222228; }
.box[aria-invalid="true"] { border-color: var(--bad); }
#err-row { margin-top: 10px; }

/* the two segmented controls: native radios, dressed as a pill */
.calc-segs { display: flex; flex-wrap: wrap; gap: 22px 40px; margin-top: 36px; }
.seg { margin: 0; padding: 0; border: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.seg-opts { display: inline-flex; padding: 3px; border-radius: 999px; border: 1.5px solid var(--line); background: #141416; }
.seg-opt { position: relative; display: block; }
.seg-opt input { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; border-radius: 999px; cursor: pointer; }
.seg-opt input:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
.seg-opt span { display: grid; place-items: center; min-height: 44px; padding: 8px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--soft); white-space: nowrap; transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg-opt input:hover + span { color: #fff; background: #232327; }
.seg-opt input:active + span { background: #2c2c33; }
.seg-opt input:checked + span { background: var(--accent); color: #fff; }

/* the three chair cards */
.chairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 40px; }
.chair { display: flex; flex-direction: column; min-width: 0; padding: clamp(22px, 2.4vw, 30px); border-radius: var(--r); background: var(--paper-2); border: 1.5px solid var(--line); }
.chair.is-top { background: linear-gradient(160deg, #1d2160, #141634 60%, #121226); border-color: #3a43b8; }
.chair-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 30px; }
.chair h3 { margin: 0; font-size: clamp(22px, 2vw, 28px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.chair-tag { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.chair-tag[hidden] { display: none; }
.terms { margin: 0; font-size: 17px; line-height: 1.75; color: var(--soft); }
.terms-note { margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: var(--soft); }
.chair .terms .nb { color: var(--hi); }
.sel { height: 44px; padding: 0 10px; border-radius: 10px; border: 1.5px solid #34343a; background: #1c1c20; color: var(--hi); font: 600 17px/1 var(--font); cursor: pointer; transition: border-color .2s var(--ease); }
.sel:hover { border-color: #55555e; }
.tier-check { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; min-height: 44px; margin-top: 2px; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.tier-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.tier { margin-top: 2px; }
.tier[hidden] { display: none; }

.chair-out { margin-top: auto; padding-top: 26px; }
.chair-out[hidden], .chair-empty[hidden], .chair-loss[hidden] { display: none; }
.chair-bar { height: 14px; border-radius: 99px; background: var(--bone); overflow: hidden; }
.chair-bar i { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(var(--shop-f, .5)); transform-origin: left center; }
.chair-bar.is-empty { background: #2a2a2e; }
.chair-loss { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--bad); }
.chair-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.chair-nums p { margin: 0; min-width: 0; }
.chair-nums span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.chair-nums b { font-size: clamp(30px, 3vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.chair-nums b.neg { color: var(--bad); }
.est { margin-left: 5px; font-size: 12px; font-weight: 500; color: var(--soft); }
.chair-steady { margin-top: 22px; }
.chair-steady-label { margin: 0 0 8px; font-size: 13px; color: var(--soft); }
.chair-range { position: relative; height: 6px; border-radius: 99px; background: #2a2a2e; overflow: hidden; }
.chair-range i { position: absolute; inset: 0; background: var(--hi); clip-path: inset(0 calc(100% - var(--from, 0%) - var(--len, 100%)) 0 var(--from, 0%) round 99px); }
.chair-steady-text { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--soft); }
.chair-steady-text [data-steady] { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chair-empty { margin: auto 0 0; padding: 18px; border-radius: 12px; border: 1.5px dashed #34343a; font-size: 16px; line-height: 1.4; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .chair-bar i { transition: transform .25s var(--ease); }
  .chair-range i { transition: clip-path .25s var(--ease); }
}

/* break-even, shop total, every number */
.calc-be { display: grid; gap: 16px; margin-top: 18px; padding: clamp(20px, 2.4vw, 28px); border-radius: var(--r); border: 1.5px dashed #3a3a42; }
.calc-be p { margin: 0; max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--soft); }
.calc-be p.lead { font-size: clamp(19px, 1.9vw, 24px); font-weight: 600; line-height: 1.35; letter-spacing: -.015em; color: var(--ink); }
.calc-be strong { color: var(--hi); font-weight: 700; }
.be-sub { display: block; margin-top: 6px; font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--soft); }
.calc-total { margin: 28px 0 0; max-width: 60ch; font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; line-height: 1.4; letter-spacing: -.015em; }

.calc-all { margin-top: 28px; }
.calc-all summary { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 650; font-size: 17px; color: var(--hi); cursor: pointer; list-style: none; }
.calc-all summary::-webkit-details-marker { display: none; }
.calc-all summary::after { content: "+"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 18px; font-weight: 400; transition: transform .25s var(--ease), border-color .2s var(--ease); }
.calc-all summary:hover::after { border-color: var(--hi); }
.calc-all[open] summary::after { transform: rotate(45deg); }
.calc-scroll { margin-top: 14px; padding: 0 8px 8px; overflow-x: auto; border-radius: var(--r); border: 1.5px solid var(--line); }
.calc-scroll table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.calc-scroll caption { caption-side: top; padding: 14px 8px; text-align: left; font-size: 14px; color: var(--soft); border-bottom: 1px solid var(--line); }
.calc-scroll thead th { padding: 12px 16px; background: #151518; text-align: right; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.calc-scroll tbody th { padding: 13px 16px; text-align: left; font-size: 15px; font-weight: 600; }
.calc-scroll td { padding: 13px 16px; text-align: right; font-size: 16px; font-weight: 600; }
.calc-scroll tbody tr { border-top: 1px solid var(--line); }
.calc-scroll tbody tr:last-child { background: rgb(139 152 255 / .07); }

.calc-act { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 36px; }
.calc-act .pill { padding-block: 8px; }   /* the height still sets the size; this keeps text off the edge if it wraps */
.calc-fine { margin: 28px 0 0; max-width: 68ch; font-size: 14px; line-height: 1.55; color: var(--soft); }

/* how the maths works */
.calc-how { padding-top: clamp(48px, 7vh, 88px); }
.calc-how h2 { font-size: clamp(36px, 4.4vw, 72px); }
.p-two.how-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.how-cards .p-card2 p { margin: 0; color: var(--soft); line-height: 1.5; }
.how-cards .p-card2 h3 { margin-bottom: 14px; }

@media (min-width: 1000px) {
  .chairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .p-two.how-cards { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .calc-row { gap: 10px; }
  .calc-f label { font-size: 13px; }
  .calc-segs { gap: 20px; }
  .seg-opt span { padding: 8px 14px; font-size: 14px; }
  .calc-act .pill { flex: 1 1 100%; justify-content: center; }
  .calc-scroll caption { padding: 12px; }
  .calc-scroll thead th, .calc-scroll tbody th, .calc-scroll td { padding: 11px 10px; }
  .calc-scroll tbody th { font-size: 14px; }
  .calc-scroll td { font-size: 15px; }
  .calc-scroll thead th { font-size: 11px; letter-spacing: .03em; }
}

/* dollar blanks hug their "$" */
.nb:has(.dollar) input { text-align: left; }
