/* CloudySystem W15 — customer-first mega navigation (pain routes → story diagram → domains), the mobile drawer,
   a compact desktop stage for shorter viewports (1536×820, 1440×800), and the cinematic reading layer for the
   chapters, needs and roles. Loaded last on all 12 pages. Desktop secondary text ≥14px, controls ≥40px. */

/* ===================== 1 · HEADER polish ===================== */
.site-header.is-light {
  background: rgb(251 250 247 / .95) linear-gradient(180deg, rgb(255 254 251 / .5), rgb(247 246 241 / .4));
  border-bottom: 1px solid rgb(16 34 80 / .1);
  box-shadow: 0 1px 0 rgb(255 255 255 / .9) inset, 0 1px 0 rgb(255 255 255 / .6);
}
.site-header.is-light::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(45 108 240 / .28) 30%, rgb(45 108 240 / .28) 70%, transparent);
}
.site-header__cta { font-weight: 600; }

/* ===================== 2 · MEGA PANELS (desktop shell) ===================== */
.mega__item { position: static; }
.mega__panel, .mega__panel--wide, .site-header.is-light .mega__panel {
  position: absolute; top: calc(100% + 1px); inset-inline: 0; margin-inline: auto; z-index: 60;
  width: min(1100px, calc(100vw - 2rem)); max-height: calc(100vh - var(--header-h) - 16px); overflow: auto;
  display: block; padding: 0; border-radius: 0 0 22px 22px;
  background: #fff; border: 1px solid rgb(16 34 80 / .1); border-top: 0;
  box-shadow: 0 46px 90px -36px rgb(6 14 40 / .55), 0 2px 6px rgb(6 14 40 / .05);
  color: #0a1430; text-align: start;
}
.mega__panel:not([hidden]) { animation: megaIn .26s var(--ease-out) both; }
@keyframes megaIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mega__inner { display: grid; }
.mega__grid { display: grid; gap: 1.5rem; padding: 1.15rem 1.5rem 1.1rem; align-items: start; }
.mega__panel :focus-visible { outline: 2px solid #1a56d1; outline-offset: 2px; }

.mega__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; margin-bottom: .7rem; }
.mega__head .mega__kicker { flex: 1 0 100%; }
.mega__head .mega__lead { flex: 1 0 100%; }
.mega__kicker { color: #1a56d1; font-size: .875rem; font-weight: 600; }
.mega__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.4; color: #0a1430; }
.mega__lead { margin-top: .2rem; color: #3d4966; font-size: .875rem; line-height: 1.8; }
.mega__count { display: inline-flex; gap: .25rem; align-items: center; padding: .1rem .65rem; border-radius: 999px; background: #eef3fd; color: #1747b8; font-size: .875rem; font-weight: 600; }
.mega__coltitle { display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; color: #3d4966; font-size: .875rem; font-weight: 600; }
.mega__coltitle svg { width: 17px; height: 17px; color: #1f63e8; }
.mega__flag { display: inline-flex; align-items: center; padding: 0 .45rem; border-radius: 999px; border: 1px solid #e3b65c; background: #fff4dc; color: #6e4300; font-size: .875rem; font-weight: 500; line-height: 1.65; white-space: nowrap; }
.mega__gicon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: #eef3fd; color: #1f63e8; transition: background var(--dur-1), color var(--dur-1); }
.mega__gicon svg { width: 20px; height: 20px; }

/* footer strip + its CTA (its own class: the header's .btn--primary stays the only primary CTA in the header) */
.mega__foot {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
  margin: 0; padding: .6rem 1.5rem; border-top: 1px solid rgb(16 34 80 / .08); background: #f6f7fb; color: #3d4966; font-size: .875rem;
}
.mega__foot p { margin: 0; max-width: 56ch; }
.mega__foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; }
.mega__panel .link-arrow { color: #1747b8; font-size: .9rem; min-height: 40px; }
.mega__cta {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem 1rem; border-radius: 999px;
  background: #0b1633; color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; transition: background var(--dur-1), transform var(--dur-1);
}
.mega__cta svg { width: 16px; height: 16px; }
.mega__cta:hover { background: #1747b8; }

/* ---------- Product: pains | story | domains ---------- */
.mega__grid--product { grid-template-columns: 250px minmax(0, 1fr) 448px; gap: 1.25rem; }
.mega__pains { display: grid; gap: .3rem; }
.mega__pain {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .65rem; align-items: center; width: 100%; min-height: 44px;
  padding: .45rem .55rem; border-radius: 12px; border: 1px solid transparent; background: none; color: inherit; text-align: start; cursor: pointer;
  font: inherit; transition: background var(--dur-1), border-color var(--dur-1);
}
.mega__pain b { display: block; color: #0a1430; font-size: .95rem; font-weight: 600; line-height: 1.45; }
.mega__pain small { display: block; color: #4a5672; font-size: .875rem; line-height: 1.5; }
.mega__picon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f1f3f8; color: #3d4966; transition: background var(--dur-1), color var(--dur-1); }
.mega__picon svg { width: 19px; height: 19px; }
.mega__pain:hover { background: #f5f7fc; }
.mega__pain[aria-selected="true"] { background: #eef3fd; border-color: rgb(45 108 240 / .35); }
.mega__pain[aria-selected="true"] .mega__picon { background: #1f63e8; color: #fff; }

.mega__story {
  position: relative; align-self: stretch; display: grid; align-content: start; gap: .5rem; min-width: 0; padding: .95rem 1.05rem .9rem; border-radius: 18px;
  background: radial-gradient(120% 80% at 100% 0%, rgb(82 148 255 / .32), transparent 60%), linear-gradient(165deg, #0b1633, #0f2457 70%, #10275f);
  color: #eef2fb; outline-offset: 3px;
}
.mega__story-k { display: flex; align-items: center; gap: .4rem; color: #a9c6ff; font-size: .875rem; font-weight: 600; }
.mega__story-k svg { width: 16px; height: 16px; }
.mega__story-t { font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.5; color: #fff; }
.mega__flow { position: relative; display: grid; gap: .1rem; margin: .1rem 0 0; padding: 0; list-style: none; }
.mega__flow::before { content: ""; position: absolute; inset-inline-start: 15px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, #4f8dff, rgb(79 141 255 / .25)); }
.mega__flow li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .6rem; align-items: center; padding: .12rem 0; }
.mega__node { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #13306f; border: 1.5px solid #4f8dff; color: #cfe0ff; transition: background var(--dur-2), transform var(--dur-2) var(--ease-out); }
.mega__node svg { width: 16px; height: 16px; }
.mega__step b { display: block; color: #fff; font-size: .9rem; font-weight: 500; line-height: 1.5; }
.mega__step small { display: block; color: #b9c9ec; font-size: .875rem; line-height: 1.45; }
.mega__step em { font-style: normal; color: #ffd88a; }
.mega__flow li.is-lit .mega__node { background: #2f7bff; color: #fff; transform: scale(1.08); box-shadow: 0 0 0 4px rgb(47 123 255 / .28); }
.mega__flow li.is-lit .mega__step b { color: #fff; font-weight: 600; }
.mega__story-p { color: #d5e0f7; font-size: .875rem; line-height: 1.75; }
.mega__story-limit { padding: .25rem .6rem; border-radius: 8px; background: rgb(255 216 138 / .1); border-inline-start: 2px solid #ffd88a; color: #ffe3ab; font-size: .875rem; line-height: 1.6; }
.mega__story-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1rem; margin-top: .1rem; }
.mega__panel .mega__story .link-arrow { color: #fff; font-size: .875rem; }
.mega__panel .mega__story .link-arrow:hover { color: #a9c6ff; }
.mega__panel .mega__story .mega__story-go { padding: .3rem .85rem; border-radius: 999px; background: #2f6cf0; font-weight: 600; text-decoration: none; }
.mega__panel .mega__story .mega__story-go:hover { background: #4f86ff; color: #fff; }
.mega__story :focus-visible, .mega__story:focus-visible { outline-color: #a9c6ff; }
@keyframes megaStory { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mega__story.is-entering > * { animation: megaStory .38s var(--ease-out) both; }
.mega__story.is-entering .mega__flow li { animation: megaStory .38s calc(var(--i) * 45ms + 60ms) var(--ease-out) both; }

.mega__groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.mega__tile { display: grid; gap: .1rem; align-content: start; min-width: 0; padding: .5rem .6rem .3rem; border-radius: 14px; border: 1px solid rgb(16 34 80 / .09); background: #fff; transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1); }
.mega__tile:hover, .mega__tile.is-lit, .mega__tile:focus-within { border-color: rgb(45 108 240 / .5); background: #fbfcff; box-shadow: 0 12px 28px -22px rgb(31 99 232 / .8); }
.mega__tile:hover .mega__gicon, .mega__tile.is-lit .mega__gicon { background: #1f63e8; color: #fff; }
.mega__ghead { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .15rem .5rem; align-items: center; color: inherit; text-decoration: none; border-radius: 10px; }
.mega__ghead > span:last-child { display: contents; }
.mega__ghead .mega__gicon { width: 32px; height: 32px; }
.mega__ghead small { grid-column: 1 / -1; }
.mega__ghead b { display: block; color: #0a1430; font-size: .95rem; font-weight: 600; line-height: 1.45; }
.mega__ghead small { display: block; color: #4a5672; font-size: .875rem; line-height: 1.45; }
.mega__ghead:hover b { color: #1747b8; }
.mega__mods { display: flex; flex-wrap: wrap; gap: 0 .2rem; margin: 0; padding: 0; list-style: none; }
.mega__mods li { display: inline-flex; align-items: center; }
.mega__mods li + li::before { content: "·"; margin-inline-end: .2rem; color: #9aa4ba; }
.mega__mods a { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .3rem; min-height: 30px; color: #1747b8; font-size: .875rem; font-weight: 500; text-decoration: none; }
.mega__mods a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mega__mods .mega__flag { padding: 0 .4rem; line-height: 1.5; }

/* ---------- Solutions: sectors | journey + responsibility ---------- */
.mega__grid--solutions { grid-template-columns: minmax(0, 1fr) 330px; gap: 1.6rem; }
.mega__col-sectors { display: grid; gap: .65rem; }
.mega__col-sectors .mega__head { margin-bottom: .1rem; }
.mega__sectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.mega__sector { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: .7rem; row-gap: .2rem; align-content: start; padding: .85rem .9rem; border-radius: 16px; border: 1px solid rgb(16 34 80 / .1); background: #fff; color: inherit; text-decoration: none; transition: border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1); }
.mega__sector:hover { border-color: #2d6cf0; box-shadow: 0 14px 30px -22px rgb(31 99 232 / .7); transform: translateY(-1px); }
.mega__sector:hover .mega__gicon { background: #1f63e8; color: #fff; }
.mega__sector .mega__gicon { grid-row: span 3; }
.mega__sector b { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; color: #0a1430; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.mega__sector > span:not(.mega__gicon) { color: #36435f; font-size: .875rem; line-height: 1.7; }
.mega__sector-mods { color: #56627f; font-size: .875rem; line-height: 1.6; }
.mega__col-side { display: grid; gap: .9rem; align-content: start; }
.mega__journey {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.25rem; align-items: center; padding: .9rem 1.05rem; border-radius: 16px; color: #eef2fb; text-decoration: none;
  background: radial-gradient(120% 90% at 100% 0%, rgb(82 148 255 / .32), transparent 60%), linear-gradient(160deg, #0b1633, #10275f);
}
.mega__journey-h { display: grid; gap: .15rem; }
.mega__journey .mega__chain { grid-row: span 2; justify-content: flex-end; max-width: 300px; }
.mega__journey small { display: flex; align-items: center; gap: .4rem; color: #a9c6ff; font-size: .875rem; font-weight: 600; }
.mega__journey small svg { width: 16px; height: 16px; }
.mega__journey b { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: #fff; }
.mega__journey-p { color: #d5e0f7; font-size: .875rem; line-height: 1.7; }
.mega__journey-go { display: inline-flex; align-items: center; gap: .35rem; color: #fff; font-weight: 600; font-size: .9rem; }
.mega__journey-go svg { width: 16px; height: 16px; }
.mega__journey:hover .mega__journey-go { color: #a9c6ff; }
.mega__chain { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; counter-reset: mc; }
.mega__chain li { counter-increment: mc; display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem .1rem .45rem; border-radius: 999px; background: rgb(255 255 255 / .09); border: 1px solid rgb(170 196 255 / .22); font-size: .875rem; color: #e3ebff; }
.mega__chain li::before { content: counter(mc); display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #2f7bff; color: #fff; font-size: .75rem; font-weight: 700; }
.mega__roles ul { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.mega__role { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 .75rem; min-height: 40px; padding: .4rem .6rem; margin-inline: -.6rem; border-radius: 10px; color: inherit; text-decoration: none; }
.mega__role:hover { background: #f3f6fc; }
.mega__role b { color: #0a1430; font-size: .925rem; font-weight: 600; }
.mega__role span { color: #4a5672; font-size: .875rem; }
.mega__price { display: grid; gap: .3rem; padding: .85rem .95rem; border-radius: 14px; border: 1px solid rgb(16 34 80 / .1); background: #f6f7fb; color: inherit; text-decoration: none; }
.mega__price:hover { border-color: rgb(45 108 240 / .5); }
.mega__price b { color: #0a1430; font-size: .95rem; }
.mega__price span { color: #3d4966; font-size: .875rem; line-height: 1.7; }
.mega__price .mega__price-go { display: inline-flex; align-items: center; gap: .3rem; color: #1747b8; font-weight: 600; }
.mega__price-go svg { width: 16px; height: 16px; }
.mega__paths { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-top: .3rem; padding-top: .3rem; border-top: 1px solid rgb(16 34 80 / .08); }

/* ---------- Resources: guides with outcomes | read | help ---------- */
.mega__grid--resources { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, .9fr); gap: 1.6rem; }
.mega__guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.mega__guide { display: grid; gap: .3rem; height: 100%; padding: .65rem .75rem; border-radius: 14px; border: 1px solid rgb(16 34 80 / .09); color: inherit; text-decoration: none; transition: border-color var(--dur-1), background var(--dur-1); }
.mega__guide:hover { border-color: rgb(45 108 240 / .5); background: #fbfcff; }
.mega__guide-q { color: #0a1430; font-size: .925rem; font-weight: 600; line-height: 1.55; }
.mega__guide-out { display: flex; gap: .35rem; align-items: flex-start; color: #1d6b43; font-size: .875rem; line-height: 1.55; }
.mega__guide-out svg { flex: none; width: 16px; height: 16px; margin-top: .2rem; }
.mega__col ul { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.mega__panel .mega__link { display: grid; gap: .05rem; padding: .45rem .6rem; margin-inline: -.6rem; border-radius: 10px; color: inherit; text-decoration: none; }
.mega__panel .mega__link:hover { background: #f3f6fc; }
.mega__panel .mega__link b { color: #0a1430; font-size: .925rem; font-weight: 600; line-height: 1.55; }
.mega__panel .mega__link span { color: #4a5672; font-size: .875rem; line-height: 1.55; }

@media (min-width: 1081px) and (max-width: 1240px) {
  .mega__grid--product { grid-template-columns: 226px minmax(0, 1fr) 400px; gap: 1rem; }
}

/* ===================== 3 · MOBILE / TABLET DRAWER ===================== */
@media (max-width: 1080px) {
  .site-header.is-light .mega {
    background: #fbfaf7; border-bottom: 1px solid rgb(16 34 80 / .1); box-shadow: 0 30px 60px -20px rgb(6 14 40 / .45);
    max-height: calc(100dvh - var(--header-h)); padding: .5rem var(--gutter) 1.25rem;
  }
  .site-header.is-light::after { display: none; }
  .mega__list { gap: 0; }
  .mega__item { border-bottom: 1px solid rgb(16 34 80 / .08); }
  .site-header.is-light .mega__top { min-height: 54px; font-size: 1.06rem; border-radius: 10px; }
  .mega__panel, .mega__panel--wide, .site-header.is-light .mega__panel {
    position: static; width: auto; max-height: none; overflow: visible; margin: 0 0 .75rem; border: 0; border-radius: 14px;
    box-shadow: none; background: #fff; animation: none;
  }
  .mega__grid, .mega__grid--product, .mega__grid--solutions, .mega__grid--resources { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: .9rem; }
  .mega__head { margin-bottom: .5rem; }
  .mega__title { font-size: 1.05rem; }
  /* pains become a two-column chooser, the story follows directly under it */
  .mega__pains { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .mega__pain { grid-template-columns: 30px minmax(0, 1fr); padding: .45rem .5rem; border-color: rgb(16 34 80 / .1); background: #fff; }
  .mega__picon { width: 30px; height: 30px; }
  .mega__pain small { display: none; }
  .mega__pain b { font-size: .9rem; }
  .mega__story { padding: .9rem; }
  .mega__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega__mods { padding-inline-start: 0; }
  .mega__sectors, .mega__guides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega__foot { padding: .8rem .9rem; border-radius: 0 0 14px 14px; }
}
@media (max-width: 600px) {
  .mega__pains { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mega__groups, .mega__sectors, .mega__guides { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
  .mega__tile { grid-template-columns: minmax(0, 1fr); padding: .5rem .55rem; }
  .mega__sector { padding: .7rem; }
  .mega__sector-mods { display: none; }
  .mega__flow li { padding: .15rem 0; }
  .mega__foot { flex-direction: column; align-items: stretch; }
  .mega__foot-links { justify-content: space-between; }
  .mega__cta { justify-content: center; width: 100%; }
}
@media (max-width: 359px) {
  .mega__pains { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .mega__panel:not([hidden]), .mega__story.is-entering > *, .mega__story.is-entering .mega__flow li { animation: none; }
  .mega__sector:hover { transform: none; }
  .mega__node { transition: none; }
}

/* ===================== 4 · PLATFORM STAGE: compact desktop for shorter viewports ===================== */
/* 1536×820, 1440×820 and 1440×800 (a laptop browser after its toolbar): the same three columns, same type sizes;
   only non-semantic spacing shrinks and the tab cards drop their module-count line (the counter still shows it). */
@media (min-width: 1081px) and (max-height: 860px) {
  /* the stage bar folds into the rail row: rail | prev · counter · next (the hint stays for screen readers) */
  .pf-sticky { gap: .45rem 1rem; grid-template-columns: minmax(0, 1fr) auto; }
  .pf-stagebar { display: contents; }
  .pf-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pf-ctrl { grid-column: 2; grid-row: 1; align-self: center; }
  .pf-rail { grid-column: 1; grid-row: 1; }
  .pf-progress, .pf-panel { grid-column: 1 / -1; }
  .pf-nav { width: 40px; height: 40px; }
  .pf .pf-tab { padding: .4rem .7rem; min-width: 196px; grid-template-columns: 30px auto; gap: .55rem; }
  .pf .pf-tab svg { width: 30px; height: 30px; padding: 6px; }
  .pf .pf-tab small { display: none; }
  .pf .pf-tabs { padding-bottom: .4rem; }
  .pf-panel { padding: .7rem 1.1rem; gap: .8rem 1.25rem; }
  .pf-progress { margin-top: -.25rem; }
  .pf-intro { gap: .4rem; }
  .pf-scene { padding-block: .55rem; }
  .pf-actions { display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
}
/* type floor inside the stage (desktop): availability marks were 12px */
@media (min-width: 1081px) {
  .pf .pf-check { font-size: .8125rem; }
}

/* pains column closes with a short orientation note (fills the column instead of leaving a gap under it) */
.mega__col-pains { display: grid; align-content: start; height: 100%; }
.mega__note { align-self: end; margin-top: .9rem; padding: .7rem .8rem; border-radius: 12px; background: #f6f7fb; color: #3d4966; font-size: .875rem; line-height: 1.7; }
.mega__note .link-arrow { display: inline-flex; min-height: 0; margin-top: .15rem; }
@media (max-width: 1080px) { .mega__note { display: none; } }
@media (max-width: 1080px) {
  .mega__journey { grid-template-columns: minmax(0, 1fr); }
  .mega__journey .mega__chain { grid-row: auto; justify-content: flex-start; max-width: none; }
}

/* ===================== 5 · ROLES: a guided stage on desktop, a gliding rail on touch ===================== */
.persona { display: block; position: relative; }
.persona__sticky { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem clamp(1.5rem, 3vw, 3rem); align-items: start; }
.persona__tabs { gap: .4rem; }
.persona__tabs [role="tab"] { position: relative; padding: .6rem .85rem; }
.persona__tabs [role="tab"] small { font-size: .875rem; }
.persona__tabs [role="tab"].is-past span.av { background: var(--blue-tint-2, rgb(47 123 255 / .14)); }
.persona__tabs [role="tab"][aria-selected="true"] span.av { background: var(--blue-600); color: #fff; }
.persona__main { display: grid; gap: .65rem; min-width: 0; }
.persona__stagebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.persona__hint { margin: 0; color: var(--text-3); font-size: .875rem; }
.persona__hint-scroll { display: none; }
.persona.is-staged .persona__hint-scroll { display: inline; }
.persona.is-staged .persona__hint-manual { display: none; }
.persona__count { font-variant-numeric: tabular-nums; direction: ltr; color: var(--text-2); font-weight: 600; }
.persona__bar { position: relative; display: block; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.persona__bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: calc((var(--ps-k, 0) + 1) / 7 * 100%); border-radius: inherit; background: linear-gradient(270deg, var(--blue-400), var(--blue-600)); transition: width var(--dur-2) var(--ease-out); }
.persona.is-staged .persona__bar i { width: max(calc(var(--stage-p, 0) * 100%), 5%); transition: width .12s linear; }
.persona__panel { grid-template-areas: "q q" "now before" "links links"; }
.persona__q { grid-area: q; }
.persona__now { grid-area: now; }
.persona__before { grid-area: before; padding: .9rem 1rem; border-radius: 14px; background: rgb(16 34 80 / .04); border: 1px dashed var(--line-2); }
.persona__before h3 { color: var(--text-3) !important; }
.persona__stops { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.persona__stops li { position: relative; padding-inline-start: 1.4rem; color: var(--text-2); font-size: .93rem; line-height: 1.7; text-decoration: line-through; text-decoration-color: rgb(16 34 80 / .35); text-decoration-thickness: 1px; }
.persona__stops li::before { content: "×"; position: absolute; inset-inline-start: 0; top: 0; color: var(--text-3); font-weight: 600; text-decoration: none; }
.persona__links { grid-area: links; }
.persona.is-staged::after { content: ""; display: block; height: var(--stage-run, 0px); }
.persona.is-staged .persona__sticky { position: sticky; top: calc(var(--header-h) + 12px); min-height: var(--ps-h, auto); }
.persona.is-staged, .persona.is-staged * { overflow-anchor: none; }
.persona.is-measuring .persona__panel > * { animation: none !important; }
@keyframes psIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.persona__panel.is-entering > * { animation: psIn .5s var(--ease-out) both; }
.persona__panel.is-entering > :nth-child(2) { animation-delay: .06s; }
.persona__panel.is-entering > :nth-child(3) { animation-delay: .12s; }
@media (max-width: 1080px) {
  .persona__sticky { grid-template-columns: minmax(0, 1fr); }
  /* the role tabs wrap into a grid (no sideways scrolling); swipe on the panel steps between roles */
  .persona__tabs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
  .persona__tabs [role="tab"] { grid-template-columns: 30px minmax(0, 1fr); gap: .5rem; padding: .45rem .6rem; min-height: 48px; }
  .persona__tabs [role="tab"] span.av { width: 30px; height: 30px; border-radius: 9px; }
  .persona__tabs [role="tab"] small { display: none; }
  .persona__tabs [role="tab"] b { font-size: .9rem; line-height: 1.4; }
}
@media (max-width: 900px) {
  .persona__panel { grid-template-areas: "q" "now" "before" "links"; }
}
@media (prefers-reduced-motion: reduce) {
  .persona__panel.is-entering > * { animation: none; }
  .persona__bar i { transition: none; }
}
/* centred in the space under the header when the stage is shorter than the viewport (no dead band below it) */
.persona.is-staged .persona__sticky { top: calc(var(--header-h) + 12px + max(0px, (100vh - var(--header-h) - 24px - var(--ps-h, 100vh)) / 2)); }

/* ===================== 6 · CHAPTERS: steps light in order, the document chain follows ===================== */
.ch-ba { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; margin: 0; }
.ch-ba > div { padding: .7rem .85rem; border-radius: 12px; }
.ch-ba dt { font-size: .875rem; font-weight: 600; }
.ch-ba dd { margin: .2rem 0 0; font-size: .93rem; line-height: 1.75; }
.ch-ba__before { border: 1px dashed var(--line-3); color: var(--text-2); }
.ch-ba__before dt { color: var(--text-3); }
.ch-ba__after { border: 1px solid rgb(82 148 255 / .4); background: rgb(47 123 255 / .08); color: var(--text-1); }
.ch-ba__after dt { color: var(--blue-200, var(--blue-300)); }
@media (max-width: 560px) { .ch-ba { grid-template-columns: minmax(0, 1fr); } }

.ch-steps { position: relative; }
.ch-steps::after { content: ""; position: absolute; inset-inline-start: 13px; top: 1.2rem; width: 2px; height: calc((100% - 2.4rem) * var(--ch-step, 0)); border-radius: 2px; background: var(--blue-400); transition: height .45s var(--ease-out); }
.ch-steps li::before { z-index: 1; transition: background var(--dur-2), color var(--dur-2), box-shadow var(--dur-2); }
.ch-steps li { transition: background var(--dur-2); border-radius: 10px; }
.ch-steps li.is-lit::before { background: rgb(47 123 255 / .2); color: var(--blue-200, #cfe0ff); }
.ch-steps li.is-now::before { background: var(--blue-600); color: #fff; box-shadow: 0 0 0 4px rgb(47 123 255 / .2); }
.ch-steps li.is-now { background: linear-gradient(270deg, rgb(47 123 255 / .08), transparent 75%); }
.ch-token li { transition: border-color .4s, background .4s, color .4s, transform .4s var(--ease-out); }
.ch-token li.is-lit { border-color: rgb(82 148 255 / .5); color: var(--text-1); }
.ch-token li.is-now { background: var(--blue-600); border-color: var(--blue-400); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgb(47 123 255 / .9); }
.ch-token li.is-now .num, .ch-token li.is-now bdi { color: #fff; }

/* tablet / mobile: a compact chapter stepper pinned under the header (the vertical index stays hidden <1100px) */
.ch-rail { display: none; }
@media (max-width: 1100px) {
  .ch-rail { display: block; position: sticky; top: var(--header-h); z-index: 5; margin-inline: calc(var(--gutter) * -1); margin-bottom: .5rem; padding: .4rem var(--gutter) .5rem; background: color-mix(in srgb, var(--bg-0) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-1); }
  .ch-rail::after { content: ''; position: absolute; inset-inline-start: 0; bottom: -1px; height: 2px; width: calc(var(--ch-p, 0) * 100%); background: linear-gradient(270deg, var(--blue-300), var(--blue-500)); transition: width .2s linear; }
  .ch-rail ol { display: flex; align-items: center; gap: .3rem; margin: 0; padding: 0; list-style: none; }
  .ch-rail li { flex: none; min-width: 0; }
  .ch-rail li:has(a[aria-current]) { flex: 0 1 auto; }
  .ch-rail a { display: flex; align-items: center; justify-content: center; gap: .4rem; min-width: 40px; min-height: 40px; border-radius: 999px; border: 1px solid transparent; color: var(--text-3); text-decoration: none; transition: background var(--dur-2), border-color var(--dur-2); }
  .ch-rail a span { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-3); font-family: var(--font-num); font-size: .78rem; font-weight: 600; }
  .ch-rail a b { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 600; }
  .ch-rail a[aria-current] { min-width: 0; padding-inline: .25rem .75rem; border-color: var(--blue-400); background: rgb(47 123 255 / .14); color: var(--text-1); }
  .ch-rail a[aria-current] span { background: var(--blue-500); border-color: var(--blue-300); color: #fff; }
  .ch-rail a[aria-current] b { display: block; }
}
@media (max-width: 359px) { .ch-rail ol { gap: .15rem; } .ch-rail a { min-width: 34px; } }
@media (prefers-reduced-motion: reduce) {
  .ch-steps::after, .ch-steps li::before, .ch-token li, .ch-rail::after, .ch-rail a { transition: none; }
  .ch-token li.is-now { transform: none; }
}
@media print { .ch-rail { display: none !important; } }
