/* Isolated calculator styles; shared brand and theme tokens remain authoritative. */
.matrix-page { padding-bottom: 0; }
.matrix-page [hidden] { display: none !important; }
.matrix-page .breadcrumb { margin-bottom: 0; }
.matrix-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; padding: 34px 0 64px; }
.matrix-intro h1 { font-size: clamp(32px,3.5vw,46px); line-height: 1.18; letter-spacing: -.035em; margin: 20px 0; }
.matrix-intro h1 span { display: block; color: var(--primary); }
.matrix-lead { font-size: 21px; font-weight: 600; margin-bottom: 16px; }
.matrix-intro > p:not(.eyebrow):not(.matrix-lead) { color: var(--text-secondary); font-size: 14px; line-height: 1.85; }
.matrix-benefits { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; list-style: none; font-size: 12px; font-weight: 500; margin: 24px 0; }
.matrix-benefits li::before { content: '✓'; color: var(--primary); margin-right: 7px; }
.matrix-intro .matrix-notice { border-left: 3px solid var(--border-focus); padding-left: 14px; font-size: 12px !important; }
.matrix-text-link { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; font-size: 13px; display: inline-flex; gap: 10px; padding-block: 8px; }
.matrix-form { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: 20px; box-shadow: var(--shadow-md); padding: 30px; min-width: 0; }
.matrix-kicker { text-transform: uppercase; color: var(--primary); letter-spacing: .09em; font-size: 11px; font-weight: 700; margin: 0 0 12px; }
.matrix-form h2 { font-size: 24px; line-height: 1.4; letter-spacing: -.025em; margin: 0 0 12px; }
.matrix-form > p:not(.matrix-kicker):not(.matrix-small):not(.matrix-error) { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.matrix-form fieldset { border: 0; padding: 0; margin: 24px 0 0; min-width: 0; }
.matrix-form legend { font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.matrix-fields { display: grid; grid-template-columns: .7fr 1.5fr 1fr; gap: 12px; }
.matrix-fields > div { min-width: 0; }
.matrix-page label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.matrix-page input:not([type=checkbox]), .matrix-page select { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; color: var(--text-primary); background: var(--background); border: 1px solid var(--border); border-radius: 9px; font: inherit; font-size: 16px; }
.matrix-page [aria-invalid=true] { border-color: #be123c !important; }
.matrix-page .matrix-small { color: var(--text-secondary); font-size: 12px; line-height: 1.75; }
.matrix-form .btn-primary { width: 100%; margin-top: 12px; min-height: 50px; gap: 10px; white-space: normal; }
.matrix-example { display: block; width: 100%; padding: 14px 4px; font-size: 12px; color: var(--primary); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.matrix-form-privacy { border-top: 1px solid var(--border); padding-top: 16px; margin: 8px 0 0; }
.matrix-error { color: #9f1239; background: #fff1f2; border: 1px solid #fda4af; padding: 12px; border-radius: 8px; font-size: 13px; }
.matrix-results { padding-bottom: 56px; border-top: 1px solid var(--border); padding-top: 36px; }
.matrix-result-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.matrix-result-header h2, .matrix-section-heading h2 { font-size: 30px; margin: 0; letter-spacing: -.025em; }
.matrix-result-header p:last-child { color: var(--text-secondary); font-size: 13px; margin-bottom: 0; }
.matrix-workspace { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 24px; align-items: start; }
.matrix-chart-card { border: 1px solid var(--border); background: var(--surface); border-radius: 18px; padding: 20px; min-width: 0; }
.matrix-chart-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 16px; }
.matrix-chart-caption span { color: var(--text-secondary); font-size: 11px; }
#matrixChart svg { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
#matrixChart [role=button] { cursor: pointer; outline: none; }
#matrixChart [role=button]:hover circle, #matrixChart [role=button]:focus circle { stroke: #0f172a; stroke-width: 4; }
#matrixChart [aria-pressed=true] circle { stroke: #0f172a; stroke-width: 4; stroke-dasharray: 4 2; }
.matrix-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; font-size: 11px; margin: 18px 0; }
.matrix-legend li { display: flex; align-items: center; gap: 6px; }
.matrix-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.matrix-dot-core { background: #2563eb; }.matrix-dot-family { background: #a855f7; }.matrix-dot-love { background: #db2777; }.matrix-dot-money { background: #059669; }
.matrix-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.matrix-page .btn { min-height: 44px; white-space: normal; }
.matrix-page button:disabled { cursor: not-allowed; opacity: .55; }
.matrix-reading { border: 1px solid var(--border); background: var(--surface); border-radius: 18px; padding: 24px; min-width: 0; }
.matrix-reading select { font-size: 13px; margin-bottom: 24px; }
#matrixPanel .matrix-kicker { margin-top: 8px; }
#matrixPanel h3 { font-size: 25px; line-height: 1.35; margin: 12px 0; }
#matrixPanel p { color: var(--text-secondary); font-size: 13px; line-height: 1.85; }
#matrixPanel .matrix-panel-lead { font-weight: 500; color: var(--text-primary); }
#matrixPanel dt { margin-top: 18px; font-weight: 600; font-size: 12px; }
#matrixPanel dd { margin: 5px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.matrix-share { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; background: var(--surface-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-top: 24px; }
.matrix-share h3 { font-size: 16px; margin: 0 0 10px; }
.matrix-share p { color: var(--text-secondary); font-size: 12px; line-height: 1.9; margin: 0 0 14px; max-width: 760px; }
.matrix-share .matrix-consent { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; margin: 0; line-height: 1.7; }
.matrix-consent input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
#matrixShareOutput { grid-column: 1/-1; min-width: 0; }
.matrix-action-status { color: var(--text-secondary); font-size: 13px; min-height: 22px; }
.matrix-section-heading { margin: 38px 0 24px; }
.matrix-section-heading > p:last-child { color: var(--text-secondary); font-size: 14px; max-width: 740px; line-height: 1.8; }
.matrix-dashboard { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.matrix-result-card { padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.matrix-result-card h3 { font-size: 18px; margin: 0 0 12px; }
.matrix-result-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.9; }
.matrix-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.matrix-chip { color: var(--primary); background: var(--primary-light); border: 1px solid var(--border); padding: 10px 12px; border-radius: 9px; min-height: 44px; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.matrix-card-reflection { border-top: 1px solid var(--border); padding-top: 14px; margin-bottom: 0; }
.matrix-decades-section { margin-top: 32px; }
.matrix-decades-section h3 { font-size: 20px; }.matrix-decades-section > p { font-size: 13px; color: var(--text-secondary); line-height: 1.9; }
.matrix-decades { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.matrix-decades li { border: 1px solid var(--border); border-radius: 9px; padding: 14px; font-size: 12px; }
.matrix-decades span { color: var(--text-secondary); display: block; margin-bottom: 6px; }
.matrix-decades strong { font-size: 13px; }
.matrix-table-details { margin-top: 24px; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.matrix-table-details summary { cursor: pointer; font-weight: 600; min-height: 28px; font-size: 14px; }
.matrix-table-details > p { font-size: 13px; color: var(--text-secondary); }
.matrix-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.matrix-table caption { text-align: left; padding-block: 14px; }
.matrix-table th,.matrix-table td { padding: 12px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.matrix-table th:first-child { width: 36%; }
.matrix-table-button { font: inherit; color: var(--primary); background: none; border: 0; padding: 4px 0; min-height: 44px; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.matrix-guide-band { border-top: 1px solid var(--border); background: var(--surface); padding-block: 56px; }
.matrix-guide-layout { display: grid; grid-template-columns: 235px minmax(0,1fr); gap: 64px; align-items: start; }
.matrix-contents { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 100px; }
.matrix-contents a { display: block; font-size: 12px; color: var(--text-secondary); padding: 10px 0; }
.matrix-contents a:hover { color: var(--primary); text-decoration: underline; }
.matrix-guide > section { scroll-margin-top: 90px; margin-bottom: 44px; }
.matrix-guide h2 { font-size: 27px; letter-spacing: -.025em; line-height: 1.4; margin: 0 0 18px; }
.matrix-guide h3 { font-size: 19px; margin: 24px 0 14px; }
.matrix-guide p,.matrix-guide li { color: var(--text-secondary); font-size: 14px; line-height: 1.9; }
.matrix-guide p { margin: 0 0 16px; }.matrix-guide li { margin-bottom: 10px; }
.matrix-guide ul,.matrix-guide ol { padding-left: 22px; }
.matrix-guide a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.matrix-example-box { border-left: 3px solid var(--primary); background: var(--background); padding: 18px 24px; border-radius: 0 12px 12px 0; margin-bottom: 20px; }
.matrix-example-box ol { margin: 0; }
.matrix-arcana-reference { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.matrix-arcana-reference details,.matrix-faq details { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--background); }
.matrix-arcana-reference summary,.matrix-faq summary { cursor: pointer; font-size: 13px; font-weight: 600; padding-block: 5px; line-height: 1.7; }
.matrix-arcana-reference p,.matrix-faq p { font-size: 13px; margin: 14px 0 0; }
.matrix-faq { display: grid; gap: 10px; }
.matrix-journal { padding: 24px; background: var(--primary-light); border: 1px solid var(--border); border-radius: 12px; }
.matrix-journal h3 { margin-top: 0; }.matrix-journal p { margin-bottom: 0; }
.matrix-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.matrix-print-note { display: none; }
@media(max-width:1100px) { .matrix-hero { gap: 32px; }.matrix-guide-layout { gap: 32px; grid-template-columns: 190px minmax(0,1fr); }.matrix-workspace { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); } }
@media(max-width:800px) {
    .matrix-hero,.matrix-workspace,.matrix-guide-layout { grid-template-columns: minmax(0,1fr); }
    .matrix-hero { gap: 28px; padding-bottom: 38px; }.matrix-intro { max-width: 640px; }
    .matrix-contents { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }.matrix-contents .matrix-kicker { grid-column: 1/-1; }
    .matrix-share { grid-template-columns: minmax(0,1fr); }.matrix-share .btn { justify-self: start; }
    .matrix-chart-card { max-width: 690px; width: 100%; margin-inline: auto; }
}
@media(max-width:480px) {
    .matrix-intro h1 { font-size: 32px; }.matrix-lead { font-size: 19px; }
    .matrix-form,.matrix-reading,.matrix-share,.matrix-result-card { padding: 20px; }
    .matrix-form h2 { font-size: 22px; }.matrix-fields { gap: 8px; grid-template-columns: .7fr 1.3fr 1fr; }
    .matrix-page input:not([type=checkbox]),.matrix-page select { padding-inline: 8px; }
    .matrix-chart-card { padding: 10px; }.matrix-chart-caption { padding: 6px; }.matrix-chart-card > p { padding-inline: 6px; }
    .matrix-result-header { align-items: flex-start; flex-direction: column; }.matrix-result-header h2,.matrix-section-heading h2 { font-size: 26px; }
    .matrix-dashboard,.matrix-arcana-reference { grid-template-columns: minmax(0,1fr); }.matrix-decades { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .matrix-guide-band { padding-block: 32px; }.matrix-guide h2 { font-size: 24px; }.matrix-example-box { padding: 16px; }
    .matrix-table-details { padding: 10px; }.matrix-table { font-size: 11px; }.matrix-table th,.matrix-table td { padding: 10px 4px; }
    .matrix-actions { flex-direction: column; }.matrix-actions .btn { width: 100%; }
}
@media(max-width:350px) {
    /* Keep the inherited header usable at 320px without changing other pages. */
    body:has(.matrix-page) .logo-text { font-size: 14px; }
    body:has(.matrix-page) .logo-mark { width: 28px; height: 28px; }
    body:has(.matrix-page) .logo { gap: 5px; }
    body:has(.matrix-page) .header-actions { gap: 6px; }
    .matrix-form { padding: 16px; }.matrix-fields { gap: 6px; }.matrix-intro h1 { font-size: 30px; }
}
@media(prefers-reduced-motion:reduce) { body:has(.matrix-page),html:has(.matrix-page) { scroll-behavior: auto; } }
@media print {
    @page { margin: 12mm; }
    body { background: white !important; color: #111827 !important; }
    .site-header,.site-footer,.skip-link,.matrix-page .breadcrumb,.matrix-hero,.matrix-guide-band,.matrix-share,.matrix-actions,.matrix-action-status,#matrixReset,.matrix-reading,.matrix-chart-caption,.matrix-table-details,.matrix-sr-only { display: none !important; }
    .matrix-page .container { max-width: none; width: 100%; padding: 0; }
    .matrix-results { border: 0; padding: 0; }.matrix-results[hidden] { display: none !important; }
    .matrix-print-note { display: block; font-size: 11px; }.matrix-workspace { display: block; }
    .matrix-chart-card { width: 150mm; max-width: 100%; margin: auto; border: 0; padding: 0; background: white; break-inside: avoid; }
    .matrix-dashboard { display: block; }.matrix-result-card { break-inside: avoid; margin-bottom: 12px; background: white; color: #111827; }
    .matrix-result-card p,.matrix-result-header p,.matrix-section-heading p,.matrix-decades-section p,.matrix-decades span,.matrix-chart-card p { color: #334155 !important; }
    .matrix-chip { background: #eff6ff; color: #1d4ed8; border-color: #cbd5e1; }.matrix-decades li { break-inside: avoid; }
    .matrix-results { --text-primary:#111827; --text-secondary:#334155; --primary:#1d4ed8; --border:#cbd5e1; }
    #matrixChart { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
