/* entmidas.com
   Palette: white page, backwater green ink and actions,
   kasavu gold used only as a border (top of page, footer, path rules). */
@font-face { font-family: "Manjari"; src: url("../fonts/manjari-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manjari"; src: url("../fonts/manjari-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --page: #ffffff;
  --surface: #f2f6f4;
  --ink: #18261f;
  --muted: #4d5f56;
  --green: #0f4c3a;
  --green-deep: #0a3a2c;
  --green-soft: #e3efe9;
  --gold: #c9a227;
  --gold-soft: #f6eccb;
  --alert: #9b3416;
  --alert-soft: #fbece5;
  --line: #d6e0da;
  --radius: 10px;
  --measure: 68ch;
  --heading: "Manjari", "Atkinson Hyperlegible", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  border-top: 6px solid var(--gold);
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--green); color: #fff; padding: 8px 14px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */
header.site { background: var(--page); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 12px; }
.brand { text-decoration: none; color: var(--ink); line-height: 1.2; }
.brand .name { display: block; font-family: var(--heading); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.brand .role { display: block; color: var(--muted); font-size: 15px; }
.actions { display: flex; gap: 10px; }

header.site { position: relative; }
nav.main { border-top: 1px solid var(--line); }
nav.main > .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; padding-top: 10px; padding-bottom: 10px; }
nav.main a { color: var(--muted); text-decoration: none; font-size: 16px; padding: 2px 0; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--green); }
nav.main > .wrap > a[aria-current="page"] { color: var(--green); border-bottom-color: var(--gold); font-weight: 700; }


/* All conditions menu */
details.conditions > summary {
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  padding: 4px 14px;
  border: 2px solid var(--green);
  border-radius: 999px;
}
details.conditions > summary::-webkit-details-marker { display: none; }
details.conditions > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
details.conditions[open] > summary { background: var(--green); color: #fff; }
details.conditions[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
details.conditions[data-current] > summary { border-bottom-width: 2px; box-shadow: 0 3px 0 -1px var(--gold); }
.cond-panel {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 15;
  background: var(--page);
  border-top: 1px solid var(--line);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 14px 30px rgba(15, 76, 58, 0.14);
  padding: 18px 0 22px;
  max-height: 75vh;
  overflow-y: auto;
}
.cond-search-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.cond-search { width: 100%; max-width: 520px; font: inherit; font-size: 17px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius); }
.cond-search:focus { border-color: var(--green); outline: none; }
.cond-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 28px; margin-top: 16px; }
.cond-group h3 { font-size: 17px; color: var(--muted); margin: 10px 0 4px; }
.cond-group ul { list-style: none; padding: 0; margin: 0; }
.cond-group li { margin: 0; border-top: 1px solid var(--line); }
.cond-group a { display: block; padding: 8px 0; text-decoration: none; color: var(--green); font-size: 17px; border: 0; }
.cond-group a:hover { text-decoration: underline; }
.cond-group a[aria-current="page"] { font-weight: 700; }
.cond-none { margin-top: 14px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--green);
}
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn.quiet { background: transparent; color: var(--green); }
.btn.quiet:hover { background: var(--green-soft); color: var(--green-deep); }

/* Text */
main { padding-bottom: 24px; }
main > * { max-width: var(--measure); }
h1, h2, h3 { font-family: var(--heading); color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.12; margin: 36px 0 14px; font-weight: 700; }
h2 { font-size: 28px; line-height: 1.2; margin: 44px 0 10px; font-weight: 700; color: var(--green); }
h3 { font-size: 21px; line-height: 1.3; margin: 28px 0 6px; font-weight: 700; }
p { margin: 0 0 14px; }
.lead { font-size: 21px; line-height: 1.55; color: var(--muted); }
.tagline { color: var(--muted); font-size: 16px; border-left: 3px solid var(--gold); padding-left: 12px; margin: 28px 0; }
.tagline strong { color: var(--ink); }
ul { padding-left: 22px; margin: 0 0 14px; }
li { margin: 5px 0; }
li::marker { color: var(--gold); }

