/* RemitBench denial-code reference.
   This layer keeps the site-wide identity from brand.css while giving the
   long-form reference pages stronger hierarchy, contrast, and reading rhythm. */

:root {
  --codes-canvas: #edf2ef;
  --codes-surface: #ffffff;
  --codes-ink: #101c26;
  --codes-copy: #1e3027;
  --codes-muted: #43594d;
  --codes-rule: #c9d6ce;
  --codes-soft: #f1f6f3;
  --codes-strong-soft: #e3eee7;
  --codes-danger: #6b2118;
  --codes-danger-bg: #fff2ee;
  --codes-danger-line: #b65c50;
  --codes-caution: #5a3907;
  --codes-caution-bg: #fff6df;
  --codes-caution-line: #b27c1c;
}

body {
  background: var(--codes-canvas);
  color: var(--codes-ink);
}

/* ------------------------------------------------------------ the header */

.site-head {
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 1px 6px rgba(10, 53, 39, .08);
}

.site-head .wrap { min-height: 68px; }

.site-head nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--codes-copy);
  font-size: 16px;
  font-weight: 600;
}

.site-head nav a.btn-primary {
  min-height: 44px;
  padding: 10px 15px;
}

/* ------------------------------------------------------------ the column */

.doc {
  padding: 0;
  font-size: 17.5px;
  line-height: 1.7;
}

.doc > .wrap {
  max-width: 920px;
  padding: 0 clamp(32px, calc((100vw - 728px) / 2), 96px) 72px;
  background: var(--codes-surface);
  box-shadow: 0 1px 6px rgba(10, 53, 39, .09);
}

.doc p,
.doc li {
  color: var(--codes-copy);
  font-size: 17.5px;
}

.doc p { margin: 0 0 18px; }

.doc ul,
.doc ol {
  margin: 0 0 20px;
  padding-left: 24px;
  color: var(--codes-copy);
}

.doc li { margin: 0 0 10px; }

.doc p,
.doc li,
.doc dd { text-wrap: pretty; }

.crumbs {
  margin: 0;
  padding: 24px 0 0;
  color: var(--codes-muted);
  font-size: 16px;
  font-weight: 500;
}

