/* =========================================================
   KDEC assessments (tests/): hub, one question per screen, result and report.
   Built on the brand layer (brand/kdec.css, loaded first): every colour, radius, shadow and easing
   is a --k-* token. Paper background, solid white cards with hairline borders, navy structure and
   headings, gold as the single accent (the key action, progress, the focus ring).
   Motion: transform and opacity only, 140-260ms, off under prefers-reduced-motion.
   ========================================================= */
:root {
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--k-bg);
    color: var(--k-ink);
    font-family: var(--k-font);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--k-font-display); font-weight: 700; line-height: 1.35; color: var(--k-navy); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--k-navy-100); color: var(--k-navy-950); }
:focus-visible { outline: 2px solid var(--k-gold-deep); outline-offset: 2px; box-shadow: var(--k-ring); }
[hidden] { display: none !important; }
.ico { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 50; padding: .6rem 1rem; background: var(--k-surface); color: var(--k-navy); border: 2px solid var(--k-gold); border-radius: var(--k-r); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* A custom background picture, only when an admin has set one (backdrop_html()). The paper veil keeps the
   navy text readable over any photo; without a picture the page shows the brand backdrop (.k-backdrop). */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--k-bg); }
.backdrop picture, .backdrop img, .backdrop video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.backdrop img, .backdrop video { object-fit: cover; }
.backdrop .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(242 245 249 / .82), rgb(242 245 249 / .92)); }
.has-photo :is(.hub-hero .lede, .hub-account, .hub-mode-head p, .tfoot-name) { color: var(--k-ink-2); }

/* entrance: fade and an 8px rise, once */
@keyframes t-rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- top bar and footer ---------- */
.tbar { position: relative; z-index: 5; background: var(--k-navy); color: var(--k-on-navy); }
.tbar::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: linear-gradient(to left, var(--k-gold-light), var(--k-gold-deep)); }
.tbar-in { max-width: 1080px; height: 64px; margin: 0 auto; padding: 0 16px; display: flex; align-items: stretch; justify-content: space-between; gap: 12px; }
.tbar-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.tbar-mark { display: block; width: auto; height: 30px; }
.tbar-name { display: grid; line-height: 1; }
.tbar-name b { font: 700 1.2rem/1 var(--k-font-display); letter-spacing: .08em; }
.tbar-name small { margin-top: 5px; font: 500 .75rem/1 var(--k-font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--k-on-navy-2); }
.tbar-links { display: flex; align-items: stretch; }
.tbar-links a { position: relative; display: inline-flex; align-items: center; padding: 0 14px; color: var(--k-on-navy-2); font-size: .92rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tbar-links a.is-active { color: #fff; }
.tbar-links a.is-active::after { content: ""; position: absolute; inset-inline: 14px; bottom: 0; z-index: 1; height: 3px; background: var(--k-gold-light); }
.tbar a:focus-visible { outline-color: var(--k-gold-light); outline-offset: -4px; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .tbar-links a:hover { color: #fff; } }
@media (max-width: 760px) { .tbar-name small { display: none; } }
@media (max-width: 460px) {
    .tbar-name { display: none; }
    .tbar-links a { padding: 0 10px; font-size: .86rem; }
    .tbar-links a.is-active::after { inset-inline: 10px; }
}

.wrap { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 16px 48px; outline: none; }
.wrap.narrow { max-width: 760px; }
.tfoot { display: grid; justify-items: center; gap: 12px; padding: 20px 16px 36px; text-align: center; }
.tfoot-name { margin: 0; font: 600 .82rem/1.4 var(--k-font-display); letter-spacing: .06em; color: var(--k-navy); }
.tfoot .k-tagline { font-size: .75rem; }

/* ---------- type ---------- */
.eyebrow { margin: 0 0 8px; color: var(--k-gold-ink); font-size: .84rem; font-weight: 600; }
.eyebrow[dir="ltr"] { font: 600 .75rem/1.4 var(--k-font-display); letter-spacing: .2em; text-transform: uppercase; }
.lede { margin: 12px 0 0; max-width: 62ch; color: var(--k-ink-2); font-size: 1.05rem; }
.body { margin: 18px 0 0; max-width: 65ch; color: var(--k-ink-2); }
.test-en { margin: 0; color: var(--k-muted); font: 500 .78rem/1.5 var(--k-font-display); letter-spacing: .02em; text-align: right; }

/* ---------- surfaces ---------- */
.panel { background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-xl); box-shadow: var(--k-shadow); }

/* ---------- buttons: navy is the primary, gold is the one key action of a view ---------- */
.btn-primary, .btn-gold, .btn-ghost, .btn-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--k-r);
    font: 600 .95rem/1.2 var(--k-font); white-space: nowrap; text-decoration: none; cursor: pointer;
    transition: transform 140ms var(--k-ease), opacity 140ms var(--k-ease);
    -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--k-navy); color: #fff; }
.btn-gold { background: var(--k-gold-grad); color: var(--k-on-gold); box-shadow: var(--k-shadow-sm); }
.btn-ghost { background: var(--k-surface); color: var(--k-navy); border-color: var(--k-line-strong); }
.btn-link { min-height: 44px; padding: 0 12px; background: none; color: var(--k-ink-2); font-weight: 500; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.02rem; }
.btn-primary .ico, .btn-gold .ico, .btn-ghost .ico { width: 1.1em; height: 1.1em; }
:is(.btn-primary, .btn-gold, .btn-ghost, .btn-link, .icon-btn):active { transform: scale(.97); }
:is(.btn-primary, .btn-gold, .btn-ghost):disabled { opacity: .6; cursor: wait; }
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover { background: var(--k-navy-700); }
    .btn-gold:hover { transform: translateY(-1px); }
    .btn-gold:hover:active { transform: scale(.97); }
    .btn-ghost:hover { background: var(--k-navy-50); border-color: var(--k-navy-300); }
    .btn-link:hover { color: var(--k-navy); text-decoration: underline; }
    .icon-btn:hover { background: var(--k-navy-50); border-color: var(--k-navy-300); }
}
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--k-line-strong); border-radius: var(--k-r); background: var(--k-surface); color: var(--k-navy); cursor: pointer; transition: transform 140ms var(--k-ease); -webkit-tap-highlight-color: transparent; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row-actions.center { justify-content: center; }

/* ---------- hub ---------- */
.is-hub > * { animation: t-rise 240ms var(--k-ease) both; }
.is-hub > :nth-child(2) { animation-delay: 40ms; }
.is-hub > :nth-child(3) { animation-delay: 80ms; }
.is-hub > :nth-child(n + 4) { animation-delay: 120ms; }

