/*
Theme Name: Prisma
Theme URI: https://prismatest.net/
Author: PrismaTest
Description: Theme for PrismaTest: free personality, relationship, cognitive and fun tests. Design and quiz engine only; all copy lives in WordPress pages.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: prisma
*/

:root {
  /* Approved palette: white base, coral primary (buttons, progress), deep violet secondary (links, accents). */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --soft: #F7F5FC;
  --ink: #161A33;
  --muted: #55597A;
  --line: #E7E4EE;
  --cta: #F2542D;
  --cta-ink: #D33F1A;
  --cta-soft: #FFF0EB;
  --on-cta: #FFFFFF;
  --accent: #3B2A8C;
  --accent-ink: #2A1D6B;
  --accent-soft: #F1EDFF;
  --footer: #161A33;
  --shadow: 0 1px 2px rgba(22, 26, 51, .06), 0 8px 24px rgba(22, 26, 51, .06);
  --shadow-lg: 0 2px 6px rgba(22, 26, 51, .08), 0 18px 40px rgba(59, 42, 140, .12);
  /* Result bars and charts */
  --c1: #3B2A8C;
  --c2: #F2542D;
  --c3: #14A38B;
  --c4: #E6A100;
  --c5: #C2357A;
  /* Category spectrum: tile background / text */
  --cat-personality: #EFEAFF; --cat-personality-ink: #3B2A8C;
  --cat-relationships: #FFE6EE; --cat-relationships-ink: #9B1C46;
  --cat-cognitive: #E3F0FF; --cat-cognitive-ink: #144A8C;
  --cat-emotional: #FFF0E0; --cat-emotional-ink: #8C4A06;
  --cat-career: #DFF5EF; --cat-career-ink: #0B6156;
  --cat-values: #FFF5D6; --cat-values-ink: #7A5A00;
  --cat-wellbeing: #E9F6E3; --cat-wellbeing-ink: #2F6413;
  --cat-entertainment: #FFE9F6; --cat-entertainment-ink: #93226A;
  --cat-trivia: #FFF0EB; --cat-trivia-ink: #A33515;
  --cat-ai: #EAF2FF; --cat-ai-ink: #29408F;
  --r-sm: 8px;
  --r-md: 16px;
  --r-pill: 999px;
  --head: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --wrap: 1180px;
  --measure: 740px;
  --tabbar: 0px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E0F1E; --surface: #171931; --soft: #13152A; --ink: #EEF0FF; --muted: #A7ABCB; --line: #2A2D50;
  --cta: #FF6A45; --cta-ink: #FF8A6B; --cta-soft: #3A1E19; --on-cta: #1A0B07;
  --accent: #B3A6FF; --accent-ink: #CFC6FF; --accent-soft: #241F4A; --footer: #0A0B17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 40px rgba(0, 0, 0, .45);
  --c1: #A99BFF; --c2: #FF6A45; --c3: #34D1B5; --c4: #F5C04A; --c5: #F07AB6;
  --cat-personality: #25204A; --cat-personality-ink: #D6CFFF;
  --cat-relationships: #3E1A2A; --cat-relationships-ink: #FFC2D6;
  --cat-cognitive: #16294A; --cat-cognitive-ink: #B9D6FF;
  --cat-emotional: #3A2814; --cat-emotional-ink: #FFD2A3;
  --cat-career: #12342E; --cat-career-ink: #A8EEDD;
  --cat-values: #383014; --cat-values-ink: #FFE69A;
  --cat-wellbeing: #1C3316; --cat-wellbeing-ink: #C3EBAE;
  --cat-entertainment: #3A1A31; --cat-entertainment-ink: #FFC2E8;
  --cat-trivia: #3A1E19; --cat-trivia-ink: #FFC1AE;
  --cat-ai: #1A2547; --cat-ai-ink: #C2D3FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.6 var(--body); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.12; letter-spacing: -0.01em; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin-top: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code { background: var(--accent-soft); padding: 0 4px; border-radius: 4px; font-size: 0.9em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: var(--surface); padding: 8px 14px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.measure { max-width: var(--measure); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3rem/1 var(--head); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span b { color: var(--accent); font-weight: 700; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; font: inherit; font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.primary-nav li { margin: 0; position: relative; }
.primary-nav a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; font-size: 0.98rem; border-radius: var(--r-sm); }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--accent-soft); color: var(--accent-ink); }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; flex-direction: column; align-items: stretch; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: flex; }
.primary-nav .menu-cta > a { background: var(--cta); color: var(--on-cta); border-radius: var(--r-pill); padding: 9px 18px; font-weight: 700; }
.primary-nav .menu-cta > a:hover { background: var(--cta-ink); color: var(--on-cta); }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; }
  .primary-nav .sub-menu { display: flex; position: static; border: 0; padding: 0 0 0 12px; min-width: 0; }
}

