/* Layout declarations in each public view are ported from the handoff. Reset the
   legacy theme only inside these views. Branding comes from the editor's tokens. */
body.insight-public .ref-view,
body.insight-public .ref-view :where(*) {
  all:revert;
  box-sizing:border-box;
}
body.insight-public .ref-view {
  display:block;
  --ref-vw:1vw;
  color:var(--ink);
  background:var(--paper);
  font:400 16px/normal var(--font-body);
  -webkit-font-smoothing:antialiased;
  word-break:keep-all;
}
body.insight-public .ref-view :is(h1,h2,h3,p,ul,ol,figure) { margin:0; }
body.insight-public .ref-view :is(h1,h2,h3) { font-family:var(--font-heading);color:var(--heading); }
body.insight-public .ref-view a { color:var(--brown);text-decoration:none; }
body.insight-public .ref-view :is(a,button,input,summary,label):focus-visible { outline:2px solid var(--brown);outline-offset:3px; }
body.insight-public .ref-view :is(button,input) { font-family:var(--font-body); }
body.insight-public .ref-view [hidden] { display:none!important; }
body.insight-public .ref-view [id] { scroll-margin-top:8px; }
body.insight-public .ref-view :is(.ref-extra,.ref-list-search,.ref-credentials details) summary {
  cursor:pointer;color:var(--brown);font:600 14px/1.65 var(--font-body);padding-block:7px;
}
body.insight-public .ref-view .ref-credentials { border-radius:10px;background:var(--bg);padding:18px 24px; }
body.insight-public .ref-view :is(.ref-credentials,.ref-extra) ul { list-style:none;padding:0;font:400 15px/1.8 var(--font-body); }
body.insight-public .ref-view .ref-extra>p { font-size:15px;line-height:1.8; }
body.insight-public .ref-view .ref-map-link { font-size:14px;font-weight:600;text-decoration:underline; }
body.insight-public .ref-view .ref-gallery { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:12px; }
body.insight-public .ref-gallery :is(figure,img) { width:100%; }
body.insight-public .ref-gallery figcaption { font-size:13px; }
body.insight-public .ref-view .reference-faq summary { list-style:none; }
body.insight-public .ref-view .reference-faq summary::-webkit-details-marker { display:none; }
.ref-view .faq-sign::before { content:"+"; }
.ref-view details[open] .faq-sign::before { content:"−"; }
body.insight-public .ref-view .ref-toc { padding:20px 24px;display:grid;gap:4px;border-radius:10px;background:var(--bg);counter-reset:heading; }
body.insight-public .ref-toc strong { font-size:13px;color:var(--heading);padding-bottom:6px; }
body.insight-public .ref-view .ref-toc a { color:var(--ink);font-size:15px;line-height:1.9;counter-increment:heading; }
.ref-view .ref-toc a::before { content:counter(heading) ". "; }
body.insight-public .ref-view .ref-prose { display:grid;gap:40px;font-size:18px;line-height:1.9;overflow-wrap:anywhere; }
body.insight-public .ref-view .ref-prose :is(h2,h3) { font-size:clamp(21px,2vw,26px);line-height:1.45;letter-spacing:-.03em; }
body.insight-public .ref-prose section { display:flex;flex-direction:column;gap:14px; }
body.insight-public .ref-prose p { text-wrap:pretty; }
body.insight-public .ref-prose :is(img,video,iframe,table) { max-width:100%; }
body.insight-public .ref-view .ref-prose table { width:100%;border-collapse:collapse; }
body.insight-public .ref-prose :is(th,td) { border:1px solid var(--line);padding:8px 12px; }
body.insight-public .ref-view .ref-prose a { text-decoration:underline; }
/* Maker long-form columns: retain the clinic reading system while giving
   evidence tables, process images and FAQs a clear editorial hierarchy. */
