/* Small helpers that replace inline style="" attributes, so the Content-Security-Policy can forbid inline styles.
   Scoped to #refx like the main stylesheet. */
#refx .u-tinted { background: #fbf8fd; }
#refx .u-mt-13 { margin-top: 13px; }
#refx .u-mt-16 { margin-top: 16px; }
#refx .u-mt-17 { margin-top: 17px; }
#refx .h3-gap { margin-bottom: 13px; }
#refx .splash-eyebrow { color: #ecd5ff; }
#refx .mock-arrow { color: #8643bf; font-size: 23px; }
#refx .evidence-title { font-size: 10px; }

/* Statistic card colours */
#refx .tone-ok strong { color: #1c8766; }
#refx .tone-warn strong { color: #b27e1d; }
#refx .tone-bad strong { color: #bd5861; }

/* Four statistic cards in the results view */
#refx .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 4px; }
@media (max-width: 900px) { #refx .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { #refx .stats.four { grid-template-columns: 1fr; } }

/* Results: give the table the width, let long ids wrap instead of forcing a horizontal scroll */
#refx .results { grid-template-columns: minmax(0, 2.2fr) minmax(250px, 1fr); }
#refx .results td:nth-child(-n+2) { white-space: normal; overflow-wrap: anywhere; max-width: 180px; }
@media (max-width: 900px) { #refx .results { grid-template-columns: 1fr; } }

/* Disclosure panel used for "how the tool read your values" */
#refx details.panel > summary::after { content: "Show"; font-size: 10px; color: #a294ab; margin-left: auto; }
#refx details.panel[open] > summary::after { content: "Hide"; }
#refx details.panel > summary { cursor: pointer; list-style: none; }
#refx details.panel > summary::-webkit-details-marker { display: none; }
#refx .rangebox input[type=checkbox] { margin: 8px 0 4px; }
#refx .field label { font-weight: 650; }
#refx .field input[type=text], #refx .field select { max-width: 100%; }

/* Used by the copy-to-clipboard fallback (an off-screen text box). Not scoped: it is added to the page body. */
.clip-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
/* The layout report box */
#refx .report-box { width: 100%; min-height: 220px; font: 11px/1.45 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid #ebe4ef; border-radius: 8px; background: #fbf8fd; color: #30213d; }
#refx .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#refx .ruletable td { vertical-align: top; }
#refx .ruletable select, #refx .ruletable input[type=number] { min-width: 96px; }
#refx .ruletable input[type=number] { width: 84px; border: 1px solid #e5dce9; padding: 8px; border-radius: 7px; font-size: 11px; }
#refx .ruletable tr.off td { opacity: .5; }
#refx .rowtools { white-space: nowrap; }
#refx .rowtools .btn { padding: 6px 8px; }
#refx .groupfield { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
#refx .groupside { min-width: 0; }
#refx .gap-top { margin-top: 12px; }
#refx .field input[type=number] { width: 120px; border: 1px solid #e5dce9; padding: 9px 10px; border-radius: 7px; font-size: 11px; }
#refx .matchcell { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
#refx .newrow td { background: #fbf8fd; }
#refx .newrow .hint { font-style: italic; }
#refx .rowtools .btn { color: #ad4b60; }
#refx .previews { align-items: start; } #refx .previews .panel { min-width: 0; }
#refx .fieldcell { display: grid; gap: 6px; min-width: 190px; } #refx .fieldcell select { width: 100%; }
#refx .structure, #refx .structure ul { list-style: none; margin: 0; padding: 0; }
#refx .structure ul { margin-left: 18px; padding-left: 12px; border-left: 2px solid #e6d8f0; }
#refx .structure li { margin: 6px 0; font-size: 11px; color: #46384e; }
#refx .st-leaf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#refx .st-name { font-family: ui-monospace, Consolas, monospace; font-weight: 650; }
#refx .st-branch { color: #7436b8; }
#refx .st-branch::before { content: '▾ '; color: #a778c6; }
#refx .st-arr { color: #ae52bb; font-weight: 500; }
#refx .st-attr { color: #a2731d; }
#refx .st-kind { font-size: 9px; font-weight: 780; padding: 3px 7px; border-radius: 5px; }
#refx .st-number { background: #e5f7ec; color: #14835c; }
#refx .st-date { background: #e8f0ff; color: #2c5cb0; }
#refx .st-id { background: #f3eafa; color: #7a4a98; }
#refx .st-sample { color: #94869c; font-size: 10px; }
#refx .st-legend { margin-top: 12px; }
#refx .rawview { font-size: 11px; line-height: 1.7; max-height: 330px; }
#refx .tok-head { background: #4a2f66; color: #fff; padding: 1px 4px; border-radius: 3px; }
#refx .tok-key { color: #f3a6e6; font-weight: 700; }
#refx .tok-attr { color: #ffd479; }
#refx .tok-str { color: #9fe0b8; }
#refx .tok-num { color: #8fc7ff; }
#refx .tok-lit { color: #ffb38a; }
#refx .tok-punc { color: #a99bb5; }
#refx .st-headcell { background: #efe1fa; color: #5b2d86; }
#refx .structure-view { align-items: start; }
#refx .structure-view .panel { min-width: 0; }
#refx .st-map { gap: 10px; }
#refx .st-map input[type=text] { width: 190px; border: 1px solid #e5dce9; padding: 6px 8px; border-radius: 7px; font-size: 11px; }
#refx .st-to { color: #a778c6; }
#refx .st-off { opacity: .5; }
#refx .st-branchlabel { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; font-size: 11px; }
#refx .scrolly { max-height: 460px; overflow: auto; }
#refx .scrolly thead th { position: sticky; top: 0; z-index: 1; }
#refx .rownum { color: #a799b0; text-align: right; width: 1%; font-variant-numeric: tabular-nums; }
#refx .ruletable tbody.rule { border-top: 2px solid #e6d8f0; }
#refx .ruletable tbody.rule:nth-of-type(odd) { background: #fcfaff; }
#refx .ruletable td.rulenum { vertical-align: top; padding-top: 16px; }
#refx .numbadge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #7436b8; color: #fff; font-weight: 800; font-size: 12px; }
#refx .numbadge.add { background: #e6d8f0; color: #7436b8; }
#refx .ruletable tr.subrow td { padding-top: 0; border-bottom: 0; }
#refx .fmtlabel { display: block; font-size: 9px; color: #94869c; margin: 0 0 3px 2px; text-transform: uppercase; letter-spacing: .5px; }
#refx .ruletable tbody.off { opacity: .5; }
#refx .teachwrap { border: 1px solid #e6d8f0; border-radius: 10px; background: #f4eef9; padding: 10px; margin: 10px 0; max-height: 640px; overflow: auto; }
#refx .teachpage { width: 100%; height: auto; display: block; background: #fff; cursor: crosshair; border-radius: 6px; max-width: 900px; margin: 0 auto; }
#refx .teachpage .pagebg { fill: #fff; }
#refx .teachpage .pagetext { fill: #3b2d49; pointer-events: none; font-family: Arial, Helvetica, sans-serif; }
#refx .teachpage .band { pointer-events: none; opacity: .28; }
#refx .teachpage .bandlabel { font-size: 9px; font-weight: 800; fill: #4a2f66; pointer-events: none; }
#refx .band-date { fill: #3b82f6; } #refx .band-description { fill: #8b5cf6; } #refx .band-out { fill: #ef4444; }
#refx .band-in { fill: #22c55e; } #refx .band-amount { fill: #f59e0b; } #refx .band-balance { fill: #14b8a6; }
#refx .teachsteps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 12px 0; }
#refx .teachsteps li { font-size: 11px; padding: 6px 10px; border-radius: 999px; background: #f3eafa; color: #7a4a98; }
#refx .teachsteps li.done { background: #e5f7ec; color: #14835c; }
#refx .teachsteps li.now { background: #7436b8; color: #fff; font-weight: 700; }
#refx .savedlayouts { list-style: none; margin: 0 0 8px; padding: 0; }
#refx .savedlayouts li { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f2ecf4; font-size: 11px; }
#refx .feedbackpage { padding: 0; background: #fbf9fd; }
#refx .feedbackpage .workbody { max-width: 900px; padding: 30px 24px 40px; }
#refx .feedback-box { width: 100%; border: 1px solid #e5dce9; border-radius: 8px; padding: 10px; font: inherit; font-size: 12px; resize: vertical; }
#refx .linkbtn { background: none; border: 0; padding: 0; color: #7436b8; font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }
#refx .feedbackfab { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 0; color: #fff; background: linear-gradient(120deg, #7037c0, #b83fae); box-shadow: 0 6px 18px #4a2f6640; cursor: pointer; text-decoration: none; }
#refx .sitefoot.compact { padding: 20px 6%; }
#refx .sitefoot.compact .footrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
#refx .sitefoot.compact .footlinks { flex-direction: row; flex-wrap: wrap; gap: 18px; }
#refx .sitefoot.compact .disclaimer { margin-top: 14px; padding-top: 12px; }
#refx section.legal { max-width: 820px; }
#refx section.legal h3 { margin: 18px 0 6px; }
#refx section.legal p { margin: 6px 0; font-size: 12px; }
#refx .hero.solo { grid-template-columns: 1fr; text-align: center; justify-items: center; }
#refx .hero.solo p { max-width: 640px; margin-left: auto; margin-right: auto; }
#refx .hero.solo .actions { justify-content: center; }
#refx .hero.solo .trust { justify-content: center; }
