/* =====================================================================
   KPI demo - page-specific styles
   Purpose : Sign-in (full-screen map, logo, glass role window), dashboard
             catalogue, district profile, super admin switches, field-app
             phone, Ask KPI chat, integration map, What's new page.
             v0.6: Simple mode on the command centre (at the end).
             v0.6.1: What's new lists every update in full.
             v0.7: the field app's forms, sent screen, My reports and tabs;
             Ask KPI's answers with the places to see each figure; the
             presenter's guide styles are removed.
   Related : js/modules/*.js
   Version : 0.7
   ===================================================================== */
/* ---------- sign-in: the KP map fills the screen; the KPI logo and key figures sit below it; the logo opens a
   small glass window with the demo roles (js/modules/login.js) ---------- */
.login { position: relative; height: 100vh; height: 100dvh; min-height: 480px; overflow: hidden; color: #e6f2ef;
  background: radial-gradient(130% 95% at 50% 16%, var(--chrome-glow) 0%, var(--brand-deep) 46%, var(--brand-deeper) 100%); }
.lg-map { position: absolute; inset: 0; z-index: 0; }
.lg-map.kpm { position: absolute; inset: 0; min-height: 0; border-radius: 0; }   /* beats .kpm (map.css loads later) */
.login .kpm-ctl { top: 70px; right: 20px; }   /* js/modules/login.js sets top under the header */
.lg-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 18px 22px; pointer-events: none; }
.lg-top .lg-theme { justify-self: end; }
.lg-top > * { pointer-events: auto; }
.lg-owner { margin: 0; font-size: 13px; line-height: 1.45; color: #a9cdc5; }
.lg-theme .theme-btn { width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #e6f2ef; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lg-theme .theme-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .34); }
.lg-theme .theme-btn svg { width: 18px; height: 18px; }

/* the dock under the map: logo, figures, live line and credits; the map stays draggable around them */
.lg-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 20px 14px; pointer-events: none; }
.lg-dock::before { content: ""; position: absolute; left: 0; right: 0; top: -60px; bottom: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 80% at 50% 82%, rgba(3, 20, 18, .66) 0%, rgba(3, 20, 18, .3) 55%, rgba(3, 20, 18, 0) 100%); }
.lg-dock > * { pointer-events: auto; }
.lg-logo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; border: 0; background: transparent; color: inherit;
  padding: 12px 22px 9px; border-radius: 24px; cursor: pointer; transition: background .2s, box-shadow .2s, transform .25s var(--ease); }
