/* ============================================================================
   APP BAR / TAB BAR CONTRACT (round E1, ruling 16 and 21). Page builders copy this markup.
   Platform sources: iOS nav bar (about 2 trailing items, large title at big text sizes), M3 small top app bar (about 3 trailing actions, rest in overflow).
   1. TOP-LEVEL page (a bottom-tab destination): search, Ask, bell, avatar. No back, no More.
        <header class="cl-app-bar">
          <h1 class="cl-app-bar__title" title="{full title}">{title}</h1>
          <div class="cl-app-bar__search">...laptop search field...</div>   <button class="cl-app-bar__ask">Ask</button>   (laptop only)
          <div class="cl-app-bar__actions">
            <a class="cl-icon-button cl-app-bar__mobile-only" aria-label="Search">   <button class="cl-icon-button cl-app-bar__mobile-only" aria-label="Ask Career Leap">
            <a class="cl-icon-button cl-app-bar__bell" aria-label="Notifications, N need your action">   <button class="cl-app-bar__avatar">
   2. SUB-PAGE (a back arrow is present): back, full title, ONE More menu. Search, Ask and Notifications live inside the menu on phones.
        <header class="cl-app-bar cl-app-bar--sub">
          <div class="cl-app-bar__lead"><a class="cl-icon-button" data-back aria-label="Back to {parent}">...</a></div>
          <h1 class="cl-app-bar__title">...</h1>
          (search field and Ask as above: they show from 840 only)
          <div class="cl-app-bar__actions">
            <button class="cl-icon-button cl-app-bar__more" aria-label="More" aria-haspopup="menu" aria-expanded="false" aria-controls="app-more" popovertarget="app-more">{i-more}</button>
            ...bell / avatar markup as for top-level: on a phone, CSS hides every action except .cl-app-bar__more whenever the bar contains one; on a laptop they all show and More is hidden...
          </div>
        </header>
        <div class="cl-menu" role="menu" popover id="app-more" aria-label="More">
          <a class="cl-menu__item" role="menuitem" href="search.html">Search</a>
          <button class="cl-menu__item" role="menuitem" data-open-chat>Ask Career Leap</button>
          <a class="cl-menu__item" role="menuitem" href="notifications.html">Notifications</a>   (the unread count goes in the text, not as a dot)
        </div>
   3. The bell's unread dot is not drawn on the Notifications page: put aria-current="page" on that page's bell (CSS hides the dot).
   4. LARGE TEXT (iOS large-title pattern, WCAG 1.4.4): when the app root is narrower than 22rem (393 px at about 111 percent text; rem follows the user's text size,
      so this is a text-size test, not a device test) the bar stops being sticky, becomes two rows (back + actions, then the title wrapped in full, never
      cut mid-word) and the title scrolls with the page like a large title. The page h1 IS the bar h1: no second heading is needed.
   5. TAB BAR at large text: below 20rem (393 px at about 123 percent text) the tab bar keeps its icons and visually hides the labels (iOS tab bar +
      large-content viewer, M3 nav bar). Every tab needs aria-label text via its .cl-bar-label and a title attribute (the tooltip / long-press name).
      Labels never end in an ellipsis: at 20rem and wider they wrap to as many lines as they need.
   ============================================================================ */
/* ============================================================================
   MARKUP CONTRACTS changed in round D1 (page builders copy these)
   1. Notification item (.cl-notif): every item carries a real More menu.
        <li class="cl-notif" data-unread="true|false">
          <div class="cl-notif__swipe"><button>Snooze</button><button>Done</button></div>      swipe = pointer shortcut; NO aria-hidden / tabindex here, CSS hides it until .cl-notif--swiped
          <div class="cl-notif__row"> ... <div class="cl-notif__tools">
              [laptop: .cl-icon-button--inline-only Snooze + Mark done]
              <button class="cl-icon-button cl-notif__more" aria-label="More for: {what}" aria-haspopup="menu" aria-expanded="false" aria-controls="{menuId}">
          </div></div>
          <div class="cl-menu cl-notif__menu" role="menu" popover="auto" id="{menuId}" aria-label="More for: {what}">
            <button class="cl-menu__item" role="menuitem" tabindex="-1">Snooze</button> ... Mark done ... Turn off this type</div>
        </li>
      Menu is a child of the li (so it nests inside the notification-panel popover). JS: organisms-app.page.js openPopover() (has the Safari 16 fallback).
   2. Sheets/dialogs: use <dialog class="cl-sheet cl-sheet--bottom|--side|--full"> and open with showModal(). CSS now sets display:none unless [open]
      (never put display on the dialog yourself). The .cl-sheet__grab is 48 high with touch-action:none; add a pointercancel handler if you wire drag.
      Backdrop-click close: only non-alert dialogs, only when the click is outside getBoundingClientRect() (see page.js).
   3. App bar: <h1 class="cl-app-bar__title" title="{full title}"> (single line, ellipsis); actions on compact: search, Ask (aria-label "Ask Career Leap",
      class cl-app-bar__mobile-only, data-live-open="chat"), bell, avatar. Laptop keeps the Ask button.
   4. Command palette input: ring is drawn on .cl-palette__field via :has(); do not add an outline to .cl-palette__input.
   5. Quiz tray / .cl-action-bar: include the ResizeObserver + visualViewport helper from organisms-app.page.js (sets --cl-tray-height, --cl-kb-inset).
   6. Skills review row (.cl-review, molecules.css): markup order name, remove button, level; CSS grid-areas place them (no page override needed).
   7. Route comparison (.cl-route): dl rows are Time / Money / You would need / Main risk; no adjective ranking; columns alphabetical.
   ============================================================================ */
/* ============================================================================
   Career Leap APP organisms: the shell and the big blocks of the logged-in web app.
   Owner: app-organisms builder. Layer cl.organisms (order declared in tokens.css). Consumes tokens, atoms and molecules by name.
   Rules: values are tokens (spacing/radius/size) or rem sizes of overlays (listed in the page's "Tokens requested" table);
   component-private values are --_name. No [data-state] mirrors here (they live in css/docs-specimens.css).
   RESPONSIVE MODEL: organisms answer to the width of their APP ROOT, not the viewport: .cl-app is a size container
   (container-name cl-app) so the same CSS renders the phone composition inside a 393 frame on a 1470 screen.
     compact  < 840  : top bar + content + bottom tab bar, sheets from the bottom
     expanded >= 840 : side nav + top bar + content, side sheets, dropdowns, two-pane pages
   (Window classes: M3 compact/medium share one composition because five labelled tabs fit at 393 and 600+; the rail is not needed.)
   Dialog/sheet are native <dialog> (showModal): Esc, inert background, focus return and aria-modal come from the platform.
   ============================================================================ */
