/* Coherence Signals — site and app styles.
   Colors are written as direct hex values (no CSS custom properties).
   Ink #0f2545 / Deep #1a3a6b / Gold #c9972b / Body #2a3648 / Muted #5b6b80
   Paper #f4f6f9 / Surface #ffffff / Rule #dde3ea                          */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.6; color: #2a3648; background: #f4f6f9; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, "Times New Roman", serif; color: #0f2545; line-height: 1.18; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 2.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.3rem; }
h4 { margin: 0 0 0.4em; font-size: 1rem; color: #0f2545; }
p { margin: 0 0 1em; }
a { color: #1a3a6b; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #0f2545; text-decoration-color: #c9972b; }
:focus-visible { outline: 3px solid #c9972b; outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: #ffffff; color: #0f2545; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.muted { color: #5b6b80; }
.small { font-size: 0.9rem; }
.fine { font-size: 0.82rem; color: #7f8ea3; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 8px; font: 600 0.95rem/1.2 "DM Sans", system-ui, sans-serif; border: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-gold { background: #c9972b; color: #0f2545; border-color: #c9972b; }
.btn-gold:hover { background: #b8871f; border-color: #b8871f; color: #0f2545; }
.btn-navy { background: #0f2545; color: #ffffff; border-color: #0f2545; }
.btn-navy:hover { background: #1a3a6b; border-color: #1a3a6b; color: #ffffff; }
.btn-ghost { background: transparent; color: #0f2545; border-color: #c3cddb; }
.btn-ghost:hover { border-color: #0f2545; color: #0f2545; }
.btn-ghost-light { background: transparent; color: #ffffff; border-color: #4f668f; }
.btn-ghost-light:hover { border-color: #ffffff; color: #ffffff; }
.btn-danger { background: #9b1c1c; color: #ffffff; border-color: #9b1c1c; }
.btn-danger:hover { background: #7f1616; color: #ffffff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Public header ---------- */
.site-header { background: #0f2545; color: #ffffff; }
.site-header .bar, .app-header .bar { display: flex; align-items: center; gap: 22px; min-height: 66px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #ffffff; text-decoration: none; font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 1.18rem; }
.logo:hover { color: #ffffff; }
.logo-mark { flex: none; color: #ffffff; }
.site-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.site-nav a { color: #c8d3e3; text-decoration: none; padding: 8px 9px; font-size: 0.92rem; font-weight: 500; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover { color: #ffffff; background: #1a3a6b; }
.site-nav a[aria-current="page"] { color: #ffffff; box-shadow: inset 0 -2px 0 #c9972b; border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-link { color: #ffffff; text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.header-link:hover { color: #ffffff; text-decoration: underline; }

/* ---------- Public sections ---------- */
.hero { background: #0f2545; color: #d4ddea; padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.hero h1 { color: #ffffff; font-size: 3.3rem; max-width: 15ch; margin-bottom: 20px; }
.hero .lede { font-size: 1.16rem; max-width: 50ch; color: #c8d3e3; margin-bottom: 28px; }
.hero .btn-row { margin-top: 4px; }
.item-card { background: #ffffff; color: #2a3648; border-radius: 16px; padding: 30px 28px 26px; box-shadow: 0 24px 60px rgba(4, 12, 30, 0.45); }
.item-card .card-cap { font-size: 0.88rem; color: #5b6b80; margin-bottom: 14px; }
.item-card .statement { font-family: "Playfair Display", Georgia, serif; font-size: 1.45rem; line-height: 1.32; color: #0f2545; margin-bottom: 22px; }
.item-card .scale { max-width: none; }
.item-card .card-foot { margin: 16px 0 0; font-size: 0.86rem; color: #5b6b80; }
.page-head { background: #0f2545; color: #c8d3e3; padding: 56px 0 60px; }
.page-head h1 { color: #ffffff; max-width: 22ch; }
.page-head p { font-size: 1.12rem; max-width: 60ch; margin: 0; }
.section { padding: 76px 0; }
.section-white { background: #ffffff; }
.section-tight { padding: 48px 0; }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head p { color: #4a5a70; font-size: 1.08rem; }
.prose { max-width: 70ch; }
.prose p, .prose li { font-size: 1.04rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.two-col { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }

/* Dimension list with weight bars */
.dim-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #dde3ea; }
.dim-list li { display: grid; grid-template-columns: minmax(200px, 1.15fr) 1.6fr 150px; gap: 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid #dde3ea; }
.dim-list .dim-name { font-weight: 700; color: #0f2545; display: block; }
.dim-list .dim-desc { color: #4a5a70; font-size: 0.94rem; }
.dim-list .dim-why { color: #5b6b80; font-size: 0.86rem; margin-top: 4px; display: block; }
.weight { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
.weight-bar { height: 8px; background: #e7ecf2; border-radius: 4px; overflow: hidden; }
.weight-fill { height: 100%; background: #0f2545; border-radius: 4px; }
.weight-fill.top { background: #c9972b; }
.weight-val { font-weight: 700; color: #0f2545; text-align: right; font-variant-numeric: tabular-nums; }
.list-foot { font-size: 0.88rem; color: #5b6b80; margin-top: 14px; }

/* Process steps (a true sequence) */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 36px; border-top: 2px solid #0f2545; }
.steps.steps-5 { grid-template-columns: repeat(5, 1fr); gap: 8px 28px; }
.steps li { padding-top: 18px; }
.steps li::before { counter-increment: step; content: counter(step); display: block; font-family: "Playfair Display", Georgia, serif; font-size: 2rem; line-height: 1; color: #c9972b; margin-bottom: 10px; }
.steps h3 { font-family: "DM Sans", system-ui, sans-serif; font-size: 1.04rem; font-weight: 700; margin-bottom: 6px; }
.steps p { font-size: 0.94rem; color: #4a5a70; margin: 0; }

/* Commitments */
.commit-list { margin: 0; }
.commit-list dt { font-weight: 700; color: #0f2545; font-size: 1.04rem; }
.commit-list dd { margin: 4px 0 22px; color: #4a5a70; }

.cta-band { background: #0f2545; color: #c8d3e3; padding: 64px 0; }
.cta-band h2 { color: #ffffff; }
.cta-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.cta-grid .btn-row { justify-content: flex-end; }

.table-plain { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 18px 0 8px; }
.table-plain th { text-align: left; font-weight: 600; color: #0f2545; padding: 10px 12px; border-bottom: 2px solid #0f2545; }
.table-plain td { padding: 12px; border-bottom: 1px solid #dde3ea; vertical-align: top; }
.callout { border-left: 4px solid #1a3a6b; background: #eef3fa; padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 18px 0; }
.callout h3 { font-family: "DM Sans", system-ui, sans-serif; font-size: 1.02rem; margin-bottom: 4px; }
.callout p { margin: 0; }
.callout-gold { border-left-color: #c9972b; background: #fbf5e6; }
.callout-plum { border-left-color: #6d28d9; background: #f3effc; }
.refs { padding-left: 0; list-style: none; }
.refs li { padding-left: 2em; text-indent: -2em; margin-bottom: 12px; font-size: 0.96rem; }
.module-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid #dde3ea; }
.module-list li { display: grid; grid-template-columns: 240px 1fr 200px; gap: 24px; padding: 20px 0; border-bottom: 1px solid #dde3ea; align-items: start; }
.module-list h3 { font-family: "DM Sans", system-ui, sans-serif; font-size: 1.05rem; margin: 0; }
.module-list p { margin: 0; color: #4a5a70; }
.module-list .links { font-size: 0.88rem; color: #5b6b80; }

/* Footer */
.site-footer { background: #0b1d38; color: #9fb0c8; padding: 48px 0 40px; font-size: 0.92rem; }
.site-footer a { color: #d4ddea; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav a { text-decoration: none; }
.footer-grid nav a:hover { text-decoration: underline; color: #ffffff; }
.logo-footer { margin-bottom: 12px; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
label.lbl, .lbl { display: block; font-weight: 600; font-size: 0.93rem; color: #1d2a3c; margin-bottom: 6px; }
.hint { font-size: 0.86rem; color: #5b6b80; margin-top: 5px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid #c3cddb; border-radius: 8px; font: inherit; font-size: 1rem; background: #ffffff; color: #1d2a3c; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #1a3a6b; outline: none; box-shadow: 0 0 0 3px rgba(201, 151, 43, 0.4); }
.field-error input, .field-error select { border-color: #9b1c1c; }
.err-text { color: #9b1c1c; font-size: 0.86rem; margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.94rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type="color"] { width: 52px; height: 44px; padding: 3px; border: 1.5px solid #c3cddb; border-radius: 8px; background: #ffffff; cursor: pointer; flex: none; }
.color-field input[type="text"] { font-variant-numeric: tabular-nums; max-width: 130px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.95rem; }
.alert-error { background: #fdf0f0; color: #7f1d1d; border: 1px solid #f0c4c4; }
.alert-success { background: #edf6f0; color: #1f5c3a; border: 1px solid #c4e1cf; }
.alert-info { background: #eef3fa; color: #1a3a6b; border: 1px solid #cad8ec; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }

/* Auth pages */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 66px); }
.auth-side { background: #0f2545; color: #c8d3e3; padding: 64px 56px; }
.auth-side h1 { color: #ffffff; font-size: 2.3rem; }
.auth-side ol { padding-left: 1.2em; }
.auth-side li { margin-bottom: 12px; }
.auth-main { padding: 56px; background: #ffffff; }
.auth-main .form-box { max-width: 520px; }
.form-section { border-top: 1px solid #dde3ea; padding-top: 22px; margin-top: 8px; }
.form-section h2 { font-family: "DM Sans", system-ui, sans-serif; font-size: 1.08rem; margin-bottom: 14px; }
.card { background: #ffffff; border: 1px solid #dde3ea; border-radius: 14px; padding: 32px; }
.signin-box { max-width: 460px; margin: 56px auto; }

/* Brand preview (registration and settings) */
.brand-preview { border: 1px solid #dde3ea; border-radius: 12px; overflow: hidden; margin-top: 6px; }
.brand-preview .bp-bar { padding: 14px 18px; font-family: "Playfair Display", Georgia, serif; font-weight: 700; }
.brand-preview .bp-body { padding: 20px 18px; background: #ffffff; }
.brand-preview .bp-slogan { font-family: "Playfair Display", Georgia, serif; font-size: 1.4rem; line-height: 1.25; color: #0f2545; margin-bottom: 14px; }
.brand-preview .bp-btn { display: inline-block; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }

/* ---------- Survey ---------- */
.survey-page { padding: 40px 0 72px; }
.survey-intro { margin-bottom: 26px; }
.survey-intro h1 { font-size: 2.2rem; }
.scale-note { font-size: 0.94rem; color: #4a5a70; max-width: 70ch; }
.privacy-note { background: #ffffff; border: 1px solid #dde3ea; border-left: 4px solid #2d7a4f; border-radius: 0 10px 10px 0; padding: 14px 18px; font-size: 0.94rem; margin-bottom: 22px; }
.privacy-note strong { color: #1f5c3a; }
.survey-progress { position: sticky; top: 0; z-index: 20; background: #f4f6f9; padding: 12px 0; margin-bottom: 18px; border-bottom: 1px solid #dde3ea; }
.survey-progress .wrap-inner { display: flex; align-items: center; gap: 16px; }
.progress-text { font-size: 0.88rem; color: #4a5a70; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 128px; }
.progress-track { flex: 1; height: 8px; background: #dde3ea; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: #c9972b; border-radius: 4px; transition: width 0.25s ease; }
.dim-block { background: #ffffff; border: 1px solid #dde3ea; border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.dim-block-head { padding: 16px 22px; border-bottom: 1px solid #e7ecf2; background: #f8fafc; }
.dim-block-head h2 { font-size: 1.18rem; margin: 0; }
.dim-block-head .dim-num { font-family: "DM Sans", system-ui, sans-serif; font-size: 0.82rem; font-weight: 600; color: #5b6b80; display: block; margin-bottom: 2px; }
.dim-block-head p { margin: 4px 0 0; color: #5b6b80; font-size: 0.92rem; }
.q { padding: 18px 22px 12px; border-bottom: 1px solid #eef2f6; }
.q:last-child { border-bottom: 0; }
.q-text { font-size: 1.04rem; color: #1d2a3c; margin: 0 0 12px; font-weight: 500; max-width: 68ch; }
.q-num { color: #7f8ea3; font-variant-numeric: tabular-nums; margin-right: 4px; font-weight: 600; }
.rev-tag { color: #8a96a8; font-size: 0.9rem; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 600px; }
.scale label { position: relative; display: block; cursor: pointer; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.scale span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 4px; border: 1.5px solid #cdd6e2; border-radius: 9px; background: #ffffff; text-align: center; transition: background-color 0.12s, border-color 0.12s; }
.scale b { font-size: 1.08rem; color: #0f2545; line-height: 1.1; }
.scale small { font-size: 0.72rem; color: #5b6b80; line-height: 1.15; }
.scale label:hover span { border-color: #1a3a6b; }
.scale input:checked + span { background: #0f2545; border-color: #0f2545; }
.scale input:checked + span b, .scale input:checked + span small { color: #ffffff; }
.scale input:focus-visible + span { outline: 3px solid #c9972b; outline-offset: 2px; }
.q-missing { min-height: 0; margin: 6px 0 0; font-size: 0.86rem; color: #9b1c1c; }
.q.missing { background: #fff7f7; }
.q.missing .scale span { border-color: #e2a3a3; }
.submit-zone { padding: 12px 0 0; }
.submit-zone .alert { margin-top: 14px; }
.context-fields { background: #ffffff; border: 1px solid #dde3ea; border-radius: 12px; padding: 20px 22px 4px; margin-bottom: 20px; }

/* ---------- Results ---------- */
.result-hero { background: #0f2545; color: #d4ddea; border-radius: 16px; padding: 34px 36px; display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; margin-bottom: 20px; }
.cl-block { display: flex; flex-direction: column; }
.cl-label { font-size: 0.9rem; color: #aebbd0; }
.cl-num { font-family: "Playfair Display", Georgia, serif; font-size: 5.4rem; line-height: 1; color: #ffffff; font-variant-numeric: lining-nums tabular-nums; }
.result-summary { margin: 12px 0 0; font-size: 1.04rem; max-width: 58ch; color: #d4ddea; }
.band-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.86rem; white-space: nowrap; }
.band-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.band-strong { background: #e3f1e8; color: #1f5c3a; } .band-strong .band-dot { background: #2d7a4f; }
.band-moderate { background: #fbf1d6; color: #6e4b0c; } .band-moderate .band-dot { background: #c08a1a; }
.band-fragile { background: #fde4d3; color: #8f2f0e; } .band-fragile .band-dot { background: #d4622a; }
.band-critical { background: #f9dcdc; color: #7f1d1d; } .band-critical .band-dot { background: #9b1c1c; }
.score-rows { margin-top: 4px; }
.score-row { display: grid; grid-template-columns: 210px 1fr 96px; gap: 18px; align-items: center; padding: 11px 0; border-bottom: 1px solid #eef2f6; }
.score-row:last-child { border-bottom: 0; }
.score-name { font-weight: 600; color: #1d2a3c; font-size: 0.96rem; }
.score-name small { display: block; font-weight: 400; color: #7f8ea3; font-size: 0.8rem; }
.score-track { position: relative; height: 12px; background: #eef2f6; border-radius: 6px; }
.score-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.score-prev { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: #0f2545; border-radius: 1px; }
.score-val { text-align: right; font-weight: 700; font-size: 1.05rem; color: #0f2545; font-variant-numeric: tabular-nums; line-height: 1.15; }
.score-val small { display: block; font-weight: 500; font-size: 0.76rem; color: #5b6b80; }
.score-val .delta { display: block; }
.delta { font-size: 0.78rem; font-weight: 600; }
.delta.up { color: #2d7a4f; } .delta.down { color: #9b1c1c; } .delta.flat { color: #7f8ea3; font-weight: 500; }
.flags { display: grid; gap: 10px; }
.flag { border-left: 4px solid #1a3a6b; padding: 12px 16px; border-radius: 0 9px 9px 0; background: #eef3fa; }
.flag h4 { margin: 0 0 3px; font-size: 0.98rem; }
.flag p { margin: 0; font-size: 0.93rem; color: #2a3648; }
.flag-risk { background: #fdf0f0; border-left-color: #9b1c1c; } .flag-risk h4 { color: #7f1d1d; }
.flag-watch { background: #fdf6e7; border-left-color: #c08a1a; } .flag-watch h4 { color: #6e4b0c; }
.flag-strength { background: #edf6f0; border-left-color: #2d7a4f; } .flag-strength h4 { color: #1f5c3a; }
.flag-info h4 { color: #1a3a6b; }

/* ---------- Org portal ---------- */
.portal-hero { padding: 64px 0 40px; }
.portal-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; }
.portal-slogan { font-family: "Playfair Display", Georgia, serif; font-size: 3rem; line-height: 1.12; color: #0f2545; margin: 0 0 18px; max-width: 18ch; }
.portal-rule { width: 64px; height: 4px; border-radius: 2px; margin-bottom: 22px; }
.portal-welcome { font-size: 1.1rem; color: #3b4a5f; max-width: 56ch; white-space: pre-line; }
.join-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.join-option { border: 1px solid #dde3ea; border-radius: 12px; padding: 20px; background: #ffffff; }
.join-option h3 { font-family: "DM Sans", system-ui, sans-serif; font-size: 1.04rem; margin-bottom: 6px; }
.join-option p { font-size: 0.92rem; color: #4a5a70; }

/* ---------- App ---------- */
.app-header { background: #0f2545; color: #ffffff; }
.org-name { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 1.2rem; text-decoration: none; line-height: 1.15; display: flex; flex-direction: column; }
.org-slogan { font-family: "DM Sans", system-ui, sans-serif; font-weight: 400; font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }
.app-nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.app-nav a { padding: 8px 12px; text-decoration: none; font-weight: 500; font-size: 0.93rem; border-radius: 6px; opacity: 0.9; }
.app-nav a:hover { opacity: 1; text-decoration: underline; }
.app-nav a[aria-current="page"] { opacity: 1; border-radius: 0; }
.app-header .header-actions { font-size: 0.92rem; }
.app-header .who { text-decoration: none; font-weight: 600; }
.app-header .who:hover { text-decoration: underline; }
.demo-banner { background: #fbf1d6; color: #6e4b0c; font-size: 0.92rem; padding: 9px 0; border-bottom: 1px solid #efdca8; }
.demo-banner a { color: #6e4b0c; font-weight: 600; }
.app-main { padding: 34px 0 72px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1 { font-size: 2.1rem; margin: 0; }
.page-title p { margin: 4px 0 0; color: #5b6b80; }
.panel { background: #ffffff; border: 1px solid #dde3ea; border-radius: 12px; padding: 24px 26px; margin-bottom: 20px; }
.panel > h2 { font-size: 1.28rem; margin-bottom: 4px; }
.panel > .panel-sub { color: #5b6b80; font-size: 0.92rem; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-main { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.kpi { background: #ffffff; border: 1px solid #dde3ea; border-radius: 12px; padding: 18px 20px; }
.kpi-label { font-size: 0.86rem; color: #5b6b80; font-weight: 500; }
.kpi-value { font-family: "Playfair Display", Georgia, serif; font-size: 2.5rem; color: #0f2545; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: lining-nums tabular-nums; }
.kpi-value.big { font-size: 3.4rem; }
.kpi-sub { font-size: 0.86rem; color: #5b6b80; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 200px; padding: 9px 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #dde3ea; margin-bottom: 24px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; text-decoration: none; color: #4a5a70; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #0f2545; }
.tabs a[aria-current="page"] { color: #0f2545; border-bottom-color: #0f2545; font-weight: 600; }
.tabs .count { display: inline-block; background: #c9972b; color: #0f2545; border-radius: 999px; font-size: 0.72rem; padding: 0 7px; margin-left: 4px; font-weight: 700; }
.table-scroll { overflow-x: auto; border: 1px solid #dde3ea; border-radius: 12px; background: #ffffff; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th { text-align: left; font-weight: 600; color: #4a5a70; padding: 10px 12px; border-bottom: 1px solid #dde3ea; white-space: nowrap; background: #f8fafc; }
table.data td { padding: 10px 12px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data.raw td, table.data.raw th { padding: 7px 9px; font-size: 0.84rem; }
table.data.raw td.q { text-align: center; color: #3b4a5f; }
table.data.raw th.q { text-align: center; }
table.data .sep { border-left: 1px solid #dde3ea; }
.heat td.cell { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-strong { background: #e3f1e8; color: #1f5c3a; }
.cell-moderate { background: #fbf1d6; color: #6e4b0c; }
.cell-fragile { background: #fde4d3; color: #8f2f0e; }
.cell-critical { background: #f9dcdc; color: #7f1d1d; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.84rem; color: #4a5a70; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #fbf1d6; color: #6e4b0c; }
.badge-active { background: #e3f1e8; color: #1f5c3a; }
.badge-disabled { background: #eceff3; color: #5b6b80; }
.badge-admin { background: #e6ecf7; color: #1a3a6b; }
.badge-open { background: #e3f1e8; color: #1f5c3a; }
.badge-closed { background: #eceff3; color: #5b6b80; }
.code-chip { display: inline-block; font-weight: 700; font-size: 1.35rem; letter-spacing: 0.08em; background: #f4f6f9; border: 1.5px dashed #9fb0c8; padding: 8px 14px; border-radius: 8px; color: #0f2545; font-variant-numeric: tabular-nums; }
.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy-row input { max-width: 520px; }
.empty { text-align: center; padding: 44px 20px; color: #5b6b80; }
.empty h2 { font-size: 1.4rem; }
.checklist { list-style: none; padding: 0; margin: 0; counter-reset: chk; }
.checklist li { counter-increment: chk; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef2f6; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: counter(chk); width: 28px; height: 28px; border-radius: 50%; background: #eef2f6; color: #0f2545; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; }
.checklist li.done::before { content: "\2713"; background: #2d7a4f; color: #ffffff; }
.checklist strong { display: block; color: #1d2a3c; }
.checklist span { font-size: 0.9rem; color: #5b6b80; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }
.actions .btn { padding: 5px 10px; font-size: 0.82rem; }
.danger-zone { border-color: #f0c4c4; }
.danger-zone h2 { color: #7f1d1d; }
details.items-key summary { cursor: pointer; font-weight: 600; color: #1a3a6b; }
details.items-key ol { columns: 2; column-gap: 32px; font-size: 0.88rem; padding-left: 1.6em; }
details.items-key li { break-inside: avoid; margin-bottom: 6px; }

/* Trend chart (inline SVG) */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: #ffffff; border: 1px solid #c3cddb; border-radius: 8px; padding: 8px 11px; font-size: 0.85rem; color: #1d2a3c; box-shadow: 0 6px 18px rgba(15, 37, 69, 0.15); white-space: nowrap; transform: translate(-50%, -115%); display: none; z-index: 5; }
.chart-tip strong { display: block; color: #0f2545; }
.dotplot { position: relative; margin: 8px 0 0; }
.dot-row { display: grid; grid-template-columns: 190px 1fr 54px; gap: 14px; align-items: center; padding: 10px 0; }
.dot-track { position: relative; height: 2px; background: #dde3ea; }
.dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #ffffff; }
.dot-axis { display: grid; grid-template-columns: 190px 1fr 54px; gap: 14px; font-size: 0.76rem; color: #7f8ea3; }
.dot-axis .ticks { display: flex; justify-content: space-between; }
.gap-callout { font-size: 0.95rem; margin-top: 12px; color: #2a3648; }

/* App footer */
.app-footer { border-top: 1px solid #dde3ea; padding: 26px 0 34px; color: #5b6b80; font-size: 0.88rem; background: #ffffff; }
.app-footer p { margin: 0 0 4px; }
.powered { display: inline-flex; align-items: center; gap: 8px; }
.powered .logo-mark { color: #0f2545; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .two-col, .portal-grid, .cta-grid, .grid-main { grid-template-columns: 1fr; gap: 36px; }
  .cta-grid .btn-row { justify-content: flex-start; }
  .steps, .steps.steps-5 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side, .auth-main { padding: 40px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .module-list li { grid-template-columns: 1fr; gap: 6px; }
  .dim-list li { grid-template-columns: 1fr; gap: 8px; }
  .weight { max-width: 320px; }
}
@media (max-width: 720px) {
  h1 { font-size: 2.1rem; }
  .hero { padding: 48px 0 56px; }
  .hero h1 { font-size: 2.4rem; }
  .page-head { padding: 40px 0 44px; }
  .section { padding: 52px 0; }
  .site-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .app-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a, .app-nav a { white-space: nowrap; }
  .grid-2, .form-grid, .join-options { grid-template-columns: 1fr; }
  .steps, .steps.steps-5 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .result-hero { grid-template-columns: 1fr; gap: 14px; padding: 26px 22px; }
  .cl-num { font-size: 4.2rem; }
  .score-row { grid-template-columns: 1fr 74px; gap: 6px 12px; }
  .score-row .score-track { grid-column: 1 / -1; grid-row: 2; }
  .dot-row, .dot-axis { grid-template-columns: 120px 1fr 44px; }
  .portal-slogan { font-size: 2.2rem; }
  .scale { gap: 5px; }
  .scale span { min-height: 58px; padding: 6px 2px; }
  .scale small { font-size: 0.64rem; }
  .q { padding: 16px 14px 10px; }
  .dim-block-head { padding: 14px; }
  .panel { padding: 20px 16px; }
  .kpis { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  details.items-key ol { columns: 1; }
  .page-title h1 { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .app-header, .site-footer, .app-footer, .demo-banner, .no-print, .survey-progress, form.survey-form, .skip { display: none !important; }
  body { background: #ffffff; color: #000000; font-size: 12pt; }
  .result-hero, .score-fill, .band-pill, .band-dot, .flag, .cell-strong, .cell-moderate, .cell-fragile, .cell-critical, .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .panel, .kpi, .flag { break-inside: avoid; }
  .app-main, .survey-page { padding: 0; }
  a { color: #000000; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