/* ---------- Main ---------- */
main { padding: 32px 0 64px; }
.page-head { padding: 24px 0 8px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.byline { font-size: 0.92rem; color: var(--muted); margin: 0.75rem 0 0; }
.byline a { color: var(--ink); }
.entry { max-width: var(--measure); }
.entry > *:first-child { margin-top: 0; }
.entry h2 { padding-top: 0.5rem; }

/* ---------- Test landing hero ---------- */
.test-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; padding: 16px 0 24px; }
.test-hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); }
.stat-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.stat-strip li { margin: 0; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 14px; font-size: 0.9rem; color: var(--muted); }
.stat-strip li b { color: var(--ink); font-weight: 700; }
.test-body { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: 48px; }
.test-aside { position: sticky; top: 88px; align-self: start; font-size: 0.95rem; }
.test-aside .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px; }
.test-aside h2 { font-size: 1.05rem; margin: 0 0 8px; }
.test-aside ul { padding-left: 18px; margin: 0; }
@media (max-width: 900px) { .test-hero, .test-body { grid-template-columns: minmax(0, 1fr); } .test-hero > *, .test-body > * { min-width: 0; } .test-aside { position: static; } }

/* ---------- Quiz ---------- */
.pt-quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; min-height: 320px; box-shadow: var(--shadow-lg); }
.pt-quiz .q-intro p { color: var(--muted); }
.q-progress { height: 8px; background: var(--cta-soft); border-radius: var(--r-pill); overflow: hidden; margin: 0 0 8px; }
.q-progress span { display: block; height: 100%; background: var(--cta); width: 0; transition: width .2s ease; }
.q-count { font-size: 0.88rem; color: var(--muted); margin: 0 0 12px; }
.q-text { font: 700 1.3rem/1.3 var(--head); margin: 0 0 18px; }
.q-options { display: grid; gap: 10px; }
.q-opt { display: block; width: 100%; text-align: left; min-height: 56px; padding: 14px 18px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .12s ease, background .12s ease; font: inherit; font-size: 1rem; color: var(--ink); cursor: pointer; }
.q-opt:hover { border-color: var(--cta); background: var(--cta-soft); }
.q-opt[aria-pressed="true"] { background: var(--cta-soft); border-color: var(--cta); box-shadow: inset 0 0 0 1px var(--cta); }
.q-likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.q-likert .q-opt { text-align: center; padding: 12px 6px; font-size: 0.9rem; line-height: 1.25; }
.q-likert-ends { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 560px) { .q-likert { grid-template-columns: 1fr; } .q-likert .q-opt { text-align: left; } .q-likert-ends { display: none; } }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border-radius: var(--r-pill); border: 1px solid var(--cta); background: var(--cta); color: var(--on-cta); font: 700 1rem/1 var(--body); text-decoration: none; cursor: pointer; box-shadow: 0 6px 18px rgba(242, 84, 45, .28); transition: background .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--cta-ink); border-color: var(--cta-ink); color: var(--on-cta); box-shadow: 0 8px 22px rgba(242, 84, 45, .34); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); box-shadow: none; }
.btn-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.95rem; cursor: pointer; text-decoration: underline; padding: 8px 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.r-kicker { font-size: 0.9rem; color: var(--muted); margin: 0 0 4px; }
.r-title { font: 700 1.9rem/1.1 var(--head); margin: 0 0 10px; }
.r-badge { display: inline-block; font: 700 0.85rem/1 var(--body); padding: 6px 10px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 10px; }
.r-bars { margin: 18px 0; display: grid; gap: 10px; }
.r-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 44px; gap: 10px; align-items: center; font-size: 0.93rem; }
.r-bar .track { height: 12px; background: var(--bg); border-radius: var(--r-pill); overflow: hidden; }
.r-bar .fill { height: 100%; border-radius: var(--r-pill); }
.r-bar .val { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.r-axis { font-size: 0.93rem; margin: 10px 0; }
.r-axis .ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; }
.r-axis .track { position: relative; height: 12px; background: var(--bg); border-radius: var(--r-pill); }
.r-axis .dot { position: absolute; top: -3px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--cta); border: 3px solid var(--surface); }
.r-text p:last-child { margin-bottom: 0; }
.r-text .r-scale { font-size: 1.05rem; margin: 1.1em 0 0.3em; }
.r-text .r-scale:first-child { margin-top: 0; }
.r-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.r-note { font-size: 0.88rem; color: var(--muted); margin-top: 14px; }