.lg-logo img { display: block; width: clamp(250px, 29vw, 440px); height: auto; filter: drop-shadow(0 8px 26px rgba(103, 225, 206, .2)); }
.lg-logo:hover { background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 20px 50px -20px rgba(103, 225, 206, .5); transform: translateY(-2px); }
.lg-logo:focus-visible { outline: 3px solid var(--hero-a); outline-offset: 4px; }
.lg-logo[aria-expanded="true"] { background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
/* a soft ring breathes around the logo to invite the click */
.lg-logo::after { content: ""; position: absolute; inset: 2px; border-radius: inherit; border: 1px solid transparent; pointer-events: none; animation: lgRing 3.4s ease-in-out infinite; }
@keyframes lgRing { 0%, 100% { border-color: rgba(103, 225, 206, 0); box-shadow: 0 0 0 0 rgba(103, 225, 206, 0); } 50% { border-color: rgba(103, 225, 206, .38); box-shadow: 0 0 34px 0 rgba(103, 225, 206, .13); } }
.lg-cta { display: inline-flex; align-items: center; gap: 8px; font: 650 13px/1.2 var(--f-text); color: #e3f5f1; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); padding: 6px 13px; border-radius: 99px; }
.lg-cta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hero-a); animation: livePulse 1.8s ease-out infinite; }
.lg-cta .on-touch { display: none; }
@media (hover: none) { .lg-cta .on-hover { display: none; } .lg-cta .on-touch { display: inline; } }
.lg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 230px)); justify-content: center; margin: 8px 0 0; }
.lg-facts div { padding: 2px 20px; border-left: 1px solid rgba(255, 255, 255, .15); }
.lg-facts div:first-child { border-left: 0; }
/* key numbers in the light half of the logo gradient (palette tokens --hero-a/--hero-b), each with an icon */
.lg-facts dt { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lg-facts .n { font-family: var(--f-display); font-weight: 850; font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; color: var(--hero-a); font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--hero-a) 0%, var(--hero-b) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lg-facts .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: var(--hero-a); }
.lg-facts .ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lg-facts dd { margin: 6px 0 0; font-size: 13px; color: #c3ded8; line-height: 1.35; }
.lg-src { display: inline-block; font-size: 10.5px; color: var(--gold); border: 1px solid rgba(189, 171, 56, .5); border-radius: 99px; padding: 0 6px; margin-top: 3px; }
.lg-live { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: min(640px, 52vw); font-size: 12.5px; color: #cfe5df; margin: 9px 0 0; min-height: 20px;
  padding: 4px 12px; border-radius: 99px; background: rgba(3, 20, 18, .35); border: 1px solid rgba(255, 255, 255, .08); }
.lg-live > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--logo-hi); flex: none; animation: livePulse 1.8s ease-out infinite; }
.lg-live b { color: #fff; font-weight: 650; }
.lg-live .k { color: #8fb8af; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(103, 225, 206, .55); } 100% { box-shadow: 0 0 0 9px rgba(103, 225, 206, 0); } }
.lg-foot { font-size: 11.5px; color: #8fb8af; margin: 10px 0 0; max-width: 130ch; line-height: 1.45; }

/* the glass window with the roles */
.lg-pop-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; }
.lg-pop-wrap[hidden] { display: none; }
.lg-scrim { position: absolute; inset: 0; background: rgba(3, 18, 16, .5); opacity: 0; transition: opacity .18s; }
.lg-pop-wrap.on .lg-scrim { opacity: 1; }
.lg-pop { position: relative; width: min(400px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  color: #fff; padding: 18px 18px 14px; border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, .09) 55%, rgba(255, 255, 255, .08) 100%), rgba(8, 40, 36, .38);
  border: 1px solid rgba(255, 255, 255, .26); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .2s, transform .26s var(--ease); }
.lg-pop-wrap.on .lg-pop { opacity: 1; transform: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .lg-pop { background: rgba(9, 44, 40, .96); } }
.lg-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #e6f2ef; cursor: pointer; }
.lg-x:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lg-x svg, .lg-note svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lg-x:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lg-pop-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 42px; }
.lg-pop-head img { flex: none; margin-top: 3px; }
.lg-pop h2 { font-family: var(--f-display); font-size: 21px; font-weight: 800; color: #fff; margin: 0 0 4px; letter-spacing: -0.01em; }
.lg-pop-head p { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .82); }
.roles { display: flex; flex-direction: column; gap: 5px; margin: 14px 0 12px; }
.role { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; align-items: center; padding: 7px 11px; border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 13px; background: rgba(255, 255, 255, .05); cursor: pointer; transition: background .15s, border-color .15s; }
.role:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .26); }
.role.on { background: rgba(103, 225, 206, .15); border-color: var(--hero-a); box-shadow: inset 3px 0 0 var(--hero-a); }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role:has(input:focus-visible) { outline: 3px solid #fff; outline-offset: 2px; }
.role .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .13); color: #fff; font-weight: 700; font-size: 12.5px; }
.role.on .av { background: var(--hero-a); color: #072a26; }
.role .rt b { display: block; font-size: 14px; font-weight: 700; color: #fff; }
.role .rt > span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .78); line-height: 1.35; margin-top: 1px; }
.lg-go { width: 100%; min-height: 46px; border: 0; border-radius: 13px; cursor: pointer; color: #072a26; font: 750 15px/1.2 var(--f-text);
  background: linear-gradient(100deg, var(--hero-a), var(--hero-b)); box-shadow: 0 12px 28px -14px rgba(103, 225, 206, .75); }