.crumbs a { color: var(--codes-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { padding: 0 7px; color: var(--codes-muted); }

.doc h1 {
  max-width: 22ch;
  margin: 18px 0 14px;
  color: var(--accent-deep);
  font-size: clamp(40px, 5vw, 48px);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.doc .lede {
  max-width: 68ch;
  margin: 0 0 34px;
  color: var(--codes-copy);
  font-size: 21px;
  line-height: 1.55;
  text-wrap: pretty;
}

.doc h2 {
  margin: 54px 0 16px;
  padding-top: 26px;
  border-top: 2px solid var(--accent-line);
  color: var(--accent-deep);
  font-size: 30px;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.doc h3 {
  margin: 32px 0 10px;
  color: var(--codes-ink);
  font-size: 22px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.doc a { font-weight: 600; }

.doc code {
  padding: 2px 6px;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
  font: 600 17px/1.3 var(--mono);
  overflow-wrap: anywhere;
  white-space: normal;
}

/* ---------------------------------------------------------- the verdict */

.verdict {
  margin: 4px 0 42px;
  padding: 10px 28px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-deep);
  box-shadow: 0 6px 0 #c5d7cc;
  color: #ffffff;
}

.verdict dl { margin: 0; }

.verdict dt {
  padding: 22px 0 0;
  color: #c4d9cc;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.verdict dd {
  margin: 8px 0 22px;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.58;
}

.verdict dd + dt { border-top: 1px solid rgba(255, 255, 255, .24); }
.verdict dd:last-of-type { margin-bottom: 22px; }
.verdict b { color: #ffffff; font-weight: 700; }

.verdict code {
  border-color: transparent;
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
}

.who {
  display: inline-block;
  max-width: 100%;
  margin: 1px 0 12px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  font: 700 13px/1.25 var(--sans);
  letter-spacing: .08em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  white-space: normal;
}

.who-practice,
.who-neither {
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
}

.who-patient {
  background: #fff0cf;
  color: #573500;
}

/* ------------------------------------------------------- the group codes */

.groups {
  margin: 0 0 26px;
  padding: 20px 22px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--codes-soft);
}

.groups p.k {
  margin: 0 0 14px;
  color: var(--codes-copy);
  font-size: 17px;
  font-weight: 600;
}

.groups dl {
  display: grid;
  grid-template-columns: minmax(64px, 76px) minmax(0, 1fr);
  gap: 0 16px;
  margin: 0;
}

.groups dt,
.groups dd {
  border-top: 1px solid var(--codes-rule);
}

.groups dt {
  padding: 15px 8px;
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
  font: 700 16px/1.5 var(--mono);
  text-align: center;
}

.groups dd {
  margin: 0;
  padding: 15px 0;
  color: var(--codes-copy);
  font-size: 17px;
  line-height: 1.6;
}

.groups dt:first-of-type,
.groups dl > dt:first-of-type + dd { border-top: 0; }

/* -------------------------------------------------------------- callouts */

.stop,
.doc .note {
  margin: 0 0 24px;
  padding: 17px 19px;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1.65;
}

.stop {
  border: 1px solid var(--codes-danger-line);
  border-top-width: 5px;
  background: var(--codes-danger-bg);
  color: var(--codes-danger);
}

.doc .note {
  border: 1px solid var(--codes-caution-line);
  border-top-width: 4px;
  background: var(--codes-caution-bg);
  color: var(--codes-caution);
}

.stop p,
.doc .stop p {
  margin: 0 0 11px;
  color: var(--codes-danger);
  font-size: 17px;
}

.doc .note p {
  margin: 0 0 11px;
  color: var(--codes-caution);
  font-size: 17px;
}

.stop p:last-child,
.doc .note p:last-child { margin-bottom: 0; }

.stop b,
.doc .note b { font-weight: 700; }

.stop code {
  border-color: #c98a81;
  background: #f7ddd7;
  color: #5d1b13;
}

/* ----------------------------------------------------------- the branches */

ol.branch {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

ol.branch > li {
  position: relative;
  margin: 0 0 0 15px;
  padding: 0 0 26px 42px;
  border-left: 1px solid var(--accent-line);
  counter-increment: step;
}

ol.branch > li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

ol.branch > li::before {
  content: counter(step);
  position: absolute;
  top: -2px;
  left: -15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font: 700 14px/30px var(--mono);
  text-align: center;
}

ol.branch h3 {
  margin: 2px 0 8px;
  color: var(--accent-deep);
  font-size: 21px;
}

ol.branch p {
  margin: 0 0 12px;
  color: var(--codes-copy);
  font-size: 17px;
}

ol.branch p:last-child { margin-bottom: 0; }

ol.branch .then {
  display: block;
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: #edf5f0;
  color: var(--codes-copy);
  font-size: 17px;
  line-height: 1.58;
}

ol.branch .then b {
  color: var(--accent-deep);
  font-weight: 700;
}

/* --------------------------------------------------------------- tables */

.doc .scroller {
  max-width: 100%;
  margin: 0 0 24px;
  overflow-x: auto;
}

.doc table.grid {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--codes-rule);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 7px;
  table-layout: fixed;
  overflow: hidden;
  font-size: 17px;
}

.doc table.grid th,
.doc table.grid td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--codes-rule);
  color: var(--codes-copy);
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  vertical-align: top;
  white-space: normal;
}

.doc table.grid thead th {
  border-bottom: 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
}

.doc table.grid th:first-child,
.doc table.grid td:first-child { width: 30%; }

.doc table.grid tbody tr:nth-child(even) td { background: var(--codes-soft); }

.doc table.grid td.num {
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.doc table.grid tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- related */

.related {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.related li {
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--codes-rule);
  font-size: 17px;
}

.related li:first-child { border-top: 1px solid var(--codes-rule); }
.related a { font-weight: 700; }

.related .why {
  display: block;
  margin-top: 4px;
  color: var(--codes-muted);
  font-size: 17px;
}

.related .plain {
  color: var(--codes-ink);
  font-weight: 700;
}

/* -------------------------------------------------------------- the hub */

.hub-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.hub-list li {
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--codes-rule);
}

.hub-list li:last-child { border-bottom: 1px solid var(--codes-rule); }

.hub-list .code {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--accent-deep);
  color: #ffffff;
  font: 700 18px/1.4 var(--mono);
  letter-spacing: 0;
  text-decoration: none;
}

.hub-list .code:hover { background: var(--accent); color: #ffffff; }

.hub-list .sum {
  display: block;
  margin-top: 8px;
  color: var(--codes-copy);
  font-size: 17px;
  line-height: 1.62;
}

.hub-list .sum b { color: var(--codes-ink); font-weight: 700; }

.soon {
  margin: 0;
  padding: 0;
  list-style: none;
}

.soon li {
  display: grid;
  grid-template-columns: minmax(78px, 92px) minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  padding: 15px 0;
  border-top: 1px solid var(--codes-rule);
  color: var(--codes-copy);
  font-size: 17px;
}

.soon li:last-child { border-bottom: 1px solid var(--codes-rule); }

.soon .code {
  align-self: start;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--codes-strong-soft);
  color: var(--accent-deep);
  font: 700 16px/1.5 var(--mono);
}

/* ---------------------------------------------------------- foot blocks */

.foot-blocks { margin: 58px 0 0; }

.tool-line {
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--codes-strong-soft);
}

