/* ClinicEngine Help Centre: shared styles for /docs pages. */
:root {
  --green: #0f3b2b;
  --green-2: #164d39;
  --lime: #d7ff7b;
  --mark: #ff5a1f;
  --ink: #111827;
  --muted: #4b5563;
  --faint: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f5;
  --card: #ffffff;
  --tip: #ecfdf3;
  --tip-line: #a7f3c4;
  --warn: #fff7ed;
  --warn-line: #fed7aa;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #0d6b47; text-underline-offset: 3px; }
a:hover { color: var(--green); }
img { max-width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--green); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar .in { max-width: 1240px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.topbar .brand img { height: 22px; width: auto; }
.topbar .brand span { font-size: 13px; font-weight: 600; color: var(--lime); border-left: 1px solid rgba(255,255,255,.25); padding-left: 12px; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 999px; }
.topbar nav a:hover, .topbar nav a[aria-current=page] { background: rgba(255,255,255,.12); color: #fff; }
.topbar nav a.cta { background: var(--lime); color: var(--green); font-weight: 600; }
.topbar nav a.cta:hover { background: #e6ffa8; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--green) 0%, var(--green-2) 100%); color: #fff; }
.hero .in { max-width: 1240px; margin: 0 auto; padding: 56px 20px 64px; }
.hero .eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--green); background: var(--lime); padding: 4px 10px; border-radius: 999px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.15; margin: 16px 0 12px; letter-spacing: -.02em; }
.hero p { font-size: 18px; color: rgba(255,255,255,.82); max-width: 720px; margin: 0; }
.hero .meta { margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.6); }

/* ---------- Layout ---------- */
.layout { max-width: 1240px; margin: 0 auto; padding: 32px 20px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-right: 6px; }
.toc h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.toc ol { list-style: none; margin: 0 0 20px; padding: 0; }
.toc li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; border-left: 2px solid transparent; }
.toc li a:hover { background: #fff; color: var(--ink); }
.toc li a.active { background: #fff; color: var(--green); font-weight: 600; border-left-color: var(--green); }
.toc .sub a { padding-left: 22px; font-size: 13px; }

main.doc { min-width: 0; }
.doc section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; margin-bottom: 24px; }
.doc h2 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.doc h2 .num { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: var(--lime); font-size: 15px; display: grid; place-items: center; }
.doc h3 { font-size: 19px; margin: 30px 0 6px; }
.doc .lead { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.doc p { margin: 10px 0; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.path { font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f5f2; color: var(--green); padding: 4px 8px; border-radius: 6px; border: 1px solid #dfe7e2; white-space: nowrap; }
.ui { font-weight: 600; background: #f3f4f6; border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; font-size: .92em; white-space: nowrap; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 5px; }
pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 10px; overflow: auto; font-size: 13px; }

/* ---------- Screenshots ---------- */
figure.shot { margin: 20px 0 8px; }
figure.shot .frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 18px 40px -24px rgba(15, 59, 43, .45); cursor: zoom-in; position: relative; }
figure.shot .frame::after { content: "Click to enlarge"; position: absolute; right: 10px; bottom: 10px; font-size: 12px; background: rgba(17,24,39,.75); color: #fff; padding: 3px 9px; border-radius: 999px; opacity: 0; transition: opacity .15s; }
figure.shot .frame:hover::after { opacity: 1; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot.narrow { max-width: 560px; }
figure.shot.medium { max-width: 780px; }
figure.shot figcaption { font-size: 13px; color: var(--faint); margin-top: 8px; }

/* Numbered callouts that match the orange badges on screenshots. */
ol.callouts { list-style: none; padding: 0; margin: 14px 0 6px; counter-reset: c; display: grid; gap: 8px; }
ol.callouts > li { counter-increment: c; position: relative; padding: 10px 14px 10px 50px; background: #fafafa; border: 1px solid var(--line); border-radius: 10px; margin: 0; }
ol.callouts > li::before { content: counter(c); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--mark); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }

ol.callouts > li ul, td ul, .note ul { margin: 6px 0 2px; padding-left: 20px; }
ol.callouts > li ul li, td ul li, .note ul li { margin: 2px 0; }

/* "Words you'll see" glossary. */
dl.words { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
dl.words dt, dl.words dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
dl.words dt { font-weight: 600; color: var(--green); background: #f8faf9; }
dl.words dt:nth-last-of-type(1), dl.words dd:last-of-type { border-bottom: 0; }
@media (max-width: 600px) {
  dl.words { grid-template-columns: 1fr; }
  dl.words dt { border-bottom: 0; padding-bottom: 2px; }
}

/* Step-by-step lists. */
ol.steps { list-style: none; padding: 0; counter-reset: s; margin: 16px 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 22px 56px; margin: 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--lime); font-weight: 700; display: grid; place-items: center; }
ol.steps > li::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--line); }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > strong:first-child { display: block; font-size: 17px; margin-bottom: 2px; }

/* Notes. */
.note { border: 1px solid var(--tip-line); background: var(--tip); border-radius: 10px; padding: 12px 16px 12px 44px; position: relative; margin: 16px 0; }
.note::before { content: "💡"; position: absolute; left: 14px; top: 11px; }
.note.warn { border-color: var(--warn-line); background: var(--warn); }
.note.warn::before { content: "⚠️"; }
.note.lock::before { content: "🔒"; }
.note p { margin: 4px 0; }

/* Tables. */
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8faf9; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td .yes { color: #15803d; font-weight: 700; }
td .no { color: #9ca3af; }

/* Cards on the landing page. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -24px rgba(15,59,43,.5); border-color: #b7d4c6; color: var(--ink); }
.card .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--green); color: var(--lime); display: grid; place-items: center; font-size: 24px; margin-bottom: 14px; }
.card h3 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0 0 14px; color: var(--muted); }
.card .go { font-weight: 600; color: #0d6b47; }
.card ul { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 15px; }

.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; background: #fff; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details[open] summary { margin-bottom: 6px; }

footer.foot { text-align: center; color: var(--faint); font-size: 13px; padding: 30px 20px 50px; }

/* Lightbox. */
.lightbox { position: fixed; inset: 0; background: rgba(10, 20, 16, .88); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); background: #fff; }

.back-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: var(--lime); display: grid; place-items: center; text-decoration: none; font-size: 20px; box-shadow: 0 8px 20px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s; }
.back-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding: 20px 16px 60px; }
  .toc { position: static; max-height: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
  .doc section { padding: 22px 18px; }
  .doc h2 { font-size: 22px; }
  .hero .in { padding: 36px 16px 40px; }
  .topbar .in { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar nav { margin-left: 0; width: 100%; }
  .topbar .brand span { display: none; }
}
@media print {
  .topbar, .toc, .back-top { display: none; }
  .layout { display: block; }
  .doc section { break-inside: avoid-page; border: 0; }
}