.hub-hero { display: grid; gap: 24px; }
@media (min-width: 900px) { .hub-hero { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 48px; align-items: center; padding-block: 12px 4px; } }
.hub-hero h1 { font-size: clamp(1.85rem, 4.6vw, 2.75rem); line-height: 1.3; }
.hub-hero .k-rule { margin-top: 14px; }
.hub-account { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; color: var(--k-muted); font-size: .92rem; }
.hub-account .ico { margin-top: .28em; color: var(--k-navy-600); }
.hub-account a { color: var(--k-navy); font-weight: 600; text-underline-offset: 3px; }

/* the navy panel beside the title: how the assessments work, with the rising bars in its corner */
.hub-panel { position: relative; overflow: hidden; padding: 22px 24px; border-radius: var(--k-r-xl); background: linear-gradient(165deg, var(--k-navy) 0%, var(--k-navy-900) 100%); color: var(--k-on-navy); box-shadow: var(--k-shadow-lift); }
.hub-panel::after { content: ""; position: absolute; inset-inline-end: -6px; bottom: 0; width: 48%; aspect-ratio: 600 / 420; background: url(../../brand/bars-light.svg) no-repeat bottom / contain; pointer-events: none; }
.hub-panel > * { position: relative; z-index: 1; }
.hub-panel-count { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--k-on-navy-line); color: var(--k-on-navy-2); }
.hub-panel-count b { font: 700 2.6rem/1 var(--k-font-display); color: #fff; }
.hub-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hub-facts li { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.hub-facts .ico { color: var(--k-gold-light); }

.empty-state { display: grid; justify-items: center; gap: 6px; margin-top: 28px; padding: 40px 24px; text-align: center; }
.empty-state .k-bars { margin-bottom: 10px; font-size: 2.4rem; }
.empty-state :is(h1, h2) { font-size: 1.35rem; }
.empty-state p { margin: 0 0 12px; max-width: 46ch; color: var(--k-ink-2); }

/* the skills discovery test (iki/): the featured card, and the hub's one gold action */
.compass-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 18px; margin-top: 32px; padding: 20px; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow); color: inherit; text-decoration: none; overflow: hidden; transition: transform 200ms var(--k-ease); }
.compass-card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--k-gold-grad); }
.compass-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--k-r); background: var(--k-navy); font-size: 1.6rem; }
.compass-ico .k-bars i:nth-child(1) { background: #fff; }
.compass-copy { display: grid; gap: 2px; min-width: 0; }
.compass-copy strong { font: 700 1.2rem/1.4 var(--k-font-display); color: var(--k-navy); }
.compass-desc { color: var(--k-ink-2); font-size: .95rem; }
.compass-go, .compass-stopped { grid-column: 1 / -1; }
@media (min-width: 720px) {
    .compass-card { grid-template-columns: auto minmax(0, 1fr) auto; padding: 22px 26px; }
    .compass-go, .compass-stopped { grid-column: auto; }
}
@media (hover: hover) and (pointer: fine) { a.compass-card:hover { transform: translateY(-2px); } }
a.compass-card:active { transform: scale(.985); }
/* stopped by the admin: the card stays as information, not a link */
.compass-card.is-stopped { box-shadow: var(--k-shadow-sm); }
.compass-card.is-stopped::before { background: var(--k-line-strong); }
.compass-card.is-stopped .compass-ico { background: var(--k-navy-100); }
.compass-card.is-stopped .compass-ico .k-bars i { background: var(--k-navy-300); }
.compass-card.is-stopped :is(strong, .compass-desc) { color: var(--k-muted); }
.compass-stopped { display: inline-flex; align-items: center; justify-self: start; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--k-r-sm); background: var(--k-warn-bg); color: var(--k-warn); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.compass-stopped .ico { width: 1em; height: 1em; }

/* the four modes: a label column and the mode's tests as rows */
.hub-modes { margin-top: 12px; }
.hub-mode { display: grid; gap: 16px; padding-block: 28px; }
.hub-mode + .hub-mode { border-top: 1px solid var(--k-line-strong); }
@media (min-width: 900px) {
    .hub-mode { grid-template-columns: 270px minmax(0, 1fr); gap: 48px; padding-block: 32px; }
    .hub-mode-head { position: sticky; top: 20px; align-self: start; }
}
.hub-mode-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: var(--k-r); background: var(--k-navy-100); color: var(--k-navy); }
.hub-mode-head h2 { font-size: 1.2rem; }
.hub-mode-head p { margin: 6px 0 0; max-width: 52ch; color: var(--k-ink-2); font-size: .95rem; }
.hub-mode-head .hub-mode-count { margin-top: 10px; color: var(--k-muted); font-size: .84rem; font-weight: 500; }
.test-list { align-self: start; list-style: none; margin: 0; padding: 0; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow-sm); overflow: hidden; }
.test-list li + li { border-top: 1px solid var(--k-line); }
.test-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 18px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.test-row:focus-visible { outline-offset: -3px; box-shadow: none; }
.test-row-main { grid-column: 1 / -1; display: grid; gap: 3px; min-width: 0; }
.test-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.test-row h3 { font-size: 1.08rem; }
.test-row-sub { margin: 4px 0 0; max-width: 60ch; color: var(--k-ink-2); font-size: .94rem; }
.test-resume { padding: 2px 9px; border-radius: 6px; background: var(--k-gold-50); color: var(--k-gold-ink); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.test-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--k-muted); font-size: .86rem; }
.test-meta span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.test-meta .ico { width: 1.05em; height: 1.05em; }
.test-go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r); color: var(--k-navy); font-size: .92rem; font-weight: 600; white-space: nowrap; transition: transform 140ms var(--k-ease); }
.test-go .ico { width: 1.05em; height: 1.05em; transition: transform 200ms var(--k-ease); }
.test-row:active .test-go { transform: scale(.97); }
@media (min-width: 720px) {
    .test-row { grid-template-columns: minmax(0, 1fr) 118px auto; gap: 20px; padding: 20px 22px; }
    .test-row-main { grid-column: auto; }
    .test-meta { display: grid; gap: 4px; }
}
@media (hover: hover) and (pointer: fine) {
    .test-row:hover { background: var(--k-surface-2); }
    .test-row:hover .test-go { background: var(--k-navy); border-color: var(--k-navy); color: #fff; }
    .test-row:hover .test-go .ico { transform: translateX(-3px); }
}
.hub-note { display: flex; gap: 12px; margin-top: 8px; padding: 16px 18px; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); color: var(--k-ink-2); font-size: .92rem; }
.hub-note p { margin: 0; max-width: 78ch; }
.hub-note .ico { margin-top: .28em; color: var(--k-navy-600); }

