/* The free calculators (tools/cpa-calculator/, tools/seo-equity-calculator/). The markup is scripts/calculators/view.mjs,
   the behaviour app.js, both built into the pages by scripts/calculators/build.mjs; this sheet is written by hand and
   reads the site's tokens and nothing else.
   One screen: the title, then the visitor's numbers on paper beside the read-out on the deep band (the site's inverted
   panel), which follows as they type. Under 880 px the read-out comes under the form. The email step is the stack
   board's sheet, renamed cx-. */
.sec.cx { padding-block: clamp(28px, 4vw, 64px) clamp(56px, 7vw, 104px); }
.cx *, .cx-dlg * { box-sizing: border-box; }
.cx .sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the title */
.cx-head { max-width: 780px; margin-bottom: clamp(24px, 3.4vw, 48px); }
.cx-eye { font: 600 var(--label)/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--orb); margin-bottom: var(--s3); }
.cx-head h1 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.02; max-width: 19ch; }
.cx-lede { margin-top: var(--s4); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.45; color: var(--muted); max-width: 52ch; }

/* the form beside the read-out */
.cx-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.cx-form, .cx-out { min-width: 0; }
.cx-form { border-top: var(--rule) solid var(--ink); padding-top: clamp(20px, 2.8vw, 36px); }
.cx-fh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: var(--s5); padding-top: 2px; }
.cx-fh h2, .cx-out h2 { font: 600 var(--label)/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--orb); }
.cx-note { font-size: var(--small); color: var(--muted); }
.cx-note[hidden] { display: none; }
.cx-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.cx-f { display: grid; gap: 6px; min-width: 0; }
.cx-f label { font: 600 16px/1.3 var(--body); }
.cx-box { display: flex; align-items: center; min-height: 54px; border: 1px solid var(--line); border-bottom: 2px solid var(--ink); border-radius: var(--r); background: var(--bg); }
.cx-box:focus-within { outline: 2px solid var(--orb); outline-offset: 1px; }
.cx-box.bad { border-color: var(--orb); }
.cx-pre, .cx-post { flex: none; font: 400 20px/1 var(--body); color: var(--muted); }
.cx-pre { padding-left: 14px; }
.cx-post { padding-right: 14px; }
.cx-box input { flex: 1 1 auto; min-width: 0; width: 100%; height: 52px; padding: 0 14px; border: 0; background: none; color: var(--ink); font: 400 20px/1 var(--body); font-variant-numeric: tabular-nums; }
.cx-pre + input { padding-left: 4px; }
.cx-box input:focus { outline: none; }
.cx-hint { font-size: var(--small); line-height: 1.4; color: var(--muted); }
.cx-err { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--orb); }
.cx-err:empty { display: none; }

/* the read-out: the deep band's colors, in both themes */
.cx-out { background: var(--deep); color: var(--deep-ink); --ink: var(--deep-ink); --bg: var(--deep); --muted: #bdb5dc; --line: rgba(243, 240, 255, .16); --btn-fill: var(--deep-surface); --orb: #a993ff; --gain: #58c98a;
  padding: clamp(20px, 2.8vw, 36px); border-radius: var(--r); }