/* ---------- Gutenberg content blocks ---------- */
.entry .wp-block-table { margin: 0 0 1.5em; overflow-x: auto; }
.entry table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); }
.entry th, .entry td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.entry th { background: var(--soft); font-weight: 700; }
.entry figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.entry .wp-block-details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 0; margin: 0 0 10px; }
.entry .wp-block-details summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
.entry .wp-block-details > *:not(summary) { padding: 0 18px; }
.entry .wp-block-details[open] { padding-bottom: 6px; }
.pt-callout, .pt-note { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0; padding: 16px 20px; margin: 0 0 1.5em; }
.pt-note { background: var(--surface); border-left-color: var(--c3); }
.pt-callout > *:last-child, .pt-note > *:last-child { margin-bottom: 0; }
.pt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 1.5em; }
.pt-cards .wp-block-column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.pt-cards .wp-block-column h3 { margin-top: 0; font-size: 1.1rem; }
.pt-cards .wp-block-column p:last-child { margin-bottom: 0; }
.pt-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pt-links li { margin: 0; }
.pt-links a { display: block; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.pt-links a:hover { border-color: var(--accent); color: var(--accent-ink); }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1.5em; }
.wp-block-button__link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); background: var(--cta); color: var(--on-cta); text-decoration: none; font-weight: 700; }
.wp-block-button__link:hover { background: var(--cta-ink); color: var(--on-cta); }

/* ---------- Test grids ---------- */
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0 0 2em; padding: 0; list-style: none; }
.test-grid li { margin: 0; }
.test-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.test-card:hover { border-color: var(--cta); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.test-card .tc-cat { align-self: flex-start; font-size: 0.75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); margin: 0 0 10px; }
.test-card .tc-title { font: 700 1.1rem/1.2 var(--head); margin: 0 0 8px; }
.test-card .tc-desc { font-size: 0.93rem; color: var(--muted); margin: 0 0 12px; flex: 1; }
.test-card .tc-meta { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.test-card .tc-meta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cta); flex: none; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 2em; padding: 0; list-style: none; }
.cat-grid li { margin: 0; }
.cat-grid a { display: block; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.cat-grid a span { display: block; font-weight: 400; font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.cat-grid a:hover { border-color: var(--accent); }

/* ---------- Home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; padding: 24px 0 40px; }
.home-hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); }
.home-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.prism-art { width: 100%; max-width: 440px; justify-self: end; }
@media (max-width: 860px) { .home-hero { grid-template-columns: 1fr; } .prism-art { max-width: 300px; justify-self: start; } }
.section-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 0; margin: 40px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: #C9D0DE; padding: 48px 0 24px; font-size: 0.95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h2 { font-size: 1rem; color: #fff; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-legal { border-top: 1px solid #2B3450; margin-top: 32px; padding-top: 18px; font-size: 0.85rem; color: #9AA4BA; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Misc ---------- */
.notfound { text-align: left; padding: 48px 0; }
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input { flex: 1; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); font: inherit; }

/* ---------- Trivia ---------- */
.q-opt.q-right { background: var(--cat-career); border-color: var(--c3); color: var(--ink); }
.q-opt.q-wrong { background: var(--cat-relationships); border-color: var(--c5); color: var(--ink); }
.q-opt[disabled] { cursor: default; opacity: 1; }
.q-why { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-md); font-size: 0.95rem; background: var(--bg); }
.q-why.is-right { border-left: 4px solid var(--c3); border-radius: 0; }
.q-why.is-wrong { border-left: 4px solid var(--c5); border-radius: 0; }
.r-missed { font-size: 0.92rem; padding-left: 18px; margin: 0 0 8px; }
.r-missed li { margin-bottom: 6px; }