/* ---------- a test: the intro ---------- */
.intro-card { padding: 24px 20px; animation: t-rise 240ms var(--k-ease) both; }
@media (min-width: 640px) { .intro-card { padding: 36px 40px; } }
.intro-card h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.intro-card h2 { font-size: 1.5rem; }
.intro-card .test-en { margin-top: 4px; }
.intro-card.center { text-align: center; }
.intro-card.center .lede { margin-inline: auto; }
.chips { list-style: none; margin: 20px 0 0; padding: 14px 0; display: flex; flex-wrap: wrap; gap: 8px 24px; border-block: 1px solid var(--k-line); color: var(--k-ink-2); font-size: .92rem; }
.chips li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chips .ico { color: var(--k-navy-600); }
.note-box { display: flex; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: var(--k-r); background: var(--k-info-bg); color: var(--k-ink-2); font-size: .95rem; }
.note-box p { margin: 0; }
.note-box .ico { margin-top: .25em; color: var(--k-info); }
.resume-box { margin-top: 22px; padding: 18px; border-radius: var(--k-r); background: var(--k-gold-50); border: 1px solid var(--k-gold-light); }
.resume-box p { margin: 0; }
@media (max-width: 559px) { .resume-box .row-actions > * { flex: 1 1 100%; } }
.start-form { display: grid; gap: 16px; margin-top: 24px; }
.fields-2 { display: grid; gap: 14px; }
@media (min-width: 560px) { .fields-2 { grid-template-columns: 2fr 1fr; } }
.fld { display: grid; gap: 6px; color: var(--k-ink); font-size: .92rem; font-weight: 500; }
.fld small { color: var(--k-muted); font-weight: 400; }
.fld input, .q-input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r); background: var(--k-surface); color: var(--k-ink); font: inherit; font-size: 1rem; font-weight: 400; }
.fld input::placeholder, .q-input::placeholder { color: var(--k-muted); opacity: .85; }
.fld input:focus, .q-input:focus { outline: none; border-color: var(--k-gold); box-shadow: var(--k-ring); }
.disclaimer { border: 1px solid var(--k-line); border-radius: var(--k-r); background: var(--k-surface-2); }
.disclaimer summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: var(--k-r); color: var(--k-navy); font-weight: 600; font-size: .95rem; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.disclaimer summary::-webkit-details-marker { display: none; }
.disclaimer summary .ico { color: var(--k-warn); }
.disclaimer summary span { flex: 1; }
.disclaimer summary::after { content: ""; width: 8px; height: 8px; margin-inline-end: 4px; border: solid var(--k-muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform 200ms var(--k-ease-inout); }
.disclaimer[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.disclaimer p { margin: 0; padding: 0 16px 14px; color: var(--k-ink-2); font-size: .93rem; }
.consent { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-block: 8px; color: var(--k-ink); cursor: pointer; }
.consent input { position: absolute; opacity: 0; pointer-events: none; }
.consent .box { display: grid; place-items: center; width: 24px; height: 24px; flex: none; margin-top: 2px; border: 1.5px solid var(--k-line-strong); border-radius: 6px; background: var(--k-surface); }
.consent .box .ico { width: 15px; height: 15px; color: #fff; stroke-width: 3; opacity: 0; transform: scale(.8); transition: opacity 140ms var(--k-ease), transform 140ms var(--k-ease); }
.consent input:checked + .box { background: var(--k-navy); border-color: var(--k-navy); }
.consent input:checked + .box .ico { opacity: 1; transform: none; }
.consent input:focus-visible + .box { outline: 2px solid var(--k-gold-deep); outline-offset: 2px; box-shadow: var(--k-ring); }
.form-msg { margin: 0; color: var(--k-danger); font-size: .92rem; font-weight: 500; }
.form-msg:empty { display: none; }
@media (max-width: 559px) { .start-form .btn-lg, .row-actions .btn-lg { width: 100%; } }

/* ---------- a test: one question per screen ---------- */
.quiz-top { position: sticky; top: 8px; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 8px; padding-inline-end: 14px; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow); }
.quiz-progress { flex: 1; min-width: 0; }
.quiz-progress-text { display: flex; justify-content: space-between; gap: 10px; color: var(--k-ink-2); font-size: .84rem; }
.quiz-progress-text span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-progress-text .num { color: var(--k-navy); font-weight: 600; }
.bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--k-navy-100); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(to left, var(--k-gold-light), var(--k-gold-deep)); transform-origin: right; transform: scaleX(var(--v, 0)); transition: transform 260ms var(--k-ease-inout); }
.save-dot { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--k-muted); font-size: .75rem; white-space: nowrap; }
.save-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k-line-strong); }
.save-dot.is-saving::before { background: var(--k-gold); }
.save-dot.is-saved::before { background: var(--k-ok); }
.save-dot.is-error { color: var(--k-danger); }
.save-dot.is-error::before { background: var(--k-danger); }
@media (max-width: 560px) { .save-dot:not(.is-error) { font-size: 0; gap: 0; } }

.q-stage { position: relative; display: grid; margin-top: 14px; }
.q-stage > .q-card { grid-area: 1 / 1; min-width: 0; }
.q-card { padding: 24px 18px 22px; animation: q-in 220ms var(--k-ease) backwards; }
@media (min-width: 640px) { .q-card { padding: 34px 36px 30px; } }
.q-card.is-leaving { animation: q-out 140ms var(--k-ease) forwards; pointer-events: none; }
/* RTL: going forward, the next question comes in from the left */
@keyframes q-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * -16px)); } }
@keyframes q-out { to { opacity: 0; transform: translateX(calc(var(--dir, 1) * 16px)); } }
.q-step-label { margin: 0 0 8px; color: var(--k-gold-ink); font-size: .86rem; font-weight: 600; }
.q-prompt { font-size: clamp(1.2rem, 4.4vw, 1.55rem); font-weight: 600; line-height: 1.6; outline: none; box-shadow: none; }
/* a long briefing (the intro step of a guided exercise) reads as text, not as a headline */
.q-prompt.is-long { max-width: 62ch; color: var(--k-ink); font-family: var(--k-font); font-size: 1.05rem; font-weight: 400; line-height: 1.95; }
.q-help { margin: 10px 0 0; color: var(--k-ink-2); font-size: .95rem; }
.q-error { margin: 12px 0 0; color: var(--k-danger); font-size: .92rem; font-weight: 500; }
.q-hint { display: none; margin: 14px 0 0; color: var(--k-muted); font-size: .84rem; }
@media (hover: hover) and (pointer: fine) { .q-hint { display: block; } }
.q-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.q-text { min-height: 132px; margin-top: 18px; line-height: 1.8; resize: vertical; }
.q-input:not(.q-text) { margin-top: 18px; font-size: 1.15rem; text-align: right; }