.cx-out h2 { margin-bottom: var(--s3); }
.cx-verdict { font: 400 clamp(23px, 2.3vw, 32px)/1.15 var(--display); text-wrap: balance; }
.cx-warn { margin-top: var(--s3); font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--orb); }
.cx-warn[hidden] { display: none; }
.cx-block { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.cx-block h3 { font: 600 var(--label)/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cx-big { margin-top: var(--s3); font: 400 clamp(38px, 10vw, 84px)/1 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (min-width: 880px) { .cx-big { font-size: clamp(44px, 5.4vw, 84px); } }
.cx-big.two { margin-top: var(--s2); font-size: clamp(28px, 3.2vw, 44px); }
.cx-unit { font: 400 17px/1.2 var(--body); color: var(--muted); white-space: nowrap; }
.cx-sub { margin-top: var(--s3); font-size: 15px; line-height: 1.45; color: var(--muted); }
.cx-sub:empty { display: none; }
.cx-none { font: 400 .5em/1.2 var(--body); color: var(--muted); }
.cx-rows { margin: var(--s3) 0 0; display: grid; gap: var(--s3); }
.cx-rows > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.cx-rows dt { font-size: 16px; line-height: 1.35; }
.cx-rows dd { margin: 0; font: 400 clamp(22px, 2.2vw, 28px)/1.15 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.cx-rows .cx-none { font-size: 15px; }
/* the gap rows: the words, then the bar under them */
.cx-rows > div[data-way] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.cx-rows > div[data-way] dd { display: grid; gap: 8px; }
.cx-rows > div[data-way="spare"] .cx-v { color: var(--gain); }
.cx-rows > div[data-way="over"] .cx-v { color: var(--orb); }
.cx-bar { position: relative; display: block; height: 12px; }
.cx-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 1px; }
.cx-bar .v { border: 1.5px solid var(--ink); }
.cx-bar[data-way="spare"] .v { background: color-mix(in srgb, var(--gain) 28%, transparent); border-color: var(--gain); }
.cx-bar .c { background: var(--ink); }
.cx-bar .o { background: repeating-linear-gradient(135deg, var(--orb) 0 4px, color-mix(in srgb, var(--orb) 45%, transparent) 4px 8px); }

.cx-acts { margin-top: var(--s6); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.cx-acts .btn { cursor: pointer; }
.cx-private { font-size: var(--small); line-height: 1.4; color: var(--muted); }

@media (max-width: 879px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
}
@media (max-width: 599px) { .cx-fields { grid-template-columns: minmax(0, 1fr); } .cx-acts .btn { flex: 1 1 100%; } }

/* the email step: the stack board's sheet (stack-board.css .sb-dlg), renamed */
html.cx-open { overflow: hidden; padding-right: var(--cx-sbw, 0px); }
.cx-dlg { width: min(520px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--ink); border-radius: var(--r); background: var(--bg); color: var(--ink); overflow: auto; overscroll-behavior: contain; }
.cx-dlg:has(.wide) { width: min(600px, calc(100vw - 32px)); }
.cx-dlg::backdrop { background: rgba(18, 18, 18, .55); }
.cx-dlg[open] { animation: cx-sheet .45s var(--ease); }
@keyframes cx-sheet { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cx-sheet { display: grid; grid-template-columns: minmax(0, 1fr); }
.cx-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.cx-sheet-head h2 { font: 400 26px/1.1 var(--display); margin: 0; }
.cx-x { width: 44px; height: 44px; flex: none; background: none; border: 0; padding: 0; position: relative; cursor: pointer; color: var(--ink); }
.cx-x i::before, .cx-x i::after { content: ""; position: absolute; left: 13px; right: 13px; top: 21px; height: 2px; background: currentColor; transform: rotate(45deg); }
.cx-x i::after { transform: rotate(-45deg); }
.cx-sheet-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 22px 20px; }
.cx-sheet-body p { margin: 0; max-width: none; }
.cx-dlede { font-size: 17px; line-height: 1.45; }
.cx-df { display: grid; gap: 6px; }
.cx-df > span { font: 600 var(--label)/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cx-df small { font: 400 13px/1.3 var(--body); text-transform: none; letter-spacing: 0; }
.cx-df input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-bottom: 2px solid var(--ink); border-radius: var(--r); background: var(--bg); color: var(--ink); font: 400 17px/1.4 var(--body); }
.cx-df input:focus { outline: 2px solid var(--orb); outline-offset: 1px; }
.cx-df input.bad { border-color: var(--orb); }
.cx-derr { font-size: 15px; line-height: 1.4; color: var(--orb); font-weight: 600; }
.cx-derr:empty { display: none; }
.cx-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cx-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 22px 18px; }
.cx-sheet-foot .btn { cursor: pointer; }
.cx-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 15px/1.2 var(--body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.cx-mail { border: 1px solid var(--ink); background: #fffdf8; }
:root[data-theme="dark"] .cx-mail { background: var(--surface); }
.cx-mail-head { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.cx-mail-head b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.cx-mail-head .cx-subj { font: 600 17px/1.3 var(--body); color: var(--ink); margin-top: 4px; }
.cx-mail-body { display: grid; gap: 10px; padding: 14px 16px 16px; font-size: 15.5px; line-height: 1.45; }
.cx-mail-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cx-mail-body li { padding-left: 12px; border-left: 2px solid var(--orb); }
.cx-mail-body a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; }
.cx-kit { font-size: 14px; line-height: 1.45; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 599px) {
  .cx-two { grid-template-columns: minmax(0, 1fr); }
  .cx-sheet-head { padding-left: 16px; }
  .cx-sheet-body { padding: 16px 16px 18px; }
  .cx-sheet-foot { padding: 10px 16px 16px; }
  .cx-sheet-foot .btn { flex: 1 1 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) { .cx-dlg, .cx-dlg * { animation: none !important; transition: none !important; } }