@layer cl.organisms {

/* ---- 0. App root and shell ------------------------------------------------------------------------------------------- */
.cl-app { container: cl-app / inline-size; display: grid; color: var(--cl-color-on-surface); }
.cl-shell {
  display: grid; min-block-size: 100dvh; min-inline-size: 0;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "bar" "main" "tabs";
}
.cl-shell > .cl-app-bar { grid-area: bar; }
.cl-shell > .cl-main { grid-area: main; min-inline-size: 0; }
.cl-shell > .cl-bottom-nav { grid-area: tabs; }
.cl-shell > .cl-side-nav { grid-area: side; display: none; }
.cl-shell > .cl-sheet--docked { grid-area: aside; display: none; }
.cl-main { padding: var(--cl-space-16) var(--cl-layout-margin) var(--cl-space-32); display: grid; gap: var(--cl-space-24); align-content: start; }
.cl-main > * { min-inline-size: 0; }
/* One fluid track for every single-column grid in the app: a grid with no template sizes its implicit track to the widest content, which is how one long line widened the whole page at 200% text (round E1 ruling 20). Later rules (container queries) override this. */
.cl-sub__content, .cl-block, .cl-setgroup, .cl-today__col, .cl-notifs, .cl-module, .cl-module__main, .cl-next, .cl-plan-card, .cl-refusal, .cl-result, .cl-wait, .cl-skills, .cl-plan-head, .cl-map, .cl-chat__thread, .cl-sheet__body { grid-template-columns: minmax(0, 1fr); }
.cl-sub__content > *, .cl-block > *, .cl-module > *, .cl-next > * { min-inline-size: 0; }
.cl-eyebrow-row { display: flex; align-items: center; gap: var(--cl-space-8); flex-wrap: wrap; }
.cl-hand-note { font-family: var(--cl-type-hand-family); font-size: var(--cl-type-hand-size); line-height: var(--cl-type-hand-line-height); letter-spacing: var(--cl-type-hand-tracking); color: var(--cl-color-primary-text); }   /* the one pen mark per screen (round A2 ruling 25) */

/* ---- 1. App top bar ------------------------------------------------------------------------------------------------- */
.cl-app-bar {
  position: sticky; inset-block-start: 0; z-index: var(--cl-z-bar);
  --_ibs: var(--cl-size-target-min);   /* icon buttons in bars are 48 px, not rem: they must not grow with text (round D1 ruling 5) */
  display: flex; align-items: center; gap: var(--cl-space-4);
  min-block-size: calc(var(--cl-top-bar-height-mobile) + var(--cl-layout-safe-area-top)); padding-block-start: var(--cl-layout-safe-area-top);
  padding-inline: max(var(--cl-space-4), var(--cl-layout-safe-area-left)) max(var(--cl-space-4), var(--cl-layout-safe-area-right));
  background: var(--cl-color-background); border-block-end: var(--cl-border-width-1) solid var(--cl-color-divider);
}
.cl-app-bar__lead { flex: none; padding-inline-start: var(--cl-space-12); }
.cl-app-bar__lead:has(.cl-icon-button) { padding-inline-start: 0; }
.cl-app-bar__title { flex: 1 1 auto; min-inline-size: 0; margin: 0; padding-inline: var(--cl-space-12); font-size: var(--cl-type-title-size); line-height: var(--cl-type-title-line-height); font-weight: var(--cl-font-weight-semibold); letter-spacing: var(--cl-type-title-tracking); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* single line; the full title is in title= and in the page h1 (round D1 ruling 5) */
.cl-app-bar__brand { display: none; align-items: center; gap: var(--cl-space-8); padding-inline: var(--cl-space-12); font-weight: var(--cl-font-weight-semibold); }
.cl-app-bar__actions { flex: none; display: flex; align-items: center; margin-inline-start: auto; }
.cl-app-bar__search { display: none; }
.cl-app-bar__ask { display: none; flex: none; white-space: nowrap; }   /* Ask never wraps (round E1 ruling 25) */
.cl-app-bar__more { display: none; }   /* sub-pages on a phone only: see the contract at the top */
.cl-app-bar__avatar { position: relative; flex: none; display: grid; place-items: center; inline-size: var(--cl-size-target-min); block-size: var(--cl-size-target-min); padding: 0; border: 0; border-radius: var(--cl-radius-999); background: transparent; cursor: pointer; color: inherit; }
.cl-app-bar__avatar::after { content: ""; position: absolute; inset: 0; }
.cl-app-bar__search-field { display: flex; align-items: center; gap: var(--cl-space-12); inline-size: 100%; min-block-size: var(--cl-size-control-48); padding-inline: var(--cl-space-16); border: var(--cl-border-width-1) solid var(--cl-color-border-strong); border-radius: var(--cl-radius-999); background: var(--cl-color-surface-raised); color: var(--cl-color-on-surface-muted); font: inherit; font-size: var(--cl-font-size-16); text-align: start; text-decoration: none; cursor: pointer; }   /* an <a> styled as a field must not look like link copy (round E1 ruling 17) */
.cl-app-bar__search-field > span:first-of-type { flex: 1 1 auto; }
.cl-app-bar__bell .cl-badge-anchor { display: inline-flex; }
.cl-app-bar__bell[aria-current="page"] .cl-badge { display: none; }   /* you are already on Notifications: no unread dot (round E1 ruling 16) */
@media (hover: hover) and (pointer: fine) { .cl-app-bar__search-field:hover { border-color: var(--cl-color-on-surface); } .cl-app-bar__avatar:hover { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } }
@media (max-height: 480px) { .cl-app-bar { min-block-size: calc(var(--cl-top-bar-height-landscape) + var(--cl-layout-safe-area-top)); } }
/* Sub-page on a phone: back, full title, one More. A bar that contains a More button is a sub-page bar (round E1 ruling 16). */
@container cl-app (max-width: 839px) {
  .cl-app-bar__more { display: inline-grid; }
  .cl-app-bar:has(.cl-app-bar__more) .cl-app-bar__actions > :not(.cl-app-bar__more) { display: none; }
}
/* Large text (iOS large title, M3 large top app bar): the title leaves the sticky row and wraps in full; never an ellipsis, never cut mid-word.
   22rem = the text-size test, rem follows the user's setting (round E1 ruling 21). */
@container cl-app (max-width: 22rem) { /* lint-allow: container query cannot read custom properties; text-size test in rem (follows the user's font size, not a device width); no --cl-breakpoint-* equals it */
  .cl-app-bar { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "lead actions" "title title"; align-items: center; column-gap: 0; row-gap: 0; min-block-size: 0; }
  .cl-app-bar__lead { grid-area: lead; }
  .cl-app-bar__actions { grid-area: actions; justify-self: end; margin-inline-start: 0; }
  .cl-app-bar__title { grid-area: title; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; padding-block: var(--cl-space-4) var(--cl-space-12); }
}

@container cl-app (min-width: 840px) {
  .cl-shell { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "side bar" "side main"; }
  .cl-shell:has(> .cl-sheet--docked:not([hidden])) { grid-template-columns: auto minmax(0, 1fr) var(--cl-side-sheet-width); grid-template-areas: "side bar aside" "side main aside"; }
  .cl-shell > .cl-side-nav { display: grid; }
  .cl-shell > .cl-sheet--docked { display: flex; }
  .cl-shell > .cl-bottom-nav { display: none; }
  .cl-main { padding: var(--cl-space-32) max(var(--cl-layout-margin), var(--cl-layout-safe-area-right)) var(--cl-space-48) var(--cl-layout-margin); max-inline-size: var(--cl-layout-content-max); inline-size: 100%; box-sizing: border-box; margin-inline: auto; }
  .cl-app-bar { min-block-size: var(--cl-top-bar-height-desktop); gap: var(--cl-space-12); padding-inline: var(--cl-layout-margin); }
  .cl-app-bar__lead, .cl-app-bar__brand { display: none; }
  .cl-app-bar__title { display: none; }
  .cl-app-bar__search { display: block; flex: 0 1 30rem; min-inline-size: 0; } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
  .cl-app-bar__ask { display: inline-flex; margin-inline-start: auto; }
  .cl-app-bar__actions { margin-inline-start: 0; gap: var(--cl-space-4); }
  .cl-app-bar__mobile-only, .cl-app-bar__more { display: none; }
}

/* ---- 2. Bottom tab bar (base.css owns hide-while-typing and the landscape label collapse) ------------------------------------ */
.cl-bottom-nav {
  position: sticky; inset-block-end: 0; z-index: var(--cl-z-bar);
  background: var(--cl-color-surface); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider);
  padding-block-end: var(--cl-layout-safe-area-bottom); padding-inline: max(var(--cl-space-4), var(--cl-layout-safe-area-left)) max(var(--cl-space-4), var(--cl-layout-safe-area-right));
}
.cl-bottom-nav__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; min-block-size: var(--cl-bottom-nav-height); }
.cl-bottom-nav__item {
  display: grid; justify-items: center; align-content: start; gap: var(--cl-space-4);
  min-block-size: var(--cl-bottom-nav-height); min-inline-size: var(--cl-bottom-nav-item-target); padding: var(--cl-space-8) 0 var(--cl-space-4); text-wrap: balance;
  color: var(--cl-color-on-surface-muted); text-decoration: none; text-align: center;
  font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); font-weight: var(--cl-font-weight-semibold);
}
.cl-bottom-nav__icon { display: grid; place-items: center; inline-size: var(--cl-space-64); min-block-size: var(--cl-control-32); border-radius: var(--cl-radius-999); position: relative; }
.cl-bottom-nav__item[aria-current="page"] { color: var(--cl-color-primary-text); }
.cl-bottom-nav__item[aria-current="page"] .cl-bottom-nav__icon { color: var(--cl-color-primary-text); }   /* selected = the filled glyph (i-*-fill sprite id) + the label colour: no blue pill (round G ask 10) */
.cl-bottom-nav__item:active .cl-bottom-nav__icon { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-pressed) * 100%), transparent); }
.cl-bottom-nav__item[aria-current="page"]:active .cl-bottom-nav__icon { background: transparent; }
@media (hover: hover) and (pointer: fine) { .cl-bottom-nav__item:hover .cl-bottom-nav__icon { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } .cl-bottom-nav__item[aria-current="page"]:hover .cl-bottom-nav__icon { background: var(--cl-color-primary-container); } }
@media (max-height: 480px) {
  .cl-bottom-nav__list, .cl-bottom-nav__item { min-block-size: var(--cl-bottom-nav-height-landscape); }
  .cl-bottom-nav__item { padding-block: var(--cl-space-4); align-content: center; }
}
/* A tab name is never truncated: the base 2-line clamp is lifted here, so a label wraps instead of ending in an ellipsis (round E1 ruling 21). */
.cl-bottom-nav .cl-bar-label { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; overflow-wrap: break-word; hyphens: manual; }
/* Large text (iOS tab bar at big sizes shows icons + the large-content viewer; M3 nav bar likewise): under 20rem the labels are visually hidden
   (still the accessible name) and the bar returns to a fixed 56 px, so it never takes 129 px of a 852 px screen. */
@container cl-app (max-width: 20rem) { /* lint-allow: container query cannot read custom properties; text-size test in rem (follows the user's font size, not a device width); no --cl-breakpoint-* equals it */
  .cl-bottom-nav .cl-bar-label { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cl-bottom-nav__list, .cl-bottom-nav__item { min-block-size: calc(var(--cl-size-target-min) + var(--cl-space-8)); }
  .cl-bottom-nav__item { padding-block: var(--cl-space-4); align-content: center; }
}
/* Focus must never end up under the tab bar (WCAG 2.4.11): base.css reads the nav height on <body>, where :root cannot see it (round E1 ruling 19). */
:root:has(body.cl-has-bottom-nav):not(:has(.cl-action-bar)) { --cl-scroll-padding-bottom: calc(var(--cl-bottom-nav-height) + var(--cl-layout-safe-area-bottom) + var(--cl-space-24)); }
@media (min-width: 840px) { :root:has(body.cl-has-bottom-nav):not(:has(.cl-action-bar)) { --cl-scroll-padding-bottom: var(--cl-space-16); } }

/* ---- 3. Side nav ------------------------------------------------------------------------------------------------------ */
.cl-side-nav { --_w: var(--cl-side-nav-width); --_rail: var(--cl-side-nav-width-collapsed); /* 80: M3 rail */ inline-size: calc(var(--_w) + var(--cl-layout-safe-area-left)); position: sticky; inset-block-start: 0; align-self: start; block-size: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: var(--cl-space-8); padding: var(--cl-space-12); padding-inline-start: calc(var(--cl-space-12) + var(--cl-layout-safe-area-left)); background: var(--cl-color-surface); border-inline-end: var(--cl-border-width-1) solid var(--cl-color-divider); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; }   /* the left safe-area inset (landscape notch) is padding, so icons never sit under it (round E1 ruling 23) */   /* short windows: the list scrolls inside, Settings and Help stay reachable (round D1 ruling 8) */
/* landscape phone: the rail (80, items 55 x 48) with visually hidden labels; the list scrolls inside so Settings and Help stay reachable (round E1 ruling 25) */
@media (max-height: 480px) {
  .cl-side-nav { --_w: var(--_rail); }
  .cl-side-nav .cl-side-nav__brand-text { display: none; }
  .cl-side-nav__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cl-side-nav__item { justify-content: center; padding-inline: 0; }
  .cl-side-nav__list { gap: 0; }
}
.cl-side-nav--collapsed { --_w: var(--_rail); }
.cl-side-nav__head { display: flex; align-items: center; gap: var(--cl-space-8); min-block-size: var(--cl-size-control-48); padding-inline-start: var(--cl-space-8); font-weight: var(--cl-font-weight-semibold); justify-content: space-between; }
.cl-side-nav--collapsed .cl-side-nav__head { justify-content: center; padding-inline: 0; flex-direction: column; min-block-size: 0; }
.cl-side-nav--collapsed .cl-side-nav__brand-text { display: none; }
.cl-side-nav__brand { display: inline-flex; align-items: center; gap: var(--cl-space-8); }
.cl-side-nav__list { display: grid; gap: var(--cl-space-8); margin: 0; padding: 0; list-style: none; align-content: start; }
.cl-side-nav__list--bottom { padding-block-start: var(--cl-space-8); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-side-nav__item { position: relative; display: flex; align-items: center; gap: var(--cl-space-12); min-block-size: var(--cl-size-control-48); padding-inline: var(--cl-space-12); border-radius: var(--cl-radius-999); color: var(--cl-color-on-surface); text-decoration: none; font-size: var(--cl-font-size-16); line-height: var(--cl-type-body-line-height); font-weight: var(--cl-font-weight-medium); }
.cl-side-nav__item .cl-icon { color: var(--cl-color-on-surface-muted); }
.cl-side-nav__item[aria-current="page"] { background: transparent; color: var(--cl-color-primary-text); font-weight: var(--cl-font-weight-semibold); box-shadow: none; }   /* selected = filled icon (i-*-fill) + label colour + a 2px left indicator: no pill, no ring (round H) */
.cl-side-nav__item[aria-current="page"]::before { content: ""; position: absolute; inset-block: var(--cl-space-8); inset-inline-start: 0; inline-size: var(--cl-border-width-2); border-radius: var(--cl-radius-999); background: var(--cl-color-selected-border); }
.cl-side-nav__item[aria-current="page"] .cl-icon { color: inherit; }
.cl-side-nav__item:active { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-pressed) * 100%), transparent); }
@media (hover: hover) and (pointer: fine) { .cl-side-nav__item:hover { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } .cl-side-nav__item[aria-current="page"]:hover { background: var(--cl-color-primary-container); } }
.cl-side-nav--collapsed .cl-side-nav__item { justify-content: center; padding-inline: 0; }
.cl-side-nav--collapsed .cl-side-nav__label { position: absolute; inset-inline-start: calc(100% + var(--cl-space-8)); inset-block-start: 50%; transform: translateY(-50%); z-index: var(--cl-z-menu); padding: var(--cl-space-8) var(--cl-space-12); border-radius: var(--cl-radius-4); background: var(--cl-color-on-surface); color: var(--cl-color-surface); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); white-space: nowrap; visibility: hidden; pointer-events: none; }
.cl-side-nav--collapsed .cl-side-nav__item:focus-visible .cl-side-nav__label { visibility: visible; }
@media (hover: hover) and (pointer: fine) { .cl-side-nav--collapsed .cl-side-nav__item:hover .cl-side-nav__label { visibility: visible; } }