/* Trivia figures (flags, shapes) and memory rounds */
.q-figure { display: flex; justify-content: center; margin: 4px 0 14px; }
.q-figure svg { max-width: 100%; min-width: 0; flex: 0 1 auto; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px rgba(21, 27, 44, 0.12); }
.q-figure .q-noframe svg, .q-figure svg.q-noframe { box-shadow: none; }
.q-memo { margin: 8px 0 12px; padding: 18px; border-radius: var(--r-md); background: var(--bg); font-size: 1.15rem; line-height: 1.7; text-align: center; letter-spacing: 0.02em; }
.q-memo .q-grid { display: inline-grid; gap: 8px; }
.q-timer { text-align: center; color: var(--muted, #5b6478); margin: 0 0 6px; }

/* Embedded quiz (iframe widget) */
body.pt-embed { background: #fff; margin: 0; }
.embed-wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.embed-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.25rem; margin: 0 0 10px; }
.embed-credit { margin: 14px 0 0; font-size: 0.9rem; color: #5b6478; text-align: center; }
.widget-code { width: 100%; min-height: 96px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; padding: 10px; border-radius: var(--r-md); border: 1px solid rgba(21, 27, 44, 0.2); background: var(--bg); }

/* Photo tools (inc/face.php, assets/js/face.js) */
.pt-face { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; margin: 0 0 2rem; }
.pt-face .q-text { font-size: 1.05rem; }
.f-points { padding-left: 1.2em; color: var(--muted); font-size: 0.95rem; }
.f-points li { margin: 4px 0; }
.f-consent { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.95rem; cursor: pointer; margin: 16px 0; }
.f-consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.f-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.f-pick-btn { position: relative; overflow: hidden; }
.f-pick-btn .f-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.f-pick-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.f-pick-btn.is-disabled .f-file { cursor: not-allowed; }
.f-pick-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.f-stage { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.f-figure { background: var(--bg); border-radius: var(--r-md); overflow: hidden; display: flex; justify-content: center; }
.f-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.f-status { color: var(--muted); font-size: 0.95rem; min-height: 1.2em; }
.f-status.is-error { color: var(--c4); font-weight: 700; }
.f-result h4 { font: 700 1.1rem/1.3 var(--head); margin: 1.4rem 0 .5rem; }
.f-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.f-table th, .f-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.f-table th[scope="row"] { font-weight: 400; color: var(--muted); width: 55%; }
.f-chip, .f-dot { display: inline-flex; align-items: center; gap: 8px; }
.f-chip span, .f-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; vertical-align: middle; margin-right: 6px; }
.f-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.f-sw { height: 74px; border-radius: var(--r-sm); border: 1px solid var(--line); display: flex; align-items: flex-end; overflow: hidden; }
.f-sw span { background: rgba(255,255,255,.9); width: 100%; font-size: 0.8rem; padding: 3px 6px; }
.f-controls { display: grid; gap: 16px; }
.f-label { font-weight: 700; margin: 0 0 6px; display: block; }
.f-label input[type="range"] { width: 100%; max-width: 320px; display: block; margin-top: 6px; accent-color: var(--accent); }
.f-swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.f-pick { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; background: var(--bg); color: var(--muted); font-size: 1.1rem; }
.f-pick.is-on { box-shadow: 0 0 0 3px var(--accent); }
.f-style-row { display: flex; flex-wrap: wrap; gap: 8px; }
.f-chipbtn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill); padding: 8px 14px; font: inherit; font-size: 0.93rem; cursor: pointer; color: var(--ink); }
.f-chipbtn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.f-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.f-note { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* Language switcher (inc/i18n.php) */
.lang-switch { position: relative; margin-left: 8px; flex: none; }
.lang-switch summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.9rem; color: var(--ink); }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch[open] summary { border-color: var(--accent); }
.lang-switch ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(21,27,44,.12); display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 2px; max-height: 70vh; overflow: auto; }
.lang-switch a { display: block; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 0.93rem; }
.lang-switch a:hover, .lang-switch a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 860px) { .lang-switch ul { grid-template-columns: 1fr 1fr; right: -8px; } }