body.insight-public .ref-view .ref-prose .article-lead {
  padding:clamp(20px,3vw,30px);border-inline-start:4px solid var(--brown);
  border-radius:0 12px 12px 0;background:var(--bg);color:var(--heading);
  font-size:clamp(18px,1.8vw,22px);font-weight:600;line-height:1.75;
}
body.insight-public .ref-view .ref-prose .quick-guide {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;
}
body.insight-public .ref-view .ref-prose .quick-guide>div {
  display:grid;align-content:start;gap:8px;padding:20px;border:1px solid var(--line);
  border-radius:12px;background:var(--paper);
}
body.insight-public .ref-view .ref-prose .quick-guide strong {
  color:var(--brown);font-size:14px;letter-spacing:.02em;
}
body.insight-public .ref-view .ref-prose .quick-guide span { font-size:16px;line-height:1.7; }
body.insight-public .ref-view .ref-prose .table-wrap {
  max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:12px;
  background:var(--paper);box-shadow:0 12px 32px rgb(49 42 36 / 5%);
  -webkit-overflow-scrolling:touch;
}
body.insight-public .ref-view .ref-prose .table-wrap:focus-visible {
  outline:2px solid var(--brown);outline-offset:3px;
}
body.insight-public .ref-view .ref-prose .table-wrap table { margin:0;border:0; }
body.insight-public .ref-view .ref-prose caption {
  caption-side:top;padding:16px 18px;text-align:left;color:var(--heading);
  background:var(--bg);font-size:15px;font-weight:700;line-height:1.5;
}
body.insight-public .ref-view .ref-prose th {
  background:color-mix(in srgb,var(--bg) 78%,var(--paper));color:var(--heading);
  font-size:14px;font-weight:700;line-height:1.55;text-align:left;vertical-align:top;
}
body.insight-public .ref-view .ref-prose td { font-size:15px;line-height:1.65;vertical-align:top; }
body.insight-public .ref-view .ref-prose .article-image {
  display:grid;gap:10px;margin:0;padding:clamp(12px,2vw,18px);border-radius:14px;
  background:var(--bg);
}
body.insight-public .ref-view .ref-prose .article-image img {
  display:block;width:100%;height:auto;max-height:520px;object-fit:contain;
  border-radius:10px;background:var(--paper);
}
body.insight-public .ref-view .ref-prose .article-image figcaption {
  color:var(--muted);font-size:13px;line-height:1.65;
}
body.insight-public .ref-view .ref-prose .condition-list {
  display:grid;gap:0;margin:0;border-block:1px solid var(--line);
}
body.insight-public .ref-view .ref-prose .condition-list>div {
  display:grid;grid-template-columns:minmax(130px,.35fr) minmax(0,1fr);gap:18px;
  padding:16px 4px;border-bottom:1px solid var(--line);
}
body.insight-public .ref-view .ref-prose .condition-list>div:last-child { border-bottom:0; }
body.insight-public .ref-view .ref-prose .condition-list :is(dt,dd) { margin:0; }
body.insight-public .ref-view .ref-prose .condition-list dt { color:var(--heading);font-weight:700; }
body.insight-public .ref-view .ref-prose .pv-block-notice {
  display:grid;gap:18px;padding:clamp(20px,3vw,30px);border-radius:14px;
  background:color-mix(in srgb,#a84a3f 7%,var(--paper));
}
body.insight-public .ref-view .ref-prose .pv-block-notice>p:first-child {
  color:#843b33;font-size:18px;line-height:1.6;
}
body.insight-public .ref-view .ref-prose .faq-item {
  margin:0;border-bottom:1px solid var(--line);padding:0;
}
body.insight-public .ref-view .ref-prose .faq-item summary {
  min-height:52px;padding:12px 34px 12px 0;align-content:center;cursor:pointer;
  color:var(--heading);font-weight:700;line-height:1.6;list-style:none;position:relative;
}
body.insight-public .ref-view .ref-prose .faq-item summary::-webkit-details-marker { display:none; }
body.insight-public .ref-view .ref-prose .faq-item summary::after {
  content:"+";position:absolute;inset-inline-end:4px;top:50%;translate:0 -50%;
  color:var(--brown);font-size:22px;font-weight:400;
}
body.insight-public .ref-view .ref-prose .faq-item[open] summary::after { content:"−"; }
body.insight-public .ref-view .ref-prose .faq-item>p { padding:0 34px 18px 0;color:var(--muted); }
body.insight-public .ref-view .ref-pages { display:flex;justify-content:center;gap:6px; }
body.insight-public .ref-view .ref-pages a { min-width:40px;min-height:40px;display:grid;place-items:center;border-radius:50%; }
body.insight-public .ref-view .ref-pages [aria-current] { background:var(--heading);color:var(--on-accent); }
body.insight-public .ref-view .ref-list-search { justify-self:end;align-self:flex-end;font-size:14px; }
body.insight-public .ref-view .ref-list-search form { display:flex;align-items:center;gap:8px; }
body.insight-public .ref-view .ref-list-search input { min-width:0;border:1px solid var(--line);padding:8px;border-radius:6px; }
body.insight-public .ref-view .ref-list-search button { border:0;border-radius:16px;background:var(--brown);color:var(--on-accent);padding:6px 12px; }
@media(max-width:760px){
  body.insight-public .ref-view :is(input,button) { max-width:100%; }
  body.insight-public .ref-view .symptom-detail { position:static!important; }
  body.insight-public .ref-view .ref-search-form input { width:100%; }
  body.insight-public .ref-view :is(.ref-list-search,.ref-pages) :is(a,summary,button){min-height:44px;}
  body.insight-public .ref-view .ref-prose .quick-guide { grid-template-columns:1fr; }
  body.insight-public .ref-view .ref-prose .table-wrap { overflow:visible;border:0;box-shadow:none;background:transparent; }
  body.insight-public .ref-view .ref-prose .table-wrap :is(table,thead,tbody,tr,th,td) { display:block;width:100%; }
  body.insight-public .ref-view .ref-prose .table-wrap thead { position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden; }
  body.insight-public .ref-view .ref-prose .table-wrap caption { display:block;border:1px solid var(--line);border-radius:10px 10px 0 0; }
  body.insight-public .ref-view .ref-prose .table-wrap tbody { display:grid;gap:12px; }
  body.insight-public .ref-view .ref-prose .table-wrap tr { overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--paper); }
  body.insight-public .ref-view .ref-prose .table-wrap td { display:grid;grid-template-columns:minmax(92px,.34fr) minmax(0,1fr);gap:12px;border:0;border-top:1px solid var(--line);padding:12px 14px; }
  body.insight-public .ref-view .ref-prose .table-wrap td:first-child { border-top:0; }
  body.insight-public .ref-view .ref-prose .table-wrap td::before { content:attr(data-label);color:var(--brown);font-size:13px;font-weight:700;line-height:1.55; }
  body.insight-public .ref-view .ref-prose .condition-list>div { grid-template-columns:1fr;gap:4px; }
}
@media(prefers-reduced-motion:reduce){
  body.insight-public .ref-view,
  body.insight-public .ref-view :where(*) {
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
body.insight-public .ref-doctors .dr {
  display:grid;grid-template-columns:300px minmax(0,1fr) minmax(0,1fr);
  gap:clamp(24px,calc(3 * var(--ref-vw)),40px);padding:24px;border-radius:14px;background:var(--beige);
}
body.insight-public .ref-doctors .dr-img {width:100%;height:100%;min-height:360px;object-fit:cover;object-position:top;border-radius:10px;display:block}
body.insight-public .ref-doctors .dr-side {display:flex;flex-direction:column;gap:22px;padding:24px;border-radius:10px;background:var(--paper)}
body.insight-public .ref-home-doctors a:has(>img):hover {background:color-mix(in srgb,var(--beige) 80%,var(--main))!important}
body.insight-public .ref-home-doctors a:has(>div:only-child) {grid-template-columns:1fr!important}
@media(max-width:1100px) {
  body.insight-public .ref-doctors .dr {grid-template-columns:260px minmax(0,1fr)}
  body.insight-public .ref-doctors .dr-side {grid-column:1/-1}
}
@media(max-width:640px) {
  body.insight-public .ref-doctors .dr {grid-template-columns:1fr;padding:16px}
  body.insight-public .ref-doctors .dr-img {height:auto;min-height:0;aspect-ratio:4/3}
}
body.insight-public.search-page {width:100%;max-width:none;margin:0;padding:0;display:block}
@media (hover:hover) {
  .ref-view [data-hover="ink"]:hover {color:var(--brown)!important}
  .ref-view [data-hover="beige"]:hover {background:var(--beige)!important}
  .ref-view [data-hover="tint"]:hover {background:color-mix(in srgb,var(--beige) 80%,var(--main))!important}
  .ref-view [data-hover="border"]:hover {border-color:var(--brown)!important}
  .ref-view [data-hover="outline"]:hover {box-shadow:0 0 0 1px var(--brown)}
}

/* Editorial archives and the term dictionary share the clinic's reading typography. */
body.insight-public .ref-view:is(.ref-library,.term-page) {
  --archive-edge:clamp(20px,4vw,48px);
  --archive-gap:clamp(16px,2vw,24px);
  & .archive-frame {max-width:1440px;margin:auto;padding:clamp(32px,5vw,68px) var(--archive-edge) clamp(52px,7vw,96px)}
  & .archive-breadcrumb {font-size:14px;line-height:1.6;color:var(--muted);margin-bottom:20px}
  & .archive-breadcrumb a {color:inherit}
  & .archive-heading {display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:20px 32px}
  & h1 {font-size:clamp(30px,3.6vw,48px);letter-spacing:-.04em;line-height:1.3;text-wrap:balance}
  & .lead {max-width:700px;color:var(--muted);font-size:clamp(16px,1.4vw,19px);line-height:1.75;margin:12px 0 0}
  & .archive-tabs {display:flex;gap:4px;background:var(--bg);border-radius:28px;padding:4px}
  & .archive-tabs a,& .archive-filters a,& .archive-more,& .archive-back {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;font-size:15px;font-weight:600;border-radius:24px}
  & .archive-tabs a[aria-current] {background:var(--paper);color:var(--heading)}
  & .archive-tools {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:28px}
  & .archive-search {display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:26px;padding:3px;width:min(100%,390px);background:var(--paper)}
  & .archive-search:focus-within {outline:2px solid var(--brown);outline-offset:2px}
  & .archive-search input {min-width:0;flex:1;padding:0 12px;height:44px;border:0;border-radius:24px;background:transparent;outline-offset:-3px;font:inherit;color:var(--heading)}
  & .archive-search button {min-height:44px;padding:0 20px;border:0;border-radius:24px;background:var(--heading);color:var(--on-accent);cursor:pointer;font:600 15px var(--font-body)}
  & .archive-reset {font-size:14px;text-decoration:underline}
  & .archive-filters {display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:18px 0 20px;margin-bottom:clamp(24px,3vw,40px)}
  & .archive-filters nav {display:flex;flex-wrap:wrap;gap:8px}
  & .archive-filters a {border:1px solid var(--line);color:var(--heading);font-size:14px}
  & .archive-filters a[aria-current] {background:var(--heading);color:var(--on-accent);border-color:var(--heading)}
  & .archive-filters>span,& .dictionary-source,& figcaption {color:var(--muted);font-size:14px;line-height:1.7}
  & .archive-feature {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(24px,3vw,44px);align-items:center;color:var(--heading);margin-bottom:40px}
  & .archive-feature:not(:has(img)) {grid-template-columns:1fr}
  & .archive-feature>img,& .archive-image {width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:12px}
  & .archive-feature>img {height:auto}
  & .archive-feature>div,& .archive-copy {display:grid;align-content:start;gap:12px;min-width:0}
  & .archive-category,& .archive-byline {font-size:14px;font-weight:600;color:var(--brown)}
  & .archive-feature h2 {font-size:clamp(24px,2.4vw,34px);letter-spacing:-.035em;line-height:1.4}
  & .archive-feature p,& .archive-copy p {color:var(--muted);font-size:16px;line-height:1.7}
  & .archive-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:36px var(--archive-gap)}
  & .archive-card {display:flex;flex-direction:column;gap:14px;height:100%;color:var(--heading)}
  & .archive-copy :is(h2,h3) {font-size:19px;letter-spacing:-.025em;line-height:1.5;text-wrap:pretty}
  & .archive-copy p {font-size:15px}
  & .archive-image {overflow:hidden;background:var(--beige);border-radius:10px}
  & .archive-image img {display:block;width:100%;height:100%;object-fit:cover}
  & .archive-tail {display:flex;justify-content:center;margin-top:32px}
  & .archive-more,& .archive-back {background:var(--bg);color:var(--heading)}
  & .archive-empty {padding:24px 0}
  & .archive-status {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
  & .dictionary-source a,& .term-article nav a {text-decoration:underline;text-underline-offset:3px}
  & :is(a,button,input,summary):focus-visible {outline:2px solid var(--brown);outline-offset:3px}
  & .archive-feature:hover h2,& .archive-card:hover :is(h2,h3) {text-decoration:underline;text-underline-offset:4px}
  @media(max-width:1023px) {& .archive-grid {grid-template-columns:repeat(2,minmax(0,1fr))}}
  @media(max-width:650px) {& .archive-feature,& .archive-grid {grid-template-columns:minmax(0,1fr)} & .archive-tools {margin-top:20px}}
}
body.insight-public .ref-view.term-page {
  & .term-article {max-width:850px;margin:auto;padding:clamp(36px,5vw,72px) var(--archive-edge)}
  & .term-article header {display:grid;gap:12px}
  & .term-article .lead {margin:0}
  & .term-credits {display:flex;flex-wrap:wrap;gap:4px 18px;list-style:none;padding:0;color:var(--muted);font-size:13px;line-height:1.6}
  & figure {margin:28px 0}
  & figure img {display:block;width:100%;height:auto;max-height:420px;object-fit:contain;background:var(--bg);border-radius:12px}
  & figcaption {margin-top:6px}
  & .dictionary-prose {font-size:17px;line-height:1.8;overflow-wrap:anywhere}
  & .dictionary-prose h2 {margin:32px 0 12px;color:var(--heading);font-size:clamp(21px,2.1vw,29px);line-height:1.45;letter-spacing:-.03em}
  & .dictionary-prose h3 {font-size:19px;margin:18px 0 8px}
  & .dictionary-prose :is(p,ul,ol) {margin:10px 0}
  & .dictionary-prose .answer-box {padding:20px;background:var(--bg);border-radius:10px}
  & .dictionary-prose details {padding:8px 0;border-bottom:1px solid var(--line)}
  & .dictionary-prose summary {align-content:center;min-height:44px;cursor:pointer;font-weight:600}
  & .dictionary-prose a {text-decoration:underline;text-underline-offset:3px}
  & .dictionary-prose nav {display:grid;gap:8px}
  & .dictionary-prose nav a {display:inline-block;min-height:44px;align-content:center}
  & .dictionary-prose .table-scroll {overflow:auto;max-width:100%}
  & .dictionary-prose table {width:100%;border-collapse:collapse}
  & .dictionary-prose th,& .dictionary-prose td {border:1px solid var(--line);padding:8px;text-align:left}
  & .archive-back {margin-top:36px}
}

body.insight-public .ref-view.term-page {
  & .term-toc {padding:12px 18px;background:var(--bg);border-radius:12px;margin-bottom:28px}
  & .term-toc summary {cursor:pointer;min-height:44px;align-content:center;font-weight:600}
  & .term-toc ol {padding-left:24px;margin:6px 0}
  & .term-toc a,& .term-related a {display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-underline-offset:3px}
  & [id],& :is(a,summary):focus-visible {scroll-margin-block:100px}
  & .term-related {display:flex;align-items:center;gap:6px 20px;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:36px;padding-top:18px}
  & .term-related h2 {width:100%;font-size:22px}
  & .dictionary-prose :is(ul,ol) {padding-inline-start:1.5em}
  & .dictionary-prose figure a {display:block}
  & .dictionary-prose figure a:hover {cursor:zoom-in}
}

body.insight-public .ref-view.ref-library .archive-tabs {flex-wrap:wrap}
body.insight-public .ref-view.ref-library :is(.archive-card,.archive-feature,.archive-more,.archive-tabs a,.archive-filters a,.archive-search input) {scroll-margin-block:115px 80px}
@media(max-width:759px){
  body.insight-public .ref-view.ref-library .archive-tabs a {padding-inline:12px}
}

body.insight-public .ref-profile .profile-post-list {
  display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:16px;
}
body.insight-public .ref-profile .profile-post {
  display:flex;min-height:148px;border:1px solid var(--line);border-radius:10px;overflow:hidden;
  background:var(--paper);color:var(--heading);
}
body.insight-public .ref-profile .profile-post-photo {
  position:relative;flex:0 0 35%;max-width:165px;background:var(--beige);
}
body.insight-public .ref-profile .profile-post-photo img {
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;
}
body.insight-public .ref-profile .profile-post-copy {
  flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:8px;
  padding:18px clamp(12px,1.4vw,20px);overflow-wrap:anywhere;
}
