/* Member adapter to /site-brand.css. The imported Design Components render
   in the light DOM; scoped selectors cover their inline type without editing
   11 screens. Desktop colours are owned by KCPersonal, NOT this sheet. Saved
   Aurora/Classic choices retain their palette and typography. Mobile keeps
   its colour/register controls, including Clear's high-legibility type. */

:root[data-member-brand][data-look="invictus"],
:root[data-member-brand="mobile"][data-presentation="focused"] {
  --font-sans: var(--iv-font, "Instrument Sans", system-ui, sans-serif) !important;
  --font-serif: var(--font-sans) !important;
  --font-display: var(--font-sans) !important;
  --font-editorial: var(--font-sans) !important;
  --font-mono: var(--kc-mono) !important;
  --au-font-display: var(--font-sans);
  --au-font-mono: var(--kc-mono);
}

:root[data-look="invictus"][data-member-brand] body,
:root[data-look="invictus"][data-member-brand] :is([style*="Nunito"], [style*="Comfortaa"], [style*="Geist"], .kc-tool-card, .kc-tool-card h2, .kc-tool-card button) {
  font-family: var(--iv-font, "Instrument Sans", system-ui, sans-serif) !important;
}
/* LABELS ARE THE LANDING'S MONO. The landing sets every kicker, honesty note
   and HUD figure in JetBrains Mono, uppercase and tracked (anatomy §1.2), so the
   component export's monospace metadata (dates, chart labels, the wordmark
   subtitle, eyebrows) now wears the same face, self-hosted, instead of being
   flattened into the sans. Code and keyboard examples stay a system monospace,
   so a label never reads as code. Tracking is held a little under the
   landing's .18em because these labels sit in tighter boxes than its kickers. */
@font-face {
  font-family: "Invictus Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/brand/JetBrainsMono.woff2") format("woff2");
}
:root[data-member-brand] {
  --kc-mono: "Invictus Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
:root[data-look="invictus"][data-member-brand] :is([style*="JetBrains"], [style*="IBM Plex Mono"], [style*="Geist Mono"], [style*="font-mono"], [font-family*="Mono"], .kc-tool-eyebrow):not(:is(code, pre, kbd, samp, code *, pre *, kbd *, samp *)) {
  font-family: var(--kc-mono) !important;
  font-weight: 500 !important;
}
:root[data-look="invictus"][data-member-brand] :is([style*="JetBrains"], [style*="IBM Plex Mono"], [style*="Geist Mono"])[style*="letter-spacing"]:not(:is(code, pre, kbd, samp, code *, pre *, kbd *, samp *)) {
  letter-spacing: .12em !important;
}
/* The phone's labels are sans, uppercase and tracked in the export; in the
   default register they become the same mono labels. */
:root[data-member-brand="mobile"][data-presentation="focused"] :is([style*="text-transform: uppercase"], [style*="text-transform:uppercase"])[style*="letter-spacing"]:not(:is(button, button *, code, pre, kbd, samp)) {
  font-family: var(--kc-mono) !important;
  font-weight: 500 !important;
  letter-spacing: .12em !important;
}
:root[data-look="invictus"][data-member-brand] :is(code, pre, kbd, samp, code *, pre *, kbd *, samp *),
:root[data-member-brand="mobile"][data-presentation="focused"] :is(code, pre, kbd, samp, code *, pre *, kbd *, samp *) {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace !important;
}
:root[data-look="invictus"][data-member-brand] :is(h1, h2, h3) {
  letter-spacing: -.035em;
  text-wrap: balance;
}
:root[data-look="invictus"][data-member-brand] body {
  background: var(--bg) !important;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
:root[data-look="invictus"][data-member-brand] aside {
  background: var(--side) !important;
  border-right-color: var(--line) !important;
}
:root[data-look="invictus"][data-member-brand] :is(section[style*="--surface"], section[style*="--t-FBF8F4"]) {
  background: var(--card-fill) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--iv-radius, 28px) !important;
  box-shadow: none !important;
}
:root[data-look="invictus"][data-member-brand] [style*="--sk-bg"] {
  --sk-bg: var(--wal-bg) !important;
  --sk-card: var(--wal-card) !important;
  --sk-ink: var(--wal-ink) !important;
  --sk-mut: var(--wal-mut) !important;
  --sk-panel: var(--wal-panel) !important;
  --sk-line: var(--wal-line) !important;
  --sk-acc: var(--wal-acc) !important;
  box-shadow: none !important;
}
:root[data-look="invictus"][data-member-brand] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) {
  border-color: var(--line) !important;
  border-radius: var(--iv-radius-sm, 16px) !important;
  font-family: var(--font-sans) !important;
}
:root[data-look="invictus"][data-member-brand] :is(.kc-tool-card, [role="dialog"]) {
  border-radius: var(--iv-radius, 28px) !important;
}
:root[data-look="invictus"][data-member-brand] :focus-visible {
  outline: 2px solid var(--kc-ink-acc) !important;
  outline-offset: 3px;
}
/* Only the neutral brand accent becomes an ivory pill. User-selected accents
   retain the computed AA-safe fill and white labels from the palette engine. */
