/* Jungian Type Profiler (OEJTS) — guided stepper (Disclaimer → Questionnaire → Profile).
   Dark console theme, matching the OCEAN / DSM-5-TR clinician look & feel. */
:root {
  --clin-bg: #0f1720;
  --clin-panel: #16212e;
  --clin-line: #24313f;
  --clin-ink: #e6edf3;
  --clin-muted: #9fb0c0;
  --clin-accent: #4bb3a3;
  --clin-user: #23405a;
}
* { box-sizing: border-box; }
.clin-body {
  margin: 0; min-height: 100vh;
  background: var(--clin-bg); color: var(--clin-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 80px; line-height: 1.55;
}

/* Header */
.clin-header { border-bottom: 1px solid var(--clin-line); background: var(--clin-panel); position: sticky; top: 0; z-index: 20; }
.clin-header-inner { max-width: 900px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.clin-title { font-weight: 650; }
.clin-title .brand-mark { color: var(--clin-accent); }
.clin-sub { color: var(--clin-muted); font-weight: 400; font-size: .85rem; }
.clin-actions { display: flex; gap: 8px; align-items: center; }
.clin-ghost { background: transparent; border: 1px solid var(--clin-line); color: var(--clin-muted); padding: 6px 12px; border-radius: 8px; text-decoration: none; font: inherit; font-size: .85rem; cursor: pointer; }
.clin-ghost:hover { color: var(--clin-ink); border-color: var(--clin-accent); }

/* Notice strip */
.notice-strip { background: #0e1a17; border-bottom: 1px solid #1f4a41; color: var(--clin-accent); font-size: .85rem; }
.notice-strip .inner { max-width: 900px; margin: 0 auto; padding: 9px 18px; }

/* Chevron stepper */
.stepper { max-width: 900px; margin: 18px auto 6px; padding: 0 18px; display: flex; gap: 4px; overflow-x: auto; }
.step {
  flex: 1 1 0; position: relative; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 9px 24px; font-size: .84rem; color: var(--clin-muted); white-space: nowrap;
  background: var(--clin-panel); border: 1px solid var(--clin-line);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
}
.step:first-child { clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%); padding-left: 14px; }
.step .chev-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #0d151e; border: 1px solid var(--clin-line); font-size: .78rem; color: var(--clin-muted); }
.step.is-active { color: var(--clin-ink); background: #1b2b3a; border-color: var(--clin-accent); }
.step.is-active .chev-num { background: var(--clin-accent); color: #06231e; border-color: var(--clin-accent); }
.step.is-done { color: var(--clin-ink); }
.step.is-done .chev-num { font-size: 0; background: #24463f; border-color: #24463f; }
.step.is-done .chev-num::after { content: "✓"; font-size: .8rem; color: var(--clin-accent); }

/* Stage */
.clin-stage { max-width: 900px; margin: 0 auto; padding: 12px 18px; }

/* Input panels */
.input-panel { background: var(--clin-panel); border: 1px solid var(--clin-line); border-radius: 14px; padding: 26px; margin-top: 12px; }
.input-panel h1 { margin: 0 0 8px; font-size: 1.5rem; }
.panel-lede { color: var(--clin-muted); margin: 0 0 14px; line-height: 1.55; }
.panel-lede strong { color: var(--clin-ink); }
.panel-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.btn-analyse { background: var(--clin-accent); color: #06231e; border: 0; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-analyse:hover { filter: brightness(1.08); }
.btn-analyse:disabled { opacity: .5; cursor: not-allowed; }
.clin-hint { color: var(--clin-muted); font-size: .84rem; }

/* Disclaimer gate */
.privacy-pill { display: flex; gap: 12px; align-items: flex-start; background: #0e1a17; border: 1px solid #1f4a41; border-left: 4px solid var(--clin-accent); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; font-size: .9rem; line-height: 1.5; color: var(--clin-ink); }
.privacy-pill .pp-icon { font-size: 1.2rem; line-height: 1.3; }
.privacy-pill strong { color: #fff; }
.privacy-pill.shield { background: #0e1622; border-color: #22415e; border-left-color: #5a9bd4; }
.privacy-pill a { color: var(--clin-accent); text-decoration: underline; text-underline-offset: 2px; }
.privacy-pill a:hover { color: #7fe0d1; }
.disclaimer-checks a { color: var(--clin-accent); }
.scope-note { font-size: .84rem; color: #e8c983; background: #2a2310; border: 1px solid #5a4a20; border-radius: 8px; padding: 8px 12px; margin: 0 0 18px; line-height: 1.45; }
.scope-note a { color: #f4d98a; }
.disclaimer-checks { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 4px; }
.disclaimer-checks label { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; color: var(--clin-ink); font-size: .92rem; line-height: 1.5; cursor: pointer; }
.disclaimer-checks input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--clin-accent); }

/* Questionnaire */
.q-progress { position: sticky; top: 49px; z-index: 15; background: var(--clin-bg); padding: 10px 0 6px; margin-bottom: 4px; }
.q-progress-bar { height: 8px; background: #0d151e; border: 1px solid var(--clin-line); border-radius: 999px; overflow: hidden; }
.q-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2b5169, #4bb3a3); border-radius: 999px; transition: width .3s ease; }
.q-progress-txt { color: var(--clin-muted); font-size: .82rem; margin-top: 6px; display: flex; justify-content: space-between; }
.q-scale-legend { color: var(--clin-muted); font-size: .8rem; margin: 6px 0 2px; }

.q-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.q-item {
  background: var(--clin-panel); border: 1px solid var(--clin-line); border-radius: 12px;
  padding: 14px 16px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 14px;
  align-items: center; transition: border-color .2s ease;
}
.q-item.answered { border-color: #244b43; }
.q-item.unanswered-flag { border-color: #6a2a2a; }
.q-num { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--clin-accent); font-weight: 700; }
.q-left, .q-right { font-size: .92rem; color: var(--clin-ink); }
.q-left { text-align: right; }
.q-right { text-align: left; }
.q-scale { display: flex; gap: 6px; align-items: center; justify-content: center; }
.q-scale label { position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.q-scale input { position: absolute; opacity: 0; width: 0; height: 0; }
.q-dot {
  display: block; border-radius: 50%; border: 2px solid var(--clin-line); background: #0d151e;
  transition: all .15s ease;
}
.q-dot.d1, .q-dot.d5 { width: 30px; height: 30px; }
.q-dot.d2, .q-dot.d4 { width: 25px; height: 25px; }
.q-dot.d3 { width: 20px; height: 20px; }
.q-scale label:hover .q-dot { border-color: var(--clin-accent); }
.q-scale input:checked + .q-dot { background: var(--clin-accent); border-color: var(--clin-accent); box-shadow: 0 0 0 3px rgba(75,179,163,.22); }
.q-scale input:focus-visible + .q-dot { outline: 2px solid #7fe0d1; outline-offset: 2px; }
.q-opt-text { display: none; } /* desktop uses the pole labels + graduated dots */

@media (max-width: 620px) {
  /* Stack each question's options vertically with clear per-option labels */
  .q-item { grid-template-columns: 1fr; text-align: left; gap: 8px; }
  .q-left, .q-right { display: none; } /* each option now names its pole */
  .q-scale { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  .q-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px;
    border: 1px solid var(--clin-line); border-radius: 10px; background: #0d151e; }
  .q-opt .q-dot { width: 20px; height: 20px; flex: none; }
  .q-opt-text { display: block; color: var(--clin-ink); font-size: .95rem; line-height: 1.35; }
  .q-scale input:checked ~ .q-opt-text { color: var(--clin-accent); font-weight: 600; }
  .q-opt:has(input:checked) { border-color: var(--clin-accent); background: #12222b; }
}

.q-error { font-size: .85rem; color: #ffb4b4; background: #3a1a1a; border: 1px solid #6a2a2a; border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; }

/* Docked action bar for the questionnaire */
.q-dock { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--clin-line); background: var(--clin-panel); z-index: 18; }
.q-dock-inner { max-width: 900px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.q-dock .clin-hint { flex: 1 1 auto; }

/* Findings / results shared */
.findings-title { font-size: 1.05rem; color: var(--clin-ink); margin: 18px 0 6px; }
.findings-sub { color: var(--clin-muted); font-size: .85rem; line-height: 1.45; margin: -2px 0 12px; max-width: 74ch; }

/* Type headline */
.type-headline { background: var(--clin-panel); border: 1px solid var(--clin-line); border-left: 4px solid var(--clin-accent); border-radius: 14px; padding: 20px 22px; margin: 12px 0 16px; }
.type-code { font-size: 2.6rem; font-weight: 800; letter-spacing: .12em; color: var(--clin-accent); line-height: 1; }
.type-name { font-size: 1.15rem; color: #fff; font-weight: 650; margin-top: 6px; }
.type-summary { color: var(--clin-ink); margin: 10px 0 0; line-height: 1.6; }

/* Dichotomy bars */
.dich-chart { display: flex; flex-direction: column; gap: 14px; background: var(--clin-panel); border: 1px solid var(--clin-line); border-radius: 12px; padding: 18px; margin: 8px 0 16px; }
.dich-row { display: grid; grid-template-columns: 1fr; gap: 5px; }
.dich-poles { display: flex; justify-content: space-between; font-size: .82rem; }
.dich-poles .pole { color: var(--clin-muted); }
.dich-poles .pole.win { color: var(--clin-ink); font-weight: 700; }
.dich-poles .pole.win .pct { color: var(--clin-accent); }
.dich-track { position: relative; height: 16px; background: #0d151e; border: 1px solid var(--clin-line); border-radius: 999px; overflow: hidden; }
.dich-fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #2b5169, #4bb3a3); }
.dich-fill.from-left { left: 0; border-radius: 999px 0 0 999px; }
.dich-fill.from-right { right: 0; border-radius: 0 999px 999px 0; background: linear-gradient(270deg, #2b5169, #4bb3a3); }
.dich-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--clin-muted); opacity: .5; }

/* Report body (on-screen) */
.report-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 16px; }
.report-meta label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--clin-muted); }
.report-meta input { background: #0d151e; color: var(--clin-ink); border: 1px solid var(--clin-line); border-radius: 8px; padding: 9px 11px; font: inherit; }
.report-meta input:focus { outline: none; border-color: var(--clin-accent); }
.report-body { color: var(--clin-ink); line-height: 1.6; }
.report-body p { margin: 4px 0 12px; }
.rep-h { color: var(--clin-accent); font-size: 1rem; margin: 22px 0 8px; border-bottom: 1px solid var(--clin-line); padding-bottom: 4px; }
.rep-dx { background: var(--clin-panel); border: 1px solid var(--clin-line); border-left: 3px solid var(--clin-accent); border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
.rep-dx-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rep-dx-head strong { font-size: 1.05rem; }
.band-pill { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; color: #06231e; background: var(--clin-accent); }
.band-pill.slight { background: #7a8791; color: #fff; }
.band-pill.moderate { background: #d9b98a; }
.conf { color: var(--clin-muted); font-size: .8rem; }
.rep-crit h5 { margin: 8px 0 3px; font-size: .82rem; color: var(--clin-muted); text-transform: uppercase; letter-spacing: .03em; }
.rep-crit ul { margin: 0; padding-left: 20px; }
.rep-crit .ticks li { list-style: none; position: relative; padding-left: 20px; margin: 3px 0; }
.rep-crit .ticks li::before { content: "✓"; position: absolute; left: 0; color: #4bb3a3; font-weight: 700; }
.rep-crit .grows li { margin: 3px 0; }
.report-body .muted { color: var(--clin-muted); }

/* Team Work & Vocations */
.tw-block { margin: 8px 0 6px; }
.tw-block h5 { margin: 10px 0 5px; font-size: .82rem; color: var(--clin-muted); text-transform: uppercase; letter-spacing: .03em; }
.complements { list-style: none; margin: 0; padding: 0; }
.complements li { margin: 5px 0; color: var(--clin-ink); font-size: .92rem; line-height: 1.5; }
.cmp-type { display: inline-block; min-width: 46px; text-align: center; font-weight: 700; letter-spacing: .06em; color: #06231e; background: var(--clin-accent); border-radius: 6px; padding: 1px 7px; margin-right: 4px; font-size: .82rem; }
.cmp-name { color: #fff; font-weight: 600; }
.report-body a.src-link { color: var(--clin-accent); text-decoration: underline; text-underline-offset: 2px; }
.report-body a.src-link:hover { color: #7fe0d1; }
.callout-disc { background: #2a2310; border: 1px solid #5a4a20; color: #e8c983; border-radius: 10px; padding: 10px 12px; font-size: .82rem; line-height: 1.45; margin-bottom: 10px; }

@media (max-width: 620px) { .report-meta { grid-template-columns: 1fr; } }

/* hidden must beat display */
[hidden] { display: none !important; }

/* Cross-tool (sibling app) links in the header */
.app-link { border-color: #2f6f63; color: #cfe6e0; }
.app-link:hover { color: #fff; border-color: var(--clin-accent); }