/* ---- 4. Menu / popover menu -------------------------------------------------------------------------------------------- */
.cl-menu { --_row: var(--cl-size-control-48); min-inline-size: var(--cl-menu-min-width); max-inline-size: var(--cl-menu-max-width); margin: 0; padding: var(--cl-space-8); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-overlay); color: var(--cl-color-on-surface); box-shadow: var(--cl-elevation-3); box-sizing: border-box; }
.cl-menu[popover] { position: fixed; inset: auto; }
@supports selector(:popover-open) { .cl-menu[popover]:not(:popover-open) { display: none; } }
.cl-menu__who { display: flex; align-items: center; gap: var(--cl-space-12); padding: var(--cl-space-8) var(--cl-space-8) var(--cl-space-12); }
.cl-menu__who strong { display: block; font-weight: var(--cl-font-weight-semibold); }
.cl-menu__who span { color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); overflow-wrap: anywhere; }
.cl-menu__list { margin: 0; padding: 0; list-style: none; display: grid; }
.cl-menu__group-label { padding: var(--cl-space-8) var(--cl-space-12) var(--cl-space-4); font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); font-weight: var(--cl-font-weight-semibold); color: var(--cl-color-on-surface-muted); }
.cl-menu__sep { margin: var(--cl-space-4) 0; border: 0; border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-menu__item { display: flex; align-items: center; gap: var(--cl-space-12); inline-size: 100%; min-block-size: var(--_row); padding: var(--cl-space-8) var(--cl-space-12); border: 0; border-radius: var(--cl-radius-8); background: transparent; color: inherit; font: inherit; font-size: var(--cl-font-size-16); line-height: var(--cl-type-body-line-height); text-align: start; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.cl-menu__item .cl-icon { color: var(--cl-color-on-surface-muted); }
.cl-menu__item > span:not(.cl-menu__check) { flex: 1 1 auto; min-inline-size: 0; }
.cl-menu__check { flex: none; inline-size: var(--cl-size-icon-24); color: var(--cl-color-primary-text); visibility: hidden; }
.cl-menu__item[aria-checked="true"] { font-weight: var(--cl-font-weight-semibold); }
.cl-menu__item[aria-checked="true"] .cl-menu__check { visibility: visible; }
.cl-menu__item:active { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-pressed) * 100%), transparent); }
@media (hover: hover) and (pointer: fine) { .cl-menu__item:hover { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } }
.cl-menu__item:focus-visible { outline-offset: calc(var(--cl-border-width-2) * -1); }
.cl-menu--sheet { --_row: var(--cl-size-control-56); inline-size: 100%; max-inline-size: none; border: 0; box-shadow: none; background: transparent; padding: 0 var(--cl-space-8); }

/* ---- 5. Scrim, bottom sheet, side sheet ----------------------------------------------------------------------------------- */
dialog.cl-sheet::backdrop, dialog.cl-dialog::backdrop, dialog.cl-palette::backdrop { background: var(--cl-color-scrim); }
dialog.cl-sheet:not([open]) { display: none; }   /* a closed sheet is out of the tree: not focusable, no layout, no off-canvas width (round D1 ruling 1) */
.cl-sheet { display: flex; flex-direction: column; min-block-size: 0; border: 0; padding: 0; background: var(--cl-color-surface-overlay); box-shadow: var(--cl-elevation-5); color: var(--cl-color-on-surface); box-sizing: border-box; overflow: hidden; }
.cl-sheet--bottom { inline-size: 100%; max-inline-size: var(--cl-sheet-max-width); max-block-size: calc(100dvh - var(--cl-space-64) - var(--cl-space-8)); border-start-start-radius: var(--cl-sheet-radius-top); border-start-end-radius: var(--cl-sheet-radius-top); }
.cl-sheet--side { inline-size: 100%; max-inline-size: var(--cl-side-sheet-width); border-start-start-radius: var(--cl-radius-16); border-end-start-radius: var(--cl-radius-16); }
dialog.cl-sheet:modal { position: fixed; margin: 0; max-inline-size: none; max-block-size: none; background: var(--cl-color-surface-overlay); }
dialog.cl-sheet--bottom:modal { inset: auto 0 var(--cl-kb-inset, 0px) 0; margin-inline: auto; inline-size: min(100%, var(--cl-sheet-max-width)); max-block-size: calc(100dvh - var(--cl-space-64) - var(--cl-space-8)); box-shadow: var(--cl-elevation-5); }
dialog.cl-sheet--side:modal { inset: 0 0 0 auto; inline-size: min(100%, var(--cl-side-sheet-width)); block-size: calc(100dvh - var(--cl-kb-inset, 0px)); max-block-size: calc(100dvh - var(--cl-kb-inset, 0px)); box-shadow: var(--cl-elevation-5); }
dialog.cl-sheet--full:modal { inset: 0; inline-size: 100%; max-inline-size: none; block-size: calc(100dvh - var(--cl-kb-inset, 0px)); max-block-size: calc(100dvh - var(--cl-kb-inset, 0px)); border-radius: 0; }
dialog.cl-sheet--bottom { transform: translateY(var(--cl-motion-sheet-from)); }
dialog.cl-sheet--side { transform: translateX(var(--cl-motion-sheet-from)); }
dialog.cl-sheet--full { transform: translateY(var(--cl-motion-sheet-from)); }
dialog.cl-sheet[open] { transform: none; }
dialog.cl-sheet, dialog.cl-dialog, dialog.cl-palette { transition: transform var(--cl-motion-exit), opacity var(--cl-motion-fade-exit) linear, overlay var(--cl-motion-exit) allow-discrete, display var(--cl-motion-exit) allow-discrete; }
dialog.cl-sheet[open] { transition: transform var(--cl-motion-enter), opacity var(--cl-motion-fade-enter) linear, overlay var(--cl-motion-enter) allow-discrete, display var(--cl-motion-enter) allow-discrete; }
@starting-style { dialog.cl-sheet--bottom[open], dialog.cl-sheet--full[open] { transform: translateY(var(--cl-motion-sheet-from)); } dialog.cl-sheet--side[open] { transform: translateX(var(--cl-motion-sheet-from)); } }
.cl-sheet--docked { position: sticky; inset-block-start: 0; align-self: start; block-size: 100dvh; max-inline-size: none; border-radius: 0; border-inline-start: var(--cl-border-width-1) solid var(--cl-color-border); background: var(--cl-color-surface-overlay); }
.cl-sheet__grab { flex: none; display: grid; place-items: center; min-block-size: var(--cl-size-target-min); touch-action: none; cursor: grab; }
.cl-sheet__grab::before { content: ""; inline-size: var(--cl-space-32); block-size: var(--cl-space-4); border-radius: var(--cl-radius-999); background: var(--cl-color-border-strong); }   /* 32x4 handle (M3); decorative, drag is never the only way: Close and Esc */
.cl-sheet__head, .cl-chat__head, .cl-palette__bar { --_ibs: var(--cl-size-target-min); }
html:has(dialog:modal) { overflow: hidden; overscroll-behavior: none; }   /* no scroll-through behind a modal (iOS Safari) */
.cl-sheet__head { flex: none; display: flex; align-items: center; gap: var(--cl-space-8); min-block-size: var(--cl-size-control-56); padding: var(--cl-space-4) var(--cl-space-4) var(--cl-space-4) var(--cl-space-20); }
.cl-sheet__title { flex: 1 1 auto; margin: 0; font-size: var(--cl-type-heading-3-size); line-height: var(--cl-type-heading-3-line-height); font-weight: var(--cl-type-heading-3-weight); letter-spacing: var(--cl-type-heading-3-tracking); }
.cl-sheet__body { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--cl-space-8) var(--cl-space-20) var(--cl-space-24); display: grid; gap: var(--cl-space-16); align-content: start; }
.cl-sheet__foot { flex: none; padding: var(--cl-space-12) var(--cl-space-20) max(var(--cl-space-16), var(--cl-layout-safe-area-bottom)); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); display: flex; flex-wrap: wrap; gap: var(--cl-space-12); justify-content: flex-end; }
.cl-sheet__sub { margin: 0; color: var(--cl-color-on-surface-muted); }