:root[data-look="invictus"][data-accent="graphite"][data-member-brand] :is(button, a):is([style*="background: var(--primary"], [style*="background:var(--primary"], [style*="background: var(--t-2434DE"], [style*="background:var(--t-2434DE"], [style*="background: var(--t-2B2A3E"], [style*="background:var(--t-2B2A3E"], .kc-tool-primary) {
  background: var(--iv-button, #eff5f2) !important;
  color: var(--iv-button-ink, #15201e) !important;
  border-color: transparent !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
:root[data-look="invictus"] .kc3-player {
  --kc3-sans: var(--iv-font, "Instrument Sans", system-ui, sans-serif);
  --kc3-display: var(--kc3-sans);
  --kc3-mono: var(--kc-mono);
  --acc-ring: var(--kc-ink-acc);
}

/* Mobile's semantic layer: neutrals and frame geometry align to the landing
   page, while the active accent and semantic status colours remain intact.
   Vivid and Clear are deliberate saved reading settings and are not restyled. */
:root[data-member-brand="mobile"][data-presentation="focused"] {
  --bg: var(--iv-bg, #08090a) !important;
  --bg-warm: var(--iv-bg, #08090a) !important;
  --surface: var(--iv-surface, #111919) !important;
  --surface-2: var(--iv-raised, #17201f) !important;
  --text: var(--iv-text, #f5f6f5) !important;
  --text-2: #c3cfcc !important;
  --text-3: #a1b3ac !important;
  --border: #34453f !important;
  --border-strong: #748c81 !important;
  --ink-900: #0c1010 !important;
  --ink-800: #111919 !important;
  --ink-700: #17201f !important;
  --hero-grad: linear-gradient(#111919, #0c1010) !important;
  --chrome-bg: linear-gradient(#08090a, #08090a) !important;
  --au-ground: linear-gradient(#08090a, #08090a);
  --au-grad-frame: linear-gradient(#34453f, #34453f);
  --au-r-frame: 28px;
  --au-r-card: 28px;
  --au-r-small: 16px;
  --r-14: 16px !important;
  --r-18: 20px !important;
  --r-20: 28px !important;
  --shadow-sm: none !important;
  --shadow-md: none !important;
}
:root[data-member-brand="mobile"][data-presentation="focused"][data-theme="light"] {
  --bg: #f2f5f2 !important;
  --bg-warm: #f2f5f2 !important;
  --surface: #ffffff !important;
  --surface-2: #e6ede7 !important;
  --text: #15201e !important;
  --text-2: #354b45 !important;
  --text-3: #53665f !important;
  --border: #cbd8cf !important;
  --border-strong: #668173 !important;
  --hero-grad: linear-gradient(#ffffff, #e6ede7) !important;
  --chrome-bg: linear-gradient(#f2f5f2, #f2f5f2) !important;
  --au-ground: linear-gradient(#f2f5f2, #f2f5f2);
}
/* Mint, the default accent (kc-boot.js ACCENT_DEFAULT, kc_profiles.accent
   DEFAULT 'mint' since 20261015120000_kc_accent_mint.sql), in the landing's own
   pairing: mint text and rings, the ivory pill as the fill. Whether it was
   chosen or is simply the default makes no difference to the paint any more;
   choosing gold, purple or green leaves this scope for kc-theme.css's ramp. */
:root[data-member-brand="mobile"][data-accent="mint"][data-presentation="focused"] {
  --acc-400: #bcefe4 !important;
  --acc-500: #a5e4dc !important;
  --acc-600: #367c6c !important;
  --acc-700: #28594f !important;
  --acc-fill: #eff5f2 !important;
  --acc-fill-hover: #d6e8df !important;
  --acc-ink: #15201e !important;
  --acc-ring: #a5e4dc !important;
  --acc-ground: #08090a !important;
  --acc-tint: #203732 !important;
  --acc-tint-2: #172a25 !important;
  --blue-600: #a5e4dc !important;
  --blue-500: #bcefe4 !important;
  --blue-fg: #a5e4dc !important;
  --blue-100: #203732 !important;
  --blue-050: #172a25 !important;
  --violet-500: #a5e4dc !important;
  --violet-100: #203732 !important;
  --au-grad: linear-gradient(#eff5f2, #eff5f2);
  --au-tint: #203732;
  --au-tint-sel: #203732;
  --au-wash-purple: none;
  --au-wash-green: none;
}
:root[data-member-brand="mobile"][data-accent="mint"][data-presentation="focused"] :is(button[style*="background: var(--blue-600)"], button[style*="background:var(--blue-600)"], button[style*="background: var(--acc-fill)"]) {
  background: #eff5f2 !important;
  color: #15201e !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
/* The members-only door is public-facing chrome, so it always shares the
   landing page's type, plain matte background and high-contrast main action. */
:root[data-member-brand] #kc-gate {
  --page: var(--iv-bg, #08090a);
  --ink1: var(--iv-text, #f5f6f5);
  --ink2: #c3cfcc;
  --ink3: #a1b3ac;
  --font-sans: var(--iv-font, "Instrument Sans", system-ui, sans-serif);
  --font-display: var(--font-sans);
  --grad: linear-gradient(#eff5f2, #eff5f2);
  --on-grad: #15201e;
  --acc: #a5e4dc;
}

/* ===========================================================================
   THE WORLD — the landing's globe of lights behind the Knowledge Center
   (site-world SPEC §2, §7). The backdrop is the shared one (site-world.css,
   site-world.js); this block decides where it may show and where it sits.

   WHEN. On /center the World is the member's ground only when
   kc-personalise.js stamps data-kc-world (the Invictus look, a dark ground,
   the first wallpaper — "World" in the panel —, stars off), before the first
   paint; any other saved choice hides the mount (center.html, an inline
   <style> in its <head>, so it holds before any sheet arrives), and a member
   with Aurora, Classic, a tinted wallpaper, Matte, stars or a light ground
   never sees a frame of it. On /m it follows the reading register (below).

   THE HOLE. The mount is fixed at z-index 0 under the page. The shell is
   lifted to z 1 and its own ground goes clear, as do Today's page ground and
   Ask's sky (kc-personalise.js sets --kc-ground and --stars to transparent),
   and Ask's own frame (below). body keeps its #08090a (it paints under the
   mount, and it is the canvas a failed still falls back to).

   CARDS ARE THE LANDING'S GLASS. With the default glass (Tinted) every card
   is the landing's window glass, rgba(16, 24, 27, .86) behind blur(16px)
   saturate(1.2), instead of the opaque #111919: the planet carries on, soft
   and dim, behind a card rather than being cut into strips by it, and no text
   ever sits on the globe itself. The fills are kc-personalise.js's
   (--card-fill, --mk-g0..2, --tg-card); the inline var(--surface) fills are
   reached the way the Clear glass reaches them (kc-app.css). Clear keeps its
   lighter glass and Solid stays opaque, as chosen; an OS request for reduced
   transparency is Solid. Inks are unchanged, and every run of text is
   measured with the globe's still behind its screen (tools/contrast_audit.mjs
   measures the Invictus look among its centre looks).

   COMPOSITIONS, per screen (data-kc-scene, stamped by kc-world.js from the
   address before the first paint). Each is drawn here completely, the still's
   box included, so the still and the live globe agree whatever variant the
   mount carries; on the full tier kc-world.js switches the variant with the
   screen and the live globe glides between them (0.9 s).
     today   the planet's limb rising behind the header: a large globe right
             of the greeting, partly off-screen, its dawn line over the top of
             the page (the shared `globe` placement, without the text scrim:
             Today has no column of running text on the ground).
     learn   a low horizon under the path: the limb at 88vh across the
             content column, the dawn line lighting the foot of the page; the
             path and its unit cards scroll over it.
     ask     Ask is "live from the moon": the Earth takes the moon's place in
             the top corner, small and whole, Singapore pulsing on it. The
             moon art steps aside so there is one body in the sky.
     dense   Marketplace, Health, Passport, Profile, Rewards, Notifications,
             Research: a calm planet at the right edge, half of it in view,
             dimmed, in the margin those screens leave.
     lesson  nothing: the full-screen player covers the page and the globe is
             stopped (kc-world.js sets `off`).
   =========================================================================== */
:root[data-kc-world] .kc-shell { position: relative; z-index: 1; background: transparent !important; }
:root[data-kc-scene="lesson"] .site-world { display: none; }
:root[data-kc-world] [data-sc-name="Ask"] > div:first-child { background: transparent !important; }
:root[data-kc-world] [data-sc-name="Ask"] main > div[aria-hidden="true"][style*="--moonWin"] { display: none !important; }

/* --- glass ------------------------------------------------------------------ */
:root[data-kc-world] {
  --kc-world-glass: var(--sw-glass, rgba(16, 24, 27, .86));
  --kc-world-filter: var(--sw-glass-filter, blur(16px) saturate(1.2));
}
:root[data-kc-world][data-glass="tinted"] :is([style*="background: var(--surface"], [style*="background: var(--t-FBF8F4"], [style*="background: var(--t-FFFFFF"]) {
  background: var(--kc-world-glass) !important;
}
:root[data-kc-world][data-glass="tinted"] .kc-shell > aside {
  background: var(--kc-world-glass) !important;
  -webkit-backdrop-filter: var(--kc-world-filter);
  backdrop-filter: var(--kc-world-filter);
}
/* (As in kc-app.css: a backdrop filter makes its box the frame for a
   position:fixed child, so a card holding an open dialog goes without it.) */
:root[data-kc-world][data-glass="tinted"] :is(section[style*="--surface"], [style*="background: var(--surface"], [style*="background: var(--t-FBF8F4"], [style*="background: var(--t-FFFFFF"], [style*="background: var(--mk-g"], [style*="background: var(--ta-card"]):not(:has([style*="position: fixed"])) {
  -webkit-backdrop-filter: var(--kc-world-filter);
  backdrop-filter: var(--kc-world-filter);
}

/* --- compositions --------------------------------------------------------- */
/* Every scene starts from a whole planet in a square box 2.5 r wide (the
   shared still's geometry), the desktop still, and no scrim. */
:root[data-kc-world] .site-world {
  --sw-x: calc(100vw + 4vh); --sw-y: 54vh; --sw-r: 24vh; --sw-dim: .8; --sw-mask: none;
}
:root[data-kc-world] .site-world::after {
  left: calc(var(--sw-x) - 1.25 * var(--sw-r)); top: calc(var(--sw-y) - 1.25 * var(--sw-r));
  width: calc(2.5 * var(--sw-r)); height: calc(2.5 * var(--sw-r));
  background-image: url(/media/world/site-globe-v1-desktop.webp);
  background-image: image-set(url(/media/world/site-globe-v1-desktop.avif) type("image/avif"), url(/media/world/site-globe-v1-desktop.webp) type("image/webp"));
}
:root[data-kc-world][data-kc-scene="today"] .site-world {
  --sw-x: 78vw; --sw-y: 58vh; --sw-r: calc(.575 * min(100vw, 100vh)); --sw-dim: 1;
}
/* Ask: the Earth where the moon was (kc/ask.html: right 3% of Ask's frame,
   88px down, a disc half of clamp(96px, 11vw, 150px)), a little larger than
   it was, so it clears the question beneath it at every width. */
:root[data-kc-world][data-kc-scene="ask"] .site-world {
  --sw-x: calc(100vw - 12px - .03 * (100vw - 284px) - clamp(48px, 5.5vw, 75px)); --sw-y: calc(92px + clamp(48px, 5.5vw, 75px));
  --sw-r: clamp(44px, 11vw - 69px, 104px); --sw-dim: 1;
}
/* The horizon: the planet's top 2 r wide, its limb 1.15 r below the box's
   top (the shared horizon still's geometry), centred on the content column. */
:root[data-kc-world][data-kc-scene="learn"] .site-world {
  --sw-x: calc(50vw + 130px); --sw-r: max(100vw, 130vh); --sw-y: calc(88vh + var(--sw-r)); --sw-dim: 1;
}
/* Learn's path labels (the units' names, each lesson's step and title, the
   landmarks' names) sit on the ground, and on a short window, or once the
   path has scrolled, they reach the dawn line: while the World is behind,
   each wears a small pill of the landing's glass, so no word is ever drawn
   on the planet itself. */
:root[data-kc-world][data-kc-scene="learn"] [data-sc-name="Learn"] :is(nav[aria-label="Units"] [role="tab"] > span[style*="text-align: center"], [data-lmwrap] span[style*="IBM Plex Mono"], div:has(> div > button[data-lesson]) > div[style*="text-align: center"]) {
  background: var(--kc-world-glass);
  border-radius: 12px;
  padding: 4px 10px;
  -webkit-backdrop-filter: var(--kc-world-filter);
  backdrop-filter: var(--kc-world-filter);
}
:root[data-kc-world][data-kc-scene="learn"] .site-world::after {
  left: calc(var(--sw-x) - var(--sw-r)); top: calc(var(--sw-y) - 1.15 * var(--sw-r));
  width: calc(2 * var(--sw-r)); height: calc(.6 * var(--sw-r));
  background-image: url(/media/world/site-horizon-v1.webp);
  background-image: image-set(url(/media/world/site-horizon-v1.avif) type("image/avif"), url(/media/world/site-horizon-v1.webp) type("image/webp"));
}

/* --- /m, the phone ---------------------------------------------------------- */
/* The World is the phone's ground in the `focused` (default) and `vivid`
   registers on the dark page. The high-legibility register keeps its plain
   opaque ground, as it refuses every moving ground, and so does a light page
   (m.html withholds the mount for both in an inline <style> in its <head>, and
   stamps the device's register there before the first paint).
   THE HOLE. .m-phone is positioned and paints over the mount, so it and the
   scroll container inside it (--kc-page-bg, m.html's pageBg) go clear; body
   and .m-stage paint under the mount and keep their ground. Cards keep their
   own fills: the phone's cards are opaque, so its ground is never behind a word. */
:root[data-member-brand="mobile"]:is([data-presentation="focused"], [data-presentation="vivid"]):not([data-theme="light"]):not(.m-preview) {
  --kc-page-bg: transparent;
}
:root[data-member-brand="mobile"]:is([data-presentation="focused"], [data-presentation="vivid"]):not([data-theme="light"]):not(.m-preview) .m-phone {
  background: transparent !important;
}
/* The desktop review frame (?full=1, html.m-preview) draws the app inside a
   handset on a light table: no World there. */
:root.m-preview .site-world { display: none; }
/* COMPOSITIONS on the phone. The phone's cards are opaque and fill the width
   (16 px gutters), so the open ground is the band beside each screen's title:
   the Earth sits there, small and whole, clear of the title and its line of
   copy, and the first card slides over it as the screen scrolls (only
   left-aligned section titles ever cross that corner on the ground). It is
   the still on a phone (the shared `quiet` rule), so nothing moves and
   nothing is drawn per frame. Per screen, from data-m-route (kc-boot.js, the
   top of the app's stack); any other screen keeps the shared quiet corner,
   and the lesson reader has nothing behind it. */
:root[data-member-brand="mobile"] .site-world::after {
  background-image: url(/media/world/site-globe-v1-phone.webp);
  background-image: image-set(url(/media/world/site-globe-v1-phone.avif) type("image/avif"), url(/media/world/site-globe-v1-phone.webp) type("image/webp"));
}
:root[data-member-brand="mobile"] .site-world { --sw-x: 92vw; }
:root[data-member-brand="mobile"][data-m-route="today"] .site-world { --sw-x: calc(100vw - 52px); --sw-y: 132px; --sw-r: 44px; --sw-dim: 1; }
:root[data-member-brand="mobile"][data-m-route="learn"] .site-world { --sw-x: calc(100vw - 60px); --sw-y: 178px; --sw-r: 40px; --sw-dim: 1; }
:root[data-member-brand="mobile"][data-m-route="ask"] .site-world { --sw-x: calc(100vw - 42px); --sw-y: 146px; --sw-r: 30px; --sw-dim: 1; }
:root[data-member-brand="mobile"][data-m-route="me"] .site-world { --sw-x: calc(100vw - 70px); --sw-y: 100px; --sw-r: 50px; --sw-dim: 1; }
:root[data-member-brand="mobile"][data-m-route="lesson"] .site-world { display: none; }
@media (max-width: 359px) {
  :root[data-member-brand="mobile"][data-m-route="today"] .site-world { --sw-x: calc(100vw - 30px); --sw-y: 92px; --sw-r: 26px; }
}

/* ===========================================================================
   WINDOWS — the landing's glass (site-world SPEC §3).
   Every dialog, sheet, popover, menu and toast in the member app wears the
   landing's window: rgba(16,24,27,.86) (on a wide screen with a fine pointer,
   .72 behind blur(16px) saturate(1.2)), a #cfe3dc2e hairline, an inset top
   light, radius 28 (popovers 18, toasts a pill), over a #030607b0 backdrop
   blurred 12px, rising in over 280ms (scale .96 -> 1, 8px, the landing's
   cubic-bezier(.16,1,.3,1)); reduced motion fades only.

   WHERE. The default look on a dark ground: the Invictus look on /center
   (data-look=invictus, data-theme=dark) and the default `focused` register on
   /m. Aurora and Classic, light grounds, and the phone's `vivid` and `clear`
   registers are saved choices with their own measured windows and are left
   exactly as they are (kc-brand.test.js, tools/contrast_audit.mjs).

   HOW. The screens are design-tool output with inline styles, so windows are
   found by what they ARE (role, aria-modal, the shell's own classes), and the
   hydrated style string where nothing else names them: kc-support.js
   re-serialises every style attribute ("inset: 0px", "rgba(36, 35, 58, 0.45)").
   Nothing here edits a screen. Tokens fall back to the shared site-world-ui.css
   values, so mounting that sheet later changes nothing here unless its values
   move. Inks are untouched: every window keeps the member's own tokens, and the
   glass is never lighter than the matte surface it replaces.
   =========================================================================== */
:root[data-member-brand] {
  --kc-win-glass: var(--sw-glass, rgba(16, 24, 27, .86));
  --kc-win-glass-full: var(--sw-glass-full, rgba(17, 25, 28, .72));
  --kc-win-solid: #10181b;
  --kc-win-filter: var(--sw-glass-filter, blur(16px) saturate(1.2));
  --kc-win-line: var(--sw-glass-line, #cfe3dc2e);
  --kc-win-inset: var(--sw-glass-inset, inset 0 1px #ffffff14);
  --kc-win-shadow: var(--sw-glass-shadow, 0 40px 60px -35px #000);
  --kc-win-r: var(--sw-radius-window, 28px);
  --kc-win-r-pop: var(--sw-radius-pop, 18px);
  --kc-win-scrim: var(--sw-scrim, #030607b0);
  --kc-win-scrim-filter: var(--sw-scrim-filter, blur(12px));
  --kc-win-ease: var(--sw-ease, cubic-bezier(.16, 1, .3, 1));
  --kc-win-in: var(--sw-in, 280ms);
}
@keyframes kcWinIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes kcWinSide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes kcWinToast { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes kcWinFade { from { opacity: 0; } to { opacity: 1; } }

/* --- windows (dialogs, sheets, the chat card) ----------------------------- */
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  #kc-personalise-panel,
  [role="dialog"][aria-modal="true"]:not([style*="inset: 0px"]):not(.kc3-player),
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
  [role="dialog"][aria-label="Ask Invictus"],
  aside[aria-label="Chat history"],
  .kc-tool-card, .kc-auth-card, .kc-share-card),
/* --- popovers and menus ----------------------------------------------------- */
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]):not([aria-label="Ask Invictus"]),
  [role="menu"], .hp-pop, #kc-tour .card, #kc-status-panel),
/* --- toasts ---------------------------------------------------------------- */
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  [role="status"][style*="translateX(-50%)"], #kc-notice) {
  background: var(--kc-win-glass) !important;
  border: 1px solid var(--kc-win-line) !important;
  box-shadow: var(--kc-win-inset), var(--kc-win-shadow) !important;
  border-radius: var(--kc-win-r) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]):not([aria-label="Ask Invictus"]),
  [role="menu"], .hp-pop:not([data-mode="sheet"]), #kc-tour .card, #kc-status-panel) {
  border-radius: var(--kc-win-r-pop) !important;
}
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is([role="status"][style*="translateX(-50%)"], #kc-notice) {
  border-radius: 999px !important;
  color: var(--iv-text, #f5f6f5) !important;
}
/* left:50% halves the width a shrink-to-fit toast may take, so a sentence
   wrapped into a tall column; it takes its own width up to the stated cap. */
:root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]) #kc-notice {
  width: max-content !important;
  padding: 12px 20px !important;
  font-family: var(--iv-font, "Instrument Sans", system-ui, sans-serif) !important;
}
/* A side drawer (Marketplace's listing on a narrow window) keeps square
   corners against the edge it is docked to, and slides in from it. */
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] [role="dialog"][aria-modal="true"][style*="border-radius: 26px 0px 0px 26px"] {
  border-radius: var(--kc-win-r) 0 0 var(--kc-win-r) !important;
}
/* The speech-bubble tails were drawn for an opaque card; under glass the
   overlap shows, and the landing's windows have none. */
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] [role="dialog"][aria-modal="true"][style*="inset: 0px"] [aria-hidden="true"][style*="rotate(45deg)"] {
  display: none !important;
}
/* The Ask buddy's chat card: its header was a slab of the design's blue (the
   Invictus look sets no --kc-acc) and its tail an opaque square. Under glass the
   header is the glass with a hairline under it, white ink on it as before. */
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] [role="dialog"][aria-label="Ask Invictus"] > div[style*="linear-gradient(160deg"] {
  background: transparent !important;
  border-bottom: 1px solid var(--kc-win-line);
}
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] [role="dialog"][aria-label="Ask Invictus"] > span[style*="rotate(45deg)"] {
  display: none !important;
}
/* Sticky window headers were opaque panels over a matte card; inside glass
   they become the glass itself, so the window reads as one sheet. */
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] [role="dialog"][aria-modal="true"] > [style*="position: sticky"] {
  background: var(--kc-win-solid) !important;
}

/* Blur where it is supported. Large, fine-pointer screens take the lighter
   .72 glass the landing uses on its full tier; elsewhere the .86 glass is
   opaque enough to read with or without it. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
    #kc-personalise-panel,
    [role="dialog"][aria-modal="true"]:not([style*="inset: 0px"]):not(.kc3-player),
    [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
    [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
    [role="dialog"][aria-label="Ask Invictus"], aside[aria-label="Chat history"],
    .kc-tool-card, .kc-auth-card, .kc-share-card,
    [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]),
    [role="menu"], .hp-pop, #kc-tour .card, #kc-status-panel,
    [role="status"][style*="translateX(-50%)"], #kc-notice) {
    -webkit-backdrop-filter: var(--kc-win-filter) !important;
    backdrop-filter: var(--kc-win-filter) !important;
  }
  @media (min-width: 900px) and (pointer: fine) {
    :root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] :is(
      #kc-personalise-panel,
      [role="dialog"][aria-modal="true"]:not([style*="inset: 0px"]):not(.kc3-player),
      [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
      [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
      [role="dialog"][aria-label="Ask Invictus"], aside[aria-label="Chat history"], .kc-tool-card,
      [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]), [role="menu"], .hp-pop) {
      background: var(--kc-win-glass-full) !important;
    }
  }
}
/* Opaque when the member chose Solid glass, or the system asks for less
   transparency (kc-personalise.js paints Solid for it on /center; /m reads the
   media query). Same colour, no see-through. */
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"][data-glass="solid"] :is(
  #kc-personalise-panel,
  [role="dialog"][aria-modal="true"]:not([style*="inset: 0px"]):not(.kc3-player),
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
  [role="dialog"][aria-label="Ask Invictus"], aside[aria-label="Chat history"], .kc-tool-card,
  [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]), [role="menu"], .hp-pop,
  [role="status"][style*="translateX(-50%)"]) {
  background: var(--kc-win-solid) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]) :is(.kc-auth-card, .kc-share-card, .hp-pop, #kc-tour .card, #kc-status-panel, #kc-notice) {
    background: var(--kc-win-solid) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* --- backdrops ------------------------------------------------------------ */
/* The Personalise panel keeps its clear click-away layer: it previews the page
   behind it, which a dimmed backdrop would hide. So does the Quick tour, whose
   lighter layer points at the page it is describing. */
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player),
  div[style*="inset: 0px"]:has(> [role="dialog"][aria-modal="true"]),
  div[style*="inset: 0px"]:has(+ aside[aria-label="Chat history"]),
  .kc-tool-scrim:not(.kc-tour-scrim), .kc-auth-scrim, .kc-share-scrim) {
  background: var(--kc-win-scrim) !important;
  -webkit-backdrop-filter: var(--kc-win-scrim-filter) !important;
  backdrop-filter: var(--kc-win-scrim-filter) !important;
  border-radius: 0 !important;
  animation: kcWinFade var(--kc-win-in) linear both !important;
}
/* Full-screen layers are not cards: no rounded corners at the screen's edge. */
:root[data-look="invictus"][data-member-brand] :is(.kc3-player, [role="dialog"][style*="inset: 0px"]) {
  border-radius: 0 !important;
}
:root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]) #kc-tour .halo {
  box-shadow: 0 0 0 3px var(--blue-600, #a5e4dc), 0 0 0 9999px var(--kc-win-scrim) !important;
}
:root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]) #kc-tour .scrim {
  background: transparent !important;
}

/* --- entrance ------------------------------------------------------------- */
/* Name, duration and easing only: a window whose design delays its entrance
   (Today's check-in waits for the dragon to land) keeps that delay. */
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
  #kc-personalise-panel,
  [role="dialog"][aria-modal="true"]:not([style*="inset: 0px"]):not(.kc3-player):not([style*="border-radius: 26px 0px 0px 26px"]),
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
  [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
  [role="dialog"][aria-label="Ask Invictus"], .kc-tool-card, .kc-auth-card, .kc-share-card,
  [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]), [role="menu"], #kc-status-panel,
  .kc-cal-panel, #m-delete) {
  animation-name: kcWinIn !important;
  animation-duration: var(--kc-win-in) !important;
  animation-timing-function: var(--kc-win-ease) !important;
  animation-fill-mode: both !important;
}
:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"] :is([role="dialog"][aria-modal="true"][style*="border-radius: 26px 0px 0px 26px"], aside[aria-label="Chat history"]) {
  animation: kcWinSide var(--kc-win-in) var(--kc-win-ease) both !important;
}
:is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is([role="status"][style*="translateX(-50%)"], #kc-notice) {
  animation: kcWinToast var(--kc-win-in) var(--kc-win-ease) both !important;
}
@media (prefers-reduced-motion: reduce) {
  :is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is(
    #kc-personalise-panel,
    [role="dialog"][aria-modal="true"]:not(.kc3-player),
    [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div[style*="border-radius"],
    [role="dialog"][aria-modal="true"][style*="inset: 0px"]:not(.kc3-player) > div > div[style*="border-radius"],
    [role="dialog"][aria-label="Ask Invictus"], aside[aria-label="Chat history"],
    .kc-tool-card, .kc-auth-card, .kc-share-card,
    [role="dialog"]:not([aria-modal]):not([style*="inset: 0px"]), [role="menu"], #kc-status-panel,
    .kc-cal-panel, #m-delete) {
    animation: kcWinFade 160ms linear both !important;
  }
  :is(:root[data-look="invictus"][data-theme="dark"][data-member-brand="desktop"], :root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"])) :is([role="status"][style*="translateX(-50%)"], #kc-notice) {
    animation: kcWinFade 160ms linear both !important;
  }
}

/* ===========================================================================
   THE LANDING'S ACTIONS AND CHIPS
   The ivory pill lifts to the landing's mint on hover (#b5e7df, -1px); chips
   on the dark ground are the landing's #1d272a (kc-personalise.js --soft).
   =========================================================================== */
:root[data-look="invictus"][data-accent="graphite"][data-member-brand] :is(button, a):is([style*="background: var(--primary"], [style*="background:var(--primary"], [style*="background: var(--t-2434DE"], [style*="background:var(--t-2434DE"], [style*="background: var(--t-2B2A3E"], [style*="background:var(--t-2B2A3E"], .kc-tool-primary):is(:hover, :focus-visible),
:root[data-member-brand="mobile"][data-accent="mint"][data-presentation="focused"] :is(button[style*="background: var(--blue-600)"], button[style*="background:var(--blue-600)"], button[style*="background: var(--acc-fill)"]):is(:hover, :focus-visible) {
  background: #b5e7df !important;
  transform: translateY(-1px);
  transition: background-color .2s var(--iv-ease, ease), transform .2s var(--iv-ease, ease);
}
@media (prefers-reduced-motion: reduce) {
  :root[data-member-brand] :is(button, a):is(:hover, :focus-visible) { transform: none; }
}

/* ===========================================================================
   /m: ACCOUNT AND SHARE LIVE IN THE APP BAR
   They were fixed pills 92-140px above the bottom edge, over card content on
   every screen (the document scrolls and the tab bar sits at its end). Now
   they are 44px round controls in the 56px app bar, scrolling with it, in the
   slot the bar keeps empty for a back button:
     · a tab's root screen (no back button): Account, then Share;
     · a deeper screen (back or close in that slot): Share beside it, and the
       title held clear. Account is the tab roots' (Me carries the same
       Password and security and Sign out on every screen).
   The right side stays the bar's own (bell, the Learn XP chip). Labels stay in
   the accessible name: Account has an aria-label, Share keeps its text,
   visually hidden. The review frame (?full=1, html.m-preview) is unchanged.
   =========================================================================== */
:root[data-member-brand="mobile"]:not(.m-preview) :is(.kc-auth-btn, .kc-share-btn) {
  position: absolute !important;
  top: calc(6px + env(safe-area-inset-top, 0px)) !important;
  bottom: auto !important;
  right: auto !important;
  width: 44px;
  height: 44px !important;
  padding: 0 !important;
  gap: 0 !important;
  justify-content: center;
  font-size: 0 !important;
  line-height: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
:root[data-member-brand="mobile"]:not(.m-preview) .kc-auth-btn { left: 8px !important; }
:root[data-member-brand="mobile"]:not(.m-preview) .kc-share-btn { left: 56px !important; }
:root[data-member-brand="mobile"]:not(.m-preview):has(.m-phone > div[style*="height: 56px"] > div:first-child button) .kc-auth-btn {
  display: none !important;
}
:root[data-member-brand="mobile"]:not(.m-preview):has(.m-phone > div[style*="height: 56px"] > div:first-child button) .m-phone > div[style*="height: 56px"] > div:nth-child(2) {
  padding-inline: 48px;
}
:root[data-member-brand="mobile"]:not(.m-preview) .kc-auth-btn::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M4.8 20c.9-3.6 3.7-5.6 7.2-5.6s6.3 2 7.2 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M4.8 20c.9-3.6 3.7-5.6 7.2-5.6s6.3 2 7.2 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root[data-member-brand="mobile"]:not(.m-preview) .kc-auth-btn:has(svg)::before { content: none; }
:root[data-member-brand="mobile"]:not(.m-preview) .kc-auth-btn .dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
}
:root[data-member-brand="mobile"]:not(.m-preview) :is(.kc-auth-btn, .kc-share-btn) svg { width: 18px; height: 18px; }
:root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]):not(.m-preview) :is(.kc-auth-btn, .kc-share-btn) {
  background: var(--kc-win-glass) !important;
  border: 1px solid var(--kc-win-line) !important;
  color: var(--iv-text, #f5f6f5) !important;
}
:root[data-member-brand="mobile"][data-presentation="focused"]:not([data-theme="light"]) .kc-auth-btn .dot { background: var(--iv-accent, #a5e4dc) !important; }