.tool-line p {
  margin: 0 0 16px;
  color: var(--codes-copy);
  font-size: 17px;
}

.ask {
  padding: 22px 24px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--codes-surface);
}

.ask label {
  display: block;
  margin: 0 0 13px;
  color: var(--codes-ink);
  font-size: 17px;
  font-weight: 600;
}

.ask form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ask input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid #6f887a;
  border-radius: 4px;
  background: var(--codes-surface);
  color: var(--codes-ink);
  font: 400 17px/1.35 var(--sans);
}

.ask input::placeholder { color: var(--codes-muted); opacity: 1; }

.ask .fine {
  margin: 13px 0 0;
  color: var(--codes-muted);
  font-size: 16px;
  line-height: 1.55;
}

.doc .btn {
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
}

/* --------------------------------------------------------------- footer */

.site-foot {
  margin-top: 0;
  border-top: 3px solid var(--accent);
  color: var(--codes-muted);
  font-size: 16px;
}

/* ---------------------------------------------------------------- small */

@media (max-width: 700px) {
  .wrap { padding-left: 18px; padding-right: 18px; }

  .site-head .wrap { gap: 8px; }
  .site-head nav { gap: 8px; }
  .site-head nav a { font-size: 15px; }
  .site-head nav a.btn-primary { padding: 9px 10px; }

  .doc > .wrap {
    padding-right: 18px;
    padding-bottom: 56px;
    padding-left: 18px;
    box-shadow: none;
  }

  .doc h1 {
    margin-top: 15px;
    font-size: 34px;
  }

  .doc .lede {
    margin-bottom: 30px;
    font-size: 19px;
  }

  .doc h2 {
    margin-top: 44px;
    padding-top: 22px;
    font-size: 27px;
  }

  .doc h3 { font-size: 21px; }

  .verdict {
    margin-bottom: 36px;
    padding: 8px 18px 10px;
    border-radius: 8px;
  }

  .verdict dt { padding-top: 19px; }
  .verdict dd { font-size: 18px; }

  .groups { padding: 17px 16px 6px; }
  .groups dl { grid-template-columns: minmax(56px, 64px) minmax(0, 1fr); gap: 0 11px; }
  .groups dt { padding-right: 4px; padding-left: 4px; }

  ol.branch > li {
    margin-left: 14px;
    padding-left: 34px;
  }

  .doc table.grid th,
  .doc table.grid td { padding: 11px 10px; }

  .doc table.grid th:first-child,
  .doc table.grid td:first-child { width: 31%; }

  .soon li { grid-template-columns: minmax(0, 1fr); }

  .tool-line,
  .ask { padding: 19px 17px; }

  .site-foot .wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-foot .spacer { display: none; }
}

/* ---------------------------------------------------------------------------
   Generated pages (build.mjs). The hand written pages do not use these two.
   --------------------------------------------------------------------------- */

/* The code list's own wording, quoted under the lede. It is deliberately quiet:
   it is there so a reader can check us against the source, not to be read
   first. */
.doc .official {
  margin: -6px 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--codes-muted);
}

.doc .official code {
  font-size: 13px;
  color: var(--codes-copy);
}

/* Questions at the foot of a page. Collapsed by default, because the answer to
   the reader's actual question is higher up and these should not push it down. */
.doc details {
  margin: 0 0 10px;
  padding: 0 18px;
  border: 1px solid var(--codes-rule);
  border-radius: 7px;
  background: var(--codes-surface);
}

.doc details summary {
  padding: 14px 0;
  font-weight: 600;
  color: var(--codes-ink);
  cursor: pointer;
  list-style: none;
}

.doc details summary::-webkit-details-marker { display: none; }

.doc details summary::after {
  content: "+";
  float: right;
  margin-left: 12px;
  font-weight: 400;
  color: var(--codes-muted);
}

.doc details[open] summary::after { content: "\2212"; }

.doc details[open] summary { border-bottom: 1px solid var(--codes-rule); }

.doc details p {
  margin: 14px 0;
  color: var(--codes-copy);
}