/* Right-to-left languages */
[dir="rtl"] .lang-switch { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .lang-switch ul { right: auto; left: 0; }
[dir="rtl"] .q-opt { text-align: right; }
[dir="rtl"] .f-points, [dir="rtl"] .entry ul, [dir="rtl"] .entry ol { padding-left: 0; padding-right: 1.2em; }
[dir="rtl"] .f-table th, [dir="rtl"] .f-table td, [dir="rtl"] .entry table th, [dir="rtl"] .entry table td { text-align: right; }
[dir="rtl"] .r-bar .val { text-align: left; }

/* ================= 2026 redesign: layout components ================= */
body { background: var(--bg); }
.site-header { backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.lang-switch summary { border-radius: var(--r-pill); height: 40px; }

/* Mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  :root { --tabbar: 64px; }
  body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--cta); }
  .site-footer { padding-bottom: 32px; }
}

/* Category tiles with illustrations */
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-grid a { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 150px; padding: 14px 14px 16px; border: 0; border-radius: 20px; background: var(--tile, var(--soft)); color: var(--tile-ink, var(--ink)); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.cat-grid a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--tile-ink, var(--ink)); }
.cat-grid img { width: 72px; height: 72px; object-fit: contain; margin: 0 0 6px; }
.cat-grid .cg-name { font: 700 1.02rem/1.2 var(--head); }
.cat-grid a span.cg-desc { display: block; font-weight: 400; font-size: 0.8rem; line-height: 1.35; color: inherit; opacity: .85; margin: 0; }
.cat-grid .cg-count { margin-top: auto; padding-top: 8px; font-size: 0.78rem; font-weight: 700; }
@media (max-width: 560px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } .cat-grid a span.cg-desc { display: none; } .cat-grid a { min-height: 132px; } .cat-grid img { width: 60px; height: 60px; } }

/* Home hero */
.home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; padding: 28px 0 32px; }
.home-hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.7rem); line-height: 1.04; }
.home-hero h1 .hl { color: var(--cta); }
.home-hero .lede { font-size: 1.12rem; }
.home-hero .actions { align-items: center; gap: 14px; margin-top: 22px; }
.home-hero .actions .btn { min-height: 56px; padding: 0 30px; font-size: 1.05rem; }
.hero-art { justify-self: end; width: 100%; max-width: 480px; aspect-ratio: 1; border-radius: 32px; background: radial-gradient(circle at 30% 25%, var(--cta-soft), transparent 60%), radial-gradient(circle at 75% 80%, var(--accent-soft), transparent 55%); display: grid; place-items: center; }
.hero-art img { width: 92%; height: auto; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 20px 0 0; font-size: 0.92rem; color: var(--muted); }
.trust-row li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.trust-row li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--cat-career) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5 10 16l8-8' fill='none' stroke='%2314A38B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; gap: 8px; padding: 8px 0 16px; }
  .hero-art { order: -1; max-width: 220px; justify-self: center; border-radius: 28px; }
  .home-hero .actions .btn { width: 100%; }
}