.opts { display: grid; gap: 10px; margin-top: 22px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r); background: var(--k-surface); color: var(--k-ink); font: inherit; font-size: 1rem; text-align: right; cursor: pointer; transition: transform 140ms var(--k-ease); -webkit-tap-highlight-color: transparent; }
.opt:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .opt:not(.is-on):hover { background: var(--k-surface-2); border-color: var(--k-navy-300); } }
.opt-key { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid var(--k-line-strong); border-radius: var(--k-r-sm); background: var(--k-surface-2); color: var(--k-ink-2); font: 600 .85rem/1 var(--k-font-display); }
.opts.is-multi .opt-key { border-radius: 6px; background: var(--k-surface); }
.opts.is-multi .opt-key .ico { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.opt-text { display: grid; gap: 2px; min-width: 0; }
.opt-text small { color: var(--k-muted); font-size: .86rem; line-height: 1.55; }
.opt.is-on { border-color: var(--k-navy); background: var(--k-navy-50); box-shadow: inset 0 0 0 1px var(--k-navy); color: var(--k-navy-950); }
.opt.is-on:focus-visible { box-shadow: inset 0 0 0 1px var(--k-navy), var(--k-ring); }
.opt.is-on .opt-key { background: var(--k-navy); border-color: var(--k-navy); color: #fff; animation: key-in 160ms var(--k-ease); }
.opt.is-on .opt-text small { color: var(--k-ink-2); }
.opts.is-multi .opt.is-on .opt-key .ico { opacity: 1; }
@keyframes key-in { from { transform: scale(.85); } }
@media (min-width: 640px) { .opts.is-many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.slider { margin-top: 26px; }
.slider-out { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.slider-out b { font: 700 3.4rem/1 var(--k-font-display); color: var(--k-navy); font-variant-numeric: tabular-nums; }
.slider-out small { color: var(--k-muted); font-size: .9rem; }
.slider.is-untouched .slider-out b { color: var(--k-navy-300); }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 10px 0 0; background: transparent; cursor: pointer; }
.slider input[type="range"]:focus-visible { outline: none; box-shadow: none; }
.slider input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--k-navy) calc(var(--v) * 100%), var(--k-navy-100) 0); }
.slider input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--k-navy) calc(var(--v) * 100%), var(--k-navy-100) 0); }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border: 3px solid var(--k-navy); border-radius: 50%; background: var(--k-surface); box-shadow: var(--k-shadow); }
.slider input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid var(--k-navy); border-radius: 50%; background: var(--k-surface); }
.slider input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--k-gold-deep); box-shadow: var(--k-ring); }
.slider input[type="range"]:focus-visible::-moz-range-thumb { border-color: var(--k-gold-deep); box-shadow: var(--k-ring); }
.slider-ends { display: flex; justify-content: space-between; color: var(--k-muted); font-size: .84rem; direction: ltr; }

.done-mark { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 16px; border-radius: var(--k-r-lg); background: var(--k-navy); color: #fff; }
.done-mark .ico { width: 30px; height: 30px; stroke-width: 2.6; }

/* ---------- the result: its navy cover, the section links, the report ---------- */
.is-result > * { animation: t-rise 240ms var(--k-ease) both; }
.is-result > :nth-child(2) { animation-delay: 40ms; }
.is-result > :nth-child(n + 3) { animation-delay: 80ms; }

.result-hero { position: relative; overflow: hidden; display: grid; gap: 20px; padding: 24px 20px; border-radius: var(--k-r-xl); background: linear-gradient(165deg, var(--k-navy) 0%, var(--k-navy-900) 100%); color: var(--k-on-navy); box-shadow: var(--k-shadow-lift); }
.result-hero::after { content: ""; position: absolute; inset-inline-end: -8px; bottom: 0; width: min(46%, 380px); aspect-ratio: 600 / 420; background: url(../../brand/bars-light.svg) no-repeat bottom / contain; opacity: .7; pointer-events: none; }
.result-hero > * { position: relative; z-index: 1; }
@media (min-width: 900px) { .result-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 40px; padding: 34px 36px 26px; align-items: center; } }
.result-hero h1 { color: #fff; font-size: clamp(1.6rem, 4.6vw, 2.3rem); }
.result-hero .eyebrow { color: var(--k-gold-light); }
.result-hero .lede { margin-top: 8px; color: var(--k-on-navy-2); font-size: 1rem; }
.result-hero .lede span { unicode-bidi: isolate; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions .btn-gold { flex: 1 1 100%; min-height: 50px; }
.result-actions .btn-ghost { flex: 1 1 auto; padding: 0 14px; background: transparent; border-color: rgb(255 255 255 / .3); color: var(--k-on-navy); font-size: .9rem; }
.result-hero :focus-visible { outline-color: var(--k-gold-light); }
@media (hover: hover) and (pointer: fine) { .result-actions .btn-ghost:hover { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .55); } }
.private-note { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 8px; margin: 0; padding-top: 16px; border-top: 1px solid var(--k-on-navy-line); color: var(--k-on-navy-2); font-size: .86rem; }
.private-note .ico { margin-top: .3em; width: 1em; height: 1em; }
.validity-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 12px; border-radius: var(--k-r-sm); font-size: .86rem; font-weight: 600; }
.validity-chip .ico { width: 1em; height: 1em; stroke-width: 2.6; }
.validity-chip.is-good { background: var(--k-ok-bg); color: var(--k-ok); }
.validity-chip.is-caution { background: var(--k-warn-bg); color: var(--k-warn); }
.validity-chip.is-questionable { background: var(--k-danger-bg); color: var(--k-danger); }

/* section links: stay in reach while reading the long report; the current section carries the gold marker */
.tr-jump { position: sticky; top: 8px; z-index: 4; display: flex; gap: 4px; margin-top: 14px; padding: 6px; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow); overflow-x: auto; scrollbar-width: none; }
.tr-jump::-webkit-scrollbar { display: none; }
.tr-jump a { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 14px; border-radius: var(--k-r-sm); color: var(--k-ink-2); font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform 140ms var(--k-ease); }
.tr-jump a:focus-visible { outline-offset: -2px; box-shadow: none; }
.tr-jump a:active { transform: scale(.97); }
.tr-jump .ico { width: 1em; height: 1em; color: var(--k-navy-600); }
.tr-jump a.is-current { background: var(--k-navy-50); color: var(--k-navy); font-weight: 600; }
.tr-jump a.is-current::after { content: ""; position: absolute; inset-inline: 14px; bottom: 4px; height: 2px; background: var(--k-gold); }
@media (hover: hover) and (pointer: fine) { .tr-jump a:hover { background: var(--k-navy-50); color: var(--k-navy); } }

.report { display: grid; gap: 14px; margin-top: 14px; }
.tr-block { min-width: 0; padding: 22px 18px; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow-sm); scroll-margin-top: 78px; }
@media (min-width: 640px) { .tr-block { padding: 28px 30px; } }
.tr-block h2 { margin-bottom: 12px; font-size: 1.25rem; }
.tr-block h3 { font-size: 1.08rem; }
.tr-lede, .tr-note { margin: 0 0 14px; max-width: 75ch; color: var(--k-ink-2); font-size: .94rem; }
.tr-note { margin: 16px 0 0; color: var(--k-muted); }
.tr-kicker { margin: 0 0 4px; color: var(--k-gold-ink); font-size: .84rem; font-weight: 600; }
.tr-sub { margin: 10px 0 6px; color: var(--k-muted); font-size: .86rem; }

