/* Fit the tool into a WordPress page. Loaded after the app's own (scoped) styles.
   Site palette (theme.json): charcoal #242424, charcoal-soft #3A3A3A, gold #E7B32B, gold-deep #7A5200,
   cream #F5F2EA, line #E6E1D3. Risk colours (red/amber/green) are left alone: they carry meaning. */

/* ---------- frame ---------- */
.ehrf-sc-main{padding:var(--wp--preset--spacing--40,1.5rem) var(--wp--preset--spacing--30,1rem) var(--wp--preset--spacing--60,3rem)}
.ehrf-sc{display:block;box-sizing:border-box;width:100%;max-width:1200px!important;margin-inline:auto!important;line-height:1.5;text-align:start;padding:0;font-size:16px}
.ehrf-sc.ehrf-sc{background:transparent} /* no grey panel: the card sits on the site background */
.ehrf-sc .wrap{margin-inline:auto;border-color:#E6E1D3;box-shadow:0 1px 2px rgba(36,36,36,.04),0 8px 24px rgba(36,36,36,.06)}
.ehrf-sc.sc-dark .wrap,.ehrf-sc[data-theme=dark] .wrap{border-color:rgba(255,255,255,.08);box-shadow:none}
.ehrf-sc :where(a){text-decoration:none}
/* the theme colours and sizes headings site-wide; inside the tool they follow the app's own rules */
.ehrf-sc :where(h1,h2,h3,h4,h5,h6){color:inherit;font-family:inherit;letter-spacing:normal}
.ehrf-sc :where(h1,h2,h3,h4,p,ul,ol){margin-block-start:0}
.ehrf-sc :where(button,input,select,textarea){letter-spacing:normal;text-transform:none}

/* ---------- site colours ---------- */
.ehrf-sc{
  --ehrf-navy:#242424;--ehrf-navy-mid:#3A3A3A;--ehrf-gold:#E7B32B;
  --ehrf-red:#7A5200;--ehrf-red-dark:#5C3D00;--ehrf-red-light:#FBF3DC; /* UI accent (selection, steps) */
  --navy:#242424;--navy2:#3A3A3A;--gold:#E7B32B;                       /* monitor */
}
.ehrf-sc.sc-dark,.ehrf-sc[data-theme=dark]{--ehrf-red:#E7B32B!important;--ehrf-red-dark:#F0C75A!important;--ehrf-red-light:rgba(231,179,43,.14)!important}
.ehrf-sc .btn-p,.ehrf-sc .pwa-install-btn{background:#E7B32B;color:#242424;border-color:#E7B32B}
.ehrf-sc .btn-p:hover{background:#D9A21A;border-color:#D9A21A;color:#242424}
.ehrf-sc .btn-p .ti{color:inherit}
/* these two are warnings, not accents: keep them red */
.ehrf-sc .t-item.sd{border-color:#c0392b;background:#fdf2f1}
.ehrf-sc.sc-dark .t-item.sd,.ehrf-sc[data-theme=dark] .t-item.sd{background:rgba(192,57,43,.16)}
.ehrf-sc .wd{border-color:#c0392b}
/* monitor: data bars in deep gold, the transnational-repression share stays red */
.ehrf-sc--monitor .btn.p{background:#242424;border-color:#242424;color:#fff}
.ehrf-sc--monitor .ht i{background:#7A5200}
.ehrf-sc--monitor .dot{background:#7A5200}
.ehrf-sc--monitor .bar i b{background:#c0392b}
.ehrf-sc--monitor .filters input:focus,.ehrf-sc--monitor .filters select:focus{border-color:#242424}
.ehrf-sc--monitor.sc-dark .ht i,.ehrf-sc--monitor.sc-dark .dot,.ehrf-sc--monitor[data-theme=dark] .ht i,.ehrf-sc--monitor[data-theme=dark] .dot{background:#E7B32B}

/* ---------- header: the site header already names EHRF ---------- */
.ehrf-sc .hdr .sc-org-logo,.ehrf-sc .hdr .ehrf-badge,.ehrf-sc .hdr .org-sep,.ehrf-sc .hdr .org-full,
.ehrf-sc--monitor .hdr .badge,.ehrf-sc--monitor .hdr .org{display:none!important}
.ehrf-sc .tool-tag{color:rgba(255,255,255,.62);margin-bottom:.6rem}
.ehrf-sc .sc-privacy-line{display:flex;align-items:center;gap:7px;font-size:13px;color:#EDEAE2;line-height:1.6}
.ehrf-sc .sc-privacy-line .ti{color:#E7B32B;font-size:15px;flex-shrink:0}

/* ---------- two columns on wide screens ---------- */
.ehrf-sc-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
.ehrf-sc-col{min-width:0}
.ehrf-sc-aside{display:flex;flex-direction:column;gap:14px;width:100%}
/* tablets: the sidebar sits under the tool as a row of cards, as wide as the tool */
@media (min-width:700px) and (max-width:1099px){.ehrf-sc-aside{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}}
/* the tool and the monitor span the site's content width (1200px), so their edges line up with the header and footer */
.ehrf-sc-col .wrap,.ehrf-sc--monitor .wrap{max-width:none}
@media (min-width:1100px){
  .ehrf-sc-layout{grid-template-columns:minmax(0,1fr) 340px;align-items:start;gap:24px}
  .ehrf-sc-aside{position:sticky;top:24px;max-width:none}
  body.admin-bar .ehrf-sc-aside{top:56px}
}
.ehrf-sc-card{background:var(--bg);border:1px solid #E6E1D3;border-radius:14px;padding:16px 18px;color:var(--t2);font-size:13.5px;line-height:1.75}
.ehrf-sc.sc-dark .ehrf-sc-card,.ehrf-sc[data-theme=dark] .ehrf-sc-card{border-color:rgba(255,255,255,.08)}
.ehrf-sc-card h2,.ehrf-sc-card summary{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;color:var(--t1);margin:0 0 6px}
.ehrf-sc-card h2 .ti,.ehrf-sc-card summary .ti{color:#7A5200;font-size:17px}
.ehrf-sc.sc-dark .ehrf-sc-card h2 .ti,.ehrf-sc.sc-dark .ehrf-sc-card summary .ti{color:#E7B32B}
.ehrf-sc-card p{margin:0}
.ehrf-sc-card--privacy{background:#FBF6E8;border-color:#EADFC2}
/* the sidebar sits on the light site background, so dark cards need an opaque base under the tint */
.ehrf-sc.sc-dark .ehrf-sc-card--privacy,.ehrf-sc[data-theme=dark] .ehrf-sc-card--privacy{background:linear-gradient(rgba(231,179,43,.1),rgba(231,179,43,.1)),var(--bg);border-color:rgba(231,179,43,.25)}
.ehrf-sc-card--about summary{cursor:pointer;list-style:none;margin:0}
.ehrf-sc-card--about summary::-webkit-details-marker{display:none}
.ehrf-sc-card--about summary::after{content:"+";margin-inline-start:auto;font-weight:400;font-size:18px;color:var(--t3)}
.ehrf-sc-card--about[open] summary::after{content:"−"}
.ehrf-sc-card--about[open] summary{margin-bottom:8px}
.ehrf-sc-aside .tool-desc{color:var(--t2);font-size:13px;line-height:1.8;max-width:none}
.ehrf-sc-aside .src-row{border-top:1px solid var(--bd3);margin-top:.75rem;padding-top:.75rem}
.ehrf-sc-aside .src-pill{background:var(--bg2);border-color:var(--bd3);color:var(--t2)}
.ehrf-sc-card--links ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.ehrf-sc-card--links li{display:flex;flex-direction:column}
.ehrf-sc-card--links a{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--t1)}
.ehrf-sc-card--links a:hover{text-decoration:underline}
.ehrf-sc-card--links a .ti{color:#7A5200;font-size:17px}
.ehrf-sc.sc-dark .ehrf-sc-card--links a .ti{color:#E7B32B}
.ehrf-sc-card--links span{font-size:12.5px;color:var(--t3);padding-inline-start:25px}

/* ---------- result: link to the monitor ---------- */
.ehrf-sc-monitor-link{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#FBF6E8;border:1px solid #EADFC2;border-radius:12px;padding:14px 16px;margin:16px 0;color:var(--t2);font-size:13px;line-height:1.6}
.ehrf-sc.sc-dark .ehrf-sc-monitor-link,.ehrf-sc[data-theme=dark] .ehrf-sc-monitor-link{background:rgba(231,179,43,.08);border-color:rgba(231,179,43,.2)}
.ehrf-sc-monitor-link > .ti{font-size:22px;color:#7A5200}
.ehrf-sc.sc-dark .ehrf-sc-monitor-link > .ti{color:#E7B32B}
.ehrf-sc-monitor-link div{flex:1;min-width:180px;display:flex;flex-direction:column}
.ehrf-sc-monitor-link strong{color:var(--t1);font-size:14px}
.ehrf-sc-monitor-link a{background:#242424;color:#fff;border-radius:6px;padding:8px 16px;font-weight:600;font-size:13px;white-space:nowrap}
.ehrf-sc-monitor-link a:hover{background:#3A3A3A}

/* ---------- extras (embed.js): quick check, map, why, plan, device check ---------- */
.ehrf-sc .ehrf-x-entry{margin:0 0 1.1rem;padding-bottom:1rem;border-bottom:1px solid var(--bd3)}
.ehrf-sc .ehrf-x-entry-btns{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ehrf-sc .ehrf-x-chip{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:7px 14px;border-radius:999px;border:1px solid #E6E1D3;background:var(--bg2);color:var(--t1);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.ehrf-sc .ehrf-x-chip .ti{color:#7A5200;font-size:16px}
.ehrf-sc .ehrf-x-chip:hover,.ehrf-sc .ehrf-x-chip.on{border-color:#7A5200;background:#FBF3DC}
.ehrf-sc.sc-dark .ehrf-x-chip,.ehrf-sc[data-theme=dark] .ehrf-x-chip{border-color:rgba(255,255,255,.12)}
.ehrf-sc.sc-dark .ehrf-x-chip .ti{color:#E7B32B}
.ehrf-sc.sc-dark .ehrf-x-chip.on,.ehrf-sc.sc-dark .ehrf-x-chip:hover{background:rgba(231,179,43,.14);border-color:#E7B32B}
.ehrf-sc .ehrf-x-hint{font-size:12.5px;color:var(--t3)}
.ehrf-sc .ehrf-x-panel{margin-top:12px}
.ehrf-sc .ehrf-x-box{border:1px solid var(--bd3);border-radius:12px;padding:16px;background:var(--bg2)}
.ehrf-sc .ehrf-x-box h3{font-size:16px;font-weight:700;margin:0 0 4px}
.ehrf-sc .ehrf-x-sub{font-size:12.5px;color:var(--t2);line-height:1.7;margin:0 0 10px}
.ehrf-sc .ehrf-x-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:10px 0 14px}
.ehrf-sc .ehrf-x-form label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600;color:var(--t1)}
.ehrf-sc .ehrf-x-form select{min-height:42px;padding:6px 10px;border:1px solid var(--bd3);border-radius:8px;background:var(--bg);color:var(--t1);font:inherit;font-size:14px;font-weight:400}
.ehrf-sc .ehrf-x-form fieldset{grid-column:1/-1;border:0;padding:0;margin:0}
.ehrf-sc .ehrf-x-form legend{font-size:13px;font-weight:600;color:var(--t1);margin-bottom:6px;padding:0}
.ehrf-sc .ehrf-x-seg{display:inline-flex;flex-wrap:wrap;gap:6px}
.ehrf-sc .ehrf-x-seg label{position:relative;display:inline-flex;cursor:pointer;font-weight:400}
.ehrf-sc .ehrf-x-seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.ehrf-sc .ehrf-x-seg span{display:inline-block;min-width:64px;text-align:center;padding:6px 12px;border:1px solid var(--bd3);border-radius:8px;background:var(--bg);font-size:13px;color:var(--t1)}
.ehrf-sc .ehrf-x-seg input:checked+span{background:#242424;border-color:#242424;color:#fff;font-weight:600}
.ehrf-sc.sc-dark .ehrf-x-seg input:checked+span{background:#E7B32B;border-color:#E7B32B;color:#242424}
.ehrf-sc .ehrf-x-seg input:focus-visible+span{outline:2px solid #E7B32B;outline-offset:2px}
.ehrf-sc .ehrf-x-qres:not(:empty){margin-top:14px}
.ehrf-sc .ehrf-x-err{color:#c0392b;font-size:13px;margin:0}
.ehrf-sc .ehrf-x-qcard{border:1px solid;border-inline-start-width:4px;border-radius:10px;padding:14px;background:var(--bg)}
.ehrf-sc .ehrf-x-qcard p{font-size:13px;color:var(--t2);line-height:1.7;margin:8px 0 0}
.ehrf-sc .ehrf-x-qlbl{font-size:11.5px;color:var(--t3);font-weight:600;text-transform:none;margin-bottom:3px}
.ehrf-sc .ehrf-x-qtier{font-size:16px;font-weight:700;margin-bottom:6px}
.ehrf-sc p.ehrf-x-warn{display:flex;gap:6px;align-items:flex-start;color:var(--t1)}
.ehrf-sc .ehrf-x-warn .ti{color:#d68910;font-size:16px;flex-shrink:0;margin-top:2px}
.ehrf-sc .ehrf-x-qcard .btn-p{margin-top:12px}
.ehrf-sc .ehrf-x-note{margin-top:10px;padding:10px 12px;border-radius:8px;background:#eafaf1;color:#14532d;font-size:13px}
.ehrf-sc.sc-dark .ehrf-x-note{background:rgba(29,158,117,.16);color:inherit}
.ehrf-sc .ehrf-x-note .ti{color:#1d9e75}
.ehrf-sc .ehrf-x-map{margin:6px 0}
.ehrf-sc .ehrf-x-map svg .c,.ehrf-sc .ehrf-x-map svg .dot{cursor:pointer}
.ehrf-sc .ehrf-x-cbox{border-top:1px solid var(--bd3);margin-top:10px;padding-top:12px;font-size:13px;color:var(--t2);line-height:1.7}
.ehrf-sc .ehrf-x-chead{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline;font-size:15px;color:var(--t1);margin-bottom:4px}
.ehrf-sc .ehrf-x-chead span{font-size:13px;font-weight:700}
.ehrf-sc .ehrf-x-cbox p{margin:0 0 6px}
.ehrf-sc .ehrf-x-reps ul{list-style:none;margin:4px 0 10px;padding:0;display:flex;flex-direction:column;gap:8px}
.ehrf-sc .ehrf-x-reps li{display:flex;flex-direction:column}
.ehrf-sc .ehrf-x-reps a{color:var(--t1);font-weight:600}
.ehrf-sc .ehrf-x-reps a:hover{text-decoration:underline}
.ehrf-sc .ehrf-x-reps span{font-size:11.5px;color:var(--t3)}
.ehrf-sc .ehrf-x-actions{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;margin-top:8px}
.ehrf-sc .ehrf-x-link{font-weight:600;color:#7A5200;font-size:13px}
.ehrf-sc.sc-dark .ehrf-x-link{color:#E7B32B}
.ehrf-sc .ehrf-x-link:hover{text-decoration:underline}
/* why this score */
.ehrf-sc .ehrf-x-total{display:flex;flex-direction:column;gap:2px;margin:4px 0 12px;font-size:14px}
.ehrf-sc .ehrf-x-total span{font-size:12.5px;color:var(--t2)}
.ehrf-sc .ehrf-x-rows{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.ehrf-sc .ehrf-x-rows summary{display:grid;grid-template-columns:minmax(0,1fr) 90px 40px;gap:10px;align-items:center;cursor:pointer;list-style:none;padding:7px 4px;border-radius:6px;font-size:13px;color:var(--t1)}
.ehrf-sc .ehrf-x-rows summary::-webkit-details-marker{display:none}
.ehrf-sc .ehrf-x-rows summary:hover{background:var(--bg2)}
.ehrf-sc .ehrf-x-rl em{font-style:normal;font-size:11px;font-weight:600;color:#1d6b4f;background:#eafaf1;border-radius:999px;padding:1px 7px;white-space:nowrap}
.ehrf-sc.sc-dark .ehrf-x-rl em{background:rgba(29,158,117,.18);color:#7ee0b8}
.ehrf-sc .ehrf-x-bar{height:8px;border-radius:4px;background:var(--bg2);overflow:hidden}
.ehrf-sc .ehrf-x-bar i{display:block;height:100%;border-radius:4px;background:#7A5200}
.ehrf-sc.sc-dark .ehrf-x-bar i{background:#E7B32B}
.ehrf-sc .ehrf-x-rows b{font-size:13px;text-align:end;color:var(--t1)}
.ehrf-sc .ehrf-x-rows details p{margin:2px 4px 8px;padding:8px 10px;border-inline-start:3px solid #E7B32B;background:var(--bg2);border-radius:4px;font-size:12.5px;color:var(--t2);line-height:1.7}
/* action plan */
.ehrf-sc .ehrf-x-plan .sblock-title{flex-wrap:wrap}
.ehrf-sc .ehrf-x-count{margin-inline-start:auto;font-size:12px;font-weight:600;color:var(--t3)}
.ehrf-sc .ehrf-x-phase h4{font-size:13.5px;font-weight:700;color:var(--t1);margin:12px 0 6px}
.ehrf-sc .ehrf-x-phase ul,.ehrf-sc .ehrf-x-dig ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.ehrf-sc .ehrf-x-phase label{display:flex;gap:10px;align-items:flex-start;cursor:pointer;font-size:13px;line-height:1.7;color:var(--t1);padding:6px 8px;border-radius:6px}
.ehrf-sc .ehrf-x-phase label:hover{background:var(--bg2)}
.ehrf-sc .ehrf-x-phase input{width:18px;height:18px;margin:3px 0 0;flex-shrink:0;accent-color:#7A5200}
.ehrf-sc .ehrf-x-phase li.done span{color:var(--t3);text-decoration:line-through}
.ehrf-sc .ehrf-x-print{margin-top:12px}
/* device check */
.ehrf-sc .ehrf-x-dig li{padding:8px 0;border-bottom:1px solid var(--bd3);display:flex;flex-direction:column;gap:6px}
.ehrf-sc .ehrf-x-dq{font-size:13px;color:var(--t1);line-height:1.6}
.ehrf-sc .ehrf-x-dtip{margin:0;font-size:12.5px;color:var(--t2);line-height:1.7;display:flex;gap:6px;align-items:flex-start}
.ehrf-sc .ehrf-x-dtip[hidden]{display:none}
.ehrf-sc .ehrf-x-dtip .ti{color:#d68910;font-size:15px;margin-top:2px}
.ehrf-sc .ehrf-x-dscore:not(:empty){margin:12px 0 8px;font-size:13.5px}
.ehrf-sc .ehrf-x-dig .ehrf-x-sub a{color:#7A5200;font-weight:600}
.ehrf-sc.sc-dark .ehrf-x-dig .ehrf-x-sub a{color:#E7B32B}
@media (max-width:480px){.ehrf-sc .ehrf-x-rows summary{grid-template-columns:minmax(0,1fr) 56px 36px;gap:6px}.ehrf-sc .ehrf-x-hint{flex-basis:100%}}

/* ---------- discreet mode: hide the site header/footer too ---------- */
body:has(.ehrf-sc.sc-discreet) header.wp-block-template-part,
body:has(.ehrf-sc.sc-discreet) footer.wp-block-template-part,
body:has(.ehrf-sc.sc-discreet) #wpadminbar{display:none!important}
html:has(.ehrf-sc.sc-discreet){margin-top:0!important}
.ehrf-sc.sc-discreet .ehrf-sc-card--about,.ehrf-sc.sc-discreet .ehrf-sc-card--links{display:none}

/* phones: the site header already has a Menu button, so the assessment shows its two toggles directly
   (the monitor keeps the collapsible menu: it also holds the back and language buttons) */
@media (max-width:640px){
  .ehrf-sc:not(.ehrf-sc--monitor) .sc-menu-btn{display:none!important}
  .ehrf-sc:not(.ehrf-sc--monitor) .sc-nav{display:contents!important}
  .ehrf-sc:not(.ehrf-sc--monitor) .sc-nav .sc-tools{flex-direction:row;width:auto;margin-inline-start:auto}
  .ehrf-sc:not(.ehrf-sc--monitor) .sc-nav .sc-tool{width:auto;min-height:40px;font-size:14px;padding:6px 12px}
}
/* narrow phones: only the current step is labelled (its name is repeated just below), no words cut in half */
@media (max-width:480px){
  .ehrf-sc .dot-lbl{overflow-wrap:normal;word-break:normal}
  .ehrf-sc .dot-lbl:not(.active){display:none}
}
@media (max-width:600px){.ehrf-sc-main{padding-inline:.5rem}.ehrf-sc-card{border-radius:12px}}
@media print{
  body:has(.ehrf-sc) header.wp-block-template-part,body:has(.ehrf-sc) footer.wp-block-template-part,
  .ehrf-sc-aside,.ehrf-sc-monitor-link{display:none!important}
  .ehrf-sc-layout{display:block}
  .ehrf-sc .wrap{box-shadow:none}
  .ehrf-x-entry,.ehrf-x-print,.ehrf-x-dig,.ehrf-x-why details:not([open]) p{display:none!important}
  /* "print the plan": everything except the plan and the elements that hold it */
  body.ehrf-x-printing :not(.ehrf-x-keep,.ehrf-x-plan,.ehrf-x-plan *){display:none!important}
  body.ehrf-x-printing .ehrf-x-plan{border:0;margin:0}
}
