/* Maturity Insights page styles (moved out of index.html by INS-030; INS-031 brand restyle). Load after brand-tokens.css. */
img { max-width: 100%; }
/* INS-031 brand restyle: page styles on top of brand-tokens.css. Presentation only.
   The old variable names are kept as aliases so the charts drawn by the script pick up the brand colours:
   neutral data is grey (median) and black (you); blues = good results, reds = challenging. */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #0B0B0B; --muted: #5B6468; --line: #ECEEEE;
  --accent: #7E888B;          /* median markers and lines in charts */
  --accent-soft: #E7F5F8;
  --warn: #0B0B0B;            /* "you" markers */
  --warn-soft: #F4F7F7;
  --l1: #D9534F; --l2: #F3A6A6; --l3: #9AA3A6; --l4: #8FD0E0; --l5: #2A9BC0;   /* Level 1..5: threat .. strength */
  --band: rgba(154,163,166,.26);
  --f-display: 'Heebo', sans-serif; --f-body: 'Heebo', sans-serif; --f-data: 'Heebo', sans-serif;
}
body { background: #fff; color: var(--mn-ink); font-family: 'Heebo', sans-serif; font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
.mn-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1em; height: 1em; display: inline-block; flex: none; vertical-align: -0.15em; fill: currentColor; }

/* Rail: the old tabs, one per view */
.mn-rail-item { border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; }
.mn-rail-item .ic { width: 22px; height: 22px; color: var(--mn-text-3); }
.mn-rail-item[aria-selected="true"] { background: var(--mn-active-bg); color: var(--mn-ink); font-weight: 600; }
.mn-rail-item[aria-selected="true"] .ic { color: var(--mn-link); }
.mn-rail-add, .mn-rail-add:hover { text-decoration: none; color: #fff; }
.mn-rail-add .ic { width: 22px; height: 22px; color: #fff; }
.mn-who { position: relative; }
.mn-avatar { border: 0; font-family: inherit; }
.mn-who-menu { position: absolute; left: calc(100% + 10px); bottom: 0; z-index: 20; min-width: 220px; display: grid; gap: 6px; padding: 14px 16px;
  background: #fff; border: 1px solid var(--mn-border); border-radius: 12px; box-shadow: 0 8px 24px rgba(11,11,11,.08); font-size: 14px; }
.mn-who-menu .who-label { font-size: 12px; font-weight: 600; color: var(--mn-text-3); }
.mn-who-menu .who-org { font-weight: 600; }
.mn-who-menu .who-out { color: var(--mn-link); }
@media (max-width: 760px) {
  .mn-rail { gap: 8px; }
  .mn-rail-item { width: auto; min-width: 64px; padding: 6px 6px; }
  .mn-rail-logo { width: 30px; height: 30px; }
  .mn-rail-add { width: 38px; height: 38px; }
  .mn-avatar { width: 36px; height: 36px; }
  .mn-who-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); }
}

/* Top bar: filters as pills */
.mn-pill { position: relative; }
.mn-pill select { appearance: none; -webkit-appearance: none; border: 0; background: none; font: 600 14px 'Heebo', sans-serif; color: var(--mn-ink);
  padding: 0 18px 0 0; margin: 0; cursor: pointer; max-width: 200px; field-sizing: content; }
.mn-pill select:focus-visible { outline: none; }
.mn-pill:focus-within { border-color: var(--mn-strength); }
.mn-pill .ic { position: absolute; right: 12px; width: 14px; height: 14px; color: var(--mn-text-3); pointer-events: none; }
.mn-pill select:disabled { opacity: 1; cursor: default; }
.more { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--mn-radius-pill); background: none;
  font: 500 14px 'Heebo', sans-serif; color: var(--mn-link); cursor: pointer; }