/* ---- 6. Dialog ----------------------------------------------------------------------------------------------------------- */
.cl-dialog { box-sizing: border-box; inline-size: min(100% - var(--cl-space-32), var(--cl-dialog-max-width)); min-inline-size: min(17.5rem, 100% - var(--cl-space-32)); max-block-size: calc(100dvh - var(--cl-space-32)); margin: auto; padding: var(--cl-dialog-padding); border: 0; border-radius: var(--cl-dialog-radius); background: var(--cl-color-surface-overlay); color: var(--cl-color-on-surface); box-shadow: var(--cl-elevation-5); display: grid; gap: var(--cl-space-16); overflow-y: auto; } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
dialog.cl-dialog:not([open]) { display: none; }
dialog.cl-dialog { opacity: 0; transform: scale(0.96); }
dialog.cl-dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog.cl-dialog[open] { opacity: 0; transform: scale(0.96); } }
.cl-dialog__title { margin: 0; font-size: var(--cl-type-heading-3-size); line-height: var(--cl-type-heading-3-line-height); font-weight: var(--cl-type-heading-3-weight); }
.cl-dialog__body { display: grid; gap: var(--cl-space-12); }
.cl-dialog__body p { margin: 0; }
.cl-dialog__list { margin: 0; padding-inline-start: var(--cl-space-20); display: grid; gap: var(--cl-space-4); }
.cl-dialog__actions { display: flex; flex-direction: column; gap: var(--cl-space-12); padding-block-start: var(--cl-space-8); }
.cl-dialog__actions .cl-button { inline-size: 100%; }
@container cl-app (min-width: 600px) { .cl-dialog__actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; } .cl-dialog__actions .cl-button { inline-size: auto; } }
.cl-dialog__step { margin: 0; color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); font-weight: var(--cl-font-weight-semibold); }
.cl-dialog--destructive { border: var(--cl-border-width-2) solid var(--cl-color-error); }
.cl-dialog__lost { margin: 0; padding: var(--cl-space-12) var(--cl-space-16); border-radius: var(--cl-radius-12); background: var(--cl-color-error-container); color: var(--cl-color-on-error-container); display: grid; gap: var(--cl-space-8); }

/* ---- 7. Command palette (laptop) and search overlay (phone) ------------------------------------------------------------------- */
.cl-palette { background: var(--cl-color-surface-overlay); box-shadow: var(--cl-elevation-5); box-sizing: border-box; inline-size: min(100% - var(--cl-space-32), var(--cl-palette-width)); max-block-size: min(36rem, calc(100dvh - var(--cl-space-80))); margin: var(--cl-space-80) auto auto; padding: 0; border: 0; border-radius: var(--cl-radius-20); display: flex; flex-direction: column; overflow: hidden; color: var(--cl-color-on-surface); } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
dialog.cl-palette:not([open]) { display: none; }
dialog.cl-palette { opacity: 0; transform: translateY(calc(var(--cl-motion-shift) * -1)); }
dialog.cl-palette[open] { opacity: 1; transform: none; }
@starting-style { dialog.cl-palette[open] { opacity: 0; transform: translateY(calc(var(--cl-motion-shift) * -1)); } }
.cl-palette--full { inline-size: 100%; max-inline-size: none; max-block-size: none; block-size: 100dvh; margin: 0; border-radius: 0; background: var(--cl-color-background); }   /* the UA dialog max-width would clip it at 355; the full-screen search is a page, so it takes the canvas (round E1 rulings 15, 25) */
dialog.cl-palette--full:modal { max-inline-size: none; max-block-size: none; inset: 0; margin: 0; }
.cl-palette__bar { flex: none; display: flex; align-items: center; gap: var(--cl-space-8); padding: var(--cl-space-8) var(--cl-space-12); border-block-end: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-palette--full .cl-palette__bar { padding: var(--cl-space-8) var(--cl-space-8) var(--cl-space-8) var(--cl-space-4); padding-block-start: max(var(--cl-space-8), var(--cl-layout-safe-area-top)); }
.cl-palette__field { flex: 1 1 auto; min-inline-size: 0; display: flex; align-items: center; gap: var(--cl-space-12); min-block-size: var(--cl-size-control-48); }
.cl-palette--full .cl-palette__field { min-block-size: var(--cl-size-control-56); padding-inline: var(--cl-space-16); border: var(--cl-border-width-1) solid var(--cl-color-border-strong); border-radius: var(--cl-radius-999); background: var(--cl-color-surface-raised); }
.cl-palette__input { flex: 1 1 auto; align-self: stretch; min-block-size: var(--cl-size-control-48); min-inline-size: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: max(16px, 1rem); outline-offset: var(--cl-space-8); }
.cl-palette__input:focus-visible { outline: none; box-shadow: none; }   /* the field wrapper draws the ring (no oversized 8px-offset box) */
.cl-palette__field:has(.cl-palette__input:focus-visible) { outline: var(--cl-border-width-2) solid var(--cl-color-focus-ring); outline-offset: 2px; box-shadow: 0 0 0 2px var(--cl-color-focus-halo); border-radius: var(--cl-radius-12); }
.cl-palette--full .cl-palette__field:has(.cl-palette__input:focus-visible) { border-radius: var(--cl-radius-999); }
@media (forced-colors: active) { .cl-palette__field:has(.cl-palette__input:focus-visible) { outline-color: Highlight; box-shadow: none; } }
.cl-palette__input::placeholder { color: var(--cl-color-on-surface-muted); }
.cl-palette__scopes { flex: none; display: flex; gap: var(--cl-space-8); padding: var(--cl-space-12) var(--cl-space-12) var(--cl-space-12); overflow-x: auto; scrollbar-width: none; }   /* padding = ring + halo so focus is never clipped (round C1 ruling 16) */
.cl-palette__scopes .cl-chip { flex: none; }
.cl-palette__scopes::-webkit-scrollbar { display: none; }
.cl-palette__scroll { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; padding-block-end: var(--cl-space-8); }
.cl-palette__foot { flex: none; display: none; align-items: center; gap: var(--cl-space-16); padding: var(--cl-space-12) var(--cl-space-16); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); }
@media (hover: hover) and (pointer: fine) { .cl-palette__foot { display: flex; } }
.cl-palette__foot span { display: inline-flex; align-items: center; gap: var(--cl-space-4); }
.cl-results { margin: 0; padding: 0 var(--cl-space-8); list-style: none; }
.cl-results__group { margin: 0; padding: 0; list-style: none; }
.cl-results__label { margin: 0; padding: var(--cl-space-12) var(--cl-space-12) var(--cl-space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--cl-space-8); font-size: var(--cl-type-eyebrow-size); line-height: var(--cl-type-eyebrow-line-height); font-weight: var(--cl-type-eyebrow-weight); letter-spacing: var(--cl-type-eyebrow-tracking); text-transform: var(--cl-type-eyebrow-transform); color: var(--cl-color-on-surface-muted); }
.cl-results__opt { display: flex; align-items: center; gap: var(--cl-space-12); min-block-size: var(--cl-size-control-48); padding: var(--cl-space-8) var(--cl-space-12); border-radius: var(--cl-radius-12); color: var(--cl-color-on-surface); text-decoration: none; cursor: pointer; }
/* full-screen palette: input fills the 56 field */
.cl-palette--full .cl-palette__input { min-block-size: var(--cl-size-control-56); }
.cl-palette--full .cl-results__opt { min-block-size: var(--cl-size-control-56); }
.cl-results__opt .cl-icon { color: var(--cl-color-on-surface-muted); }
.cl-results__text { flex: 1 1 auto; min-inline-size: 0; display: grid; }
.cl-results__title { font-weight: var(--cl-font-weight-medium); overflow-wrap: anywhere; }
.cl-results__title b { font-weight: var(--cl-font-weight-semibold); text-decoration: underline; text-decoration-thickness: var(--cl-border-width-2); text-underline-offset: var(--cl-space-4); text-decoration-color: var(--cl-color-primary-indicator); }
.cl-results__meta { font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); color: var(--cl-color-on-surface-muted); }
.cl-results__opt[aria-selected="true"] { background: var(--cl-color-selected-container); color: var(--cl-color-on-selected-container); box-shadow: inset var(--cl-space-4) 0 0 var(--cl-color-selected-border); }
.cl-results__opt[aria-selected="true"] .cl-icon, .cl-results__opt[aria-selected="true"] .cl-results__meta { color: inherit; }
@media (hover: hover) and (pointer: fine) { .cl-results__opt:hover { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } .cl-results__opt[aria-selected="true"]:hover { background: var(--cl-color-primary-container); } }
.cl-palette__empty { display: grid; gap: var(--cl-space-12); justify-items: start; padding: var(--cl-space-24) var(--cl-space-20); }
.cl-palette__empty p { margin: 0; }