/* Result preview (home) */
.rp { margin: 8px 0 32px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.rp-card:hover { border-color: var(--cta); color: var(--ink); }
.rp-card .rp-k { font-size: 0.78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.rp-card .rp-t { font: 700 1.5rem/1.1 var(--head); margin: 0 0 12px; }
.rp-card .rp-bars { display: grid; gap: 8px; margin: 0 0 14px; }
.rp-card .rp-bar { display: grid; grid-template-columns: 92px 1fr 36px; gap: 8px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.rp-card .rp-bar i { display: block; height: 9px; border-radius: 9px; background: var(--soft); overflow: hidden; }
.rp-card .rp-bar i b { display: block; height: 100%; border-radius: 9px; }
.rp-card .rp-go { margin-top: auto; font-weight: 700; color: var(--cta); font-size: 0.95rem; }
.rp-note { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }

/* Test page: start button visible on phones, sticky start bar */
@media (max-width: 900px) {
  .test-hero { gap: 14px; padding: 4px 0 16px; }
  .test-hero h1 { font-size: clamp(1.7rem, 1.2rem + 3vw, 2.2rem); margin-bottom: .3em; }
  .test-hero .lede { font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0; }
  .test-hero .stat-strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 10px; }
  .test-hero .stat-strip li { white-space: nowrap; }
  .test-hero .byline { display: none; }
  .pt-quiz { padding: 20px; border-radius: 18px; }
}
.start-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); z-index: 65; display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.start-bar.show { display: flex; }
.start-bar span { font-size: 0.9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-bar .btn { min-height: 44px; padding: 0 20px; flex: none; }
@media (min-width: 901px) { .start-bar { left: auto; right: 24px; max-width: 420px; } }

/* Section headings on home and hubs */
.entry h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); }
.home .entry h2 { margin-top: 1.4em; }
.cat-grid img { background: #FFFFFF; border-radius: 50%; padding: 6px; box-shadow: 0 4px 14px rgba(22, 26, 51, .08); }
/* Hero composition built from the category icons */
.hero-art { position: relative; background: radial-gradient(circle at 50% 45%, #FFFFFF 0 42%, transparent 43%), radial-gradient(circle at 30% 25%, var(--cta-soft), transparent 60%), radial-gradient(circle at 75% 80%, var(--accent-soft), transparent 55%); }
.hero-art .ha-main { position: relative; width: 66%; height: auto; border-radius: 50%; }
.hero-art .ha-f { position: absolute; width: 22%; height: auto; border-radius: 50%; background: #FFFFFF; padding: 4px; box-shadow: var(--shadow-lg); animation: pt-float 6s ease-in-out infinite; }
.hero-art .ha-1 { top: 8%; left: 6%; }
.hero-art .ha-2 { top: 4%; right: 8%; animation-delay: -1.5s; }
.hero-art .ha-3 { bottom: 8%; left: 10%; animation-delay: -3s; }
.hero-art .ha-4 { bottom: 6%; right: 6%; animation-delay: -4.5s; }
@keyframes pt-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 900px) {
  .pt-quiz .q-intro .r-kicker { display: none; }
  .pt-quiz .q-intro .q-text { font-size: 1.08rem; margin-bottom: 10px; }
  .pt-quiz .q-intro p { font-size: 0.93rem; margin-bottom: 14px; }
  .test-hero .lede { -webkit-line-clamp: 2; }
  .pt-quiz .q-intro .btn { width: 100%; }
}

/* Brand mark and illustrated hero */
.brand svg { width: 34px; height: 34px; color: var(--ink); }
.site-footer .brand svg { color: #FFFFFF; }
.hero-art { background: radial-gradient(circle at 50% 50%, #FFFFFF 0 62%, transparent 63%), radial-gradient(circle at 25% 20%, var(--cta-soft), transparent 60%), radial-gradient(circle at 80% 85%, var(--accent-soft), transparent 55%); }
.hero-art > img { width: 88%; height: auto; border-radius: 50%; }

/* Footer: light by default, dark in dark mode */
.site-footer { background: var(--bg); color: var(--muted); border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--cta); }
.footer-grid h2 { color: var(--ink); }
.footer-legal { border-top-color: var(--line); color: var(--muted); }
.site-footer .brand, .site-footer .brand svg { color: var(--ink) !important; }
.site-footer p[style] { color: var(--muted) !important; }
:root[data-theme="dark"] .site-footer { background: var(--footer); }

/* Non-heading labels in the footer and test sidebar */
.footer-grid .footer-h { font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.test-aside .aside-h { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
