.selftest-container{max-width:1000px}.selftest-heading{margin:0 0 1.4rem}.selftest-heading h1{font-size:clamp(1.8rem,4vw,2.6rem);color:#123b63;letter-spacing:-.035em}.selftest-heading p{color:#5c6b7b;max-width:720px;margin-top:.5rem}.self-source{min-height:210px;resize:vertical;line-height:1.65;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.self-setup-grid{display:grid;grid-template-columns:minmax(180px,260px) minmax(0,1fr);align-items:center;gap:1rem;margin:1rem 0}.self-check{display:flex;align-items:center;gap:.65rem;padding:.8rem 1rem;border:1px solid #d7e0e8;border-radius:10px;background:#f8fafc}.self-check input{width:18px;height:18px;accent-color:#174f7c}.self-check strong,.self-check small{display:block}.self-check strong{font-size:.9rem}.self-check small{font-size:.78rem;color:#687789;margin-top:.15rem}.self-message{margin-top:.7rem;color:#9a3412;font-size:.85rem}.self-workspace[hidden],.self-result[hidden],.self-pdf-row[hidden],.self-passage-card[hidden]{display:none!important}.self-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem}.self-timer-block{display:flex;flex-direction:column}.self-metric-label,.self-section-label{font-size:.7rem;letter-spacing:.12em;font-weight:800;color:#687789}.self-timer-block strong{font-variant-numeric:tabular-nums;font-size:1.8rem;color:#123b63}.self-toolbar-actions{display:flex;flex-wrap:wrap;gap:.5rem}.self-toolbar-actions .btn{padding:.6rem .85rem;font-size:.85rem}.self-passage-card,.self-type-card{margin-top:1rem}.self-passage{font-family:Consolas,'Courier New',monospace;font-size:1.08rem;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;color:#243548;margin-top:.8rem}.self-highlight-enabled .self-current{background:#fde68a;color:#1f2937;border-radius:2px}.self-char-correct{color:#18794e}.self-char-wrong{color:#b42318;background:#fee2e2;border-radius:2px}.self-typed{min-height:190px;resize:vertical;font-family:Consolas,'Courier New',monospace;line-height:1.75;margin-top:.8rem}.self-hint{font-size:.8rem;color:#748194;margin-top:.65rem}.self-pdf-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem 1.2rem;margin-top:1rem;border:1px solid #d6e3ed;border-radius:12px;background:#f0f6fb}.self-pdf-row p{font-size:.83rem;color:#607183;margin-top:.25rem}.self-result h2{color:#123b63;margin:.4rem 0 1rem}.self-result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin:1rem 0}.self-result-grid>div{padding:1rem;border:1px solid #dce4ec;border-radius:10px;background:#f8fafc}.self-result-grid span,.self-result-grid strong{display:block}.self-result-grid span{font-size:.78rem;color:#6b7888}.self-result-grid strong{font-size:1.45rem;color:#123b63;margin-top:.35rem;font-variant-numeric:tabular-nums}.self-result-note{font-size:.82rem;color:#697789;margin-bottom:1rem}@media(max-width:650px){.self-setup-grid{grid-template-columns:1fr}.self-toolbar{align-items:flex-start;flex-direction:column}.self-toolbar-actions{width:100%}.self-toolbar-actions .btn{flex:1}.self-pdf-row{align-items:flex-start;flex-direction:column}.self-result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Long-passage guardrails: the passage scrolls inside its own fixed-height panel. */
.self-source{height:clamp(160px,28vh,280px);max-height:38vh;overflow:auto;resize:vertical}
.self-passage{height:clamp(180px,26vh,300px);max-height:300px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:.2rem .35rem}
.self-typed{height:clamp(180px,24vh,280px);max-height:320px;overflow:auto;resize:vertical}
.self-analysis-breakdown,.self-result-comparison{margin-top:1rem;padding-top:1rem;border-top:1px solid #dce4ec}
.self-analysis-breakdown h3,.self-result-comparison h3{font-size:1rem;color:#123b63;margin-bottom:.8rem}
.self-analysis-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.65rem}
.self-analysis-grid>div{min-width:0;padding:.75rem;border:1px solid #dce4ec;border-radius:9px;background:#f8fafc}
.self-analysis-grid span,.self-analysis-grid strong{display:block}
.self-analysis-grid span{font-size:.75rem;line-height:1.35;color:#687789}
.self-analysis-grid strong{font-size:1.25rem;color:#123b63;margin-top:.3rem;font-variant-numeric:tabular-nums}
.self-result-typed{height:clamp(180px,26vh,320px);max-height:320px;overflow:auto;overscroll-behavior:contain;white-space:pre-wrap;overflow-wrap:anywhere;padding:1rem;border:1px solid #dce4ec;border-radius:10px;background:#fff;line-height:1.9;font-family:Consolas,'Courier New',monospace}
.self-token-wrong,.self-token-missing,.self-token-extra{color:#b42318;background:#fee2e2;border-radius:3px;padding:0 .15rem;font-weight:700}
.self-token-unreached{color:#64748b;background:#f1f5f9;border-radius:3px;padding:0 .15rem}
.self-token-match{color:#18794e}
@media(max-width:760px){.self-analysis-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.self-source{max-height:32vh}.self-passage,.self-result-typed{height:220px;max-height:220px}.self-typed{height:210px;max-height:260px}}


.selftest-heading{display:flex;align-items:center;justify-content:space-between;gap:1.25rem;padding:1.15rem 1.25rem;border:1px solid #dbe5ee;border-radius:16px;background:linear-gradient(120deg,#f3faff,#fff 65%);box-shadow:0 8px 24px rgba(18,59,99,.06)}
.selftest-heading-copy{min-width:0;flex:1}
.selftest-thumbnail{display:block;width:min(34%,300px);height:auto;aspect-ratio:16/9;object-fit:cover;object-position:center;border-radius:12px;border:1px solid #d6e1eb;box-shadow:0 8px 20px rgba(12,44,74,.14)}
@media(max-width:640px){.selftest-heading{align-items:stretch;flex-direction:column}.selftest-thumbnail{width:100%;max-width:420px;margin:.25rem auto 0}.selftest-heading-copy{width:100%}}

/* Self-test parity controls and live typing dashboard */
.self-saved-tools{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr);gap:1rem;align-items:end;margin-top:.9rem;padding:1rem;border:1px solid #d9e4f1;border-radius:12px;background:linear-gradient(120deg,#f4f7ff,#f1fbfa)}
.self-saved-actions{display:flex;flex-wrap:wrap;gap:.45rem}
.self-saved-actions .btn{font-size:.82rem;padding:.55rem .7rem}
.self-saved-actions .btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}
.self-setup-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.self-live-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.65rem;margin:.65rem 0 1rem}
.self-live-metrics>div{min-width:0;padding:.75rem .85rem;border:1px solid #dce5f0;border-radius:11px;background:linear-gradient(150deg,#fff,#f5f8ff);box-shadow:0 4px 12px rgba(28,61,105,.045)}
.self-live-metrics span,.self-live-metrics strong{display:block}
.self-live-metrics span{font-size:.72rem;color:#6b788b;font-weight:650}
.self-live-metrics strong{font-size:clamp(1.1rem,2.3vw,1.55rem);color:#244f96;font-variant-numeric:tabular-nums;margin-top:.22rem}
#self-live-net{color:#11815b}
#self-live-errors{color:#b42318}
#self-live-keystrokes{color:#6853bb}
#self-highlight[aria-pressed="true"]{background:#e9edff;border-color:#aab8ff;color:#3546a7}
.self-passage:not(.self-highlight-enabled) .self-current,.self-passage-card:not(.self-highlight-enabled) .self-current{background:transparent;color:inherit;box-shadow:none}
@media(max-width:760px){.self-saved-tools{grid-template-columns:1fr}.self-setup-grid{grid-template-columns:1fr}.self-saved-actions .btn{flex:1}.self-live-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.self-live-metrics>div:last-child{grid-column:span 2}}

/* Focused, compact typing workspace and readable formula comparison */
.self-typed{height:calc(3 * 1.75em + 2rem)!important;min-height:0!important;max-height:calc(3 * 1.75em + 2rem)!important;resize:none;overflow-y:auto;scroll-behavior:smooth}
.self-passage{height:8em!important;max-height:8em!important;line-height:1.9;scroll-behavior:smooth}
.self-passage-card:not(.self-highlight-enabled) .self-char-correct,
.self-passage-card:not(.self-highlight-enabled) .self-char-wrong{color:inherit!important;background:transparent!important;text-decoration:none!important}
.self-formula-comparison{margin:1rem 0;padding:1rem;border:1px solid #dbe5ef;border-radius:14px;background:linear-gradient(135deg,#f5f9ff,#f8fffc)}
.self-formula-comparison h3{margin:0 0 .75rem;color:#123b63;font-size:1.05rem}
.self-formula-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.self-formula-card{padding:1rem;border:1px solid #d6e1ed;border-radius:12px;background:#fff}
.self-formula-card.is-selected{border-color:#2563eb;box-shadow:0 0 0 2px #dbeafe}
.self-formula-card>strong{display:block;margin-bottom:.6rem;color:#123b63;font-size:1rem}
.self-formula-card p{display:flex;justify-content:space-between;gap:.75rem;margin:.3rem 0;color:#536273;font-size:.85rem}
.self-formula-card p{font-variant-numeric:tabular-nums}
@media(max-width:600px){.self-formula-grid{grid-template-columns:1fr}.self-live-metrics{grid-template-columns:repeat(5,minmax(0,1fr));gap:.35rem}.self-live-metrics>div{padding:.45rem .3rem}.self-live-metrics span{font-size:.62rem}.self-live-metrics strong{font-size:.9rem}}


/* Keep complete words together and reclaim vertical space in the practice toolbar. */
.self-passage, .self-result-typed {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none;
}
.self-toolbar {
  padding: .55rem .85rem !important;
  min-height: 0;
  gap: .6rem;
}
.self-timer-block strong {
  font-size: 1.45rem;
  line-height: 1.15;
}
.self-toolbar-actions { gap: .4rem; }
.self-toolbar-actions .btn {
  min-height: 34px;
  padding: .38rem .65rem;
}
.self-passage-card, .self-type-card { margin-top: .65rem; }
.self-analysis-breakdown {
  margin-top: 1.1rem;
  padding: 1.1rem;
  border: 1px solid #d9e4ef;
  border-radius: 14px;
  background: linear-gradient(145deg,#f7faff,#fff 75%);
}
.self-analysis-breakdown h3 {
  display:flex;
  align-items:center;
  gap:.5rem;
  font-size:1.08rem;
  margin-bottom:.9rem;
}
.self-analysis-grid { gap:.6rem; }
.self-analysis-grid > div {
  padding:.85rem;
  border-radius:12px;
  background:#fff;
  border-color:#d6e2ee;
  box-shadow:0 3px 10px rgba(18,59,99,.045);
}
.self-analysis-grid strong { font-size:1.35rem; line-height:1.25; }
.self-result-comparison {
  margin-top:1.1rem;
  padding:1.1rem;
  border:1px solid #d9e4ef;
  border-radius:14px;
  background:#f8fafc;
}
.self-result-comparison h3 { margin-bottom:.8rem; }
.self-result-typed {
  background:#fff;
  border-color:#cbd8e5;
  line-height:1.8;
}
@media(max-width:600px) {
  .self-toolbar { padding:.5rem .65rem !important; }
  .self-timer-block strong { font-size:1.3rem; }
  .self-toolbar-actions .btn { min-height:32px; padding:.32rem .48rem; font-size:.78rem; }
  .self-analysis-breakdown,.self-result-comparison { padding:.75rem; }
  .self-analysis-grid > div { padding:.65rem; }
  .self-analysis-grid strong { font-size:1.15rem; }
}

/* Keep every passage word on one line; move the whole word when it does not fit. */
.self-passage .self-word { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; hyphens: none; }
.self-passage { word-break: normal; overflow-wrap: normal; hyphens: none; }

/* Self-test scorecard parity with the standard typing result PDF */
#self-result .result-pdf-header{display:grid;gap:14px;padding:22px 24px;margin:0 0 22px;border-radius:14px;background:linear-gradient(125deg,#102d50,#175783);color:#fff;break-inside:avoid}
#self-result .result-pdf-brand{display:flex;align-items:center;gap:13px}
#self-result .result-pdf-mark{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;border:2px solid rgba(255,255,255,.72);border-radius:12px;font-size:27px;font-weight:900;color:#fff}
#self-result .result-pdf-brand h1{margin:0;font-size:clamp(1.2rem,2.6vw,1.8rem);line-height:1.2;color:#fff}
#self-result .result-pdf-brand p{margin:5px 0 0;color:#d9e8f6;font-size:.9rem;letter-spacing:.06em;text-transform:uppercase}
#self-result .result-pdf-meta{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(0,1.45fr);gap:12px}
#self-result .result-pdf-meta>div{min-width:0;padding:11px 13px;border:1px solid rgba(255,255,255,.24);border-radius:9px;background:rgba(255,255,255,.08)}
#self-result .result-pdf-meta span,#self-result .result-pdf-meta strong{display:block}
#self-result .result-pdf-meta span{font-size:.72rem;color:#d9e8f6;text-transform:uppercase;letter-spacing:.09em}
#self-result .result-pdf-meta strong{margin-top:5px;color:#fff;font-size:1rem;overflow-wrap:anywhere}
#self-result .result-pdf-links{display:flex;flex-wrap:wrap;gap:8px 18px;padding-top:12px;border-top:1px solid rgba(255,255,255,.25)}
#self-result .result-pdf-links a{color:#fff;text-decoration:underline;text-underline-offset:3px;font-size:.82rem;overflow-wrap:anywhere}
.self-result-print-content{margin-top:1rem}.self-result-print-content h3{margin:.9rem 0 .4rem;color:#123b63}
.self-result-print-content .result-content{padding:.75rem;border:1px solid #d8e2ec;border-radius:8px;background:#f8fafc;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;font-size:.86rem;line-height:1.6}
.self-result-print-content .exact-typed-content{background:#fffdf5;border-color:#f2d48a}
.self-scorecard-actions{display:flex;justify-content:center;gap:.75rem;flex-wrap:wrap;margin-top:1.25rem}
@page{size:A4 portrait;margin:13mm 12mm 15mm}
@media(max-width:600px){#self-result .result-pdf-meta{grid-template-columns:1fr}#self-result .result-pdf-links{flex-direction:column}.self-scorecard-actions{flex-direction:column}}
@media print{
 html,body{background:#fff!important;color:#172b43!important;font-size:9pt!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
 body *{visibility:hidden!important}
 #self-result,#self-result *{visibility:visible!important}
 #self-result{display:block!important;position:absolute!important;inset:0!important;width:100%!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important}
 #self-result .self-result-pdf-header{margin:0 0 12px!important;padding:14px 16px!important;border-radius:8px!important;background:#12395d!important;break-inside:avoid}
 #self-result .result-pdf-mark{width:38px;height:38px;flex-basis:38px;font-size:21px}
 #self-result .result-pdf-brand h1{font-size:19pt!important}
 #self-result .result-pdf-brand p,#self-result .result-pdf-meta span{font-size:7pt!important}
 #self-result .result-pdf-meta{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(0,1.45fr)!important;gap:7px!important}
 #self-result .result-pdf-meta>div{padding:6px 8px!important}
 #self-result .result-pdf-meta strong{font-size:8pt!important}
 #self-result .result-pdf-links{gap:5px 12px;padding-top:7px}
 #self-result .result-pdf-links a{font-size:7pt!important;color:#fff!important}
 #self-result .result-screen-only,#self-result .self-scorecard-actions,#self-result #self-again,#self-result #self-print-scorecard{display:none!important}
 #self-result .self-result-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;margin:9px 0 12px!important}
 #self-result .self-result-grid>div{padding:8px!important;border:1px solid #d8e2ec!important;border-top:3px solid #2563eb!important;border-radius:7px!important;background:#f6f9fc!important;break-inside:avoid}
 #self-result .self-result-grid>div:nth-child(3n+1){border-top-color:#0891b2!important}
 #self-result .self-result-grid>div:nth-child(3n+2){border-top-color:#16a34a!important}
 #self-result .self-result-grid span{font-size:7pt!important;color:#5b6e82!important}
 #self-result .self-result-grid strong{font-size:14pt!important;color:#12395d!important}
 #self-result .self-analysis-breakdown,#self-result .self-result-comparison,#self-result .self-formula-comparison{padding:9px!important;margin:8px 0!important;background:#fff!important;break-inside:auto!important}
 #self-result .self-analysis-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important}
 #self-result .self-analysis-grid>div{padding:5px!important;border:1px solid #e0e7ef!important;background:#f8fafc!important;break-inside:avoid}
 #self-result .self-analysis-grid span{font-size:6.5pt!important}
 #self-result .self-analysis-grid strong{font-size:10pt!important;color:#12395d!important}
 #self-result .self-formula-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #self-result .self-formula-card{padding:7px!important;break-inside:avoid}
 #self-result .self-result-print-content{break-inside:auto!important}
 #self-result .self-result-print-content .result-content{font-size:7.5pt!important;line-height:1.45!important;padding:7px!important;background:#f8fafc!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important}
 #self-result .self-result-print-content .exact-typed-content{background:#fffdf5!important}
 #self-result h3{font-size:11pt!important;color:#12395d!important}
}

/* Self-test passage wrapping: regular spaces must remain wrap opportunities. */
#self-passage{white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:normal!important}
#self-passage .self-word{white-space:normal!important;display:inline}


/* Compact self-test toolbar controls; descriptions appear only on hover/focus. */
.self-toolbar-actions .compact-tip-control{position:relative!important;display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 42px!important;width:42px!important;min-width:42px!important;max-width:42px!important;height:40px!important;min-height:40px!important;padding:0!important;font-size:0!important;line-height:1!important;overflow:visible!important;white-space:nowrap!important}
.self-toolbar-actions .compact-tip-control::before{content:attr(data-icon);font-size:1.15rem;font-weight:800;line-height:1}
.self-toolbar-actions .compact-tip-control::after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 9px);z-index:1000;transform:translate(-50%,4px);width:max-content;max-width:min(280px,80vw);white-space:normal;text-align:left;line-height:1.45;font-size:.78rem;font-weight:600;letter-spacing:0;padding:.65rem .75rem;border-radius:8px;background:#0f2742;color:#fff;box-shadow:0 8px 22px rgba(15,23,42,.25);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .14s ease,transform .14s ease}
.self-toolbar-actions .compact-tip-control:hover::after,.self-toolbar-actions .compact-tip-control:focus-visible::after{opacity:1;visibility:visible;transform:translate(-50%,0)}
.self-toolbar-actions .compact-tip-control:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
@media(max-width:650px){.self-toolbar-actions .compact-tip-control{flex:0 0 40px!important;width:40px!important;min-width:40px!important;max-width:40px!important}.self-toolbar-actions .compact-tip-control::after{left:auto;right:0;transform:translateY(4px);max-width:min(250px,75vw)}.self-toolbar-actions .compact-tip-control:hover::after,.self-toolbar-actions .compact-tip-control:focus-visible::after{transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.self-toolbar-actions .compact-tip-control::after{transition:none}}

/* Clear, accessible hover/focus descriptions and compact controls */
.self-toolbar-actions .compact-tip-control::after{background:#071827!important;color:#fff!important;border:2px solid #60a5fa!important;box-shadow:0 10px 28px rgba(2,8,23,.48)!important;font-size:.82rem!important;font-weight:750!important;text-shadow:none!important;}
.self-toolbar-actions .compact-tip-control:disabled{opacity:.72!important;filter:none!important;}
.self-toolbar{padding: .9rem 1rem;border:1px solid #d7e2ec;box-shadow:0 4px 14px rgba(15,40,70,.06);}
.self-toolbar-actions{gap:.55rem;justify-content:flex-end;}
.self-toolbar-actions .compact-tip-control{border:1px solid #9bb2c8!important;background:#fff!important;color:#173b5e!important;box-shadow:0 2px 0 rgba(15,40,70,.08);}
.self-toolbar-actions .compact-tip-control:hover,.self-toolbar-actions .compact-tip-control:focus-visible{background:#e8f2ff!important;border-color:#2563eb!important;color:#123b63!important;}

/* Yellow-glow, glass-black descriptions for clearer hover/focus help. */
.self-toolbar-actions .compact-tip-control::after{background:rgba(2,5,12,.96)!important;color:#ffe96a!important;border:1px solid rgba(250,204,21,.9)!important;box-shadow:0 12px 32px rgba(0,0,0,.68),0 0 0 1px rgba(250,204,21,.14),0 0 26px rgba(250,204,21,.28)!important;text-shadow:0 0 7px rgba(250,204,21,.75),0 0 15px rgba(250,204,21,.32)!important;backdrop-filter:blur(12px)!important;-webkit-backdrop-filter:blur(12px)!important;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:.84rem!important;font-weight:800!important;letter-spacing:.01em!important;line-height:1.5!important;}
.self-toolbar-actions .compact-tip-control:hover,.self-toolbar-actions .compact-tip-control:focus-visible{filter:drop-shadow(0 0 7px rgba(250,204,21,.34));}

/* Official logo image in self-test scorecard PDF. */
#self-result .result-pdf-mark{display:block;width:64px;height:64px;flex:0 0 64px;object-fit:contain;background:#fff;border-radius:12px;padding:4px;box-shadow:0 3px 12px #02061730}
@media print{#self-result .result-pdf-mark{width:54px;height:54px;flex-basis:54px;object-fit:contain;background:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}}


/* Accessible, readable tooltips shared by the typing-test and self-test toolbars.
   Keep the complete description inside its own surface and above neighbouring controls. */
.compact-tip-control,
.self-toolbar-actions .compact-tip-control { isolation:isolate; }
.compact-tip-control:hover,
.compact-tip-control:focus-visible,
.self-toolbar-actions .compact-tip-control:hover,
.self-toolbar-actions .compact-tip-control:focus-visible { z-index:10002!important; filter:none!important; }
.compact-tip-control::after,
.self-toolbar-actions .compact-tip-control::after {
  content:attr(data-tooltip)!important;
  display:block!important;
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:calc(100% + 12px)!important;
  z-index:10003!important;
  width:280px!important;
  max-width:min(320px,calc(100vw - 28px))!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  box-sizing:border-box!important;
  padding:11px 14px!important;
  overflow:visible!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-align:left!important;
  line-height:1.5!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-size:13px!important;
  font-weight:600!important;
  letter-spacing:0!important;
  color:#17324d!important;
  background:#fff!important;
  border:1px solid #9db8d0!important;
  border-radius:10px!important;
  box-shadow:0 8px 22px rgba(15,39,66,.18),0 2px 5px rgba(15,39,66,.08)!important;
  text-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:translate(-50%,4px)!important;
  transition:opacity .14s ease,transform .14s ease,visibility .14s ease!important;
}
.compact-tip-control:hover::after,
.compact-tip-control:focus-visible::after,
.self-toolbar-actions .compact-tip-control:hover::after,
.self-toolbar-actions .compact-tip-control:focus-visible::after {
  opacity:1!important;
  visibility:visible!important;
  transform:translate(-50%,0)!important;
}
@media(max-width:600px) {
  .compact-tip-control::after,
  .self-toolbar-actions .compact-tip-control::after {
    left:auto!important;
    right:-8px!important;
    width:260px!important;
    max-width:min(280px,calc(100vw - 28px))!important;
    transform:translateY(4px)!important;
  }
  .compact-tip-control:hover::after,
  .compact-tip-control:focus-visible::after,
  .self-toolbar-actions .compact-tip-control:hover::after,
  .self-toolbar-actions .compact-tip-control:focus-visible::after {
    transform:translateY(0)!important;
  }
}
@media(prefers-reduced-motion:reduce) {
  .compact-tip-control::after,
  .self-toolbar-actions .compact-tip-control::after { transition:none!important; }
}


/* Final tooltip polish: high contrast, predictable placement, no neon glow. */
.compact-tip-control,
.self-toolbar-actions .compact-tip-control { position:relative!important; isolation:isolate!important; }
.compact-tip-control:hover,
.compact-tip-control:focus-visible,
.self-toolbar-actions .compact-tip-control:hover,
.self-toolbar-actions .compact-tip-control:focus-visible { z-index:10020!important; filter:none!important; }
.compact-tip-control::after,
.self-toolbar-actions .compact-tip-control::after {
  left:50%!important; right:auto!important; top:calc(100% + 10px)!important; bottom:auto!important;
  width: min(300px, calc(100vw - 32px))!important; max-width:calc(100vw - 32px)!important;
  padding:12px 14px!important; border-radius:10px!important;
  background:#102b46!important; color:#f8fafc!important; border:1px solid #54718d!important;
  box-shadow:0 10px 26px rgba(15,23,42,.24),0 3px 8px rgba(15,23,42,.12)!important;
  text-shadow:none!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-size:13px!important; font-weight:500!important; line-height:1.5!important; letter-spacing:0!important;
  text-align:left!important; white-space:normal!important; overflow-wrap:anywhere!important; word-break:normal!important;
  box-sizing:border-box!important; transform:translate(-50%,-3px)!important;
}
.compact-tip-control:hover::after,
.compact-tip-control:focus-visible::after,
.self-toolbar-actions .compact-tip-control:hover::after,
.self-toolbar-actions .compact-tip-control:focus-visible::after { transform:translate(-50%,0)!important; }
@media(max-width:600px) {
  .compact-tip-control::after,.self-toolbar-actions .compact-tip-control::after {
    left:0!important; right:auto!important; width:min(280px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important; transform:translate(0,-3px)!important;
  }
  .compact-tip-control:hover::after,.compact-tip-control:focus-visible::after,
  .self-toolbar-actions .compact-tip-control:hover::after,.self-toolbar-actions .compact-tip-control:focus-visible::after { transform:translate(0,0)!important; }
}
@media(prefers-reduced-motion:reduce){.compact-tip-control::after,.self-toolbar-actions .compact-tip-control::after{transition:none!important}}


/* Clear ON/OFF state for toolbar toggles: pressed = active green, unpressed = neutral. */
.compact-tip-control[aria-pressed="true"],
.self-toolbar-actions .compact-tip-control[aria-pressed="true"] {
  background:#15803d!important;
  color:#fff!important;
  border-color:#166534!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12),0 2px 5px rgba(21,128,61,.22)!important;
}
.compact-tip-control[aria-pressed="true"]::before,
.self-toolbar-actions .compact-tip-control[aria-pressed="true"]::before { color:#fff!important; }
.compact-tip-control[aria-pressed="false"],
.self-toolbar-actions .compact-tip-control[aria-pressed="false"] {
  background:#fff!important;
  color:#234b70!important;
  border-color:#b7c8d8!important;
  box-shadow:0 1px 2px rgba(15,40,70,.08)!important;
}
.compact-tip-control[aria-pressed="false"]::before,
.self-toolbar-actions .compact-tip-control[aria-pressed="false"]::before { color:#234b70!important; }
.compact-tip-control[aria-pressed="true"]:hover,
.compact-tip-control[aria-pressed="true"]:focus-visible,
.self-toolbar-actions .compact-tip-control[aria-pressed="true"]:hover,
.self-toolbar-actions .compact-tip-control[aria-pressed="true"]:focus-visible { background:#166534!important; border-color:#14532d!important; }

/* Formula toggle and scorecard metric parity */
.self-result-formula-switch{margin:1rem 0}.self-result-formula-switch .formula-option{flex:1;min-width:0}
#self-result .self-result-grid>div{border-top:3px solid #2563eb;background:linear-gradient(155deg,#f8fbff,#fff)}
#self-result .self-result-grid>div:nth-child(4n+1){border-top-color:#0891b2}#self-result .self-result-grid>div:nth-child(4n+2){border-top-color:#16a34a}#self-result .self-result-grid>div:nth-child(4n+3){border-top-color:#7c3aed}#self-result .self-result-grid>div:nth-child(4n){border-top-color:#ea580c}
#self-result .self-result-grid strong{font-variant-numeric:tabular-nums}
@media print{#self-result .self-result-formula-switch{display:flex!important;gap:7px!important;margin:7px 0!important}#self-result .self-result-formula-switch .formula-option{padding:6px!important;border:1px solid #d8e2ec!important;border-radius:6px!important;background:#f8fafc!important;color:#12395d!important;box-shadow:none!important}#self-result .self-result-formula-switch .formula-option span{font-size:6pt!important}#self-result .self-result-formula-switch .formula-option strong{font-size:8pt!important}#self-result .self-result-formula-switch .formula-option small{font-size:6pt!important}#self-result .self-result-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}

/* Two remaining setup controls after moving formula selection to the result card. */
@media(min-width:761px){.self-setup-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}


/* Premium self-test setup surface — no behaviour changes */
#self-setup.self-setup{position:relative;isolation:isolate;overflow:hidden;max-width:980px;margin-inline:auto;padding:clamp(1rem,2.8vw,2rem);border:1px solid #7c9cff55;border-radius:22px;background:linear-gradient(145deg,#ffffff 0%,#f5f7ff 55%,#effcff 100%);box-shadow:0 20px 60px #142d5520,0 0 0 1px #ffffff inset}
#self-setup.self-setup:before{content:"";position:absolute;z-index:-1;inset:0 0 auto;height:3px;background:linear-gradient(90deg,#22d3ee,#818cf8,#c084fc,#34d399);background-size:220% 100%;animation:selfSetupGlow 8s linear infinite}
#self-setup .card-title{font-size:clamp(1.15rem,2.1vw,1.5rem);letter-spacing:-.03em}
#self-setup .self-source{min-height:118px;border-radius:14px;border-color:#cbd5f5;background:#ffffffdf;box-shadow:inset 0 1px 2px #132b4d0a;transition:border-color .2s,box-shadow .2s}
#self-setup .self-source:focus,#self-setup .form-control:focus{outline:none;border-color:#818cf8;box-shadow:0 0 0 3px #818cf82b,0 0 24px #22d3ee12}
#self-setup .form-control{border-radius:12px;border-color:#cbd5e1;min-height:43px}
#self-setup .form-label{font-weight:800;color:#293b5e;font-size:.86rem}
#self-setup .self-saved-tools{gap:1rem;padding:1rem;border:1px solid #dbeafe;border-radius:15px;background:#eff6ff99}
#self-setup .self-saved-actions .btn{border-radius:10px;transition:transform .18s,box-shadow .18s}
#self-setup .self-saved-actions .btn:hover{transform:translateY(-2px);box-shadow:0 7px 18px #3341551a}
#self-setup .self-setup-grid{gap:.85rem;margin:1rem 0}
#self-setup .self-check{border:1px solid #dbeafe;border-radius:14px;background:#ffffffc9;padding:.8rem 1rem;box-shadow:0 6px 18px #1e3a8a08}
#self-setup #self-start{min-height:48px;border-radius:13px;box-shadow:0 9px 24px #4f46e529;transition:transform .2s,box-shadow .2s}
#self-setup #self-start:hover{transform:translateY(-2px);box-shadow:0 14px 30px #4f46e53b}
@keyframes selfSetupGlow{to{background-position:220% 0}}
@media(prefers-reduced-motion:reduce){#self-setup.self-setup:before{animation:none}#self-setup #self-start{transition:none}}