/* ---- 8. Notification list and panel -------------------------------------------------------------------------------------------- */
.cl-notifs { display: grid; gap: var(--cl-space-8); }
.cl-notifs__group { margin: 0; padding: 0; list-style: none; }
.cl-notifs__label { margin: 0; padding: var(--cl-space-16) var(--cl-space-16) var(--cl-space-4); font-size: var(--cl-type-eyebrow-size); line-height: var(--cl-type-eyebrow-line-height); font-weight: var(--cl-type-eyebrow-weight); letter-spacing: var(--cl-type-eyebrow-tracking); text-transform: var(--cl-type-eyebrow-transform); color: var(--cl-color-on-surface-muted); }
.cl-notif { position: relative; display: grid; overflow: hidden; border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-notif__swipe { position: absolute; inset-block: 0; inset-inline-end: 0; display: flex; visibility: hidden; }   /* swipe is a pointer shortcut: its buttons are only in the tree while revealed, never invisible-but-focusable (round D1 ruling 2); the More menu is the real path */
.cl-notif--swiped .cl-notif__swipe { visibility: visible; }
.cl-notif__more { --_ibs: var(--cl-size-target-min); }
.cl-notif__menu { min-inline-size: var(--cl-menu-min-width); }
.cl-notif__swipe button { inline-size: var(--cl-swipe-action-width); border: 0; display: grid; place-items: center; align-content: center; gap: var(--cl-space-2); font: inherit; font-size: var(--cl-type-caption-size); font-weight: var(--cl-font-weight-semibold); cursor: pointer; background: var(--cl-color-primary-container); color: var(--cl-color-on-primary-container); }
.cl-notif__swipe button + button { background: var(--cl-color-surface); color: var(--cl-color-on-surface); }
.cl-notif__row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--cl-space-12); align-items: center; padding: var(--cl-space-12) var(--cl-space-8) var(--cl-space-12) var(--cl-space-16); background: var(--cl-color-background); transition: transform var(--cl-motion-enter-small); }
.cl-notif--swiped .cl-notif__row { transform: translateX(calc(var(--cl-swipe-action-width) * -2)); }
.cl-notif__icon { display: grid; place-items: center; inline-size: var(--cl-size-control-40); block-size: var(--cl-size-control-40); border-radius: var(--cl-radius-999); background: var(--cl-color-surface); color: var(--cl-color-on-surface-muted); position: relative; }
.cl-notif[data-unread="true"] .cl-notif__icon { background: var(--cl-color-selected-container); color: var(--cl-color-on-selected-container); box-shadow: inset 0 0 0 var(--cl-border-width-2) var(--cl-color-selected-border); }
.cl-notif__body { display: grid; gap: var(--cl-space-4); min-inline-size: 0; }
.cl-notif__what { margin: 0; font-size: var(--cl-font-size-16); line-height: var(--cl-type-body-line-height); font-weight: var(--cl-font-weight-medium); overflow-wrap: anywhere; display: flex; align-items: flex-start; gap: var(--cl-space-8); }
.cl-notif[data-unread="true"] .cl-notif__what { font-weight: var(--cl-font-weight-semibold); }
.cl-notif__dot { flex: none; inline-size: var(--cl-space-8); block-size: var(--cl-space-8); margin-block-start: var(--cl-space-8); border-radius: var(--cl-radius-999); background: var(--cl-color-primary-indicator); }
.cl-notif__why { margin: 0; font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); color: var(--cl-color-on-surface-muted); }
.cl-notif__act { justify-self: start; margin-inline-start: calc(var(--cl-space-12) * -1); }
.cl-notif__tools { display: flex; align-items: center; }
.cl-notif__tools .cl-icon-button--inline-only { display: none; }
.cl-notifs__empty { display: grid; gap: var(--cl-space-12); justify-items: center; text-align: center; padding: var(--cl-space-40) var(--cl-space-24); }
.cl-notifs__empty p { margin: 0; }
.cl-notif-panel { inline-size: min(100%, var(--cl-side-sheet-width)); display: flex; flex-direction: column; border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-overlay); box-shadow: var(--cl-elevation-4); overflow: hidden; max-block-size: min(40rem, 80dvh); box-sizing: border-box; } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
.cl-notif-panel[popover] { position: fixed; inset: auto; margin: 0; padding: 0; }
.cl-notif-panel[popover]:not(:popover-open) { display: none; }
/* iOS/Safari 16 (no Popover API): menus and the panel are toggled by JS with [data-open], same ARIA (round D1 ruling 10) */
@supports not selector(:popover-open) {
  .cl-menu[popover], .cl-notif-panel[popover] { display: none; }
  .cl-menu[popover][data-open] { display: block; z-index: var(--cl-z-menu); }
  .cl-notif-panel[popover][data-open] { display: flex; z-index: var(--cl-z-menu); }
}
.cl-notif-panel__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--cl-space-8); padding: var(--cl-space-8) var(--cl-space-8) 0 var(--cl-space-16); }
.cl-notif-panel__title { margin: 0; font-size: var(--cl-type-title-size); line-height: var(--cl-type-title-line-height); font-weight: var(--cl-font-weight-semibold); }
.cl-notif-panel__scroll { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; }
.cl-notif-panel__foot { flex: none; display: flex; justify-content: center; padding: var(--cl-space-4); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-notif-panel .cl-notif__row { padding-inline-start: var(--cl-space-16); }
@container cl-app (min-width: 840px) { .cl-notif__tools .cl-icon-button--inline-only { display: inline-flex; } }   /* More stays on laptop: it holds "Turn off this type" */

/* ---- 9. Assistant chat ------------------------------------------------------------------------------------------------------- */
.cl-chat { display: flex; flex-direction: column; min-block-size: 0; flex: 1 1 auto; }
.cl-chat__head { flex: none; display: flex; align-items: center; gap: var(--cl-space-8); padding: var(--cl-space-4) var(--cl-space-4) var(--cl-space-4) var(--cl-space-16); min-block-size: var(--cl-size-control-56); border-block-end: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-chat__title { flex: 1 1 auto; margin: 0; display: flex; align-items: center; gap: var(--cl-space-8); flex-wrap: wrap; font-size: var(--cl-type-title-size); line-height: var(--cl-type-title-line-height); font-weight: var(--cl-font-weight-semibold); }
.cl-chat__thread { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--cl-space-16); display: grid; gap: var(--cl-space-16); align-content: start; }
.cl-chat__foot { flex: none; display: grid; gap: var(--cl-space-8); padding: var(--cl-space-8) var(--cl-space-16) max(var(--cl-space-12), var(--cl-layout-safe-area-bottom)); border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); background: var(--cl-color-surface-overlay); }
.cl-chat__typing { display: inline-flex; align-items: center; gap: var(--cl-space-8); color: var(--cl-color-on-surface-muted); }
.cl-chat__stop { justify-self: start; }
.cl-chat__fallback { margin: 0; text-align: center; font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); color: var(--cl-color-on-surface-muted); }
.cl-chat .cl-quick { padding-inline: 0; }

/* ---- 10. Guided quiz shell ------------------------------------------------------------------------------------------------------ */
.cl-quiz { container: cl-app / inline-size; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-block-size: 100dvh; background: var(--cl-color-background); color: var(--cl-color-on-surface); }
.cl-quiz__bar { position: sticky; inset-block-start: 0; z-index: var(--cl-z-bar); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--cl-space-4) var(--cl-space-16); padding: calc(var(--cl-layout-safe-area-top) + var(--cl-space-4)) max(var(--cl-space-8), var(--cl-layout-safe-area-right)) var(--cl-space-8) max(var(--cl-space-8), var(--cl-layout-safe-area-left)); min-block-size: var(--cl-top-bar-height-mobile); background: var(--cl-color-background); border-block-end: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-quiz__bar .cl-stage { padding-inline-end: var(--cl-space-8); }
.cl-quiz__panes { display: grid; grid-template-columns: minmax(0, 1fr); min-block-size: 0; }
.cl-quiz__conv { min-inline-size: 0; padding: var(--cl-space-16) var(--cl-layout-margin) var(--cl-space-24); display: grid; gap: var(--cl-space-16); align-content: start; }
.cl-quiz__map { display: none; }
.cl-quiz__tray { grid-row: 3; }
.cl-quiz__inline { display: none; }
.cl-map { display: grid; gap: var(--cl-space-16); align-content: start; }
.cl-map__title { margin: 0; }
.cl-map__slot { display: grid; gap: var(--cl-space-4); padding: var(--cl-space-12) var(--cl-space-16); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-12); background: var(--cl-color-surface-raised); }
.cl-map__slot--empty { border-style: dashed; background: transparent; color: var(--cl-color-on-surface-muted); }
.cl-map__k { margin: 0; font-size: var(--cl-type-eyebrow-size); line-height: var(--cl-type-eyebrow-line-height); font-weight: var(--cl-type-eyebrow-weight); letter-spacing: var(--cl-type-eyebrow-tracking); text-transform: var(--cl-type-eyebrow-transform); color: var(--cl-color-on-surface-muted); }
.cl-map__v { margin: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--cl-space-8); font-weight: var(--cl-font-weight-medium); }
.cl-map__v > span { min-inline-size: 0; overflow-wrap: anywhere; }
.cl-map__v > .cl-button, .cl-map__v > .cl-icon-button { flex: none; white-space: nowrap; }
.cl-map__v > .cl-tag { flex: none; overflow-wrap: normal; word-break: keep-all; }   /* a tag in a map slot never breaks letter by letter (round H) */   /* the Change button never shrinks or wraps letter by letter */
@container cl-app (min-width: 840px) {
  .cl-quiz__bar { grid-template-columns: auto minmax(0, 24rem); justify-content: space-between; padding-inline: var(--cl-layout-margin); } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
  .cl-quiz__panes { grid-template-columns: minmax(0, var(--cl-reading-column)) minmax(0, var(--cl-map-panel-width)); justify-content: center; gap: var(--cl-space-40); padding-inline: var(--cl-layout-margin); }
  .cl-quiz__conv { padding-inline: 0; padding-block: var(--cl-space-32); gap: var(--cl-space-24); }
  .cl-quiz__map { display: grid; position: sticky; inset-block-start: calc(var(--cl-top-bar-height-desktop) + var(--cl-space-16)); align-self: start; padding-block: var(--cl-space-32); }
  .cl-quiz__tray { display: none; }
  .cl-quiz__inline { display: grid; gap: var(--cl-space-16); padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); }
}

/* swipe deck */
.cl-deck { display: grid; gap: var(--cl-space-16); }
.cl-deck__stack { position: relative; display: grid; padding-block-end: var(--cl-space-16); }
.cl-deck__stack > .cl-deck__card { grid-area: 1 / 1; }
.cl-deck__card { display: grid; gap: var(--cl-space-12); align-content: start; padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-20); background: var(--cl-color-surface-raised); box-shadow: var(--cl-elevation-2); touch-action: pan-y; transition: transform var(--cl-motion-enter-small), opacity var(--cl-motion-fade-enter); }
.cl-deck__card--behind { box-shadow: var(--cl-elevation-1); transform: translateY(var(--cl-space-8)) scale(0.96); }
.cl-deck__card--behind + .cl-deck__card--behind { transform: translateY(var(--cl-space-16)) scale(0.92); }
.cl-deck__stack > .cl-deck__card:not(.cl-deck__card--behind) { z-index: var(--cl-z-pinned); }
.cl-deck__card--behind > * { visibility: hidden; }
.cl-deck__role { margin: 0; font-size: var(--cl-type-heading-3-size); line-height: var(--cl-type-heading-3-line-height); font-weight: var(--cl-type-heading-3-weight); }
.cl-deck__card p { margin: 0; }
.cl-deck__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: var(--cl-space-8); }   /* 3 -> 2 -> 1 columns as the width or text size demands */ /* lint-allow: grid minimum in rem: the narrowest a column may be before it wraps; follows text size, not a layout token */
.cl-deck__actions .cl-button { flex-direction: column; gap: var(--cl-space-4); padding-inline: var(--cl-space-8); min-block-size: var(--cl-size-control-56); font-size: var(--cl-font-size-16); line-height: var(--cl-type-body-line-height); font-weight: var(--cl-font-weight-semibold); }   /* 16/24 600 on 48 and 56 buttons (ruling 4, D1 ruling 6) */
@container cl-app (max-width: 40rem) { .cl-deck:not(.cl-deck--row) .cl-deck__actions { grid-template-columns: 1fr 1fr; } .cl-deck:not(.cl-deck--row) .cl-deck__actions .cl-button:last-child { grid-column: 1 / -1; } }   /* 2 + 1 below 640 so three labels never cramp */ /* lint-allow: container query cannot read custom properties; text-size test in rem (follows the user's font size, not a device width); no --cl-breakpoint-* equals it */
.cl-deck__count { margin: 0; text-align: center; color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); }
.cl-deck--row .cl-deck__stack { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cl-space-16); padding: 0; }
.cl-deck--row .cl-deck__stack > .cl-deck__card { grid-area: auto; align-content: space-between; box-shadow: var(--cl-elevation-1); }
.cl-deck--row .cl-deck__actions { grid-template-columns: 1fr; }
.cl-deck--row .cl-deck__actions .cl-button { flex-direction: row; gap: var(--cl-space-8); font-size: var(--cl-font-size-16); min-block-size: var(--cl-size-control-48); }
.cl-deck__card[data-decision] { border-color: var(--cl-color-primary); }

/* skills review list */
.cl-skills { display: grid; gap: var(--cl-space-12); }
.cl-skills__list { border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); overflow: hidden; }
.cl-skills__foot { display: flex; flex-wrap: wrap; gap: var(--cl-space-12); align-items: center; justify-content: space-between; }