.more::before { content: ""; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 256 256%22 fill=%22%231C6F89%22%3E%3Cpath d=%22M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z%22 opacity=%220.2%22/%3E%3Cpath d=%22M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z%22/%3E%3C/svg%3E") center / contain no-repeat; }
.more:hover, .more[aria-expanded="true"] { background: var(--mn-active-bg); }
.more .cnt { font-size: 11px; font-weight: 600; line-height: 18px; min-width: 18px; text-align: center; background: var(--mn-ink); color: #fff; border-radius: 999px; padding: 0 5px; }
.mn-topbar-right { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.mn-badge .ic { width: 15px; height: 15px; }
.cohort { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--mn-radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--mn-surface); color: var(--mn-ink); }
.cohort b { font-weight: 700; }
.cohort.low { color: var(--mn-text-3); }
.extra { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--mn-rule); }
.chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips:empty { display: none; }
.chip { font: 500 13px 'Heebo', sans-serif; display: inline-flex; gap: 6px; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; border: 0;
  background: var(--mn-surface); color: var(--mn-ink); cursor: pointer; }
.chip span { font-size: 15px; line-height: 1; color: var(--mn-text-3); }
.reset { font: 500 13px 'Heebo', sans-serif; background: none; border: 0; color: var(--mn-link); cursor: pointer; padding: 3px 4px; }
.extra .mn-pill:has(select:disabled) { opacity: .55; cursor: not-allowed; }
.lockhint .ic { color: var(--mn-text-3); margin-right: 4px; }
.lockhint { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--mn-text-2); background: var(--mn-surface); padding: 8px 12px; border-radius: 10px; }

/* Page header */
.mn-main { gap: 32px; }
.mn-crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mn-text-3); }
.mn-crumb .ic { width: 12px; height: 12px; transform: rotate(-90deg); color: var(--mn-text-4); }
.mn-crumb b { font-weight: 500; color: var(--mn-ink); }
.mn-pagehead { display: grid; gap: 12px; }
.mn-pagehead h1 { margin-top: 6px; }
.lede { margin: 0; max-width: 720px; font-size: 17px; line-height: 1.6; color: var(--mn-text-2); }
#notice:empty { display: none; }
#notice { display: grid; gap: 10px; }

/* Views */
#views { transition: opacity .15s; }
section.view { display: grid; gap: 36px; }
section.view > div:first-child > h2:first-child { font-size: 44px; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 14px; text-wrap: balance; }
section.view > div:first-child > h2:first-child + .sub { font-size: 17px; max-width: 720px; }
h2 { font-weight: 700; font-size: 26px; line-height: 1.2; margin: 0 0 6px; text-wrap: balance; }
.panel h2 { font-size: 20px; }
.sub { margin: 0; color: var(--mn-text-2); font-size: 15px; line-height: 1.6; max-width: 72ch; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mn-text-4); }
.panel { background: #fff; border: 1px solid var(--mn-border); border-radius: var(--mn-radius-card); padding: 22px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { border: 1px solid var(--mn-border); border-radius: var(--mn-radius-card); padding: 22px; display: grid; gap: 8px; align-content: start; }
.stat .v { order: 2; font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat .k { order: 1; font-size: 13px; font-weight: 600; color: var(--mn-text-3); }
.chart { width: 100%; overflow-x: auto; }
svg text { font-family: 'Heebo', sans-serif; }
.gate { display: grid; place-items: center; text-align: center; gap: 6px; padding: 36px 20px; border-radius: var(--mn-radius-card); background: var(--mn-surface); color: var(--mn-text-2); }
.gate strong { font-size: 18px; font-weight: 700; color: var(--mn-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--mn-text-3); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.lens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lens .lbl { font-size: 13px; font-weight: 600; color: var(--mn-text-3); margin-right: 4px; }
.seg { font: 500 14px 'Heebo', sans-serif; color: var(--mn-text-2); background: #fff; border: 1px solid var(--mn-border-2); border-radius: 999px; height: 34px; padding: 0 14px; cursor: pointer; }
.seg:hover { border-color: var(--mn-strength); }
.seg[aria-pressed="true"] { background: var(--mn-active-bg); color: var(--mn-ink); border-color: transparent; font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 18px 0; }
.kv div { border-top: 1px solid var(--mn-border); padding-top: 10px; }
.kv .v { font-size: 24px; font-weight: 700; }
.kv .k { font-size: 13px; color: var(--mn-text-3); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--mn-rule); color: var(--mn-text-2); }
.pill.named { background: var(--mn-active-bg); color: var(--mn-link); }
.pill.verified { background: var(--mn-strength-tint); color: var(--mn-good-ink); } /* INS-066 PR C */
.badge { font-size: 14px; }
.mcol h2 { font-size: 20px; }
details summary { color: var(--mn-link); }

/* Factor explorer */
.factor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
@media (max-width: 1000px) { .factor-layout { grid-template-columns: 1fr; } }
@media (min-width: 1001px) and (max-width: 1240px) { .frow { grid-template-columns: 44px minmax(0,1fr) 34px; } .frow .mini { display: none; } }
.flist { display: grid; gap: 2px; max-height: 560px; overflow-y: auto; }
.frow { display: grid; grid-template-columns: 44px minmax(0,1fr) 92px 34px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.frow:hover { background: var(--mn-surface); }
.frow[aria-pressed="true"] { background: var(--mn-active-bg); box-shadow: inset 3px 0 0 var(--mn-link); }
.frow .code { font-size: 13px; font-weight: 600; color: var(--mn-text-4); }
.frow .nm { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .md { font-size: 14px; font-weight: 600; text-align: right; }
.mini { height: 6px; border-radius: 3px; background: var(--mn-rule); position: relative; overflow: hidden; }
.mini span { position: absolute; inset: 0 auto 0 0; background: var(--mn-median); border-radius: 3px; }
.fdetail h3 { font-size: 22px; margin: 6px 0 2px; text-wrap: balance; }

/* Tables */
.tablewrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--mn-border); border-radius: var(--mn-radius-card); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 640px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--mn-rule); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--mn-text-3); background: var(--mn-surface-2); border-bottom-color: var(--mn-border); }
th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--mn-surface-2); }
td.num { font-variant-numeric: tabular-nums; }
table.ptable { min-width: 0; }

