/* ============================================================================
   ZKELETON // HL7 -> FHIR — SEO content + reference pages
   Long-form, readable, same IDE token system as the converter. Built to be the
   canonical, runnable HL7<->FHIR mapping reference. Self-hosted fonts; zero
   external requests (same privacy guarantee as the tool).
============================================================================ */

.doc {
  max-width: 1000px;          /* wide enough that the side-by-side code example breathes */
  margin: 0 auto;
  padding: 0 var(--pad) 100px;
}
/* prose stays at a readable measure even though the page (and code/tables) runs wider */
.lead, section > p { max-width: 760px; }

/* ------------------------------------------------------------------- top bar */
.doc-top {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; margin: 0 calc(-1 * var(--pad)) 0;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 10, 10, 0.86); backdrop-filter: blur(8px);
}
.doc-top .brand {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text);
}
.doc-top .brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 9px; }
.doc-top .brand .sep { color: var(--faint); margin: 0 6px; }
.doc-top .brand .sub { color: var(--muted); font-weight: 500; }
.doc-top .top-cta {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent-border); border-radius: 5px;
  padding: 6px 12px; transition: background .15s var(--ease), color .15s var(--ease);
}
.doc-top .top-cta:hover { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- breadcrumb */
.crumbs {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  margin: 26px 0 18px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .c-sep { color: var(--faint); }
.crumbs .c-here { color: var(--muted-2); }

/* --------------------------------------------------------------------- type */
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--muted-2); line-height: 1.55; margin: 0 0 26px; }

section { margin: 0 0 38px; }
h2 {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--accent); margin: 0 0 14px; padding-top: 6px;
}
h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); margin: 26px 0 10px; }
p { margin: 0 0 14px; color: #d4d4d4; line-height: 1.68; }
.doc strong { color: var(--text); font-weight: 620; }
.doc a.inline { color: var(--accent); }
.doc a.inline:hover { text-decoration: underline; text-underline-offset: 3px; }

ul.bullets { margin: 0 0 16px; padding: 0; list-style: none; }
ul.bullets li { position: relative; padding: 0 0 9px 22px; color: #d4d4d4; line-height: 1.62; }
ul.bullets li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border: 1px solid var(--accent); border-radius: 1px; }

/* ------------------------------------------------------- above-the-fold answer */
.answer {
  border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  background: var(--bg-surface); border-radius: 0 8px 8px 0;
  padding: 18px 20px; margin: 0 0 30px;
}
.answer .a-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.answer p { margin: 0; max-width: none; font-size: 16px; color: var(--text); line-height: 1.62; }
.answer .mono { color: #c2ccd6; }   /* inline code = neutral slate, NOT the alarm accent */

/* ---------------------------------------------------------------- map table */
.table-wrap { overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; margin: 0 0 16px; }
table.map { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.map th, table.map td { text-align: left; padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); vertical-align: top; }
table.map thead th { background: var(--bg-surface-2); color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
table.map tbody tr:last-child td { border-bottom: none; }
table.map tbody tr:hover { background: var(--bg-surface); }
table.map .fld { font-family: var(--font-mono); color: var(--text); white-space: nowrap; }
table.map .arrow { color: var(--faint); }
table.map .path { font-family: var(--font-mono); color: #c2ccd6; }   /* FHIR path = neutral slate code, reserve red for actions */
table.map .note { color: var(--muted); font-size: 13px; }
table.map .note .mono, table.map td .mono { color: #aeb8c2; }

/* --------------------------------------------------- "what doesn't map" panel */
.review {
  border: 1px solid var(--accent-border); background: var(--accent-surface);
  border-radius: 8px; padding: 16px 18px; margin: 0 0 16px;
}
.review h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.review h3 .pin { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
/* clear/success state: red == error in dev UIs, so a clean conversion gets a calm neutral treatment */
.review.clear { border-color: var(--border-strong); background: var(--bg-surface); }
.review.clear h3 .pin { background: #5fb37e; }
.review.clear li::before { color: var(--muted); }
.review .r-sub { font-size: 13px; color: var(--muted-2); margin: 0 0 12px; }
.review ul { margin: 0; padding: 0; list-style: none; }
.review li { font-family: var(--font-mono); font-size: 13px; color: #e2cfd0; padding: 7px 0 7px 24px; position: relative; border-top: 1px solid rgba(138,34,42,0.35); line-height: 1.5; }
.review li:first-child { border-top: none; }
.review li::before { content: '!'; position: absolute; left: 2px; top: 7px; color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------- live example */
.live {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 0 0 16px;
}
.live .live-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-surface-2); border-bottom: 1px solid var(--border);
}
.live .live-head .lh-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.live .try {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.live .try:hover { text-decoration: underline; text-underline-offset: 3px; }
.live .try .play { font-size: 10px; }
.io { display: grid; grid-template-columns: 1fr 1fr; }
.io .col { min-width: 0; }
.io .col + .col { border-left: 1px solid var(--border); }
.io .col-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); padding: 10px 16px 2px; }
.io pre { margin: 0; padding: 6px 16px 16px; overflow-x: auto; white-space: pre; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: #c9c9c9; }
.io pre .k { color: #e8e8e8; font-weight: 600; }   /* JSON keys = brighter mono, monochrome contrast (no red) */
@media (max-width: 680px) { .io { grid-template-columns: 1fr; } .io .col + .col { border-left: none; border-top: 1px solid var(--border); } }

/* --------------------------------------------------------------- related nav */
.related { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.related a {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 13px;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.related a:hover { border-color: var(--border-strong); color: var(--text); }
.related a .ar { color: var(--accent); margin-left: 6px; }

/* ------------------------------------------------------- index / hub listing */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0 0 8px; }
.hub-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 15px 16px;
  transition: border-color .15s var(--ease), background .15s var(--ease); display: block;
}
.hub-card:hover { border-color: var(--border-strong); background: var(--bg-surface); }
.hub-card .hc-seg { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); }
.hub-card .hc-seg .to { color: var(--accent); }
.hub-card .hc-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* -------------------------------------------------------- company foot block */
.company {
  margin-top: 56px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-surface); padding: 24px 24px;
}
.company .c-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.company .c-id { font-size: 16px; color: var(--text); line-height: 1.55; margin: 0 0 16px; }
.company .c-id b { font-weight: 650; }
.company .c-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.company a.btn-primary {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: #fff;
  background: var(--accent); border-radius: 6px; padding: 10px 16px;
}
.company a.btn-primary:hover { filter: brightness(1.08); }
.company a.btn-ghost {
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px; padding: 10px 16px;
}
.company a.btn-ghost:hover { border-color: var(--muted); background: rgba(255, 255, 255, 0.09); }

/* ----------------------------------------------------------------- page foot */
.doc-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 12px;
}
.doc-foot a { color: var(--muted); }
.doc-foot a:hover { color: var(--text); }
.doc-foot .f-sep { color: var(--faint); }
.doc-foot .f-spacer { flex: 1; }

@media (max-width: 640px) {
  h1 { font-size: 27px; }
  .lead { font-size: 17px; }
}