/* analysis wait */
.cl-wait { display: grid; gap: var(--cl-space-16); }
.cl-wait__stages { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--cl-space-4); }
.cl-wait__stage { display: grid; grid-template-columns: var(--cl-size-icon-24) minmax(0, 1fr); gap: var(--cl-space-12); align-items: center; min-block-size: var(--cl-size-control-48); color: var(--cl-color-on-surface-muted); }
.cl-wait__mark { display: grid; place-items: center; inline-size: var(--cl-size-icon-24); block-size: var(--cl-size-icon-24); border-radius: var(--cl-radius-999); border: var(--cl-border-width-2) solid var(--cl-color-border-strong); box-sizing: border-box; }
.cl-wait__stage[data-status="done"] { color: var(--cl-color-on-surface); }
.cl-wait__stage[data-status="done"] .cl-wait__mark { background: var(--cl-color-success); border-color: var(--cl-color-success); color: var(--cl-color-on-success); }
.cl-wait__stage[data-status="active"] { color: var(--cl-color-on-surface); font-weight: var(--cl-font-weight-semibold); }
.cl-wait__stage[data-status="active"] .cl-wait__mark { border-color: transparent; }
.cl-wait__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-12); }   /* also emitted by js/quiz-prototype.js (Cancel) */
.cl-wait__note { margin: 0; color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }

/* result card */
.cl-result { display: grid; gap: var(--cl-space-16); }
.cl-result__routes { display: grid; gap: var(--cl-space-12); grid-template-columns: minmax(0, 1fr); }
.cl-route { display: grid; gap: var(--cl-space-12); align-content: start; padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); }
.cl-route h3 { margin: 0; }
.cl-route p { margin: 0; }
.cl-route__phrase { background: linear-gradient(transparent 55%, var(--cl-color-highlight) 55%, var(--cl-color-highlight) 92%, transparent 92%); color: var(--cl-color-on-highlight, inherit); padding-inline: var(--cl-space-2); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
/* Night: dark on-highlight text needs gold under all of it, so the mark becomes a full band (same idea as .cl-mark-insight's darker-gold swipe) */
:root[data-theme="dark"] .cl-route__phrase { background: var(--cl-color-highlight); border-radius: var(--cl-radius-4); padding-inline: var(--cl-space-4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-route__phrase { background: var(--cl-color-highlight); border-radius: var(--cl-radius-4); padding-inline: var(--cl-space-4); } }   /* the one pen mark: highlighter on the route phrase */
.cl-route dl { margin: 0; display: grid; gap: var(--cl-space-8); }
.cl-route dl div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--cl-space-12); } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
.cl-route dt { color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
.cl-route dd { margin: 0; font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
.cl-result__foot { display: flex; flex-wrap: wrap; gap: var(--cl-space-8) var(--cl-space-16); align-items: center; }
@container cl-app (min-width: 840px) { .cl-result__routes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cl-space-16); } }

/* ---- 11. Today's focus ------------------------------------------------------------------------------------------------------------- */
.cl-today { display: grid; gap: var(--cl-space-24); grid-template-columns: minmax(0, 1fr); }
.cl-today__col { display: grid; gap: var(--cl-space-24); align-content: start; min-inline-size: 0; }
@container cl-app (min-width: 840px) { .cl-today { grid-template-columns: minmax(0, 1fr) var(--cl-map-panel-width); gap: var(--cl-space-32); } }
.cl-plan-head { display: grid; gap: var(--cl-space-4); }
.cl-plan-head h1, .cl-plan-head h2 { margin: 0; }
.cl-plan-head p { margin: 0; color: var(--cl-color-on-surface-muted); }
.cl-next { display: grid; gap: var(--cl-space-16); padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-20); background: var(--cl-color-surface-raised); box-shadow: var(--cl-elevation-1); }
.cl-next__title { margin: 0; font-size: var(--cl-type-heading-4-size); line-height: var(--cl-type-heading-4-line-height); font-weight: var(--cl-type-heading-4-weight); letter-spacing: var(--cl-type-heading-4-tracking); }
.cl-next p { margin: 0; }
.cl-next__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-12); }
.cl-block { display: grid; gap: var(--cl-space-8); }
.cl-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cl-space-4) var(--cl-space-8); }
.cl-block__head > .cl-block__title { flex: 1 1 auto; min-inline-size: 0; }
.cl-block__head > .cl-link { display: inline-flex; align-items: center; min-block-size: var(--cl-size-target-min); }   /* standalone links are 48 high (round E1 ruling 22) */
.cl-block__title { margin: 0; font-size: var(--cl-type-heading-4-size); line-height: var(--cl-type-heading-4-line-height); font-weight: var(--cl-font-weight-semibold); }
.cl-block .cl-list { border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-commit { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--cl-space-4) var(--cl-space-4); }
.cl-commit .cl-check { align-self: start; }
.cl-commit__due { color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
.cl-checkin__choices { display: flex; flex-wrap: wrap; gap: var(--cl-space-16) var(--cl-space-8); border: 0; margin: 0; padding: var(--cl-space-4); }

/* ---- 12. Module card and submodule step layout ------------------------------------------------------------------------------------------------ */
.cl-module { display: grid; gap: var(--cl-space-12); padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-20); background: var(--cl-color-surface-raised); }
.cl-module__title { margin: 0; font-size: var(--cl-type-heading-4-size); line-height: var(--cl-type-heading-4-line-height); font-weight: var(--cl-type-heading-4-weight); }
.cl-module p { margin: 0; }
.cl-module__ends { display: flex; align-items: center; gap: var(--cl-space-8); font-weight: var(--cl-font-weight-medium); }
.cl-module__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-4) var(--cl-space-8); color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
/* Meta separators are drawn, trailing, on every item but the last: a separator can never start a line (round E1 ruling 17). Markup holds no middle-dot characters. */
.cl-module__meta > :not(:last-child, .cl-tag)::after, .cl-meta > :not(:last-child, .cl-tag)::after { /* a tag is already a boxed item; a dot inside its border read as part of the label */  content: "\00b7"; margin-inline-start: var(--cl-space-8); color: var(--cl-color-on-surface-muted); }
.cl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-4) var(--cl-space-8); margin: 0; padding: 0; list-style: none; }
.cl-module__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-12); }
@container cl-app (min-width: 840px) { .cl-module { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--cl-space-32); align-items: center; } .cl-module__actions { flex-direction: column; align-items: stretch; min-inline-size: 12rem; } .cl-module > .cl-module__main { display: grid; gap: var(--cl-space-12); } } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
.cl-module__main { display: grid; gap: var(--cl-space-12); }
.cl-sub { display: grid; gap: var(--cl-space-16); grid-template-columns: minmax(0, 1fr); }
.cl-sub__content { display: grid; gap: var(--cl-space-16); align-content: start; min-inline-size: 0; }
.cl-sub__content h1 { margin: 0; }
.cl-sub__content p { margin: 0; }
.cl-sub__nav, .cl-sub__aside { display: none; }
.cl-sub__stuck { justify-self: start; }
@container cl-app (min-width: 840px) {
  .cl-sub { grid-template-columns: 12rem minmax(0, 1fr); gap: var(--cl-space-24); }   /* 840-1199: nav + content; the aside drops under the content (round E1 ruling 25) */ /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
  .cl-sub__nav { display: block; }
  .cl-sub__aside { grid-column: 2; display: grid; align-content: start; gap: var(--cl-space-12); position: sticky; inset-block-start: calc(var(--cl-top-bar-height-desktop) + var(--cl-space-16)); align-self: start; padding: var(--cl-space-16); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); }
  .cl-sub__stuck-inline { display: none; }
}
@container cl-app (min-width: 1200px) {
  .cl-sub { grid-template-columns: 14rem minmax(0, var(--cl-reading-column)) var(--cl-settings-nav-width); gap: var(--cl-space-32); } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
  .cl-sub__aside { grid-column: auto; }
}
.cl-sub__aside p { margin: 0; }

/* ---- 13. Sticky action bar (shared by quiz tray and sticky CTA) ------------------------------------------------------------------------------- */
.cl-action-bar { position: sticky; inset-block-end: 0; z-index: var(--cl-z-action-bar); display: grid; gap: var(--cl-space-12); padding: var(--cl-space-12) max(var(--cl-layout-margin), var(--cl-layout-safe-area-left)) max(var(--cl-space-12), var(--cl-layout-safe-area-bottom)); background: var(--cl-color-surface-raised); border-block-start: var(--cl-border-width-1) solid var(--cl-color-border); max-block-size: 60dvh; overflow-y: auto; }
.cl-action-bar--tray { padding-block-start: var(--cl-space-16); border-start-start-radius: var(--cl-radius-20); border-start-end-radius: var(--cl-radius-20); }
/* Tray at large text (round E1 ruling 25): it caps at half the screen and scrolls INSIDE, while its primary row (Next) stays pinned at the bottom of
   the tray, so the one primary action is always on screen. Flex column, not grid: a sticky grid item cannot leave its own grid area. */
.cl-action-bar--tray { display: flex; flex-direction: column; gap: var(--cl-space-12); max-block-size: 50svh; overscroll-behavior: contain; padding-block-end: 0; }
.cl-action-bar--tray > * { flex: none; }
.cl-action-bar--tray > .cl-action-bar__row { background: inherit; position: sticky; inset-block-end: 0; z-index: var(--cl-z-pinned); padding-block: var(--cl-space-8) max(var(--cl-space-12), var(--cl-layout-safe-area-bottom)); }
.cl-action-bar--tray > :last-child:not(.cl-action-bar__row) { padding-block-end: max(var(--cl-space-12), var(--cl-layout-safe-area-bottom)); }
.cl-action-bar__row { display: flex; flex-wrap: wrap; gap: var(--cl-space-12); align-items: center; }
.cl-action-bar__row .cl-button--lg:not(.cl-button--text) { flex: 1 1 auto; }
.cl-action-bar__status { margin: 0; color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
@container cl-app (min-width: 840px) { .cl-action-bar--inline { position: static; padding-inline: 0; background: transparent; border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); } .cl-action-bar__row--end { justify-content: flex-end; } .cl-action-bar__row .cl-button--lg:not(.cl-button--text) { flex: 0 0 auto; } }
:root:has(.cl-action-bar) { --cl-scroll-padding-bottom: calc(var(--cl-tray-height, calc(var(--cl-size-control-56) + var(--cl-space-24) + var(--cl-layout-safe-area-bottom))) + var(--cl-space-16)); }   /* --cl-tray-height is written by a ResizeObserver (js/app-shell helper in organisms-app.page.js) */
/* 200% text / short windows: a tray that holds a text field stops being sticky and sits at the end of the thread (one thing per page) */
@media (max-height: 480px) { :root:has(.cl-action-bar) { --cl-scroll-padding-bottom: var(--cl-space-16); } }
.cl-action-bar { transform: translateY(calc(var(--cl-kb-inset, 0px) * -1)); }   /* visualViewport helper lifts it above the iOS keyboard */
@media (max-height: 480px) { .cl-action-bar { position: static; } }   /* landscape phone: the bar scrolls with content so it cannot eat the screen */