/* Outlook readiness map (always 2 x 2) */
.mn-quad-box { gap: 4px; }
.mn-quad-name { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.mn-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.mn-quad-rule, .mn-quad-note { font-size: 13px; color: var(--mn-text-3); }
.mn-quad-big { font-size: 40px; font-weight: 700; line-height: 1.1; margin-top: 10px; letter-spacing: -.02em; }
.mn-quad-you { font-size: 24px; font-weight: 600; }
.mn-quad-box .mn-bar { margin-top: 8px; background: rgba(255,255,255,.75); }
.mn-rank-row .pct { white-space: nowrap; }

/* Matches */
.mcard { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--mn-rule); }
.mcard:first-of-type { border-top: 0; padding-top: 8px; }
.mcard .who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600; }
.mcard .fit { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--mn-active-bg); color: var(--mn-link); }
.mcard .intro { margin: 0; font-size: 14px; font-style: italic; color: var(--mn-text-2); }
.mcard .why { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard .why span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--mn-surface); color: var(--mn-text-2); }
.mcard .hk-hide { justify-self: start; }
.rq-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.rq-acts .btn { padding: 6px 12px; font-size: 13px; }
.rq-thread td { background: var(--mn-surface); }
.rq-help .btn, .rq-share .btn { padding: 6px 12px; font-size: 13px; }
.thread { display: grid; gap: 10px; padding: 4px 0; }
.thread .msg { max-width: 640px; padding: 10px 12px; border-radius: 10px; background: var(--mn-bg, #fff); border: 1px solid var(--mn-rule); }
.thread .msg.mine { justify-self: end; background: var(--mn-active-bg); }
.thread .msg p { margin: 4px 0 0; white-space: pre-wrap; }
.msgform { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.msgform textarea { font: inherit; min-height: 64px; padding: 10px 12px; border: 1px solid var(--mn-rule); border-radius: 8px; color: var(--mn-ink); background: var(--mn-bg, #fff); }
.msgform .hkmsg { grid-column: 1 / -1; }
.gate .optin { display: grid; gap: 8px; width: min(100%, 460px); margin-top: 10px; }
.gate .optin input { font: inherit; color: var(--mn-ink); background: var(--mn-bg, #fff); border: 1px solid var(--mn-rule); border-radius: 8px; padding: 10px 12px; }
.mcard .meta { font-size: 13px; color: var(--mn-text-3); }
.mcard ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.mcard li .code { font-size: 13px; font-weight: 600; color: var(--mn-text-4); margin-right: 6px; }
.mcard li .lv { font-size: 13px; color: var(--mn-text-3); margin-left: 6px; }
.btn { font: 600 14px 'Heebo', sans-serif; color: #fff; background: var(--mn-ink); border: 0; border-radius: var(--mn-radius-btn); height: 38px; padding: 0 16px; cursor: pointer; width: fit-content; }
.btn:hover { background: var(--mn-link); }
.btn.ghost { color: var(--mn-ink); background: #fff; border: 1px solid var(--mn-border-2); }
.btn.ghost:hover { border-color: var(--mn-strength); background: var(--mn-surface); }
.hkform { display: grid; gap: 8px; }
.hkform textarea { font: inherit; font-size: 14px; color: var(--mn-ink); background: #fff; border: 1px solid var(--mn-border-2); border-radius: 10px; padding: 10px 12px; min-height: 70px; resize: vertical; }
.hkmsg { font-size: 14px; }
.hkmsg.ok { color: var(--mn-good-ink); }
.hkmsg.err { color: var(--mn-bad-ink); }

/* Next steps + footer */
.mn-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mn-next-card { display: grid; gap: 6px; align-content: start; color: inherit; }
.mn-next-card > .ic { width: 28px; height: 28px; color: var(--mn-link); margin-bottom: 6px; }
.mn-next-card b { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; color: var(--mn-ink); }
.mn-next-card b .ic { width: 16px; height: 16px; }
.mn-next-card p { font-size: 14px; color: var(--mn-text-2); }
a.mn-next-card:hover { border-color: var(--mn-strength); color: inherit; }
.mn-footer { color: var(--mn-text-3); font-size: 13px; }
.mn-foot-notes { display: grid; gap: 6px; max-width: 720px; flex: 1 1 360px; }
.mn-footer-brand { margin-left: auto; }
.mn-foot-notes .sample b { font-weight: 600; color: var(--mn-text-2); }
@media (max-width: 760px) { section.view > div:first-child > h2:first-child, h1 { font-size: 32px; } .frow { grid-template-columns: 40px minmax(0,1fr) 34px; } .frow .mini { display: none; } }

.skel-wrap { display: grid; gap: 16px; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.skel-row2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.skel { border-radius: var(--mn-radius-card); background: linear-gradient(90deg, var(--mn-surface) 25%, #E9EEEF 50%, var(--mn-surface) 75%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
.skel-card { height: 110px; }
.skel-panel { height: 260px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.f-toggle { display: none; }
@media (max-width: 760px) {
  .mn-rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 30; height: auto; padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--mn-border); border-bottom: 0; overflow: visible; }
  .mn-rail-logo, .mn-rail-add { display: none; }
  .mn-rail nav { flex: 1; justify-content: space-around; gap: 0; }
  .mn-rail-item { flex: 1; min-width: 0; width: auto; padding: 4px 2px; font-size: 10px; line-height: 1.1; }
  .mn-rail-foot { margin: 0 0 0 4px; }
  .mn-avatar { width: 32px; height: 32px; font-size: 11px; }
  .mn-who-menu { top: auto; bottom: calc(100% + 8px); right: 0; left: auto; }
  .mn-main { padding-bottom: 96px; }
  .f-toggle { display: inline-flex; }
  .mn-topbar-inner > .mn-pill, .mn-topbar-inner > #f-more { display: none; }
  .mn-topbar.open .mn-topbar-inner > .mn-pill, .mn-topbar.open .mn-topbar-inner > #f-more { display: inline-flex; }
}

/* INS-063 level summary and info tips */
.lvlhead { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin-top: 16px; padding: 10px 0 10px 14px; border-left: 3px solid var(--accent); }
.lvlbadge .v { font-family: var(--f-data); font-size: 28px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.lvlbadge .v .act, .metrics3 .v .act { font-size: .58em; font-weight: 500; color: var(--muted); }
.lvlbadge .k, .metrics3 .k { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.lvldesc p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.45; }
.lvlbetween { font-weight: 600; }
.metrics3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.metrics3 > div { border-top: 2px solid var(--line); padding-top: 8px; }
.metrics3 .v { font-family: var(--f-data); font-size: 20px; font-weight: 600; white-space: nowrap; }
.info { position: relative; display: inline-grid; place-items: center; flex: none; width: 14px; height: 14px; border: 0; border-radius: 50%; background: none; color: var(--muted); opacity: .75; padding: 0; cursor: help; }
.info svg { width: 12px; height: 12px; fill: currentColor; }
.info:hover, .info:focus-visible { opacity: 1; color: var(--ink); outline: none; }
.info:hover::after, .info:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: 240px; padding: 8px 10px; border-radius: 6px; background: var(--ink); color: var(--bg); font: normal 400 12.5px/1.4 system-ui, sans-serif; white-space: normal; text-align: left; z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.metrics3 > div:last-child .info:hover::after, .metrics3 > div:last-child .info:focus::after { left: auto; right: -8px; transform: none; }
@media (max-width: 760px) { .lvlhead { grid-template-columns: 1fr; gap: 8px; } .metrics3 { grid-template-columns: 1fr 1fr; } }

/* INS-064: tips inside table headers, legends and stat labels */
th .info, .legend .info, .stat .info, .mn-quad-note .info { vertical-align: -2px; margin-left: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