/* a band's tone: one navy ramp (the higher the band, the deeper the navy), ending in the alert red */
.tone-low { --tone: var(--k-navy-300); --tone-bg: var(--k-navy-50); --tone-ink: var(--k-navy-700); }
.tone-mid { --tone: var(--k-navy-600); --tone-bg: var(--k-navy-100); --tone-ink: var(--k-navy); }
.tone-high { --tone: var(--k-navy); --tone-bg: var(--k-navy); --tone-ink: #fff; }
.tone-alert { --tone: var(--k-danger); --tone-bg: var(--k-danger-bg); --tone-ink: var(--k-danger); }
.tr-chip, .tr-band { display: inline-flex; align-items: center; flex: none; padding: 1px 10px; border-radius: 6px; background: var(--tone-bg, var(--k-navy-100)); color: var(--tone-ink, var(--k-navy)); font-size: .78rem; font-weight: 600; line-height: 1.75; white-space: nowrap; }
.tr-band { padding: 3px 12px; font-size: .84rem; }

.tr-crisis { background: var(--k-danger-bg); border-color: rgb(179 38 30 / .35); }
.tr-crisis h2 { color: var(--k-danger); }
.tr-crisis p { margin: 0 0 10px; max-width: 75ch; color: var(--k-ink); }
.tr-crisis .tr-crisis-line { margin: 0; max-width: none; padding: 12px 14px; border-radius: var(--k-r); background: var(--k-surface); border: 1px solid rgb(179 38 30 / .22); font-weight: 500; }

/* 1. your result in one minute */
.tr-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tr-findings li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-find-n { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--k-r-sm); background: var(--k-navy); color: var(--k-gold-hi); font: 700 .95rem/1 var(--k-font-display); }
.tr-findings p { margin: 0; color: var(--k-ink); font-size: .96rem; line-height: 1.75; }
.tr-findings .tr-find-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
.tr-findings .tr-find-head b { color: var(--k-navy); font-weight: 600; }
.tr-summary-note { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--k-r); background: var(--k-warn-bg); color: var(--k-ink-2); font-size: .9rem; }