/* ---- 14. Plan card (was .cl-offer; the marketing .cl-offer lives in organisms-site.css, round E1 ruling 31) and refusal panel --------------------------------------------------------------------------------------------------------- */
.cl-plan-card { display: grid; gap: var(--cl-space-16); padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border-strong); border-radius: var(--cl-radius-20); background: var(--cl-color-surface-raised); }
.cl-plan-card p, .cl-plan-card ul { margin: 0; }
.cl-plan-card__title { margin: 0; font-size: var(--cl-type-heading-4-size); line-height: var(--cl-type-heading-4-line-height); font-weight: var(--cl-type-heading-4-weight); }
.cl-plan-card__gets { padding-inline-start: var(--cl-space-20); display: grid; gap: var(--cl-space-4); }
.cl-plan-card__safe { display: flex; align-items: center; gap: var(--cl-space-8); padding: var(--cl-space-12); border-radius: var(--cl-radius-12); background: var(--cl-color-info-container); color: var(--cl-color-on-info-container); }
.cl-plan-card__actions { display: flex; flex-wrap: wrap; gap: var(--cl-space-12); align-items: center; }
.cl-plan-card--inline { padding: var(--cl-space-12); gap: var(--cl-space-8); }   /* compact card inside a conversation bubble (was an inline style) */
.cl-plan-card__split { display: grid; gap: var(--cl-space-16); }
@container cl-app (min-width: 840px) { .cl-plan-card--wide .cl-plan-card__split { grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); align-items: start; column-gap: var(--cl-space-32); } } /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
.cl-refusal { display: grid; gap: var(--cl-space-16); padding: var(--cl-space-20); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-20); background: var(--cl-color-surface); }
.cl-refusal p, .cl-refusal ul { margin: 0; }
.cl-refusal__title { margin: 0; font-size: var(--cl-type-heading-4-size); line-height: var(--cl-type-heading-4-line-height); font-weight: var(--cl-type-heading-4-weight); }
.cl-refusal__kept { padding-inline-start: 0; list-style: none; display: grid; gap: var(--cl-space-8); }
.cl-refusal__kept li { display: flex; align-items: center; gap: var(--cl-space-8); }
.cl-refusal__log { color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }

/* ---- 15. Settings --------------------------------------------------------------------------------------------------------------------------- */
.cl-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cl-space-16); }
.cl-settings__nav { display: grid; gap: var(--cl-space-4); align-content: start; }
.cl-settings__page { display: none; min-inline-size: 0; }
.cl-settings__nav-title { margin: 0; padding: var(--cl-space-16) var(--cl-space-16) var(--cl-space-4); font-size: var(--cl-type-eyebrow-size); line-height: var(--cl-type-eyebrow-line-height); font-weight: var(--cl-type-eyebrow-weight); letter-spacing: var(--cl-type-eyebrow-tracking); text-transform: var(--cl-type-eyebrow-transform); color: var(--cl-color-on-surface-muted); }
.cl-settings--page .cl-settings__nav { display: none; }
.cl-settings--page .cl-settings__page { display: grid; gap: var(--cl-space-16); align-content: start; }
@container cl-app (min-width: 840px) {
  .cl-settings { grid-template-columns: var(--cl-grid-min-track) minmax(0, 1fr); gap: var(--cl-space-24); }   /* 840-1199: narrower nav, fluid page (round E1 ruling 25) */
  .cl-settings .cl-settings__nav, .cl-settings--page .cl-settings__nav { display: grid; position: sticky; inset-block-start: calc(var(--cl-top-bar-height-desktop) + var(--cl-space-16)); align-self: start; }
  .cl-settings .cl-settings__page { display: grid; gap: var(--cl-space-24); align-content: start; }
  .cl-settings__back { display: none; }
}
@container cl-app (min-width: 1200px) { .cl-settings { grid-template-columns: var(--cl-settings-nav-width) minmax(0, var(--cl-reading-column)); gap: var(--cl-space-40); } }
.cl-setgroup { display: grid; gap: var(--cl-space-4); }
.cl-setgroup__title { margin: 0; padding-inline: var(--cl-space-16); font-size: var(--cl-type-eyebrow-size); line-height: var(--cl-type-eyebrow-line-height); font-weight: var(--cl-type-eyebrow-weight); letter-spacing: var(--cl-type-eyebrow-tracking); text-transform: var(--cl-type-eyebrow-transform); color: var(--cl-color-on-surface-muted); }
.cl-setgroup__rows { margin: 0; padding: 0; min-inline-size: 0; list-style: none; border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); overflow: hidden; }
.cl-setrow { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cl-space-8) var(--cl-space-12); min-block-size: var(--cl-list-item-min-height-one-line); padding: var(--cl-space-4) var(--cl-space-16); }
.cl-setrow + .cl-setrow { border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-setrow__body { flex: 1 1 auto; min-inline-size: 0; display: grid; }
.cl-setrow__title { font-weight: var(--cl-font-weight-medium); overflow-wrap: break-word; hyphens: auto; }   /* break-word, not anywhere: the label keeps its words whole and the row wraps instead (round E1 ruling 21) */
.cl-setrow__support { color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
.cl-setrow .cl-button { flex: none; white-space: nowrap; }
.cl-setrow__body { flex: 1 1 40%; min-inline-size: min(12rem, 100%); }   /* below 12rem of room the trailing control wraps under the label: label above value, never one word per line */ /* lint-allow: component measure in rem so it follows text size (menu, panel, column or frame width); no layout token holds this value */
.cl-setrow__value { flex: 1 1 auto; max-inline-size: 50%; color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); text-align: end; overflow-wrap: break-word; }
.cl-setrow__lead { flex: none; color: var(--cl-color-on-surface-muted); }
.cl-setrow--nav { color: inherit; text-decoration: none; min-block-size: var(--cl-list-item-min-height-two-line); }
.cl-setrow--nav:active { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-pressed) * 100%), transparent); }
.cl-setrow--nav[aria-current="page"] { background: transparent; color: var(--cl-color-primary-text); box-shadow: inset var(--cl-border-width-2) 0 0 var(--cl-color-selected-border); }
.cl-setrow--nav[aria-current="page"] .cl-setrow__support, .cl-setrow--nav[aria-current="page"] .cl-setrow__lead { color: inherit; }
@media (hover: hover) and (pointer: fine) { .cl-setrow--nav:hover { background: color-mix(in srgb, var(--cl-color-state-layer-on-surface) calc(var(--cl-opacity-state-hover) * 100%), transparent); } .cl-setrow--nav[aria-current="page"]:hover { background: var(--cl-color-primary-container); } }
.cl-setrow .cl-switch--trailing { flex: 1 1 auto; }
.cl-setrow--destructive { color: var(--cl-color-on-error-container); font-weight: var(--cl-font-weight-semibold); text-align: start; border: 0; background: transparent; inline-size: 100%; font: inherit; cursor: pointer; }
.cl-setrow--destructive .cl-setrow__lead { color: inherit; }
.cl-matrix { inline-size: 100%; border-collapse: collapse; }
.cl-matrix caption { text-align: start; padding: 0 0 var(--cl-space-8); font-weight: var(--cl-font-weight-semibold); }
.cl-matrix th { font-weight: var(--cl-font-weight-semibold); text-align: start; }
.cl-matrix thead th { padding: var(--cl-space-8) var(--cl-space-4); font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height); color: var(--cl-color-on-surface-muted); text-align: center; }
.cl-matrix tbody th { padding: var(--cl-space-8) var(--cl-space-16); }
.cl-matrix td { text-align: center; padding: 0; }
.cl-matrix td .cl-check { justify-content: center; }
.cl-matrix__col { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cl-matrix__why { display: block; font-weight: var(--cl-font-weight-regular); color: var(--cl-color-on-surface-muted); font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); }
.cl-matrix tbody tr + tr { border-block-start: var(--cl-border-width-1) solid var(--cl-color-divider); }
.cl-matrix-wrap { border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-16); background: var(--cl-color-surface-raised); overflow-x: auto; padding: var(--cl-space-4); }
@container cl-app (max-width: 839px) {
  .cl-matrix, .cl-matrix tbody { display: block; }
  .cl-matrix thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .cl-matrix tbody tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 0 var(--cl-space-8); padding: var(--cl-space-8) var(--cl-space-12); } /* lint-allow: grid minimum in rem: the narrowest a column may be before it wraps; follows text size, not a layout token */
  .cl-matrix tbody th { grid-column: 1 / -1; padding: var(--cl-space-8) var(--cl-space-4) 0; }
  .cl-matrix td { text-align: start; }
  .cl-matrix td .cl-check { justify-content: flex-start; }
  .cl-matrix-wrap { padding: 0; }
  .cl-matrix__col { position: static; inline-size: auto; block-size: auto; overflow: visible; clip-path: none; white-space: normal; }
}

/* .cl-next keeps the lite fill and the lift but never a blur: it can carry a spot illustration and glass sits only over the canvas (round G9). */
.cl-next { background: var(--cl-color-surface-glass-lite); border-color: var(--cl-glass-border); box-shadow: var(--cl-glass-shadow); -webkit-backdrop-filter: none; backdrop-filter: none; isolation: isolate; }
/* ---- Glass (round G ask 5): app cards, bars, sheets and menus. Cards: lite fill on phones, blur from 600. Bars, sheets and menus keep the blur on phones (at most 6 blurred layers per viewport). ---- */
.cl-module, .cl-plan-card, .cl-refusal, .cl-route, .cl-map__slot, .cl-quiz__inline, .cl-skills__list { background: var(--cl-color-surface-glass-lite); border-color: var(--cl-glass-border); box-shadow: var(--cl-glass-shadow); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (min-width: 600px) { .cl-module, .cl-plan-card, .cl-refusal, .cl-route, .cl-map__slot, .cl-quiz__inline, .cl-skills__list { background: var(--cl-color-surface-glass); -webkit-backdrop-filter: var(--cl-glass-filter); backdrop-filter: var(--cl-glass-filter); } }   /* cards drop the blur on phones: at most 6 blurred layers per viewport */
}

