.compat-page [hidden] { display: none !important; }
.compat-header, .compat-main, .compat-footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.compat-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.compat-brand { color: var(--ink); font-weight: 750; text-decoration: none; }
.compat-brand > span { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-right: 8px; background: var(--gold-soft); color: #82601f; border-radius: 50%; }
.compat-test-badge { padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px; color: var(--violet); background: #fff9; font-size: .77rem; white-space: nowrap; }
.compat-intro { max-width: 850px; padding: 52px 0 28px; }
.compat-intro h1 { font-size: clamp(2.7rem, 5.7vw, 4.5rem); max-width: 900px; }
.compat-intro h1 > span { color: #a87628; }
.compat-lead { color: var(--ink); font-size: 1.12rem; max-width: 700px; margin: 23px 0 12px; }
.compat-stage-note { color: var(--muted); margin: 0; font-size: .92rem; }
.compat-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; background: var(--surface); box-shadow: 0 16px 45px #261d4307; }
.compat-formats { padding: 0 0 28px; margin: 0; border: 0; min-width: 0; }
.compat-formats legend { font-weight: 700; margin-bottom: 15px; padding: 0; }
.compat-format-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.compat-format-options label { position: relative; cursor: pointer; }
.compat-format-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.compat-format-options span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; height: 100%; padding: 12px; border: 1px solid #cfc4df; border-radius: 13px; color: var(--violet); font-size: .9rem; font-weight: 650; background: white; }
.compat-format-options input:checked + span { background: var(--gold); border-color: var(--gold); color: #19152f; }
.compat-format-options input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }
.compat-format-options label:hover span { border-color: var(--violet); }
.compat-fields { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: start; gap: 16px; }
.compat-field label { display: block; font-weight: 700; font-size: .91rem; margin-bottom: 12px; }
.compat-field-index { font-size: .75rem; color: #96691c; margin-right: 8px; }
.compat-field input { width: 100%; min-height: 58px; border: 1px solid #cfc4df; border-radius: 13px; padding: 12px 16px; color: var(--ink); background: #fff; font-size: 1.12rem; letter-spacing: .04em; }
.compat-field input:focus { outline: 3px solid #5f4a912a; outline-offset: 2px; border-color: var(--violet); }
.compat-field input[aria-invalid="true"] { border-color: #a92b39; }
.compat-plus { color: var(--gold); font: 36px Georgia, serif; text-align: center; margin-top: 39px; }
.compat-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 26px; }
.compat-page .primary-button { background: var(--gold); color: #19152f; min-height: 54px; padding-inline: 25px; }
.compat-page .primary-button > span { margin-left: 18px; }
.compat-page .primary-button:hover { background: #d5aa57; }
.compat-page button:disabled { opacity: .55; cursor: wait; }
.compat-text-button { background: none; border: 0; padding: 8px 0; color: var(--violet); font-weight: 650; font-size: .88rem; text-underline-offset: 4px; }
.compat-text-button:hover { text-decoration: underline; }
.compat-page :is(button, a, [tabindex]):focus-visible { outline: 3px solid var(--violet); outline-offset: 5px; }
.compat-privacy { margin: 20px 0 0; color: var(--muted); font-size: .79rem; }
.compat-field-error, .compat-form-error { color: #a32739; font-size: .85rem; margin: 8px 0 0; }
.compat-form-error { border-left: 3px solid #a32739; padding: 8px 12px; margin-top: 16px; background: #fff4f4; }
.compat-results { scroll-margin-top: 24px; margin-top: 50px; }
.compat-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.compat-result-heading h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.compat-dates { margin: 14px 0 0; color: var(--muted); }
.compat-result-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 24px; align-items: stretch; }
.compat-diagram-card { border: 1px solid var(--line); background: white; border-radius: var(--radius); padding: 25px; }
#compat-svg { display: block; width: 100%; max-width: 600px; margin-inline: auto; }
.compat-node circle { fill: #fff; stroke: var(--violet); stroke-width: 2.5; }
.compat-node text { text-anchor: middle; dominant-baseline: central; fill: var(--ink); font-weight: 750; font-size: 25px; }
.compat-node.is-interactive { cursor: pointer; }
.compat-node.is-interactive circle { fill: #f9f1dd; stroke: #a87628; stroke-width: 3.5; }
.compat-node.is-interactive:hover circle, .compat-node.is-interactive:focus circle, .compat-node.is-selected circle { fill: #ead29b; stroke: var(--violet); }
.compat-node.is-interactive:focus { outline: none; }
.compat-node.is-interactive:focus-visible circle { stroke-width: 6; }
.compat-potential-button { display: block; width: 100%; margin-top: 20px; min-height: 56px; padding: 16px 20px; border: 1px solid #c8a15c; border-radius: 15px; color: var(--ink); background: #faf4e8; text-align: center; font-weight: 700; line-height: 1.5; cursor: pointer; }
.compat-potential-button:hover { background: #f3e6c9; }
.compat-reading-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.compat-reading-actions .compat-potential-button { margin-top: 0; }
.compat-reading { margin-top: 28px; padding: 30px; border: 1px solid #c8a15c; border-radius: var(--radius); background: var(--surface); scroll-margin-top: 24px; }
.compat-reading-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.compat-reading-heading h2 { font: 500 clamp(1.6rem,3vw,2.3rem)/1.25 Georgia,serif; }
.compat-reading-name { font-size: 1.14rem; color: var(--violet); margin-bottom: 22px; }
.compat-reading-note { color: var(--muted); font-size: .88rem; }
.compat-text-block { border-top: 1px solid var(--line); }
.compat-section-toggle { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; cursor: pointer; }
.compat-section-toggle::-webkit-details-marker { display: none; }
.compat-section-toggle h3 { margin: 0; font: 700 1.05rem/1.5 Arial,sans-serif; }
.compat-section-icon { color: var(--violet); flex: 0 0 24px; text-align: center; }
.compat-text-block:not(.is-locked)[open] .compat-section-icon { transform: rotate(45deg); }
.compat-text-block.is-locked .compat-section-toggle { color: var(--muted); }
.compat-section-body { max-width: 850px; padding-bottom: 20px; line-height: 1.8; }
.compat-section-body p { margin: 0 0 16px; }
.compat-section-body p:last-child { margin-bottom: 0; }
.compat-locked-note { color: var(--muted); }
.compat-section-body .reading-subscription-link { display:block; width:fit-content; max-width:100%; margin-top:14px; padding:8px 0; color:var(--violet,#604b91); font:600 .9rem/1.65 Arial,sans-serif; text-decoration:underline; text-underline-offset:3px; }
.compat-section-body .reading-subscription-link:focus-visible { outline:2px solid #9c85bb; outline-offset:4px; }
.compat-foundation-node circle { fill: var(--night); stroke: var(--gold); stroke-width: 3; }
.compat-foundation-node.is-interactive circle { fill: var(--night); stroke: var(--gold); stroke-width: 3; }
.compat-foundation-node.is-interactive:hover circle,.compat-foundation-node.is-interactive:focus circle,.compat-foundation-node.is-selected circle { fill: #41315f; stroke: #d5aa57; stroke-width: 5; }
.compat-foundation-node text { text-anchor: middle; dominant-baseline: central; fill: white; font-size: 39px; font-weight: 750; }
.compat-foundation-node rect { fill: white; }
.compat-foundation-node .compat-center-caption { fill: var(--violet); font-size: 17px; font-weight: 650; }
.compat-foundation { background: linear-gradient(145deg, #f0eaf8, #faf7ef); border: 1px solid var(--line); border-radius: var(--radius); padding: 35px; display: flex; flex-direction: column; justify-content: center; }
.compat-foundation h3 { font: 500 clamp(1.65rem, 2.7vw, 2.2rem)/1.15 Georgia, serif; margin: 0; }
.compat-foundation-number { font: 500 90px/1 Georgia, serif; color: var(--violet); margin: 18px 0 8px; }
.compat-foundation-summary { line-height: 1.7; overflow-wrap: break-word; }
.compat-foundation-summary p { margin: 14px 0 0; }
.compat-foundation-summary .compat-foundation-name { color: var(--violet); font-weight: 650; }
.compat-footer { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 25px 0 35px; margin-top: 50px; color: var(--muted); font-size: .8rem; }
.compat-footer p { margin: 0; }
.compat-footer a { color: var(--violet); }
.compat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .compat-reading-actions { grid-template-columns: 1fr; }
  .compat-format-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compat-result-grid { grid-template-columns: 1fr; }
  .compat-fields { grid-template-columns: 1fr 20px 1fr; gap: 10px; }
  .compat-form { padding: 22px; }
  .compat-foundation { padding: 28px; }
  .compat-foundation-number { font-size: 72px; }
  .compat-result-heading { align-items: start; }
}
@media (max-width: 540px) {
  .compat-format-options span { font-size: .82rem; padding-inline: 8px; }
  .compat-reading { padding: 22px 18px; }
  .compat-reading-heading { flex-direction: column; gap: 8px; }
  .compat-section-toggle h3 { font-size: .96rem; }
  .compat-header, .compat-main, .compat-footer { width: calc(100% - 32px); }
  .compat-header { flex-wrap: wrap; gap: 12px; padding: 19px 0; }
  .compat-brand { font-size: .87rem; }
  .compat-test-badge { font-size: .72rem; }
  .compat-intro { padding-top: 32px; }
  .compat-intro h1 { font-size: clamp(2.1rem, 8.4vw, 2.8rem); }
  .compat-intro h1 > span { display: block; }
  .compat-lead { font-size: 1rem; }
  .compat-fields { grid-template-columns: 1fr; gap: 18px; }
  .compat-field label { font-size: .83rem; }
  .compat-plus { display: none; }
  .compat-actions { gap: 12px 20px; margin-top: 20px; }
  .compat-page .primary-button { width: 100%; padding-inline: 14px; font-size: .94rem; }
  .compat-text-button { font-size: .82rem; }
  .compat-results { margin-top: 35px; }
  .compat-result-heading { display: block; }
  .compat-result-heading .compat-text-button { margin-top: 6px; }
  .compat-diagram-card { padding: 12px 9px 18px; }
  .compat-foundation { padding: 25px; }
  .compat-footer { display: grid; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .compat-page { scroll-behavior: auto; } }