/* 2. how to read this report */
.tr-block.tr-howto { padding-block: 12px; }
.tr-howto-box > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; border-radius: var(--k-r); list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tr-howto-box > summary::-webkit-details-marker { display: none; }
.tr-howto-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--k-r); background: var(--k-navy-100); color: var(--k-navy); }
.tr-howto-title { flex: 1; min-width: 0; display: grid; }
.tr-block .tr-howto-title h2 { margin: 0; font-size: 1.1rem; }
.tr-howto-title small { color: var(--k-muted); font-size: .84rem; }
.tr-howto-more { flex: none; padding: 6px 12px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r-sm); background: var(--k-surface); color: var(--k-navy); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.tr-howto-more::after { content: "اعرض الشرح"; }
.tr-howto-box[open] .tr-howto-more::after { content: "إخفاء الشرح"; }
.tr-howto-list { margin: 16px 0 6px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tr-howto-list > div { padding: 12px 14px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-howto-list dt { color: var(--k-navy); font-weight: 600; font-size: .94rem; }
.tr-howto-list dd { margin: 4px 0 0; color: var(--k-ink-2); font-size: .92rem; }
.tr-howto-box[open] .tr-howto-list { animation: t-rise 200ms var(--k-ease) both; }
@media (max-width: 520px) { .tr-howto-title small { display: none; } .tr-howto-more { padding: 6px 10px; } }

/* the guided exercise: before and after, the record, the thinking patterns */
.tr-shift { display: grid; gap: 12px; }
@media (min-width: 760px) { .tr-shift { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-shift-card { display: grid; gap: 10px; padding: 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-shift-card .tr-bar { grid-template-columns: 44px 1fr auto; }
.tr-bar.is-before .tr-bar-track > span { background: var(--k-navy-300); }
.tr-delta { margin: 0; color: var(--k-ink-2); font-size: .92rem; font-weight: 500; }
.tr-delta.is-down { color: var(--k-ok); }
.tr-record { display: grid; gap: 10px; margin: 0; }
.tr-record > div { padding: 14px 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-record > div.is-key { background: var(--k-gold-50); border-color: var(--k-gold-light); }
.tr-record dt { color: var(--k-navy); font-size: .88rem; font-weight: 600; }
.tr-record dt small { display: block; color: var(--k-muted); font-size: .8rem; font-weight: 400; }
.tr-record dd { margin: 4px 0 0; color: var(--k-ink); overflow-wrap: anywhere; }
.tr-distortions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .tr-distortions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-distortions li { padding: 14px 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-distortions b { display: block; color: var(--k-navy); }
.tr-distortions span { display: block; margin-top: 4px; color: var(--k-ink-2); font-size: .9rem; }

/* 3. all dimensions side by side: the radar and one bar each, linked to its detail card */
.tr-profile-grid { display: grid; gap: 18px; align-items: center; }
@media (min-width: 860px) { .tr-profile-grid { grid-template-columns: 340px 1fr; } .tr-profile-grid.is-bars-only { grid-template-columns: 1fr; } }
.tr-radar { margin: 0; display: grid; place-items: center; }
.tr-radar svg { width: 100%; max-width: 340px; height: auto; overflow: visible; }
.tr-radar-shape { animation: fade-in 260ms var(--k-ease) both; }
@keyframes fade-in { from { opacity: 0; } }
.tr-bars { display: grid; gap: 12px; }
.tr-bar { display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 12px; font-size: .95rem; }
.tr-bar-name { color: var(--k-ink-2); }
.tr-bar-track { height: 10px; border-radius: 5px; background: var(--k-navy-50); overflow: hidden; }
.tr-bar-track > span { display: block; height: 100%; border-radius: inherit; background: var(--k-navy); transform-origin: right; transform: scaleX(var(--v)); animation: bar-in 260ms var(--k-ease) both; }
.tr-bar.tone-alert .tr-bar-track > span { background: var(--k-danger); }
@keyframes bar-in { from { transform: scaleX(0); } }
.tr-bar-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-bar-val b { color: var(--k-navy); font-weight: 700; }
.tr-bar-val small { color: var(--k-muted); font-size: .8rem; }
a.tr-bar.has-band { grid-template-columns: minmax(110px, 30%) 1fr auto 112px; min-height: 44px; margin: -4px -8px; padding: 4px 8px; border-radius: var(--k-r-sm); color: inherit; text-decoration: none; }
a.tr-bar.has-band:focus-visible { outline-offset: 0; }
@media (hover: hover) and (pointer: fine) { a.tr-bar.has-band:hover { background: var(--k-surface-2); } }
.tr-bar-band { justify-self: start; }
@media (max-width: 600px) {
    a.tr-bar.has-band { grid-template-columns: 1fr 104px; gap: 4px 12px; }
    a.tr-bar.has-band .tr-bar-name { grid-column: 1; grid-row: 1; color: var(--k-ink); font-weight: 500; }
    a.tr-bar.has-band .tr-bar-band { grid-column: 2; grid-row: 1; justify-self: end; }
    a.tr-bar.has-band .tr-bar-track { grid-column: 1; grid-row: 2; }
    a.tr-bar.has-band .tr-bar-val { grid-column: 2; grid-row: 2; justify-self: end; }
}

.tr-quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; }
.tr-quad { display: grid; place-items: center; gap: 4px; min-height: 84px; padding: 12px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); color: var(--k-ink-2); font-size: .92rem; text-align: center; }
.tr-quad.is-you { background: var(--k-navy); border-color: var(--k-navy); color: #fff; font-weight: 600; }
.tr-quad b { padding: 1px 8px; border-radius: 6px; background: var(--k-gold-light); color: var(--k-on-gold); font-size: .76rem; }
.tr-quadrant h3 { margin-top: 16px; }
.tr-quadrant p { max-width: 75ch; color: var(--k-ink-2); }
.tr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tr-stats div { display: grid; gap: 6px; padding: 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-stats b { font: 700 2.4rem/1 var(--k-font-display); color: var(--k-navy); }
.tr-stats span { color: var(--k-ink-2); font-size: .9rem; }

/* 4. the band scale: bands from the right (lowest) to the left (highest), your pin, the reference average */
.tr-scale { margin: 14px 0 4px; padding: 0 18px; } /* room for the pin's label at either end */
.tr-scale-rail { position: relative; padding-top: 36px; }
.tr-scale-rail:has(.tr-norm) { margin-bottom: 24px; }
.tr-scale-track { display: flex; align-items: center; gap: 3px; height: 16px; }
.tr-seg { display: block; height: 10px; border-radius: 2px; background: var(--tone, var(--k-navy-600)); opacity: .3; }
.tr-seg:first-child { border-radius: 0 5px 5px 0; }
.tr-seg:last-child { border-radius: 5px 0 0 5px; }
.tr-seg:only-child { border-radius: 5px; }
.tr-seg.is-you { height: 16px; opacity: 1; }
.tr-pin { position: absolute; top: 0; z-index: 1; display: grid; justify-items: center; transform: translateX(50%); pointer-events: none; }
.tr-pin b { display: block; min-width: 40px; padding: 2px 10px; border-radius: 6px; background: var(--k-navy-950); color: #fff; font: 700 .86rem/1.6 var(--k-font-display); text-align: center; font-variant-numeric: tabular-nums; }
.tr-pin i { position: relative; display: block; width: 2px; height: 18px; background: var(--k-navy-950); }
.tr-pin i::after { content: ""; position: absolute; left: -5px; bottom: -6px; width: 8px; height: 8px; border-radius: 50%; background: var(--k-gold-light); border: 2px solid var(--k-navy-950); }
.tr-norm { position: absolute; top: 32px; display: grid; justify-items: center; transform: translateX(50%); pointer-events: none; }
.tr-norm i { display: block; width: 2px; height: 24px; background: var(--k-muted); }
.tr-norm small { margin-top: 2px; color: var(--k-muted); font-size: .75rem; line-height: 1.3; white-space: nowrap; }
.tr-scale-labels { display: flex; gap: 3px; margin-top: 6px; }
.tr-seg-label { display: grid; justify-items: center; align-content: start; min-width: 0; color: var(--k-muted); font-size: .78rem; line-height: 1.45; text-align: center; }
.tr-seg-label b { font-weight: 500; }
.tr-seg-label small { font-size: .75rem; font-variant-numeric: tabular-nums; }
.tr-seg-label.is-you { color: var(--k-navy); }
.tr-seg-label.is-you b { font-weight: 700; }

/* 5. one card per dimension */
.tr-dims2 { display: grid; gap: 14px; }
.tr-dim2 { min-width: 0; padding: 18px 16px; border-radius: var(--k-r); background: var(--k-surface); border: 1px solid var(--k-line-strong); scroll-margin-top: 78px; }
@media (min-width: 640px) { .tr-dim2 { padding: 22px 24px; } }
/* on a phone a card inside a card costs too much reading width: the dimensions become ruled sections */
@media (max-width: 639px) {
    .tr-dims2 { gap: 0; }
    .tr-dim2 { padding: 22px 0; border: 0; border-top: 2px solid var(--k-navy); border-radius: 0; }
    .tr-dim2:last-child { padding-bottom: 0; }
}
.tr-dim2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--k-line); }
.tr-dim2-head h3 { font-size: 1.2rem; }
.tr-dim2-head small { display: block; color: var(--k-muted); font: 500 .8rem/1.4 var(--k-font-display); letter-spacing: .02em; text-align: right; }
.tr-dim2-what { margin: 12px 0 0; max-width: 80ch; color: var(--k-ink-2); font-size: .95rem; }
.tr-dim2-what b { color: var(--k-navy); font-weight: 600; }
.tr-dim2 h4 { margin: 0 0 6px; font-size: .96rem; }
.tr-dim2-num { margin: 6px 0 0; color: var(--k-ink); font-size: .92rem; font-variant-numeric: tabular-nums; }
.tr-dim2-body { display: grid; gap: 14px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); align-items: start; }
.tr-dim2-meaning > p { margin: 0; color: var(--k-ink); font-size: .96rem; }
.tr-dim2-meaning > p.tr-sub { margin-top: 10px; color: var(--k-muted); font-size: .86rem; }
.tr-dim2-sides { display: grid; gap: 10px; }
.tr-side { padding: 12px 14px; border-radius: var(--k-r); }
.tr-side.is-plus { background: var(--k-ok-bg); }
.tr-side.is-plus h4 { color: var(--k-ok); }
.tr-side.is-watch { background: var(--k-warn-bg); }
.tr-side.is-watch h4 { color: var(--k-warn); }
.tr-dim2-tips { margin-top: 14px; padding: 14px 16px; border-radius: var(--k-r); background: var(--k-navy-50); }

/* lists with drawn markers (the PDF renderer draws native RTL markers on the wrong side) */
.tr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--k-ink); font-size: .94rem; line-height: 1.7; }
.tr-list .tr-mk { flex: none; width: 6px; height: 6px; margin-top: .75em; border-radius: 50%; background: var(--k-navy-600); }
.tr-list.is-plus .tr-mk { background: var(--k-ok); }
.tr-list.is-watch .tr-mk { background: var(--k-warn); }
.tr-list.is-tips .tr-mk, .tr-steps .tr-mk:not(:empty) { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 6px; background: var(--k-navy); color: var(--k-gold-hi); font: 700 .78rem/1 var(--k-font-display); }

/* 6. next steps */
.tr-next-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.tr-next-col { padding: 16px 18px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); }
.tr-next-col.is-week { background: var(--k-navy-50); border-color: var(--k-navy-100); }
.tr-next-col h3 { font-size: 1.05rem; }
.tr-next-col .tr-sub { margin-top: 4px; }
.tr-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.tr-steps li { display: flex; align-items: flex-start; gap: 10px; }
.tr-steps .tr-mk { flex: none; width: 6px; height: 6px; margin-top: .7em; border-radius: 50%; background: var(--k-navy-600); }
.tr-steps b { display: block; color: var(--k-navy); font-weight: 600; font-size: .95rem; }
.tr-steps p { margin: 2px 0 0; color: var(--k-ink-2); font-size: .93rem; }
.tr-next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tr-validity-title { display: inline-flex; margin: 0 0 10px; padding: 3px 12px; border-radius: var(--k-r-sm); font-size: .9rem; font-weight: 600; }
.tr-validity.is-good .tr-validity-title { background: var(--k-ok-bg); color: var(--k-ok); }
.tr-validity.is-caution .tr-validity-title { background: var(--k-warn-bg); color: var(--k-warn); }
.tr-validity.is-questionable .tr-validity-title { background: var(--k-danger-bg); color: var(--k-danger); }
.tr-list.is-validity li { color: var(--k-ink-2); }
.tr-science p { margin: 0 0 12px; max-width: 80ch; color: var(--k-ink-2); }
.tr-science .tr-disclaimer { margin: 0; max-width: none; padding: 12px 14px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); font-size: .9rem; }

/* ---------- the written (AI) report. Its parts (loader, contents, text, tables) are drawn by
   iki/assets/css/report.css, shared with the skills test; these rules only set how the card sits on
   this page, and style the parts that stylesheet leaves to its host page (the consent box, the buttons). ---------- */
.ai-report.tr-ai { margin: 14px 0 0; padding: 22px 18px; border-radius: var(--k-r-lg); box-shadow: var(--k-shadow-sm); scroll-margin-top: 78px; }
@media (min-width: 640px) { .ai-report.tr-ai { padding: 28px 30px; } }
.tr-ai .ai-head { margin-bottom: 18px; }
.tr-ai .ai-head h2 { margin: 10px 0 6px; font-size: 1.3rem; }
.tr-ai .ai-head p { max-width: 65ch; }
.ai-optin { display: grid; gap: 12px; justify-items: start; padding: 16px; border-radius: var(--k-r); background: var(--k-surface-2); border: 1px solid var(--k-line); color: var(--k-ink-2); font-size: .94rem; }
.ai-optin p { margin: 0; max-width: 70ch; }
/* the loader's four circles belong to the skills test: here they take the brand's navy and gold */
.tr-ai .rep-orb span:nth-child(1) { background: var(--k-navy-600); }
.tr-ai .rep-orb span:nth-child(2) { background: var(--k-gold-light); }
.tr-ai .rep-orb span:nth-child(3) { background: var(--k-navy-300); }
.tr-ai .rep-orb span:nth-child(4) { background: var(--k-gold); }
/* report.js names its buttons after the skills test's own classes */
.tr-ai :is(.a-btn-primary, .btn-brand) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: var(--k-r); background: var(--k-navy); color: #fff; font: 600 .95rem/1.2 var(--k-font); white-space: nowrap; cursor: pointer; transition: transform 140ms var(--k-ease); }
.tr-ai :is(.a-btn-primary, .btn-brand):active { transform: scale(.97); }

/* ---------- PDF pages: report.js lays the report's blocks on white A4 sheets (always 794px wide), inside
   its own .rep-body. The doubled class outranks that stylesheet's text rules, which would otherwise reach
   these blocks; sizes are in px because the sheet is paper, whatever the screen. ---------- */
.pdf-sheet .tr-block.tr-block { margin: 0 0 12px; padding: 18px 20px; background: #fff; border: 1px solid var(--k-line); border-radius: 12px; box-shadow: none; color: var(--k-ink); }
.pdf-sheet .tr-block.tr-block.is-piece { padding-top: 12px; }
.pdf-sheet .tr-block.tr-block :is(h2, h3, h4) { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; font-family: var(--k-font-display); color: var(--k-navy); }
.pdf-sheet .tr-block.tr-block h2 { margin-bottom: 10px; font-size: 17px; }
.pdf-sheet .tr-block.tr-block h3 { font-size: 15px; }
.pdf-sheet .tr-block.tr-block h4 { margin-bottom: 3px; font-size: 12.5px; }
.pdf-sheet .tr-block.tr-block p { margin: 0 0 8px; color: var(--k-ink-2); font-size: 12.5px; line-height: 1.65; }
.pdf-sheet .tr-block.tr-block :is(ul, ol) { margin: 0; padding: 0; list-style: none; color: var(--k-ink); }
.pdf-sheet .tr-block.tr-block li { position: static; margin: 0; padding: 0; }
.pdf-sheet .tr-block.tr-block .tr-kicker { margin-bottom: 2px; color: var(--k-gold-ink); font-size: 11.5px; }
.pdf-sheet .tr-block.tr-block :is(.tr-lede, .tr-note) { max-width: none; font-size: 12px; }
.pdf-sheet .tr-block.tr-block .tr-note { margin: 10px 0 0; color: var(--k-muted); }
.pdf-sheet .tr-bar-track > span { animation: none; }
/* summary and guide */
.pdf-sheet .tr-findings { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pdf-sheet .tr-block.tr-block .tr-findings li { padding: 12px 14px; }
.pdf-sheet .tr-block.tr-block .tr-findings p { margin: 0; color: var(--k-ink); }
.pdf-sheet .tr-block.tr-block .tr-find-head { margin-bottom: 3px; }
.pdf-sheet .tr-block.tr-block .tr-summary-note { margin: 10px 0 0; }
.pdf-sheet .tr-block.tr-block.tr-howto { padding: 16px 20px; }
/* the PDF renderer cannot draw an icon taken from the page's symbol sheet, so its box goes too */
.pdf-sheet .tr-howto-more, .pdf-sheet .tr-howto-title small, .pdf-sheet .tr-howto-ico { display: none; }
.pdf-sheet .tr-block.tr-block .tr-howto-title h2 { margin: 0; font-size: 16px; }
/* the guide travels in groups of three (data-pdf-split), so three columns make each group one full row */
.pdf-sheet .tr-howto-list { margin: 12px 0 0; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdf-sheet .tr-howto-list > div { padding: 10px 12px; }
.pdf-sheet .tr-howto-list dt { font-size: 12.5px; }
.pdf-sheet .tr-howto-list dd { font-size: 12px; line-height: 1.65; }
/* profile */
.pdf-sheet .tr-profile-grid { grid-template-columns: 260px 1fr; }
.pdf-sheet .tr-profile-grid.is-bars-only { grid-template-columns: 1fr; }
.pdf-sheet .tr-radar img { width: 250px; height: 250px; }
.pdf-sheet .tr-bar { font-size: 12.5px; }
.pdf-sheet a.tr-bar.has-band { grid-template-columns: minmax(100px, 30%) 1fr auto 104px; gap: 12px; min-height: 0; margin: 0; padding: 2px 0; }
.pdf-sheet a.tr-bar.has-band > * { grid-row: auto !important; grid-column: auto !important; justify-self: auto !important; }
.pdf-sheet a.tr-bar.has-band .tr-bar-name { color: var(--k-ink-2); font-weight: 400; }
.pdf-sheet a.tr-bar.has-band .tr-bar-band { justify-self: start !important; }
.pdf-sheet .tr-chip, .pdf-sheet .tr-band { font-size: 11px; }
/* a dimension card must fit on one A4 page (the pager cannot cut inside it), so it is set tighter */
.pdf-sheet .tr-dims2 { gap: 12px; }
.pdf-sheet .tr-dim2 { padding: 12px 16px 14px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r); }
.pdf-sheet .tr-dim2-head { padding-bottom: 8px; }
.pdf-sheet .tr-dim2-head small { font-size: 11px; }
.pdf-sheet .tr-block.tr-block .tr-dim2-what, .pdf-sheet .tr-block.tr-block .tr-dim2-num { max-width: none; margin: 6px 0 0; font-size: 12px; }
.pdf-sheet .tr-block.tr-block .tr-dim2-num { color: var(--k-ink); }
.pdf-sheet .tr-scale { margin: 8px 0 2px; }
.pdf-sheet .tr-scale-rail { padding-top: 32px; }
.pdf-sheet .tr-pin b { font-size: 12px; line-height: 1.5; }
.pdf-sheet .tr-pin i { height: 16px; }
.pdf-sheet .tr-norm { top: 28px; }
.pdf-sheet .tr-norm small, .pdf-sheet .tr-seg-label small { font-size: 10px; }
.pdf-sheet .tr-seg-label { font-size: 11px; }
.pdf-sheet .tr-dim2-body { gap: 10px; margin-top: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdf-sheet .tr-block.tr-block .tr-dim2-meaning > p { margin: 0; color: var(--k-ink); }
.pdf-sheet .tr-block.tr-block .tr-dim2-meaning > p.tr-sub, .pdf-sheet .tr-block.tr-block .tr-sub { margin: 6px 0 3px; color: var(--k-muted); font-size: 11px; }
.pdf-sheet .tr-list { gap: 3px; }
.pdf-sheet .tr-block.tr-block .tr-list li { gap: 8px; font-size: 12px; line-height: 1.6; }
.pdf-sheet .tr-list .tr-mk { margin-top: .68em; }
.pdf-sheet .tr-list.is-tips .tr-mk, .pdf-sheet .tr-steps .tr-mk:not(:empty) { width: 19px; height: 19px; margin-top: 1px; font-size: 10.5px; }
.pdf-sheet .tr-dim2-sides { gap: 8px; }
.pdf-sheet .tr-side { padding: 8px 12px; }
.pdf-sheet .tr-dim2-tips { margin-top: 10px; padding: 9px 14px; }
/* next steps, the record, the rest */
.pdf-sheet .tr-next-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdf-sheet .tr-steps { gap: 8px; }
.pdf-sheet .tr-block.tr-block .tr-steps p { margin: 2px 0 0; }
.pdf-sheet .tr-steps b { font-size: 12.5px; }
.pdf-sheet .tr-shift, .pdf-sheet .tr-distortions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdf-sheet .tr-block.tr-block .tr-delta { margin: 0; }
.pdf-sheet .tr-block.tr-block .tr-distortions li, .pdf-sheet .tr-record > div { padding: 10px 14px; }
.pdf-sheet .tr-record dt { font-size: 12px; }
.pdf-sheet .tr-record dt small { font-size: 10.5px; }
.pdf-sheet .tr-record dd { font-size: 12.5px; line-height: 1.7; }
.pdf-sheet .tr-distortions span, .pdf-sheet .tr-stats span { font-size: 12px; }
.pdf-sheet .tr-quad { font-size: 12.5px; }
.pdf-sheet .tr-block.tr-block .tr-validity-title { margin: 0 0 8px; font-size: 12px; }
.pdf-sheet .tr-block.tr-block .tr-crisis-line, .pdf-sheet .tr-block.tr-block .tr-disclaimer { margin: 0; }
.pdf-sheet .tr-block.tr-block.tr-crisis { background: var(--k-danger-bg); }
.pdf-sheet .tr-block.tr-block.tr-crisis h2 { color: var(--k-danger); }
.pdf-sheet .tr-block.tr-block.tr-crisis p { color: var(--k-ink); }

/* ---------- print (the browser's own "Save as PDF") ---------- */
@media print {
    .k-backdrop, .backdrop, .tbar, .tfoot, .result-actions, .tr-jump, .ai-optin, .private-note, .tr-next-actions, .tr-howto-more, [data-screen-only] { display: none !important; }
    body { background: #fff; }
    .wrap { padding: 0; }
    .is-result > *, .tr-bar-track > span, .tr-radar-shape { animation: none !important; }
    .result-hero { padding: 0 0 12px; background: none; box-shadow: none; color: var(--k-ink); }
    .result-hero::after { display: none; }
    .result-hero h1 { color: var(--k-navy); }
    .result-hero :is(.eyebrow, .lede) { color: var(--k-ink-2); }
    .tr-block, .ai-report.tr-ai { box-shadow: none; break-inside: avoid; }
    .tr-block.tr-detail, .tr-block:has([data-pdf-split]) { break-inside: auto; }
    .tr-dim2, .tr-findings li, .tr-next-col, .tr-record > div { break-inside: avoid; }
    .tr-seg, .tr-pin b, .tr-pin i, .tr-mk, .tr-find-n, .tr-chip, .tr-band, .tr-bar-track, .tr-bar-track > span, .tr-side, .tr-quad, .validity-chip, .tr-validity-title {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-hub > *, .is-result > *, .intro-card, .q-card, .q-card.is-leaving, .opt.is-on .opt-key, .tr-radar-shape, .tr-bar-track > span, .tr-howto-box[open] .tr-howto-list { animation: none !important; }
    .btn-primary, .btn-gold, .btn-ghost, .btn-link, .icon-btn, .opt, .compass-card, .test-go, .test-go .ico, .tr-jump a, .bar > span, .consent .box .ico, .disclaimer summary::after { transition: none; }
    :is(.btn-primary, .btn-gold, .btn-ghost, .btn-link, .icon-btn, .opt, a.compass-card, .tr-jump a):active, .test-row:active .test-go, .btn-gold:hover, a.compass-card:hover, .test-row:hover .test-go .ico { transform: none; }
}
