/* ===================================================================
   Make scores make sense: assets/score-explorer.css
   Everything is scoped to <main class="sx"> on tool-score-explorer.html,
   so nothing here touches styles.css and site styles do not reshape the tool.

   1. Tokens and base       6. CHC abilities        11. Dialog, toast, utilities
   2. Hero                  7. SLD reference        12. Presentation mode
   3. Sticky section bar    8. Report language      13. Responsive
   4. Shared components     9. Conversion table     14. Print
   5. Workspace            10. Notes and sources
   =================================================================== */

/* ---- 1. Tokens and base ------------------------------------------- */
.sx {
  --ink: #13233a;
  --ink-2: #2a3c55;
  --muted: #465870;
  --faint: #5b6c83;
  --line: #cdd8e5;
  --line-2: #e2e9f2;
  --line-strong: #a3b6cf;
  --page: #e5ecf4;
  --soft: #f3f6fa;
  --tint: #f7f9fc;
  --navy: #163c76;
  --blue: #2459a3;
  --blue-soft: #e6eefa;
  --blue-line: #b5c9e6;
  --gold: #b0852f;
  --gold-soft: #f8f0dd;
  --gold-line: #e6d3a8;
  --gold-ink: #7a5a1c;
  --teal: #12756f;
  --teal-soft: #e8f4f2;
  --teal-line: #c3e1da;
  --teal-ink: #0f5d57;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 35, 65, 0.07), 0 10px 28px rgba(15, 35, 65, 0.08);
  --shadow-lg: 0 2px 4px rgba(15, 35, 65, 0.06), 0 20px 48px rgba(15, 35, 65, 0.16);
  --focus: 0 0 0 4px rgba(36, 89, 163, 0.22);
  --sx-top: 0px;
  display: block;
  background: var(--page);
  color: var(--ink-2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  padding-bottom: 64px;
}
/* styles.css sets heading and paragraph colors, sizes, and margins globally; reset them here. */
.sx h1, .sx h2, .sx h3, .sx h4 { color: var(--ink); line-height: 1.2; margin: 0; font-weight: 700; }
.sx p { color: inherit; margin: 0; }
.sx ul, .sx ol { margin: 0; }
.sx dl, .sx dd { margin: 0; }
.sx button, .sx input, .sx select, .sx textarea { font: inherit; color: inherit; }
.sx button { cursor: pointer; }
.sx select, .sx input { min-width: 0; max-width: 100%; }
.sx a { color: var(--blue); }
.sx a:hover { text-decoration-thickness: 2px; }
.sx :focus-visible { outline: 3px solid #9a7225; outline-offset: 2px; }
.sx-shell { max-width: 1600px; margin: 0 auto; padding: 0 24px; }

/* ---- 2. Hero -------------------------------------------------------- */
.sx .sx-hero {
  position: relative;
  overflow: hidden;
  color: #e9f0fa;
  background: radial-gradient(900px 340px at 88% -20%, rgba(230, 193, 114, 0.22), transparent 62%),
    linear-gradient(135deg, #0f2747 0%, #173f7a 58%, #1d4f91 100%);
}
.sx .sx-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}
.sx .sx-hero-in { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 20px; padding-bottom: 18px; }
.sx .sx-kicker { font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 800; color: #e6c172; margin-bottom: 8px; }
.sx .sx-hero h1 { font-size: 36px; line-height: 1.05; letter-spacing: -1.2px; color: #ffffff; font-weight: 800; margin-bottom: 8px; }
.sx .sx-hero h1 span { color: #e6c172; }
.sx .sx-lede { font-size: 16px; line-height: 1.55; color: #c9d6ea; max-width: 640px; }
.sx .sx-flow { list-style: none; padding: 0; display: flex; gap: 10px; flex-shrink: 0; }
.sx .sx-flow li { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); color: #ffffff; font-size: 15px; font-weight: 650; }
.sx .sx-flow b { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e6c172; color: #1a2a40; font-size: 15px; }

/* ---- 3. Sticky section bar and menus --------------------------------- */
.sx .sx-bar {
  position: sticky;
  top: var(--sx-top, 0px);
  z-index: 90;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(15, 35, 65, 0.07);
}
.sx .sx-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; }
.sx .sx-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.sx .sx-tabs::-webkit-scrollbar { display: none; }
.sx .sx-tabs a { display: inline-flex; align-items: center; height: 58px; padding: 0 12px; font-size: 15px; font-weight: 650; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.sx .sx-tabs a:hover { color: var(--navy); }
.sx .sx-tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.sx .sx-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sx .menu { position: relative; }
.sx .menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 130;
  min-width: 290px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #ffffff;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 35, 65, 0.22);
}
.sx .menu-pop.wide { min-width: 520px; gap: 12px; padding: 16px; }
.sx .menu-pop > button, .sx .menu-pop > a { display: block; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: none; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.sx .menu-pop > button:hover, .sx .menu-pop > a:hover { background: var(--blue-soft); color: var(--navy); }
.sx .menu-pop > button small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--muted); }

/* ---- 4. Shared components ------------------------------------------ */
.sx .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 15px; border: 1.5px solid var(--line); border-radius: 10px; background: #ffffff; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.2; text-decoration: none; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.sx .btn:hover { border-color: var(--blue-line); background: #f6f9fe; }
.sx .btn.primary { background: var(--navy); border-color: var(--navy); color: #ffffff; box-shadow: 0 2px 8px rgba(22, 60, 118, 0.28); }
.sx .btn.primary:hover { background: #1f4f94; }
.sx .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.sx .btn.ghost:hover, .sx .btn.ghost[aria-expanded='true'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--navy); }
.sx .btn[aria-expanded='true'] { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }
.sx .btn.sm { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.sx .btn.wide { width: 100%; }
.sx .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sx .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sx .link-btn { background: none; border: 0; padding: 6px 2px; color: var(--blue); font-weight: 650; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.sx .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1.5px solid var(--line); border-radius: 9px; background: #ffffff; color: var(--ink); font-size: 22px; line-height: 1; }
.sx .icon-btn:hover { border-color: var(--blue-line); background: var(--blue-soft); }
.sx .icon-btn.sm { width: 32px; height: 32px; font-size: 20px; }
.sx .icon-btn.on { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }
.sx .icon-btn.danger:hover { border-color: #e2b4b4; background: #fdeeee; color: #a12d2d; }
.sx .panel { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sx .panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(180deg, #fbfcfe 0%, #f2f6fb 100%); }
.sx .panel-head h2 { font-size: 18px; letter-spacing: -0.2px; }
.sx .step { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #ffffff; font-size: 14px; font-weight: 800; box-shadow: 0 0 0 3px #dbe6f6; }
/* Every typing field gets a clear box: visible border, white fill, inner shadow, and a focus glow. */
.sx .fld,
.sx .field input, .sx .field select, .sx .inline-field input, .sx .inline-field select {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 7px 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 9px;
  background-color: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  box-shadow: inset 0 1px 2px rgba(15, 35, 65, 0.07);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sx .field input, .sx .field select { margin-top: 6px; }
.sx .fld:hover, .sx .field input:hover, .sx .field select:hover, .sx .inline-field input:hover, .sx .inline-field select:hover { border-color: #7f9bc2; }
.sx .fld:focus, .sx .field input:focus, .sx .field select:focus, .sx .inline-field input:focus, .sx .inline-field select:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.sx .fld::placeholder, .sx .field input::placeholder, .sx .inline-field input::placeholder { color: #8594a8; font-weight: 500; }
.sx select.fld, .sx .field select, .sx .inline-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23465870' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
}
.sx .fld.fnum { font-variant-numeric: tabular-nums; }
.sx input[aria-invalid='true'], .sx .fld[aria-invalid='true'] { border-color: #b23b3b; background-color: #fff6f6; }
.sx .field { display: block; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.sx .inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sx .inline-field input, .sx .inline-field select { width: auto; min-height: 36px; }
.sx .helper { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-top: 8px; }
.sx .validation { font-size: 13.5px; color: #a12d2d; font-weight: 650; }
.sx .validation:empty { display: none; }
.sx .eyebrow { font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; color: var(--blue); margin-bottom: 6px; }
.sx .muted { color: var(--faint); }
.sx .warn { color: #8a2b2b; }
.sx .gold-ink { color: var(--gold-ink); }
.sx .num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #ffffff; font-size: 12.5px; font-weight: 800; flex-shrink: 0; }
.sx .num.lg { width: 30px; height: 30px; font-size: 14px; }
.sx .pill { font-size: 12px; font-weight: 750; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.sx .count { font-size: 13px; font-weight: 750; color: var(--muted); background: #e9eff7; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.sx .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: #e9eef5; border: 1px solid var(--line-2); }
.sx .seg button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; }
.sx .seg button:hover { color: var(--navy); }
.sx .seg button[aria-pressed='true'] { background: #ffffff; color: var(--navy); box-shadow: 0 1px 3px rgba(15, 35, 65, 0.18), 0 0 0 1px rgba(36, 89, 163, 0.12); }
.sx .tog { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 13px; border: 1.5px solid var(--line); border-radius: 999px; background: #ffffff; color: var(--muted); font-size: 14px; font-weight: 650; }
.sx .tog small { margin-left: 2px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.sx .tog:hover { border-color: var(--blue-line); }
.sx .tog .chk { width: 14px; height: 14px; display: none; }
.sx .tog[aria-pressed='true'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--navy); padding-left: 10px; }
.sx .tog[aria-pressed='true'] .chk { display: block; }
.sx .pal-row, .sx .mini-pal { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sx .pal-swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--sw); border: 2px solid #ffffff; box-shadow: 0 0 0 1px rgba(15, 35, 65, 0.22); }
.sx .pal-swatch.sm { width: 24px; height: 24px; }
.sx .pal-swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--sw); }
.sx .section { margin-top: 64px; scroll-margin-top: calc(var(--sx-top) + 76px); }
.sx .sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.sx .sec-head h2 { position: relative; font-size: 31px; letter-spacing: -0.7px; padding-left: 16px; margin-bottom: 6px; }
.sx .sec-head h2::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 5px; border-radius: 3px; background: var(--gold); }
.sx .sec-head h2:focus { outline: none; }
.sx .sec-head p:not(.eyebrow) { font-size: 16.5px; color: var(--muted); max-width: 780px; line-height: 1.6; }
.sx .sec-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; flex-shrink: 0; }
.sx .note { margin: 16px 0; padding: 14px 18px; border: 1px solid #d3dff0; border-radius: 12px; background: #eef3fb; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.sx .note.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.sx .note strong { color: var(--ink); }
.sx .band-dot { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(15, 35, 65, 0.18); border-radius: 3px; }

/* ---- 5. Workspace ---------------------------------------------------- */
.sx .workspace { margin-top: 22px; scroll-margin-top: calc(var(--sx-top) + 70px); }

/* 5a. Score table */
.sx .table-panel .ph-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-left: auto; }
.sx .table-panel #st-name { width: 150px; }
.sx .table-panel #profile { width: 262px; }
.sx .table-panel.collapsed .panel-head { border-bottom: 0; border-radius: var(--radius); }
.sx .table-panel #table-toggle .icon { transition: transform 0.2s; }
.sx .table-panel.collapsed #table-toggle .icon { transform: rotate(180deg); }
.sx .st-wrap { overflow-x: auto; }
.sx .score-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.sx .score-table thead th { position: static; padding: 9px 7px; text-align: left; white-space: nowrap; background: #f5f8fc; border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); }
.sx .score-table thead th:first-child { padding-left: 18px; }
.sx .th-note { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #7a889b; }
.sx .score-table td { padding: 5px 6px; vertical-align: middle; border-bottom: 1px solid var(--line-2); background: #ffffff; }
.sx .score-table .fld { min-height: 36px; padding: 5px 10px; }
.sx .score-table select.fld { padding-right: 26px; background-position: right 8px center; }
.sx .score-table td:first-child { padding-left: 18px; }
.sx .score-table td:last-child { padding-right: 18px; }
.sx .srow:hover td { background: #fafcff; }
.sx .srow.selected td { background: #f0f5fd; }
.sx .srow.selected td:first-child { box-shadow: inset 5px 0 0 var(--c); }
.sx .c-num { width: 58px; position: relative; }
.sx .c-name { min-width: 210px; }
.sx .c-val { width: 96px; }
.sx .c-val .fld { font-size: 17px; font-weight: 750; color: var(--navy); }
.sx .c-scale { width: 172px; }
.sx .c-ci { width: 176px; }
.sx .ci-pair { display: flex; align-items: center; gap: 5px; color: var(--faint); }
.sx .ci-pair .fld { width: 72px; }
.sx .c-lvl { width: 112px; }
.sx .c-type { width: 152px; }
.sx .c-desc { width: 178px; font-size: 14px; line-height: 1.35; }
.sx .c-desc b { color: var(--ink); font-weight: 750; }
.sx .c-desc small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.sx .meta-empty { font-size: 13px; color: var(--faint); }
.sx .c-act { width: 86px; white-space: nowrap; text-align: right; }
.sx .c-act .icon-btn + .icon-btn { margin-left: 5px; }
.sx .sc-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--c); color: #ffffff; font-size: 14px; font-weight: 800; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px var(--line); }
.sx .sc-dot::after { content: ''; position: absolute; right: -4px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #ffffff; background: conic-gradient(#2f5ea8 0 25%, #12756f 0 50%, #94561f 0 75%, #ab3765 0); }
.sx .palette { position: absolute; left: 12px; top: calc(100% - 2px); z-index: 40; width: 236px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; box-shadow: 0 12px 28px rgba(15, 35, 65, 0.18); }
.sx .palette > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; color: var(--muted); }
.sx .srow-more td { background: #f6f9fd; }
.sx .more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding: 4px 0 8px; }
.sx .more-grid .helper { grid-column: 1 / -1; margin-top: 0; }
.sx .srow-err td { padding-top: 0; border-bottom: 1px solid var(--line-2); }
.sx .st-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px 12px; }
.sx .privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.sx .st-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px 14px; }

/* 5b. Chart and the explanation panel side by side */
.sx .stage { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; margin-top: 20px; }
.sx .chart-panel { min-width: 0; }
.sx .chart-head { column-gap: 10px; }
.sx .chart-head .chart-types { margin-left: 2px; }
.sx .chart-head .chart-types button { gap: 6px; padding: 5px 10px; }
.sx .chart-head .chart-types .icon { width: 19px; height: 19px; }
.sx .ch-tail { display: flex; flex: 1 1 400px; align-items: center; gap: 10px; min-width: 0; }
.sx .title-field { flex: 1 1 140px; min-width: 0; }
.sx .chart-head .ov-tools { display: flex; gap: 8px; margin-left: auto; }
.sx .title-field input { width: 100%; min-height: 38px; padding: 6px 10px; border: 1.5px dashed var(--line-strong); border-radius: 9px; background: #ffffff; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.sx .title-field input::placeholder { color: #8594a8; font-weight: 500; }
.sx .title-field input:focus { outline: none; border-style: solid; border-color: var(--blue); box-shadow: var(--focus); }
.sx .ov-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px 14px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); background: #fbfcfe; }
.sx .ov-label { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 76px; padding-top: 1px; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--faint); }
.sx .ov-count { padding: 1px 7px; border-radius: 999px; background: #e3ebf6; color: var(--navy); font-size: 11.5px; letter-spacing: 0.2px; text-transform: none; }
.sx .ov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sx .ov-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px 4px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: #ffffff; color: var(--muted); font-size: 14px; font-weight: 650; }
.sx .ov-chip:hover { border-color: var(--blue-line); color: var(--ink); }
.sx .ov-sw { flex-shrink: 0; width: 18px; height: 14px; border-radius: 4px; background: var(--sw); box-shadow: inset -3px 0 0 var(--sl, rgba(15, 35, 65, 0.25)); opacity: 0.45; }
.sx .ov-chip[aria-pressed='true'] { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); box-shadow: 0 1px 3px rgba(36, 89, 163, 0.18); }
.sx .ov-chip[aria-pressed='true'] .ov-sw { opacity: 1; }
.sx .ov-settings { display: grid; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.sx .set-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); border-left-width: 5px; }
.sx .set-row.sld { background: var(--gold-soft); border-color: var(--gold-line); border-left-color: #a6762a; }
.sx .set-row.custom { background: #eef6f4; border-color: var(--teal-line); border-left-color: var(--teal); }
.sx .set-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 750; color: var(--muted); }
.sx .set-row label.grow { flex: 1 1 200px; }
.sx .set-row .fld { min-height: 36px; }
.sx .set-row [data-sld='ability'] { width: 250px; }
.sx .set-row [data-sld='test'] { width: 270px; }
.sx .set-row .fld.fnum { width: 96px; }
.sx .set-row .seg { align-self: flex-end; }
.sx .set-row .mini-pal { align-self: center; padding-bottom: 4px; }
.sx .set-title { display: inline-flex; align-items: center; gap: 8px; align-self: center; min-width: 140px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.sx .set-title .ov-sw { opacity: 1; }
.sx .set-status { flex-basis: 100%; font-size: 14px; color: var(--gold-ink); }
.sx .set-status.warn { color: #8a2b2b; font-weight: 650; }
.sx .dc-group { display: flex; align-items: flex-start; gap: 12px; }
.sx .dc-label { flex: 0 0 104px; padding-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--faint); }
.sx .dc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sx .dc-chips select.fld { width: auto; min-height: 36px; }
.sx .dc-note { font-size: 13px; color: var(--muted); }
.sx .pop-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sx .pop-presets .dc-label { flex-basis: 100%; padding: 0; }
.sx .scroll-hint { margin: 10px 18px 0; font-size: 13.5px; color: var(--muted); }
.sx .scroll-hint[hidden] { display: none; }
.sx .chart-scroll { overflow-x: auto; padding: 6px 0 0; }
.sx .chart-scroll svg { display: block; width: 100%; min-width: 700px; height: auto; }
.sx .chart-scroll [data-drag] { cursor: grab; touch-action: none; }
.sx .chart-scroll [data-drag]:active { cursor: grabbing; }
body[data-sx-chart='profile'] .sx .chart-scroll [data-drag] { cursor: ns-resize; }
.sx .legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 12px; }
.sx .key-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 13px 4px 4px; border: 1.5px solid var(--line); border-radius: 999px; background: #ffffff; color: var(--ink-2); font-size: 14.5px; }
.sx .key-chip:hover { border-color: var(--blue-line); }
.sx .key-chip[aria-pressed='true'] { border-color: var(--blue); background: var(--blue-soft); }
.sx .key-label { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx .chart-caption { margin: 0 18px 16px; padding: 11px 14px; border-radius: 10px; background: var(--soft); color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.sx .chart-caption strong { color: var(--ink); }

/* 5c. Explain panel */
.sx .side-panel { position: sticky; top: calc(var(--sx-top) + 74px); max-height: calc(100vh - var(--sx-top) - 92px); overflow: auto; overscroll-behavior: contain; }
.sx .side-panel .panel-head { position: sticky; top: 0; z-index: 2; }
.sx .ro-steps { display: flex; gap: 6px; margin-left: auto; }
.sx .ro-score { padding: 14px 18px 4px; }
.sx .ro-eyebrow { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; color: var(--faint); }
.sx .ro-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.sx .ro-name { font-size: 21px; letter-spacing: -0.3px; }
.sx .ro-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.sx .ro-value b { font-size: 44px; line-height: 1.05; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.sx .ro-value > span { font-size: 15px; font-weight: 650; color: var(--muted); }
.sx .band-chip { align-self: center; padding: 3px 12px; border: 1px solid rgba(15, 35, 65, 0.14); border-radius: 999px; background: var(--bf); color: var(--ink); font-size: 14px; font-weight: 750; }
.sx .band-chip.neutral { background: #eef2f7; }
.sx .seg.views { display: flex; margin: 12px 18px 4px; }
.sx .seg.views button { flex: 1; justify-content: center; padding: 5px 6px; }
.sx .ro-body { display: grid; gap: 12px; padding: 10px 18px 18px; }
.sx .ro-block { padding: 12px 14px 13px; border: 1px solid var(--line-2); border-radius: 12px; }
.sx .ro-block h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; letter-spacing: 0.9px; text-transform: uppercase; }
.sx .ro-block h4.sub { margin-top: 14px; }
.sx .ro-block.family { background: var(--teal-soft); border-color: var(--teal-line); }
.sx .ro-block.family h4 { color: var(--teal-ink); }
.sx .ro-block.family p { margin-bottom: 7px; font-size: 16px; line-height: 1.6; color: var(--ink); }
.sx .ro-block.family p:last-child { margin-bottom: 0; }
.sx .ro-block.clinical { background: #f7f9fc; }
.sx .ro-block.clinical h4, .sx .ro-block.visual h4 { color: var(--blue); }
.sx .stat-list > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.sx .stat-list > div:last-child { border-bottom: 0; }
.sx .stat-list dt { padding-top: 2px; font-size: 12px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--faint); }
.sx .stat-list dd { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sx .stat-list dd b { color: var(--ink); font-size: 15.5px; }
.sx .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sx .tile { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 9px 11px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #ffffff; box-shadow: 0 1px 2px rgba(15, 35, 65, 0.05); }
.sx .tile span { font-size: 11.5px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--faint); }
.sx .tile b { font-size: 20px; line-height: 1.3; letter-spacing: -0.2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx .tile small { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.sx .stat-list.flags { margin-top: 8px; }
.sx .ro-block .more-link { margin-top: 6px; padding: 2px 0; font-size: 13.5px; }
.sx .ro-compare { margin-top: 10px; }
.sx .ro-compare summary { cursor: pointer; font-size: 13.5px; font-weight: 750; color: var(--blue); }
.sx .ro-compare ul { list-style: none; padding: 0; display: grid; gap: 6px; margin-top: 8px; }
.sx .ro-compare li { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; line-height: 1.45; }
.sx .ro-compare .num { width: 21px; height: 21px; font-size: 11.5px; margin-top: 1px; }
.sx .ro-block .ruler, .sx .ro-block .translator { display: block; width: 100%; height: auto; }
.sx .vis-note { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.sx .ro-empty { padding: 20px 18px; }
.sx .ro-empty h3 { margin-bottom: 6px; font-size: 20px; }
.sx .ro-empty p { font-size: 15.5px; }

/* 5d. What the overlays mean */
.sx .overlay-notes { margin-top: 20px; }
.sx .notes-title { margin-bottom: 10px; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.sx .note-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.sx .note-card { padding: 14px 16px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 14px; background: #ffffff; box-shadow: var(--shadow); }
.sx .note-card.gold { border-top-color: #a6762a; }
.sx .note-card h3 { margin-bottom: 6px; font-size: 16px; }
.sx .note-card p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

/* print-only blocks stay hidden on screen */
.sx .print-head, .sx .print-scores, .sx .chc-print { display: none; }

/* ---- 6. CHC abilities ------------------------------------------------ */
.sx .chc-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.sx .chc-map { padding: 20px; background: #f7f9fd; border-right: 1px solid var(--line-2); border-radius: var(--radius) 0 0 var(--radius); }
.sx .g-factor { display: block; width: 100%; padding: 14px 18px; text-align: center; border: 1px solid #c9d8ee; border-radius: 12px; background: #e8effa; }
.sx .g-factor b { display: block; font-size: 16.5px; color: var(--navy); }
.sx .g-factor span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.sx .g-factor:hover { border-color: var(--blue-line); }
.sx .g-factor[aria-pressed='true'] { border-color: var(--blue); background: #dfe9f9; box-shadow: inset 0 0 0 1px var(--blue); }
.sx .hierarchy-line { width: 2px; height: 20px; margin: 0 auto; background: #c3d0e2; }
.sx .broad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Group colors follow the broad groupings in Schneider & McGrew (2012). */
.sx [data-group='reason'] { --g: #2459a3; --gb: #e6eefa; --gl: #b5c9e6; }
.sx [data-group='memory'] { --g: #6b4596; --gb: #efe8f8; --gl: #d4c4ea; }
.sx [data-group='speed'] { --g: #a3385f; --gb: #fae8ee; --gl: #ecc3d1; }
.sx [data-group='percept'] { --g: #0f6b65; --gb: #e4f3f0; --gl: #bfe0d9; }
.sx [data-group='knowledge'] { --g: #8a4b1c; --gb: #f7eadf; --gl: #e8cdb5; }
.sx .ability-btn { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 12px; text-align: left; border: 1.5px solid var(--line); border-radius: 12px; background: #ffffff; transition: border-color 0.15s, box-shadow 0.15s; }
.sx .ability-btn:hover { border-color: var(--gl); box-shadow: 0 2px 8px rgba(15, 35, 65, 0.08); }
.sx .ability-btn[aria-pressed='true'] { border-color: var(--g); background: var(--gb); box-shadow: inset 4px 0 0 var(--g); }
.sx .ability-code, .sx .other-btn, .sx .ability-detail .eyebrow { font-feature-settings: 'cv05' 1; }
.sx .ability-code { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 50px; height: 40px; padding: 0 6px; border: 1px solid var(--gl); border-radius: 10px; background: var(--gb); color: var(--g); font-size: 17px; font-weight: 800; }
.sx .ability-btn[aria-pressed='true'] .ability-code { background: #ffffff; }
.sx .chc-groups { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.sx .chc-groups span { display: inline-flex; align-items: center; gap: 6px; }
.sx .chc-groups i { width: 11px; height: 11px; border-radius: 3px; background: var(--g); }
.sx .ability-detail .eyebrow[data-group] { color: var(--g); }
.sx .ability-name { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.sx .ability-name small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.sx .other-abilities { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; font-weight: 750; color: var(--faint); }
.sx .other-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sx .other-btn { min-width: 46px; min-height: 34px; border: 1.5px solid var(--line); border-radius: 8px; background: #ffffff; color: var(--muted); font-size: 14px; font-weight: 750; }
.sx .other-btn[aria-pressed='true'] { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }
.sx .chc-foot { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.sx .ability-detail { min-height: 520px; padding: 22px 24px; }
.sx .ability-detail h3 { margin: 2px 0 4px; font-size: 28px; letter-spacing: -0.6px; }
.sx .ability-detail .alias { margin-bottom: 12px; font-size: 14.5px; color: var(--muted); }
.sx .ability-detail .description { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; background: #f4f7fc; font-size: 17px; line-height: 1.6; color: var(--ink); }
.sx .dtabs { display: flex; gap: 2px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.sx .dtabs button { margin-bottom: -1px; padding: 10px 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-size: 14.5px; font-weight: 650; white-space: nowrap; }
.sx .dtabs button:hover { color: var(--navy); }
.sx .dtabs button[aria-selected='true'] { color: var(--navy); border-bottom-color: var(--blue); }
.sx .ability-detail h4 { margin: 16px 0 8px; font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--blue); }
.sx .dpanel > h4:first-child, .sx .dpanel > .acad-grid:first-child h4 { margin-top: 0; }
.sx .ability-detail ul { padding-left: 20px; }
.sx .ability-detail li { margin-bottom: 5px; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.sx .narrow .code { margin: 0 4px; padding: 1px 6px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 750; }
.sx .interpretation { margin-top: 16px; padding: 12px 15px; border-left: 3px solid var(--gold); border-radius: 0 9px 9px 0; background: var(--gold-soft); color: #5e4716; font-size: 15px; line-height: 1.65; }
.sx .acad-grid { display: grid; gap: 10px; }
.sx .acad { padding: 12px 15px; border: 1px solid var(--line-2); border-radius: 11px; background: #fbfcfe; }
.sx .acad h4 { margin: 0 0 4px; }
.sx .acad p { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.sx .strength-box { padding: 12px 16px; border: 1px solid var(--teal-line); border-radius: 11px; background: var(--teal-soft); }
.sx .ability-detail .strength-box h4 { margin: 0 0 4px; color: var(--teal-ink); }
.sx .strength-box p { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.sx .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sx table.measured { width: 100%; border-collapse: collapse; font-size: 15px; }
.sx table.measured th, .sx table.measured td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.sx table.measured thead th { font-size: 12.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); background: none; position: static; }
.sx table.measured tbody th { white-space: nowrap; font-weight: 750; color: var(--ink); }

/* ---- 7. SLD reference ------------------------------------------------ */
.sx .sld-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 20px; }
.sx .sld-inputs { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.sx .sld-inputs .helper { margin-top: 0; }
.sx .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sx .sld-output { padding: 22px 24px; }
.sx .sld-output h3 { margin-bottom: 6px; font-size: 20px; }
.sx .sld-output .note { margin-bottom: 0; }
.sx .sld-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 10px 0 14px; }
.sx .sld-result strong { display: block; font-size: 36px; line-height: 1.1; letter-spacing: -0.8px; color: var(--ink); }
.sx .sld-result strong.gold { color: var(--gold-ink); }
.sx .sld-result span { font-size: 13.5px; color: var(--muted); }
.sx .sld-mini-chart { display: block; width: 100%; max-width: 700px; height: auto; margin: 0 0 10px; }
.sx .sld-comparison { margin-bottom: 10px; padding: 12px 16px; border: 1px solid var(--gold-line); border-radius: 10px; background: var(--gold-soft); font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.sx .subsection { margin-top: 18px; }
.sx .subsection > summary { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; color: var(--ink); font-size: 15.5px; font-weight: 750; cursor: pointer; }
.sx .subsection[open] > summary { border-radius: 12px 12px 0 0; }
.sx .table-wrap { overflow: hidden; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: #ffffff; }
.sx .sld-table { max-height: 380px; overflow: auto; }
.sx table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sx caption { padding: 12px 16px; text-align: left; caption-side: top; font-size: 14px; line-height: 1.55; color: var(--muted); }
.sx thead th { position: sticky; top: 0; z-index: 1; background: #f2f6fb; color: var(--ink-2); font-size: 13.5px; }
.sx .sld-table th, .sx .sld-table td, .sx .conversion-scroll th, .sx .conversion-scroll td { padding: 9px 16px; text-align: center; font-size: 15px; border-bottom: 1px solid var(--line-2); }
.sx .sld-table tbody th { font-weight: 650; }
.sx .sld-table tr.current { background: #e7eefa; box-shadow: inset 4px 0 var(--blue); }
.sx .selected-col { color: var(--blue); font-weight: 800; }

/* ---- 8. Report language ---------------------------------------------- */
.sx .report-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.sx .report-settings { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.sx .report-settings .helper { margin-top: -4px; }
.sx .checks { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; }
.sx .checks legend { margin-bottom: 6px; font-size: 13.5px; font-weight: 750; color: var(--muted); }
.sx .checks label { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--ink-2); }
.sx .checks input { width: 18px; height: 18px; accent-color: var(--navy); }
.sx .band-table { font-size: 14px; }
.sx .band-table caption { padding: 0 0 8px; font-size: 13.5px; }
.sx .band-table th, .sx .band-table td { padding: 7px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.sx .band-table thead th { position: static; background: none; font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--faint); }
.sx .band-table tbody th { font-weight: 700; color: var(--ink); }
.sx .band-table tbody th small { display: block; margin: 1px 0 0 17px; font-size: 13px; font-weight: 500; color: var(--muted); }
.sx .band-table td { white-space: nowrap; }
.sx .band-dot { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(15, 35, 65, 0.18); border-radius: 3px; }
.sx .report-output { padding: 20px 22px; }
.sx .rl-group h4, .sx .tips h4 { margin-bottom: 10px; font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--blue); }
.sx .rl-group + .rl-group { margin-top: 22px; }
.sx .rl-block { position: relative; margin-bottom: 10px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fbfcfe; }
.sx .rl-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding-right: 76px; font-size: 14px; font-weight: 750; color: var(--muted); }
.sx .rl-label .num { width: 21px; height: 21px; font-size: 11.5px; }
.sx .rl-text { font-size: 16.5px; line-height: 1.7; color: var(--ink); }
.sx .rl-block .btn.sm { position: absolute; top: 9px; right: 10px; }
.sx .tips { margin-top: 22px; padding: 14px 18px; border: 1px solid var(--teal-line); border-radius: 12px; background: var(--teal-soft); }
.sx .tips h4 { color: var(--teal-ink); }
.sx .tips ul { padding-left: 20px; }
.sx .tips li { margin-bottom: 4px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* ---- 9. Conversion table --------------------------------------------- */
.sx .conversion-panel { overflow: hidden; }
.sx .reference-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.sx .reference-tools .field { min-width: 250px; }
.sx .small-count { margin: 0 0 10px auto; font-size: 14px; color: var(--muted); }
.sx .conversion-scroll { max-height: 470px; overflow: auto; }
.sx .conversion-scroll tbody tr:hover { background: #f3f7fc; }
.sx .table-mean { background: #e7eefa; font-weight: 750; }
.sx thead th small { font-size: 12px; font-weight: 500; color: var(--faint); }
.sx .table-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }

/* ---- 10. Notes and sources -------------------------------------------- */
.sx .guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sx .guide-card { padding: 20px 22px; }
.sx .guide-number { display: block; margin-bottom: 10px; font-size: 12.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue); }
.sx .guide-card h3 { margin-bottom: 8px; font-size: 19px; }
.sx .guide-card p { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.sx .guide-card .mini { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--navy); font-size: 14.5px; }
.sx .faq { margin-top: 18px; padding: 6px 22px; }
.sx .faq details { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.sx .faq details:last-child { border-bottom: 0; }
.sx .faq summary { cursor: pointer; font-size: 16.5px; font-weight: 650; color: var(--ink); }
.sx .faq p { max-width: 1000px; margin-top: 10px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.sx .sources { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 28px; margin-top: 18px; padding: 22px 24px; scroll-margin-top: calc(var(--sx-top) + 76px); }
.sx .sources h3 { margin-bottom: 8px; font-size: 21px; }
.sx .sources p:not(.eyebrow) { font-size: 14.5px; line-height: 1.65; color: var(--muted); }
.sx .source-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; }
.sx .source-list li { scroll-margin-top: calc(var(--sx-top) + 90px); }
.sx .source-list a, .sx .source-list .src-title { display: block; font-size: 15px; font-weight: 750; color: var(--blue); text-decoration: none; }
.sx .source-list .src-title { color: var(--ink); }
.sx .source-list a:hover { text-decoration: underline; }
.sx .source-list span:not(.src-title) { display: block; margin-top: 3px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.sx .closing-note { margin: 28px 2px 0; font-size: 14px; color: var(--muted); }

/* ---- 11. Dialog, toast, utilities ------------------------------------ */
.sx .sx-dialog { width: min(1200px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(10, 25, 50, 0.45); }
.sx .sx-dialog::backdrop { background: rgba(10, 22, 44, 0.64); }
.sx .dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); background: #ffffff; }
.sx .dlg-head h2 { font-size: 18px; }
.sx .dlg-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; font-size: 26px; line-height: 1; }
.sx .sx-dialog figure { margin: 0; padding: 18px; }
.sx .sx-dialog img { display: block; width: 100%; height: auto; }
.sx .sx-dialog figcaption { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.sx .toast { position: fixed; left: 50%; bottom: 24px; z-index: 1200; display: flex; align-items: center; gap: 14px; max-width: min(660px, 92vw); padding: 12px 14px 12px 18px; transform: translateX(-50%); border-radius: 12px; background: #15253b; color: #ffffff; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.sx .toast-act { flex-shrink: 0; padding: 6px 13px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 8px; background: transparent; color: #ffffff; font-weight: 750; }
.sx .toast-act:hover { background: rgba(255, 255, 255, 0.12); }
.sx [hidden] { display: none !important; }
.sx .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sx .skip { position: absolute; top: -80px; left: 20px; z-index: 300; padding: 12px 16px; border-radius: 8px; background: #ffffff; color: var(--navy); font-weight: 700; }
.sx .skip:focus { top: 12px; }
.sx kbd { margin-left: 6px; padding: 0 5px; border: 1px solid rgba(21, 37, 59, 0.3); border-radius: 4px; font: inherit; font-size: 11.5px; }

/* ---- 12. Presentation mode (body.meeting) ----------------------------- */
.sx .pbar { position: sticky; top: 0; z-index: 95; background: rgba(12, 28, 54, 0.97); color: #e9f0fa; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.sx .pbar-in { display: flex; align-items: center; gap: 16px; max-width: 1560px; margin: 0 auto; padding: 10px 24px; }
.sx .pbar-title { flex: 1; min-width: 0; overflow: hidden; color: #ffffff; font-size: 17px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.sx .pbar-nav { display: flex; align-items: center; gap: 10px; }
.sx .p-pos { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 240px; font-size: 15.5px; white-space: nowrap; }
.sx .p-name { color: #ffffff; font-weight: 750; }
.sx .p-count { color: #a9bbd6; font-size: 14px; }
.sx .pbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sx .pbtn { min-height: 40px; padding: 6px 14px; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 9px; background: rgba(255, 255, 255, 0.06); color: #ffffff; font-size: 14.5px; font-weight: 650; }
.sx .pbtn:hover { background: rgba(255, 255, 255, 0.15); }
.sx .pbtn.icon { width: 46px; padding: 0; font-size: 28px; line-height: 1; }
.sx .pbtn[aria-pressed='true'], .sx .pbtn[aria-expanded='true'] { background: #e6c172; border-color: #e6c172; color: #1a2a40; }
.sx .pbtn.exit { background: #ffffff; border-color: #ffffff; color: #15253b; }
.sx .pseg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.sx .pseg button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; white-space: nowrap; border: 0; border-radius: 7px; background: transparent; color: #d7e2f2; font-size: 13.5px; font-weight: 650; }
.sx .pseg button .icon { width: 18px; height: 18px; }
.sx .pseg button[aria-pressed='true'] { background: #ffffff; color: #15253b; }
.sx .pbar .menu-pop { color: var(--ink-2); }
.sx .pbar .menu-pop.wide { min-width: 520px; }
.sx .pbar .ov-chips { gap: 6px; }

body.meeting { background: #0e2240; }
body.meeting .navbar, body.meeting .site-footer-unified { display: none !important; }
.meeting .sx { min-height: 100vh; padding-bottom: 30px; background: linear-gradient(160deg, #0e2240 0%, #163a72 100%); }
.meeting .sx .sx-hero, .meeting .sx .sx-bar, .meeting .sx .table-panel, .meeting .sx .section, .meeting .sx .closing-note,
.meeting .sx .chart-head, .meeting .sx .ov-bar, .meeting .sx .ov-settings, .meeting .sx .overlay-notes, .meeting .sx .ro-steps,
.meeting .sx .scroll-hint, .meeting .sx .skip, .meeting .sx .ro-compare { display: none !important; }
.meeting .sx-shell { max-width: 1600px; padding: 0 24px; }
.meeting .sx .workspace { margin-top: 18px; }
.meeting .sx .stage { grid-template-columns: minmax(0, 1fr) 430px; margin-top: 0; gap: 18px; }
.meeting .sx .chart-panel, .meeting .sx .side-panel { border: 0; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.meeting .sx .side-panel { position: sticky; top: 74px; max-height: calc(100vh - 92px); }
.meeting .sx .side-panel .panel-head { display: none; }
.meeting .sx .chart-scroll { padding: 12px 0 0; }
.meeting .sx .chart-scroll svg { min-width: 0; max-height: calc(100vh - 116px); }
.meeting .sx .chart-scroll [data-drag] { cursor: pointer; }
.meeting .sx .legend .key-chip { font-size: 15.5px; }
.meeting .sx .chart-caption { font-size: 15px; }
.meeting .sx .ro-score { padding-top: 16px; }
.meeting .sx .ro-eyebrow { display: none; }
.meeting .sx .ro-name { font-size: 25px; }
.meeting .sx .ro-value b { font-size: 48px; }
.meeting .sx .ro-block.family p { margin-bottom: 6px; font-size: 17.5px; line-height: 1.5; }
.meeting .sx .stat-list dd { font-size: 16px; }
.meeting .sx .stat-list dd b { font-size: 17px; }
.meeting .sx .tile b { font-size: 23px; }
.meeting .sx .tile small { font-size: 13.5px; }

/* ---- 13. Responsive ----------------------------------------------------- */
@media (max-width: 1400px) {
  .sx .pbar-title { display: none; }
  .sx .pseg button .icon, .sx .chart-head .chart-types .icon { display: none; }
  .sx .p-pos { min-width: 200px; }
}
@media (max-width: 1320px) {
  .sx .sx-actions .lbl { display: none; }
  .sx .sx-actions #present .lbl { display: inline; }
  .sx .sx-actions .btn.ghost { padding: 8px 10px; }
  .sx .stage { grid-template-columns: minmax(0, 1fr) 370px; }
  .sx .sx-flow li span { display: none; }
  .sx .sx-flow li { padding-right: 10px; }
}
/* Medium widths: each score becomes a two-line row (name, score, scale / interval, level, measures, where it falls). */
@media (max-width: 1240px) and (min-width: 641px) {
  .sx .score-table, .sx .score-table thead, .sx .score-table tbody { display: block; }
  .sx .score-table thead tr, .sx .srow { display: grid; grid-template-columns: 44px repeat(12, minmax(0, 1fr)); gap: 6px 8px; align-items: center; padding: 8px 16px; }
  .sx .score-table thead tr { padding-top: 7px; padding-bottom: 7px; background: #f5f8fc; border-bottom: 1px solid var(--line-2); }
  .sx .score-table thead th, .sx .srow td { display: block; width: auto; min-width: 0; padding: 0 !important; border: 0; background: none !important; }
  .sx .score-table .c-num { grid-column: 1; grid-row: 1 / span 2; }
  .sx .score-table .c-name { grid-column: 2 / span 5; grid-row: 1; }
  .sx .score-table .c-val { grid-column: 7 / span 2; grid-row: 1; }
  .sx .score-table .c-scale { grid-column: 9 / span 3; grid-row: 1; }
  .sx .score-table .c-act { grid-column: 12 / span 2; grid-row: 1; }
  .sx .score-table .c-ci { grid-column: 2 / span 4; grid-row: 2; }
  .sx .score-table .c-lvl { grid-column: 6 / span 2; grid-row: 2; }
  .sx .score-table .c-type { grid-column: 8 / span 3; grid-row: 2; }
  .sx .score-table .c-desc { grid-column: 11 / span 3; grid-row: 2; }
  .sx .srow { border-bottom: 1px solid var(--line-2); }
  .sx .srow:hover { background: #fafcff; }
  .sx .srow.selected { background: #f0f5fd; box-shadow: inset 5px 0 0 var(--c); }
  .sx .srow.selected td:first-child { box-shadow: none; }
  .sx .ci-pair .fld { width: auto; flex: 1; }
  .sx .srow-more, .sx .srow-err { display: block; }
  .sx .srow-more td, .sx .srow-err td { display: block; padding: 0 16px 10px 68px; border: 0; }
  .sx .srow-more td:first-child, .sx .srow-err td:first-child { display: none; }
  .sx .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sx .stage { grid-template-columns: minmax(0, 1fr); }
  .sx .side-panel { position: static; max-height: none; overflow: visible; }
  .sx .side-panel .panel-head { position: static; }
  .sx .ro-body { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
  .meeting .sx .stage { grid-template-columns: minmax(0, 1fr); }
  .meeting .sx .side-panel { position: static; max-height: none; }
  .sx .pbar-in { flex-wrap: wrap; gap: 10px; }
  .sx .pseg button span { display: none; }
}
@media (max-width: 1000px) {
  .sx .chc-layout, .sx .sld-layout, .sx .report-layout { grid-template-columns: minmax(0, 1fr); }
  .sx .chc-map { border-right: 0; border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; }
  .sx .ability-detail { min-height: 0; }
  .sx .guide-grid, .sx .sources { grid-template-columns: minmax(0, 1fr); }
  .sx .sec-head { flex-direction: column; align-items: flex-start; }
  .sx .sec-actions { justify-content: flex-start; }
  .sx .sx-hero-in { flex-direction: column; align-items: flex-start; gap: 14px; }
  .sx .p-pos { min-width: 0; }
}
@media (max-width: 760px) {
  .sx .ov-bar { grid-template-columns: minmax(0, 1fr); }
  .sx .ov-label { flex-direction: row; align-items: center; gap: 8px; }
}
@media (max-width: 640px) {
  .sx { font-size: 15px; }
  .sx-shell { padding: 0 14px; }
  .sx .sx-hero h1 { font-size: 30px; letter-spacing: -1px; }
  .sx .sx-lede { font-size: 15.5px; }
  .sx .sx-flow { display: none; }
  .sx .sx-bar-in { gap: 6px; }
  .sx .sx-tabs { flex: 1; }
  .sx .sx-tabs a { padding: 0 9px; font-size: 14px; }
  .sx .sx-actions .lbl, .sx .sx-actions #present .lbl { display: none; }
  .sx .sx-actions .btn { padding: 8px 9px; }
  .sx .sec-head h2 { font-size: 26px; }
  .sx .panel-head { padding: 12px 14px; }
  .sx .table-panel .ph-tools { margin-left: 0; width: 100%; }
  .sx .table-panel .inline-field { flex: 1 1 100%; justify-content: space-between; }
  .sx .table-panel #profile, .sx .table-panel #st-name { width: auto; flex: 1; }
  /* score table becomes one card per score, with a small label over each field */
  .sx .score-table thead { display: none; }
  .sx .score-table, .sx .score-table tbody { display: block; }
  .sx .srow { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr) 96px; grid-template-areas: 'num name name act' 'num val scale scale' 'num ci ci lvl' 'num type type type' 'num desc desc desc'; gap: 8px 10px; padding: 12px; border-bottom: 1px solid var(--line-2); }
  .sx .srow td { display: block; width: auto; padding: 0 !important; border: 0; background: none !important; }
  .sx .srow td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); }
  .sx .srow.selected { background: #f0f5fd; box-shadow: inset 5px 0 0 var(--c); }
  .sx .srow.selected td:first-child { box-shadow: none; }
  .sx .c-num { grid-area: num; } .sx .c-name { grid-area: name; min-width: 0; } .sx .c-val { grid-area: val; } .sx .c-scale { grid-area: scale; }
  .sx .c-ci { grid-area: ci; } .sx .c-lvl { grid-area: lvl; } .sx .c-type { grid-area: type; } .sx .c-desc { grid-area: desc; } .sx .c-act { grid-area: act; }
  .sx .ci-pair .fld { width: auto; flex: 1; }
  .sx .srow-more, .sx .srow-err { display: block; }
  .sx .srow-more td, .sx .srow-err td { display: block; padding: 0 12px 12px; border: 0; }
  .sx .srow-more td:first-child, .sx .srow-err td:first-child { display: none; }
  .sx .more-grid { grid-template-columns: minmax(0, 1fr); }
  .sx .st-foot { flex-direction: column; align-items: flex-start; }
  .sx .chart-head .chart-types .icon { display: block; }
  .sx .chart-head .chart-types span { display: none; }
  .sx .ch-tail { flex-wrap: wrap; }
  .sx .ch-tail .title-field { flex-basis: 100%; }
  .sx .chart-head .ov-tools { margin-left: 0; }
  .sx .table-panel #table-toggle .lbl { display: none; }
  .sx .ov-bar { padding: 10px 14px; }
  .sx .set-row [data-sld='ability'], .sx .set-row [data-sld='test'] { width: 100%; }
  .sx .set-row label { flex: 1 1 100%; }
  .sx .set-row .fld.fnum { width: 100%; }
  .sx .dc-group { flex-direction: column; gap: 6px; }
  .sx .dc-label { flex-basis: auto; padding: 0; }
  .sx .menu-pop, .sx .menu-pop.wide { position: fixed; left: 10px; right: 10px; top: auto; min-width: 0; max-height: 70vh; overflow: auto; }
  .sx .context-points, .sx .two-col, .sx .source-list, .sx .pair { grid-template-columns: minmax(0, 1fr); }
  .sx .broad-grid { gap: 8px; }
  .sx .ability-btn { gap: 8px; padding: 9px; }
  .sx .ability-detail { padding: 18px; }
  .sx .ability-detail h3 { font-size: 24px; }
  .sx .sld-result strong { font-size: 28px; }
  .sx .reference-tools .field { min-width: 0; flex: 1 1 100%; }
  .sx .small-count { margin-left: 0; }
  .sx .pbtn { padding: 6px 10px; font-size: 13.5px; }
  .sx .seg.views button { font-size: 13px; }
}
@media (max-width: 520px) {
  .sx .broad-grid { grid-template-columns: minmax(0, 1fr); }
  .sx .ability-btn { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sx * { transition: none !important; scroll-behavior: auto !important; }
}
/* ---- 14. Print: one-page score summary, references on request -----------
   Score summary (the default, and what the browser's own print command gives):
   dated header, chart with its caption, and a table of the plotted scores.
   Summary with references (body[data-print-scope='full']) adds the ten CHC
   definitions in report wording, the SLD lookup if it has been used, and sources.
   Controls, the score table, the Explain panel, and site chrome never print, and
   backgrounds are dropped to save ink. */
@media print {
  @page { margin: 0.5in 0.55in; }
  html, body { background: #ffffff !important; }
  .navbar, .site-footer-unified,
  .sx .skip, .sx .sx-hero, .sx .sx-bar, .sx .pbar, .sx .table-panel, .sx .chart-head, .sx .ov-bar, .sx .ov-settings,
  .sx .scroll-hint, .sx .legend, .sx .side-panel, .sx .overlay-notes, .sx #report, .sx #conversions, .sx #notes > .sec-head,
  .sx .guide-grid, .sx .faq, .sx .sec-actions, .sx .chc-layout, .sx .chc-groups, .sx #chc > .panel, .sx .closing-note, .sx .toast, .sx .sx-dialog,
  .sx .sld-inputs, .sx .subsection, .sx .note a[href^='#'], .sx .menu-pop, .sx .palette,
  .sx #chc .sec-head p:not(.eyebrow), .sx #sld .sec-head p:not(.eyebrow) { display: none !important; }
  body:not([data-print-scope='full']) .sx #chc, body:not([data-print-scope='full']) .sx #sld, body:not([data-print-scope='full']) .sx #notes { display: none !important; }
  .sx { padding: 0; background: #ffffff; color: #111111; font-size: 10pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sx-shell { max-width: none; padding: 0; }
  .sx a { color: inherit; text-decoration: none; }
  .sx .eyebrow { margin-bottom: 3pt; font-size: 7.5pt; color: #444444; }

  .sx .print-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12pt; margin: 0 0 8pt; padding: 0 0 5pt; border-bottom: 1.5pt solid #111111; }
  .sx .print-head b { display: block; font-size: 15pt; line-height: 1.15; letter-spacing: -0.3pt; }
  .sx .print-head span { display: block; font-size: 8pt; line-height: 1.5; color: #444444; }
  .sx .print-head > div:last-child { max-width: 58%; text-align: right; }

  .sx .panel { background: #ffffff; border: 1px solid #c8c8c8; border-radius: 4pt; box-shadow: none; break-inside: avoid; }
  .sx .workspace, .sx .stage { display: block; margin: 0; }
  .sx .chart-panel { margin: 0 0 6pt; }
  .sx .chart-scroll { overflow: visible; padding: 4pt 0 0; }
  .sx .chart-scroll svg { min-width: 0; width: 100%; height: auto; max-height: 5.4in; }
  .sx .chart-caption { margin: 0; padding: 4pt 10pt 5pt; border-top: 1px solid #dddddd; border-radius: 0; background: none; font-size: 8pt; line-height: 1.45; color: #333333; }

  .sx .print-scores { display: block; break-inside: avoid; }
  .sx .print-scores table { width: 100%; border-collapse: collapse; font-size: 8.3pt; text-align: left; }
  .sx .print-scores caption { padding: 0 0 3pt; font-size: 7.5pt; line-height: 1.4; text-align: left; color: #444444; }
  .sx .print-scores th, .sx .print-scores td { padding: 2.5pt 5pt; text-align: left; vertical-align: top; white-space: nowrap; border-bottom: 1px solid #dddddd; font-size: 8.3pt; }
  .sx .print-scores tbody th, .sx .print-scores td:last-child { white-space: normal; }
  .sx .print-scores thead th { position: static; background: none; border-bottom: 1px solid #999999; font-size: 7pt; letter-spacing: 0.3pt; text-transform: uppercase; color: #333333; }
  .sx .print-scores thead th.lc { text-transform: none; font-size: 8pt; }
  .sx .print-scores tbody th { color: #111111; font-weight: 600; }
  .sx .print-dot { display: inline-flex; align-items: center; justify-content: center; width: 13pt; height: 13pt; border-radius: 50%; color: #ffffff; font-size: 7.5pt; font-weight: 700; }

  .sx .section { margin-top: 0; }
  .sx .sec-head { display: block; margin: 0 0 6pt; break-after: avoid; }
  .sx .sec-head h2 { padding-left: 0; font-size: 14pt; margin-bottom: 3pt; }
  .sx .sec-head h2::before { display: none; }
  .sx .sec-head p:not(.eyebrow) { font-size: 9pt; color: #333333; }
  .sx .note, .sx .note.gold { margin: 5pt 0; padding: 5pt 8pt; border: 1px solid #cccccc; border-radius: 3pt; background: none; font-size: 8.3pt; line-height: 1.45; color: #222222; break-inside: avoid; }
  .sx #chc { break-before: page; }
  .sx .chc-print { display: grid; grid-template-columns: 1fr 1fr; gap: 5pt; margin-top: 5pt; }
  .sx .chc-print article { padding: 4.5pt 7pt; border: 1px solid #cccccc; border-radius: 3pt; break-inside: avoid; }
  .sx .chc-print h3 { margin: 0 0 2pt; font-size: 9pt; }
  .sx .chc-print p { margin: 0 0 2.5pt; font-size: 7.8pt; line-height: 1.42; color: #222222; }
  .sx .chc-print p:last-child { margin: 0; }

  .sx #sld { display: none; }
  body.sld-used .sx #sld { display: block; break-before: page; }
  .sx .sld-layout { display: block; }
  .sx .sld-output { padding: 8pt 10pt; }
  .sx .sld-output h3 { margin: 0 0 4pt; font-size: 11pt; }
  .sx .sld-result { gap: 6pt; padding: 4pt 0; }
  .sx .sld-result strong { font-size: 16pt; }
  .sx .sld-result span { font-size: 7.5pt; color: #444444; }
  .sx .sld-mini-chart { max-width: 5.5in; }
  .sx .sld-comparison { padding: 5pt 8pt; border: 1px solid #cccccc; background: none; font-size: 8.5pt; line-height: 1.45; color: #222222; }
  .sx .sld-output .helper { font-size: 8pt; line-height: 1.45; color: #333333; }

  .sx #notes { margin-top: 10pt; }
  .sx .sources { display: block; margin-top: 0; padding: 8pt 0 0; border: 0; border-top: 1px solid #999999; border-radius: 0; }
  .sx .sources h3 { font-size: 11pt; }
  .sx .sources p:not(.eyebrow) { margin: 0 0 4pt; font-size: 8pt; color: #333333; }
  .sx .source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4pt 12pt; margin-top: 6pt; }
  .sx .source-list li { break-inside: avoid; }
  .sx .source-list a, .sx .source-list .src-title { font-size: 8pt; color: #111111; }
  .sx .source-list span:not(.src-title) { margin-top: 1pt; font-size: 7.5pt; line-height: 1.45; color: #444444; }
}