/* Home intro */
.intro { display: grid; grid-template-columns: 1fr 220px; gap: 36px; align-items: end; max-width: none; padding-top: 8px; }
.intro h1 { margin-top: 28px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.intro-photo { width: 220px; border-radius: var(--radius); border-bottom: 6px solid var(--gold); display: block; }

/* Paths: what brings you here */
.paths { list-style: none; padding: 0; margin: 14px 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; max-width: none; }
.paths li { margin: 0; border-top: 1px solid var(--line); }
.paths a { display: block; padding: 14px 0 14px 16px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.paths a:hover { border-left-color: var(--gold); background: var(--surface); }
.paths strong { display: block; font-size: 19px; color: var(--green); }
.paths span { display: block; font-size: 16px; color: var(--muted); }

/* Jump links on long pages */
.choose { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.choose a { display: inline-block; padding: 9px 16px; border: 2px solid var(--green); border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 16px; color: var(--green); }
.choose a:hover { background: var(--green-soft); }

/* Images */
.hero { display: block; max-height: 260px; width: auto; margin: 28px 0 4px; border-radius: var(--radius); }
.portrait { float: right; width: 190px; margin: 32px 0 16px 28px; border-radius: var(--radius); border-bottom: 6px solid var(--gold); }


/* Questions patients ask (chat) */
.chat { max-width: var(--measure); }
.chat-note { color: var(--muted); font-size: 16px; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.msg { max-width: 88%; padding: 10px 16px 12px; border-radius: 16px; }
.msg p { margin: 0; }
.msg .who { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.msg.q { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.msg.q .who { color: var(--muted); }
.msg.a { align-self: flex-start; background: var(--green-soft); border-bottom-left-radius: 4px; }
.msg.a .who { color: var(--green); }

/* Ask your AI assistant */
.ai-help { max-width: var(--measure); }
.prompt-box { border: 2px dashed var(--gold); border-radius: var(--radius); padding: 16px 18px; background: #fffdf6; margin: 14px 0; }
.prompt-text { font-size: 17px; margin-bottom: 12px; }
.ai-note { font-size: 15px; color: var(--muted); }

/* Callouts */
.box, .urgent { padding: 14px 18px; border-radius: var(--radius); margin: 20px 0; }
.box { background: var(--green-soft); }
.urgent { background: var(--alert-soft); border-left: 5px solid var(--alert); }
.urgent strong { color: var(--alert); }

/* Tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 17px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 12px 11px 0; text-align: left; vertical-align: top; }
th { font-family: var(--heading); font-size: 18px; color: var(--green); border-bottom: 2px solid var(--green); }

/* Video */
.video-fig { margin: 26px 0; max-width: var(--measure); }
.video-fig figcaption { font-size: 15px; color: var(--muted); margin-top: 6px; }
.video { position: relative; padding-top: 56.25%; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

/* Footer */
footer.site { margin-top: 56px; background: var(--green-deep); color: #dfe9e4; border-top: 6px solid var(--gold); padding: 36px 0 28px; font-size: 16px; }
footer.site a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.foot-name { font-family: var(--heading); font-weight: 700; font-size: 20px; color: #fff; margin-bottom: 6px; }
.fine { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 14px; color: #b9cbc2; }

/* Phone action bar */
.dock { display: none; }

@media (max-width: 700px) {
  body { font-size: 17px; padding-bottom: 64px; }
  .actions { display: none; }
  .brand .name { font-size: 23px; }
  .intro { grid-template-columns: 1fr; gap: 0; }
  .intro-photo { width: 150px; order: -1; margin-top: 24px; }
  .intro h1 { margin-top: 18px; }
  .paths { grid-template-columns: 1fr; }
  .portrait { float: none; display: block; width: 160px; margin: 24px 0 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero { max-height: 200px; }
  .cond-panel { max-height: calc(100vh - 260px); padding-bottom: 16px; }

  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child { display: none; }
  table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 8px 14px; }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td::before { content: attr(data-label) ": "; font-weight: 700; color: var(--muted); }

  .dock {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: var(--page);
    border-top: 3px solid var(--gold);
    box-shadow: 0 -4px 14px rgba(15, 76, 58, 0.12);
  }
  .dock a { text-align: center; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); font-weight: 700; font-size: 17px; text-decoration: none; color: #fff; background: var(--green); }
  .dock a + a { background: var(--page); color: var(--green); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* MERA score */
.score-form h2 { margin-top: 2rem; }
.q { border: 1px solid #d9e3de; border-radius: 10px; padding: .9rem 1rem 1rem; margin: 0 0 1rem; background: #fff; }
.q legend { font-weight: 700; padding: 0 .3rem; color: #0f4c3a; }
.q-hint { margin: .2rem 0 .6rem; font-size: .95rem; color: #555; }
.opts { display: grid; gap: .45rem; }
.opt { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid #e3e8e5; border-radius: 8px; cursor: pointer; }
.opt input { margin-top: .25rem; accent-color: #0f4c3a; width: 1.1rem; height: 1.1rem; flex: none; }
.opt:has(input:checked) { border-color: #0f4c3a; background: #eef6f2; }
.bmi-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .4rem; }
.bmi-row label { display: flex; flex-direction: column; font-size: .95rem; gap: .25rem; }
.bmi-row input { width: 8rem; padding: .5rem; font-size: 1rem; border: 1px solid #c9d4cf; border-radius: 6px; }
.bmi-out { font-weight: 600; color: #0f4c3a; min-height: 1.2em; margin: .2rem 0 .6rem; }
.score-missing { color: #a3261b; font-weight: 600; }
.score-result { border: 2px solid #c9a227; border-radius: 12px; padding: 1rem 1.2rem; margin: 2rem 0; background: #fffdf5; }
.score-big { font-size: 3rem; font-weight: 800; color: #0f4c3a; margin: .2rem 0; line-height: 1.1; }
.score-band { font-weight: 700; padding: .7rem .9rem; border-radius: 8px; }
.score-band.low { background: #e8f5ee; color: #0f4c3a; }
.score-band.mid { background: #fff4d6; color: #7a5a00; }
.score-band.high { background: #fde8e6; color: #a3261b; }

/* MERA unbranded tool pages */
body.mera { padding-bottom: 0; }
.mera-head { background: #0f4c3a; color: #fff; border-bottom: 4px solid #c9a227; }
.mera-head .wrap { padding-top: .8rem; padding-bottom: .8rem; display: flex; align-items: baseline; gap: .6rem; }
.mera-head a { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .08em; text-decoration: none; }
.mera-head span { color: #e8dcae; font-size: .95rem; }
.mera-foot { margin-top: 3rem; padding: 1.2rem 0 1.6rem; border-top: 1px solid #d9e3de; color: #555; font-size: .9rem; }