.cl-app-bar, .cl-bottom-nav, .cl-quiz__bar, .cl-action-bar { background: var(--cl-color-surface-glass-bar); -webkit-backdrop-filter: var(--cl-glass-filter); backdrop-filter: var(--cl-glass-filter); box-shadow: var(--cl-glass-highlight); }
.cl-menu, .cl-notif-panel, dialog.cl-sheet, dialog.cl-dialog, dialog.cl-palette, .cl-sheet--docked { background: var(--cl-color-surface-glass-bar); -webkit-backdrop-filter: var(--cl-glass-filter); backdrop-filter: var(--cl-glass-filter); border: var(--cl-border-width-1) solid var(--cl-glass-border); }
dialog.cl-palette--full { background: var(--cl-color-background); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* a full-screen page: opaque canvas, no blur over the logo (round G9) */
.cl-action-bar--tray { background: var(--cl-color-surface-glass-fallback); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* the quiz tray is ONE opaque surface, so its sticky action row is never a square grey panel inside the rounded tray (round H) */
/* ---- Forced colours -------------------------------------------------------------------------------------------------------------------------- */
@media (forced-colors: active) {
  .cl-menu, .cl-sheet, .cl-dialog, .cl-palette, .cl-notif-panel, .cl-plan-card, .cl-refusal, .cl-route, .cl-module, .cl-next, .cl-setgroup__rows, .cl-deck__card { border: var(--cl-border-width-1) solid CanvasText; }
  .cl-bottom-nav__item[aria-current="page"] .cl-bottom-nav__icon, .cl-side-nav__item[aria-current="page"], .cl-results__opt[aria-selected="true"], .cl-setrow--nav[aria-current="page"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .cl-notif__dot, .cl-sheet__grab::before { forced-color-adjust: none; background: CanvasText; }
  .cl-route__phrase { forced-color-adjust: none; background: Mark; color: MarkText; }
}
@media (prefers-reduced-motion: reduce) {
  .cl-notif__row, .cl-deck__card { transition: none; }
}

/* ---- Map strip (.cl-mapstrip), quiz v3 round D1: "the map that draws itself" ----
   One drawing of answers we already hold. Five slots, each a mark: route (flag + road shape), blocker (stones), tried (footprints),
   story (waymark), matters (sign). Sizes: data-size="pill" (40 tall, sticky on question screens), "land" (a mark is arriving),
   "hero" (results). .cl-map stays its text twin. Art is decorative (aria-hidden); every mark is also said in words. */
.cl-mapstrip { display: grid; gap: var(--cl-space-12); margin: 0; }
.cl-mapstrip__art { position: relative; aspect-ratio: 3 / 1; border-radius: var(--cl-radius-12); overflow: hidden; background: var(--cl-il-paper); }
.cl-mapstrip__art svg { display: block; inline-size: 100%; block-size: 100%; }
.cl-mapstrip__caption { margin: 0; min-inline-size: 0; font-size: var(--cl-type-body-small-size); line-height: var(--cl-type-body-small-line-height); color: var(--cl-color-on-surface-muted); }
.cl-mapstrip__caption b { color: var(--cl-color-on-surface); font-weight: var(--cl-font-weight-semibold); }
.cl-mapstrip__note { margin: 0; color: var(--cl-color-primary-text); }

/* pill: a sticky row under the quiz bar; the art is 40 tall and scales up while a mark lands */
.cl-mapstrip[data-size="pill"], .cl-mapstrip[data-size="land"] { position: sticky; inset-block-start: calc(var(--cl-top-bar-height-mobile) + var(--cl-space-8)); z-index: var(--cl-z-pinned); grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--cl-space-12); padding: var(--cl-space-4) var(--cl-space-16) var(--cl-space-4) var(--cl-space-4); border: var(--cl-border-width-1) solid var(--cl-color-border); border-radius: var(--cl-radius-999); background: var(--cl-color-surface-raised); box-shadow: var(--cl-elevation-1); }
.cl-mapstrip[data-size="pill"] .cl-mapstrip__art, .cl-mapstrip[data-size="land"] .cl-mapstrip__art { block-size: var(--cl-size-control-40); border-radius: var(--cl-radius-999); transform-origin: left center; transition: transform var(--cl-motion-land-settle); }
.cl-mapstrip[data-size="land"] .cl-mapstrip__art { transform: scale(1.4); }
.cl-mapstrip[data-size="pill"] .cl-mapstrip__caption, .cl-mapstrip[data-size="land"] .cl-mapstrip__caption { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; transition: transform var(--cl-motion-land-settle); }
.cl-mapstrip[data-size="land"] .cl-mapstrip__caption { transform: translateX(var(--cl-space-16)); }
.cl-mapstrip[data-size="pill"] .cl-mapstrip__note, .cl-mapstrip[data-size="land"] .cl-mapstrip__note { display: none; }
@container cl-app (min-width: 840px) { .cl-mapstrip[data-size="pill"], .cl-mapstrip[data-size="land"] { inset-block-start: calc(var(--cl-top-bar-height-desktop) + var(--cl-space-8)); } }
.cl-mapstrip[data-keyboard="open"] { opacity: 0; pointer-events: none; }
.cl-mapstrip[data-size="hero"] .cl-mapstrip__art { box-shadow: inset 0 0 0 var(--cl-border-width-1) var(--cl-color-border); }

/* the drawing: every part is a class so dark mode follows the --cl-il-* roles */
.cl-mapstrip__sky { fill: var(--cl-il-duo-4); }
.cl-mapstrip__ground { fill: var(--cl-il-paper); }
.cl-mapstrip__hill { fill: var(--cl-il-hz-mid); }
.cl-mapstrip__hill--near { fill: var(--cl-il-hz-near); opacity: 0.55; }
.cl-mapstrip__horizon { fill: none; stroke: var(--cl-il-hz-far); stroke-width: 2; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__road-edge { fill: none; stroke: var(--cl-il-blue-soft); stroke-width: 12; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__road { fill: none; stroke: var(--cl-il-hz-road); stroke-width: 8; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__road--soft { stroke-dasharray: 10 8; }   /* lint-allow: SVG dash pattern in user units */
.cl-mapstrip__road-edge--soft { opacity: 0.5; }
.cl-mapstrip__trail { fill: none; stroke: var(--cl-il-blue-soft); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 6; }   /* lint-allow: SVG stroke and dash in user units */
.cl-mapstrip__pole { stroke: var(--cl-il-ink); stroke-width: 2; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__flag { fill: var(--cl-il-gold); stroke: var(--cl-il-ink); stroke-width: 1.25; stroke-linejoin: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__stone { fill: var(--cl-il-duo-2); stroke: var(--cl-il-ink); stroke-width: 1; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__foot { fill: var(--cl-il-ink); opacity: 0.5; }
.cl-mapstrip__post { stroke: var(--cl-il-ink); stroke-width: 1.5; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__board { fill: var(--cl-il-blue-pale); stroke: var(--cl-il-ink); stroke-width: 1.25; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__board--gold { fill: var(--cl-il-gold-pale); }
.cl-mapstrip__door { fill: var(--cl-il-duo-3); stroke: var(--cl-il-ink); stroke-width: 1.25; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__door-gap { fill: var(--cl-il-gold); }
.cl-mapstrip__tick { stroke: var(--cl-il-ink); stroke-width: 1.5; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__leaf { fill: var(--cl-il-leaf-a); stroke: var(--cl-il-ink); stroke-width: 1; }   /* lint-allow: SVG stroke width in user units */
.cl-mapstrip__leaf--b { fill: var(--cl-il-leaf-b); }
.cl-mapstrip__spark { fill: var(--cl-il-gold); }
.cl-mapstrip__pen { fill: none; stroke: var(--cl-il-gold); stroke-width: 2.5; stroke-linecap: round; }   /* lint-allow: SVG stroke width in user units */

/* motion: a new mark drops into its slot and settles once; at most two strokes draw at the same time (the order is the slot order) */
.cl-mapstrip__mark { transform-box: fill-box; transform-origin: center bottom; }
.cl-mapstrip__mark[data-new] { animation: cl-map-land var(--cl-motion-land) both; animation-delay: calc(var(--_i, 0) * var(--cl-motion-draw-stagger)); }
@keyframes cl-map-land { 0% { opacity: 0; transform: translateY(-40%) scale(0.6); } 70% { opacity: 1; transform: translateY(2%) scale(1.02); } 100% { opacity: 1; transform: none; } }
.cl-mapstrip__roadwrap[data-new] { animation: cl-reveal-x var(--cl-motion-draw-long) both; }
@keyframes cl-reveal-x { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* hero reveal (first result and the five end screens): road, then marks, then the pen circle; a tap sets data-reveal="done" */
.cl-mapstrip[data-reveal="run"] .cl-mapstrip__art { animation: cl-map-rise var(--cl-motion-enter) both; }
@keyframes cl-map-rise { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.cl-mapstrip[data-reveal="run"] .cl-mapstrip__roadwrap { animation: cl-reveal-x var(--cl-motion-draw-long) both; animation-delay: var(--cl-motion-reveal-step); }
.cl-mapstrip[data-reveal="run"] .cl-mapstrip__mark { animation: cl-map-land var(--cl-motion-land) both; animation-delay: calc(var(--cl-motion-reveal-step) * 2 + var(--_i, 0) * var(--cl-motion-draw-stagger)); }
.cl-mapstrip__pen { stroke-dasharray: 1; stroke-dashoffset: 0; }
.cl-mapstrip[data-reveal="run"] .cl-mapstrip__pen { stroke-dashoffset: 1; animation: cl-draw var(--cl-motion-draw-long) forwards; animation-delay: calc(var(--cl-motion-reveal-step) * 4); }
.cl-mapstrip[data-reveal="run"] .cl-mapstrip__note { animation: cl-st-fade var(--cl-motion-enter) both; animation-delay: calc(var(--cl-motion-reveal-step) * 5); }
.cl-mapstrip[data-reveal="done"] * { animation: none; }

/* the result primary pulses once when the reveal settles, never again */
.cl-button[data-pulse="once"] { animation: cl-pulse-once var(--cl-motion-pulse-once) both; animation-delay: calc(var(--cl-motion-reveal-step) * 5); }
@keyframes cl-pulse-once { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 40% { box-shadow: 0 0 0 var(--cl-space-8) var(--cl-color-focus-halo); } }

/* the screen swap: the bubble rises in, the widget follows one stagger step later */
.cl-quiz__step { animation: cl-st-enter-up var(--cl-motion-step) both; }
.cl-quiz__step > :nth-child(2) { animation: cl-st-enter-up var(--cl-motion-bubble) both; animation-delay: var(--cl-motion-draw-stagger); }

@media (prefers-reduced-motion: reduce) {
  .cl-mapstrip *, .cl-mapstrip .cl-mapstrip__art, .cl-button[data-pulse="once"], .cl-quiz__step, .cl-quiz__step > * { animation: none; transition: none; }
  .cl-mapstrip .cl-mapstrip__pen { stroke-dashoffset: 0; }
  .cl-mapstrip[data-size="land"] .cl-mapstrip__art, .cl-mapstrip[data-size="land"] .cl-mapstrip__caption { transform: none; }
}
@media (forced-colors: active) {
  .cl-mapstrip__art { forced-color-adjust: none; border: var(--cl-border-width-1) solid CanvasText; }
}

}