.lg-go:hover { filter: brightness(1.07); }
.lg-go:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.lg-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 11.5px; line-height: 1.45; color: rgba(255, 255, 255, .76); }
.lg-note svg { margin-top: 1px; color: var(--hero-a); }
.lg-real { margin: 8px 0 0; font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .66); }
@media (prefers-reduced-motion: reduce) {
  .lg-logo::after, .lg-cta .dot, .lg-live .dot { animation: none; }
  .lg-pop, .lg-scrim, .lg-logo { transition: none; }
}
@media (max-width: 1000px) {
  .lg-top { grid-template-columns: minmax(0, 1fr) auto; }
  .lg-top .lg-live { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; margin: 0; }
  .lg-top .lg-theme { grid-column: 2; grid-row: 1; }
}
@media (max-height: 700px) and (min-width: 701px) {
  .lg-logo img { width: clamp(240px, 28vw, 400px); }
  .lg-facts .n { font-size: 30px; }
  .lg-facts .ic { width: 30px; height: 30px; }
  .lg-foot .lg-how { display: none; }
}
@media (max-width: 700px) {
  .lg-top { padding: 14px; }
  .lg-owner { font-size: 12px; }
  .lg-dock { padding: 0 10px 10px; }
  .lg-logo { padding: 10px 12px 8px; gap: 8px; }
  .lg-logo img { width: min(80vw, 360px); }
  .lg-cta { font-size: 12px; padding: 5px 11px; }
  .lg-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 8px; }
  .lg-facts div { padding: 2px 6px; }
  .lg-facts dt { flex-direction: column; gap: 4px; }
  .lg-facts .n { font-size: 25px; }
  .lg-facts .ic { width: 26px; height: 26px; border-radius: 8px; }
  .lg-facts .ic svg { width: 14px; height: 14px; }
  .lg-facts dd { font-size: 11.5px; margin-top: 3px; }
  .lg-live { font-size: 11.5px; }
  .lg-foot { font-size: 10.5px; margin-top: 6px; }
  .lg-foot .lg-how { display: none; }
  .lg-foot .lg-attr { display: block; font-size: 10px; opacity: .85; }
  .login .kpm-ctl { right: 12px; }
  .lg-pop { padding: 18px 14px 14px; border-radius: 18px; }
  .lg-pop h2 { font-size: 19px; }
}

