/* Styles for demo.html only.
 *
 * ➤ A SEPARATE FILE RATHER THAN MORE OF site.css, because none of this is used by the other
 * three pages and the home page is the one that has to be fast.
 *
 * ⚠ EVERYTHING IS HERE AND NOTHING IS INLINE. `style-src 'self'` drops a style="" attribute
 * silently -- no console entry the visitor will see, no layout, no explanation -- and the
 * deploy preflight refuses a marketing page carrying one.
 *
 * The CMS-1500 colour tokens (--cms-red, --cms-rule, --cms-tint, --cms-ink) are defined in
 * site.css for the home page's miniature and reused here, so the two cannot drift apart.
 */

:root { --stop: #b3261e; --stop-bg: #fdf3f2; }

/* ---- hero ---------------------------------------------------------------- */
.demo-hero { padding: 54px 0 10px; }
.demo-hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; margin: .3rem 0 1rem; }
.demo-hero .lede { max-width: 56ch; }
.demo-note {
  margin-top: 1.2rem; max-width: 62ch; font-size: .92rem; color: var(--ink-2);
  border-left: 3px solid var(--blue); padding: .55rem 0 .55rem .9rem; background: var(--blue-50);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- the step bar -------------------------------------------------------- */
.stepbar {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.step-btn {
  width: 100%; text-align: left; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: .55rem;
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink-2); font-size: .92rem; font-weight: 600;
  border-bottom-width: 3px;
}
.step-btn:hover { border-color: #c9d2e4; color: var(--ink); }
.step-btn.is-on { color: var(--blue); border-color: #c3cbf7; border-bottom-color: var(--blue); background: var(--blue-50); }
.step-n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .76rem; font-weight: 700;
  background: var(--line); color: var(--ink-2);
}
.step-btn.is-on .step-n { background: var(--blue); color: #fff; }

/* ---- the two-pane layout ------------------------------------------------- */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.demo-form-wrap { margin: 0; }
.demo-cap { font-size: .8rem; color: var(--ink-3); margin-bottom: .5rem; display: flex; gap: .5rem; align-items: center; }
.demo-cap-k {
  font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: .14rem .4rem; border-radius: 4px;
}

/* ---- the CMS-1500 -------------------------------------------------------- */
.cms1500 {
  background: var(--cms-tint); border: 1px solid var(--cms-rule); border-radius: 6px;
  padding: 10px; font-size: .7rem; color: var(--cms-ink); overflow: hidden;
}
.cf-carrier { border: 1px solid var(--cms-rule); border-radius: 3px; padding: 7px 8px; margin-bottom: 7px; background: #fff; }
.cf-payer { font-weight: 700; font-size: .78rem; letter-spacing: .01em; }
.cf-payer-sub { color: var(--ink-3); font-size: .68rem; }
.cf-row { display: grid; gap: 5px; margin-bottom: 5px; }
.cf-1 { grid-template-columns: 1fr; }
.cf-2 { grid-template-columns: 1fr 1.25fr; }
.cf-3 { grid-template-columns: 1.1fr 1.3fr .8fr; }
.cf-4 { grid-template-columns: 1.4fr 1fr .7fr .7fr; }
.cf-box {
  border: 1px solid var(--cms-rule); border-radius: 3px; background: #fff;
  padding: 3px 6px 5px; min-width: 0; transition: box-shadow .18s, border-color .18s, background .18s;
}
.cf-n {
  display: block; font-size: .54rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--cms-red); margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-v {
  display: block; font-family: var(--mono); font-size: .68rem; font-weight: 500;
  color: var(--cms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-sub { color: var(--ink-3); font-size: .62rem; }
.cf-npi { font-size: .62rem; color: var(--ink-3); margin-top: 2px; }
.cf-npi b { color: var(--cms-ink); font-weight: 600; }
.cf-dx { letter-spacing: .04em; }
.cf-total .cf-v { font-weight: 700; }

/* box 24: the service-line grid */
.cf-24 { border: 1px solid var(--cms-rule); border-radius: 3px; background: #fff; margin-bottom: 5px; overflow: hidden; }
.cf-24head, .cf-24row {
  display: grid; grid-template-columns: 1.5fr .5fr 1.2fr .6fr 1fr .5fr;
  gap: 4px; padding: 3px 6px; align-items: baseline;
}
.cf-24head {
  font-size: .5rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--cms-red); background: var(--cms-tint); border-bottom: 1px solid var(--cms-rule);
}
.cf-24head span, .cf-24row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-24row { font-family: var(--mono); font-size: .64rem; border-bottom: 1px solid #f4e7e5; }
.cf-24row:last-child { border-bottom: 0; }
.cf-cpt { font-weight: 700; }
/* ⚠ THE GAP IS DOING REAL WORK. Right-aligned against the units column, "101 76" and "1" read
   as "101 76 1" -- one number. On a page whose claim is "we read this correctly", a rendering
   that is ambiguous to a human undercuts the whole point. */
.cf-money { text-align: right; padding-right: .5rem; }
.cf-24head span:last-child, .cf-24row span:last-child { text-align: right; }

/* the "being read" state */
.cf-box.is-lit { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(20, 40, 210, .14); background: #fbfcff; }
.cms1500.is-reading .cf-24 { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(20, 40, 210, .14); }

/* ---- the panel ----------------------------------------------------------- */
.demo-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; background: var(--white); box-shadow: var(--shadow); }
.demo-panel h3 { font-size: 1.12rem; margin: 0 0 .5rem; }
.demo-panel p { font-size: .94rem; color: var(--ink-2); margin: 0 0 .85rem; }
.demo-broken { border-color: var(--stop); background: var(--stop-bg); color: var(--stop); font-weight: 600; }
.panel-note { font-size: .86rem !important; color: var(--ink-3) !important; border-top: 1px solid var(--line); padding-top: .8rem; margin-bottom: 0 !important; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 1rem; align-items: baseline; }
.kv dt { font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.kv dd { margin: 0; font-size: .86rem; font-weight: 600; color: var(--ink); }

.readout { width: 100%; border-collapse: collapse; font-size: .82rem; }
.readout th {
  text-align: left; font-weight: 500; color: var(--ink-3); padding: .32rem .6rem .32rem 0;
  white-space: nowrap; border-bottom: 1px solid var(--line); width: 1%;
}
.readout td {
  font-family: var(--mono); font-size: .78rem; color: var(--ink); font-weight: 500;
  padding: .32rem 0; border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.chk { border-radius: var(--radius); padding: .7rem .85rem; margin-bottom: .7rem; border: 1px solid; }
.chk p { margin: 0; font-size: .85rem !important; }
.chk-h { font-weight: 700; font-size: .72rem !important; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .25rem !important; }
.chk-warn { border-color: #e8d4a8; background: #fdf8ee; }
.chk-warn .chk-h { color: var(--warn); }
.chk-warn p { color: #6b5420 !important; }
.chk-stop { border-color: #eec4c0; background: var(--stop-bg); }
.chk-stop .chk-h { color: var(--stop); }
.chk-stop p { color: #7d2a24 !important; }

.x12 {
  font-family: var(--mono); font-size: .7rem; line-height: 1.55; color: #cfe0ff;
  background: var(--navy); border-radius: var(--radius); padding: 12px 14px;
  max-height: 340px; overflow: auto; margin: 0 0 .9rem; white-space: pre;
}

/* ---- the refusal section ------------------------------------------------- */
.refusal-card {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
  border-left: 4px solid #ff8d82; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 26px;
}
.refusal-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #ff8d82; margin: 0 0 .5rem;
}
.refusal-why { margin: 0; font-size: 1rem; line-height: 1.6; color: #eaf0ff; font-family: var(--mono); }
/* Our explanation of the quoted message, visibly OURS -- different type, different colour and
   a label -- so nobody reads it as part of what the software said. */
.refusal-gloss { margin: -14px 0 26px; font-size: .93rem; color: #b9c4dc; max-width: 68ch; }
.refusal-gloss-k {
  display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--grey); margin-right: .55rem;
}
.refusal-gloss code { font-family: var(--mono); font-size: .88em; color: #fff; background: rgba(255,255,255,.12); padding: .05em .35em; border-radius: 3px; }
.refusal-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.refusal-rail h4 { color: #fff; font-size: .95rem; margin: 0 0 .4rem; }
.refusal-rail p { color: #b9c4dc; font-size: .92rem; margin: 0; }

/* ---- print image --------------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.two-col h2 { margin-bottom: .8rem; }
.two-col p { color: var(--ink-2); margin-bottom: .9rem; }
.muted-note { font-size: .9rem; color: var(--ink-3); border-left: 3px solid var(--line); padding-left: .9rem; }
.pi-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.pi-k { font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); margin: 0 0 .7rem; }
.pi-pre {
  font-family: var(--mono); font-size: .66rem; line-height: 1.7; color: var(--ink);
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin: 0 0 .8rem; overflow-x: auto; white-space: pre;
}
.pi-foot { font-size: .82rem; color: var(--ink-3); margin: 0; }

/* ---- differentiators ----------------------------------------------------- */
.diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.diff { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; background: var(--white); }
.diff h3 { font-size: 1rem; line-height: 1.3; margin: 0 0 .5rem; }
.diff p { font-size: .9rem; color: var(--ink-2); margin: 0; }

/* ---- cta ----------------------------------------------------------------- */
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-inner h2 { color: #fff; margin: 0 0 .4rem; }
.cta-inner p { color: #b9c4dc; margin: 0; max-width: 52ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { background: #eef1fe; }
.btn-ghost-light { border: 1px solid rgba(255,255,255,.4); color: #fff; font-family: var(--mono); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }

/* ---- narrow -------------------------------------------------------------- */
@media (max-width: 940px) {
  .demo-grid, .two-col, .refusal-rail { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr 1fr; }
  .stepbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .diff-grid { grid-template-columns: 1fr; }
  .cf-3, .cf-4, .cf-2 { grid-template-columns: 1fr 1fr; }
  .cf-24head, .cf-24row { grid-template-columns: 1.4fr .5fr 1fr .9fr; }
  .cf-24head span:nth-child(4), .cf-24row span:nth-child(4),
  .cf-24head span:nth-child(6), .cf-24row span:nth-child(6) { display: none; }
  .demo-panel { padding: 18px 16px; }
  .x12 { font-size: .62rem; }
}