/* ---------- catalogue ---------- */
.dom-block { margin-bottom: 22px; }
.dom-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.dom-head h2 { font-size: 17px; font-weight: 700; margin-right: 4px; }
.dom-own { font-size: 12.5px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.sys { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 2px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.sys:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); color: var(--ink); }
.sys .sid { grid-row: 1 / 3; font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-tint); border-radius: 6px; padding: 3px 6px; align-self: start; }
.sys .snm { font-weight: 650; font-size: 14px; line-height: 1.3; }
.sys .ssub { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sys .smeth { grid-column: 2; display: flex; gap: 6px; margin-top: 5px; color: var(--pin); }
.sys .sscr { grid-column: 2; font-size: 12px; font-weight: 650; color: var(--brand-ink); margin-top: 3px; }
.sys { align-content: start; }   /* cards in a row share a height: keep the extra space below, so clamped text stays clamped */
.sys.is-new { border-color: #67e1ce; box-shadow: inset 3px 0 0 #2fbfa8; }
.sys .snm .newb { margin-left: 6px; }
.sys .snm .pill.sample { font-size: 10.5px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.sys .smeth svg, .lg-m svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-m { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; }
.lg-m svg { color: var(--pin); }

/* ---------- district profile ---------- */
.dom-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.ds-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; }
.ds-row:hover { background: var(--surface-2); color: var(--brand-ink); }
.ds-row.off { color: var(--muted); }

/* ---------- super admin ---------- */
.ctl-matrix td { padding: 2px 1px; text-align: center; }
.ctl-matrix td.rh { text-align: left; }
.ctl-matrix { min-width: 860px; }
.tog { flex: none; min-width: 30px; width: 30px; height: 18px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; padding: 0; vertical-align: middle; }
.tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.tog.on { background: var(--brand); }
.tog.on::after { transform: translateX(12px); }
.tog.draft { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }

/* ---------- field app phone ---------- */
.phone-col { display: flex; justify-content: center; }
.phone { width: 340px; max-width: 100%; border-radius: 34px; background: #0f1d1a; padding: 12px; box-shadow: var(--shadow-pop); }
.ph-top { display: flex; align-items: center; gap: 8px; background: var(--brand-deep); color: #fff; padding: 14px 14px 12px; border-radius: 24px 24px 0 0; font-size: 13.5px; }
.ph-top img { height: 24px; width: auto; }
.ph-net { border: 0; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; background: #1d7a4c; color: #fff; }
.ph-net.off { background: var(--critical); }
.ph-body { background: var(--surface); padding: 14px; border-radius: 0 0 24px 24px; }
.ph-body .field { margin-bottom: 10px; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 4px; }
.ph-queue { color: #f3d99a; font-size: 12px; text-align: center; padding: 6px 0 2px; min-height: 22px; }
.ph-hint { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 10px 4px; }
/* v0.7: the field app as the officer's workspace: form picker, sent screen, my reports, tabs */
.phone-col { flex-direction: column; align-items: center; }
.phone { display: flex; flex-direction: column; min-height: 640px; }
.ph-net { display: inline-flex; align-items: center; gap: 5px; }
.ph-net svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.ph-screen { flex: 1; background: var(--surface); padding: 16px 14px; overflow: auto; max-height: 620px; }
.ph-screen .ph-body { padding: 0; border-radius: 0; background: transparent; }
.ph-screen .ph-h { font-family: var(--f-display); font-size: 18px; font-weight: 700; margin: 4px 0 12px; outline: none; }
.ph-hi { display: flex; flex-direction: column; margin-bottom: 14px; }
.ph-hi span { font-size: 13px; color: var(--muted); }
.ph-hi b { font-family: var(--f-display); font-size: 19px; outline: none; }
.ph-hi small { font-size: 12.5px; color: var(--brand-ink); font-weight: 600; margin-top: 2px; }
.ph-ask { font-weight: 650; margin: 0 0 8px; }
.ph-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-form { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; min-height: 104px; transition: border-color .15s, transform .15s var(--ease); }
.ph-form:hover { border-color: var(--brand); transform: translateY(-1px); }
.ph-form b { font-size: 13.5px; line-height: 1.2; }
.ph-form span:last-child { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.pfi { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand-tint); color: var(--brand-ink); flex: none; margin-bottom: 4px; }
.pfi svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-back { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--brand-ink); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; }
.ph-back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.ic.flip { transform: scaleX(-1); }
.ph-goes { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.ph-goes svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ph-send { width: 100%; margin-top: 10px; min-height: 44px; }
.field.yn { border: 0; padding: 0; margin: 0 0 10px; }
.field.yn legend { font-size: 13px; font-weight: 600; margin-bottom: 5px; padding: 0; }
.field.yn .seg { display: flex; }
.ynb { position: relative; flex: 1; }
.ynb input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ynb span { display: block; text-align: center; padding: 6px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ynb input:checked + span { background: var(--surface); color: var(--brand-ink); box-shadow: 0 0 0 1px var(--line-2); }
.ynb input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.ph-screen .err { display: block; color: var(--critical-ink, var(--critical)); font-size: 12px; margin-top: 4px; }
.ph-screen .err.hidden { display: none; }
.ph-sent { text-align: center; padding-top: 18px; }
.ok-ring { width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #fff; box-shadow: 0 0 0 10px color-mix(in srgb, var(--good) 18%, transparent); animation: okPop .5s var(--ease); }
.ok-ring svg { width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes okPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ph-sent p { font-size: 13.5px; color: var(--ink-2); }
.ph-alert { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px !important; }
.ph-alert.lv2, .ph-alert.lv3 { border-color: color-mix(in srgb, var(--serious) 45%, transparent); background: color-mix(in srgb, var(--serious) 8%, var(--surface)); }
.ph-acts { display: grid; gap: 8px; margin-top: 14px; }
.ph-acts .btn { justify-content: center; min-height: 40px; }
.ph-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ph-mine li { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ph-mine .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.ph-mine .m { font-size: 11.5px; color: var(--muted); margin: 3px 0 6px; }
.ph-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; padding: 6px 8px 10px; }
.ph-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; padding: 6px; border-radius: 10px; position: relative; }
.ph-tabs button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-tabs button[aria-current="true"] { color: var(--brand-ink); background: var(--brand-tint); }
.ph-tabs .n { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-size: 10.5px; display: grid; place-items: center; }
.fstat { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fs-dots { display: inline-flex; gap: 3px; }
.fs-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: background .3s; }
.fs-dots i.on { background: var(--brand); }
.fstat[data-k="0"] .fs-dots i.on { background: var(--gold); }
.fstat[data-k="4"] .fs-dots i.on { background: var(--good); }
.field-side { display: grid; gap: 16px; align-content: start; }
.fdest { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.fdest li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.fdest .pfi { margin: 0; width: 28px; height: 28px; }
.fdest a { color: var(--brand-ink); }
@media (max-width: 700px) { .fdest { grid-template-columns: 1fr; } .phone { min-height: 0; } .ph-screen { max-height: none; } }
@media (prefers-reduced-motion: reduce) { .ok-ring { animation: none; } .ph-form { transition: none; } }
.hub-tbl { table-layout: fixed; min-width: 980px; }
.hub-tbl td { font-size: 12.5px; }
.hub-tbl code { font-size: 11px; word-break: break-all; }
.hub-tbl .pin { max-width: none; }

/* ---------- Ask KPI ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
/* v0.7: Ask KPI answers name the places to see each figure */
.ask-intro { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-tint); color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.ask-intro svg { width: 20px; height: 20px; flex: none; color: var(--brand-ink); stroke: currentColor; fill: none; stroke-width: 1.8; margin-top: 1px; }
.msg.bot { max-width: 100%; }
.msg .sicon, .msg svg.st { vertical-align: -2px; }
.ans-places { display: grid; gap: 6px; margin-top: 10px; }
.ans-place { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 7px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ans-place.api { border-color: var(--api-line); box-shadow: inset 3px 0 0 var(--api-rail); }
.ap-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; flex: 1; min-width: 200px; text-decoration: none; color: var(--ink); font-size: 13px; }
.ap-main:hover b { color: var(--brand-ink); text-decoration: underline; }
.ap-main .muted { font-size: 12px; }
.ap-main > svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; color: var(--brand-ink); }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg .btn { white-space: normal; text-align: left; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg .btn { font-weight: 500; text-align: left; }

/* ---------- integration map ---------- */
.imap .node { cursor: pointer; }
.imap .node:hover rect, .imap .node:focus rect { stroke: var(--pin); stroke-width: 1.5; }
.imap .node:focus { outline: none; }
.imap text { font-size: 12px; }
.imap .lk { transition: stroke .15s, stroke-opacity .15s; }

@media (max-width: 1100px) {
  .dom-status { grid-template-columns: 1fr; }
}


/* ---------- What's new (js/modules/whatsnew.js) ---------- */
.wn-sec { margin: 0 0 24px; }
.wn-sec > h2 { font-size: 17px; font-weight: 700; margin: 0 0 10px; }
.wn-sec > h2 .muted { font-weight: 500; }
.wn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.wn-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px; background: var(--surface); border: 1px solid #67e1ce;
  border-radius: var(--r-md); box-shadow: inset 3px 0 0 #2fbfa8; text-decoration: none; color: var(--ink); }
a.wn-card:hover { box-shadow: inset 3px 0 0 #2fbfa8, 0 0 0 3px var(--brand-tint); color: var(--ink); }
.wn-card .newb { position: absolute; top: 12px; right: 12px; margin: 0; }
.wn-k { font-size: 12px; color: var(--muted); padding-right: 64px; }
.wn-t { font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--brand-ink); }
.wn-b { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.wn-f { margin-top: 6px; }
.wn-list { margin: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.wn-list > div { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); }
.wn-list > div:first-child { border-top: 0; }
.wn-list dt { font-weight: 700; font-size: 13.5px; }
.wn-list dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.wn-list ul { margin: 0; padding-left: 18px; }
.wn-old dt { color: var(--muted); }
@media (max-width: 700px) { .wn-list > div { grid-template-columns: 1fr; gap: 2px; } }
/* v0.6.1: every update, version by version */
.wn-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wn-jump a { text-decoration: none; font-size: 12.5px; font-weight: 650; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--ink-2); }
.wn-jump a:hover { border-color: var(--brand); color: var(--brand-ink); }
.wn-ver { margin-bottom: 12px; padding: 14px 18px 12px; scroll-margin-top: 80px; }
.wn-vh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.wn-vh h3 { flex: 1 1 320px; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.wn-vn { font-family: var(--f-display); font-weight: 800; font-size: 18px; color: var(--brand-ink); }
.wn-vd { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wn-vc { font-size: 12px; }
.wn-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.wn-items li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); max-width: 110ch; }
.wn-kind { align-self: start; text-align: center; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 0; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.wn-kind.k-added { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand-ink); }
.wn-kind.k-fixed { background: var(--good-tint); border-color: transparent; color: var(--good-ink); }
.wn-kind.k-security { background: var(--surface); border-color: var(--ink-2); color: var(--ink); }
#all, #api { scroll-margin-top: 80px; }
@media (max-width: 640px) { .wn-items li { grid-template-columns: 1fr; gap: 3px; } .wn-kind { justify-self: start; padding: 1px 9px; } }

/* ---------- command centre: Simple mode (v0.6) ----------
   The switch sits at the top right of the heading; in Simple mode the map card takes the full width,
   with the ranked list in two columns and a taller map. */
.screen-head.cc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 28px; align-items: start; }
.cc-head-t { min-width: 0; }
.cc-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; max-width: 250px; padding-top: 2px; }
.cc-mode .switch { height: 38px; font-size: 14px; padding: 0 14px 0 10px; }
.cc-mode .newb { margin-left: 0; }
.cc-mode-d { flex: 1 0 100%; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: right; }
.cc-row.cc-simple .glance { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.cc-row.cc-simple .glance .dlist { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.cc-row.cc-simple .glance .dlist button { padding-top: 7px; padding-bottom: 7px; font-size: 14px; }
.cc-row.cc-simple .glance .map-box { height: 500px; }
@media (max-width: 1100px) {
  .cc-row.cc-simple .glance { grid-template-columns: minmax(0, 1fr); }
  .cc-row.cc-simple .glance .dlist { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cc-row.cc-simple .glance .map-box { height: 380px; }
}
@media (max-width: 760px) {
  .screen-head.cc-head { grid-template-columns: minmax(0, 1fr); }
  .cc-mode { justify-content: flex-start; max-width: none; }
  .cc-mode-d { text-align: left; }
}
@media (max-width: 700px) { .cc-row.cc-simple .glance .map-box { height: 320px; } }
