/* profile-wk.css - GENERATED by scripts/build-css.sh. DO NOT EDIT: edit assets/profile/*.css and rebuild.
 * sources (in order):
 *   assets/profile/tokens.css
 *   assets/profile/base.css
 *   assets/profile/chrome.css
 *   assets/profile/components.css
 *   assets/profile/shell.css
 *   assets/profile/home.css
 *   assets/profile/learn.css
 *   assets/profile/library.css
 *   assets/profile/explore.css
 *   assets/profile/account.css
 * sha256 of sources: 5e188909d4ac8df8 */

/* ===== tokens.css ===== */
/* ==========================================================================
   tokens.css  -  Workspace design tokens (dark-first, light-ready)
   Owner: DESIGN-LEAD. Every colour literal in the whole stylesheet lives HERE.
   Prefix --wk-  (no clash with Bootstrap --bs-*, nor the legacy chrome names
   --primary-color etc. that chrome.css keeps for the shared nav).
   Contrast pairs are verified in scripts/contrast.py (WCAG 2.x, computed).
   Light theme: NOT shipped (site chrome is dark-only). To add it later, add ONE
   block  :root[data-wk-theme="light"] { ...same semantic names... }  and no
   component file needs to change, because components only read semantic tokens.
   ========================================================================== */
:root {
  color-scheme: dark;

  /* ---- surfaces (opaque, indigo-tinted; no blur needed) ---------------- */
  --wk-bg:           #0D0C1D;   /* page; equals site --bg-primary            */
  --wk-surface-1:    #141329;   /* cards, rail                                */
  --wk-surface-2:    #1B1A33;   /* raised: menus, inputs, popover base        */
  --wk-surface-3:    #252445;   /* hover on raised, selected row              */
  --wk-scrim:        rgba(5, 5, 15, 0.66);
  --wk-hover:        rgba(255, 255, 255, 0.04);
  --wk-press:        rgba(255, 255, 255, 0.07);

  /* ---- lines ------------------------------------------------------------ */
  --wk-line:         #2B2A4A;   /* card border (decorative, 1.4:1 on bg)      */
  --wk-line-strong:  #3A3960;   /* dividers on raised surfaces                */
  --wk-control-line: #6B6F8E;   /* input/checkbox border: 3.7:1 on surface-1 (WCAG 1.4.11) */

  /* ---- text (all AA on bg, surface-1, surface-2, surface-3) ------------- */
  --wk-text:         #F4F4FB;   /* 15.4:1 on surface-2                        */
  --wk-text-2:       #B6B9CC;   /* 8.7:1                                      */
  --wk-text-3:       #9296AE;   /* 5.8:1 (replaces old #6B7280 = 3.99, fail)  */
  --wk-text-on-accent: #FFFFFF; /* 5.7:1 on --wk-accent                       */

  /* ---- brand (site indigo -> violet; NOT the old blue/cyan) ------------- */
  --wk-accent:       #5B4EE8;   /* fills; white text 5.68:1                   */
  --wk-accent-hover: #4F46E5;   /* site --primary-color; white 6.29:1         */
  --wk-accent-press: #4338CA;
  --wk-accent-2:     #7C3AED;   /* site --secondary-color; gradient end only, never under small text */
  --wk-accent-text:  #B7AAFF;   /* accent as TEXT/icon on dark: 8.2:1 on surface-2 */
  --wk-accent-soft:  rgba(124, 108, 255, 0.14);
  --wk-accent-line:  rgba(124, 108, 255, 0.40);
  --wk-ring:         #A78BFA;   /* focus ring: 6.2:1 on surface-2 (needs 3:1) */
  --wk-ring-inner:   #0D0C1D;

  /* ---- status: ALWAYS paired with an icon + words, never colour alone --- */
  --wk-success:      #4ADE9C;   /* 9.8:1 on surface-2 */
  --wk-success-soft: rgba(74, 222, 156, 0.12);
  --wk-success-line: rgba(74, 222, 156, 0.35);
  --wk-warn:         #FBBF24;   /* 10.1:1 */
  --wk-warn-soft:    rgba(251, 191, 36, 0.12);
  --wk-warn-line:    rgba(251, 191, 36, 0.38);
  --wk-danger:       #FF8A8A;   /* 7.5:1 */
  --wk-danger-soft:  rgba(255, 138, 138, 0.12);
  --wk-danger-line:  rgba(255, 138, 138, 0.38);
  --wk-danger-fill:  #B91C1C;   /* destructive button fill; white 6.5:1 */
  --wk-danger-fill-hover: #991B1B;
  --wk-info:         #7DB7FF;   /* 8.1:1 */
  --wk-info-soft:    rgba(125, 183, 255, 0.12);
  --wk-info-line:    rgba(125, 183, 255, 0.35);

  /* ---- ambient (ONE static gradient; zero animation, zero blur) --------- */
  --wk-glow-1:       rgba(79, 70, 229, 0.16);
  --wk-glow-2:       rgba(167, 139, 250, 0.09);

  /* ---- type ------------------------------------------------------------- */
  --wk-font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wk-font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wk-fs-xs:   0.75rem;     /* 12  floor: nothing smaller                    */
  --wk-fs-sm:   0.8125rem;   /* 13                                            */
  --wk-fs-base: 0.875rem;    /* 14  default UI text                           */
  --wk-fs-md:   1rem;        /* 16                                            */
  --wk-fs-lg:   1.125rem;    /* 18  section title                             */
  --wk-fs-xl:   1.375rem;    /* 22  page title (phone)                        */
  --wk-fs-2xl:  1.75rem;     /* 28  page title (desktop)                      */
  --wk-fs-3xl:  2.25rem;     /* 36  first-run / big number                    */
  --wk-lh-tight: 1.2;
  --wk-lh-snug:  1.35;
  --wk-lh-base:  1.55;
  --wk-fw-regular: 400;
  --wk-fw-medium:  500;
  --wk-fw-semi:    600;       /* heaviest weight used; 700-900 are banned      */
  --wk-track-caps: 0.05em;

  /* ---- space (4px base) -------------------------------------------------- */
  --wk-s-0: 0;
  --wk-s-1: 0.25rem;   /*  4 */
  --wk-s-2: 0.5rem;    /*  8 */
  --wk-s-3: 0.75rem;   /* 12 */
  --wk-s-4: 1rem;      /* 16 */
  --wk-s-5: 1.25rem;   /* 20 */
  --wk-s-6: 1.5rem;    /* 24 */
  --wk-s-8: 2rem;      /* 32 */
  --wk-s-10: 2.5rem;   /* 40 */
  --wk-s-12: 3rem;     /* 48 */
  --wk-s-16: 4rem;     /* 64 */
  --wk-gutter: 1rem;   /* 16 phone; widened in base.css at 640/1024 */

  /* ---- shape ------------------------------------------------------------- */
  --wk-r-sm:   0.375rem;  /*  6 chips, inputs, buttons */
  --wk-r-md:   0.625rem;  /* 10 cards                  */
  --wk-r-lg:   0.875rem;  /* 14 dialogs, palette       */
  --wk-r-pill: 999px;
  --wk-hit:    2.75rem;   /* 44 minimum touch target   */
  --wk-hit-sm: 2.25rem;   /* 36 dense pointer:fine only */

  /* ---- elevation (dark: lightness + border, then shadow for overlays) ---- */
  --wk-shadow-pop:    0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --wk-shadow-dialog: 0 24px 64px rgba(0, 0, 0, 0.6),  0 0 0 1px rgba(255, 255, 255, 0.08);
  --wk-inset-top:     inset 0 1px 0 rgba(255, 255, 255, 0.10);  /* primary-button top light */

  /* ---- motion ------------------------------------------------------------ */
  --wk-dur-fast: 120ms;   /* hover / press                    */
  --wk-dur-base: 180ms;   /* expand / tab / toast in          */
  --wk-dur-slow: 240ms;   /* dialog / palette in              */
  --wk-dur-out:  160ms;   /* anything leaving                 */
  --wk-ease:     cubic-bezier(0.2, 0, 0, 1);
  --wk-skeleton-anim: wk-shimmer;   /* animation-name; set to none for reduced motion */
  --wk-skeleton-dur:  1400ms;
  --wk-spin-anim:     wk-spin;      /* spinner; none under reduced motion (a static arc + the word Loading remain) */

  /* ---- z-index scale (site nav = 50, site dropdowns <= 1001, Keeper = 2147483000) */
  --wk-z-rail:     10;
  --wk-z-header:   20;
  --wk-z-bottombar: 40;    /* below the site nav (50) so nav dropdowns win     */
  --wk-z-menu:     60;
  --wk-z-toast:    80;
  --wk-z-dialog:   90;     /* <dialog> is in the top layer anyway; this is for the non-modal fallback */

  /* ---- layout ------------------------------------------------------------ */
  --wk-nav-h:        4rem;      /* the site nav bar (64px); the banner above it scrolls away */
  --wk-anchor-offset: 5.5rem;   /* scroll-margin-top for every in-page target   */
  --wk-rail-w:       14.5rem;   /* 232 */
  --wk-content-max:  72.5rem;   /* 1160 */
  --wk-bottombar-h:  4rem;      /* 64, + safe-area inset */
  --wk-bp-sm: 640px;            /* documentation only: custom properties cannot be used in @media */
  --wk-bp-rail: 1024px;
  --wk-bp-wide: 1280px;
}

/* Reduced motion: durations collapse to ~0 and the skeleton stops shimmering.
   Components only ever read these tokens, so this needs no !important. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --wk-dur-fast: 0.01ms;
    --wk-dur-base: 0.01ms;
    --wk-dur-slow: 0.01ms;
    --wk-dur-out:  0.01ms;
    --wk-skeleton-anim: none;
    --wk-spin-anim: none;
  }
}

/* Forced colours (Windows High Contrast): map roles to system colours. */
@media (forced-colors: active) {
  :root {
    --wk-bg: Canvas;
    --wk-surface-1: Canvas;
    --wk-surface-2: Canvas;
    --wk-surface-3: Canvas;
    --wk-text: CanvasText;
    --wk-text-2: CanvasText;
    --wk-text-3: GrayText;
    --wk-line: CanvasText;
    --wk-line-strong: CanvasText;
    --wk-control-line: CanvasText;
    --wk-accent: Highlight;
    --wk-accent-hover: Highlight;
    --wk-accent-press: Highlight;
    --wk-accent-text: LinkText;
    --wk-text-on-accent: HighlightText;
    --wk-ring: Highlight;
    --wk-ring-inner: Canvas;
  }
}

/* ===== base.css ===== */
/* ==========================================================================
   base.css  -  workspace reset, typography, layout primitives, a11y utilities
   Everything is scoped under the root class  .wk  (the <div class="wk"> that
   wraps the workspace between the site nav and the site footer).  Nothing here
   targets html/body/nav/footer except the two documented exceptions at the
   bottom (smooth scroll; bottom-bar clearance).  Selectors inside .wk use
   :where() so they carry ZERO extra specificity and components always win.
   Bootstrap 5.1.1 coexistence: BS sets  a{color;underline}  a:hover{color}
   (0,1,1).  Rule for every component that can be an <a>: set colour on the
   base AND :hover/:focus-visible state (all are >= 0,2,0).
   ========================================================================== */

.wk {
  position: relative;
  min-height: 60vh;
  font-family: var(--wk-font);
  font-size: var(--wk-fs-base);
  font-weight: var(--wk-fw-regular);
  line-height: var(--wk-lh-base);
  color: var(--wk-text);
  background-color: var(--wk-bg);
  /* one static ambient gradient replaces the old fixed, blurred, animated blobs */
  background-image:
    radial-gradient(60rem 34rem at 0% -8%, var(--wk-glow-1), transparent 62%),
    radial-gradient(52rem 32rem at 100% 100%, var(--wk-glow-2), transparent 62%);
  background-repeat: no-repeat;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

.wk *,
.wk *::before,
.wk *::after { box-sizing: border-box; }

.wk :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre, fieldset) {
  margin: 0;
  padding: 0;
}
.wk :where(ul, ol) { list-style: none; }
.wk :where(h1, h2, h3, h4, h5, h6) {
  font-weight: var(--wk-fw-semi);
  line-height: var(--wk-lh-snug);
  color: var(--wk-text);
}
.wk :where(a) {
  color: inherit;
  text-decoration: none;
  transition: color var(--wk-dur-fast) var(--wk-ease);
}
.wk :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  margin: 0;
  letter-spacing: inherit;
}
.wk :where(button) {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  text-align: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.wk :where(button:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
.wk :where(img, svg, video) { display: block; max-width: 100%; }
.wk :where(img) { height: auto; }
.wk :where(table) { border-collapse: collapse; border-spacing: 0; }
.wk :where(label) { display: inline; margin: 0; }
.wk :where(hr) { border: 0; border-top: 1px solid var(--wk-line); margin: 0; opacity: 1; height: 0; }
.wk :where(summary) { cursor: pointer; }
.wk :where(kbd) { font-family: var(--wk-font-mono); }

/* [hidden] must beat any component display value */
.wk [hidden] { display: none; }

/* every in-page target clears the sticky site nav (64px) + 24px air */
.wk [id] { scroll-margin-top: var(--wk-anchor-offset); }

/* ---- focus ring: one rule, every interactive element ------------------ */
.wk :where(a, button, input, select, textarea, summary, [tabindex]):focus { outline: none; }
.wk :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--wk-ring);
  outline-offset: 2px;
}
.wk :where([tabindex="-1"]):focus-visible { outline: none; }   /* programmatic focus targets (headings) */
.wk :where(.wk-input, .wk-select):focus-visible { outline-offset: 0; }

/* ---- accessibility utilities ------------------------------------------ */
.wk-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.wk-skip {
  position: fixed;
  top: var(--wk-s-2);
  left: var(--wk-s-2);
  z-index: var(--wk-z-menu);
  display: inline-flex;
  align-items: center;
  min-height: var(--wk-hit);
  padding: 0 var(--wk-s-4);
  border-radius: var(--wk-r-sm);
  background: var(--wk-accent);
  color: var(--wk-text-on-accent);
  font-weight: var(--wk-fw-semi);
  transform: translateY(-200%);
  transition: transform var(--wk-dur-fast) var(--wk-ease);
}
.wk-skip:focus,
.wk-skip:focus-visible { transform: translateY(0); color: var(--wk-text-on-accent); }
.wk-skip:hover { color: var(--wk-text-on-accent); }

/* ---- typography -------------------------------------------------------- */
.wk-title {                                 /* page title (h1), once per page */
  font-size: var(--wk-fs-xl);
  line-height: var(--wk-lh-tight);
  font-weight: var(--wk-fw-semi);
  letter-spacing: -0.015em;
}
.wk-h2 {                                    /* section title */
  font-size: var(--wk-fs-lg);
  line-height: 1.3;
  font-weight: var(--wk-fw-semi);
  letter-spacing: -0.01em;
}
.wk-h3 {                                    /* card / dialog title */
  font-size: var(--wk-fs-md);
  line-height: var(--wk-lh-snug);
  font-weight: var(--wk-fw-semi);
}
.wk-kicker {                                /* the ONLY all-caps style */
  font-size: var(--wk-fs-xs);
  line-height: 1rem;
  font-weight: var(--wk-fw-medium);
  letter-spacing: var(--wk-track-caps);
  text-transform: uppercase;
  color: var(--wk-text-3);
}
.wk-text-sm   { font-size: var(--wk-fs-sm); line-height: 1.25rem; }
.wk-muted     { color: var(--wk-text-2); }
.wk-subtle    { color: var(--wk-text-3); }
.wk-num       { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.wk-mono      { font-family: var(--wk-font-mono); }
.wk-link {
  color: var(--wk-accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  border-radius: 2px;
}
.wk-link:hover,
.wk-link:focus-visible { color: var(--wk-text); text-decoration-thickness: 2px; }

.wk-truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
/* user-generated strings: mixed LTR/RTL, emoji, 250-char unbroken words */
.wk-user-text {
  unicode-bidi: plaintext;
  text-align: left;              /* keep the list edge stable for RTL strings (site is LTR) */
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ---- layout primitives ------------------------------------------------- */
.wk-shell {
  display: block;
  width: 100%;
  max-width: calc(var(--wk-content-max) + var(--wk-rail-w) + var(--wk-s-8) + 2 * var(--wk-gutter));
  margin-inline: auto;
  padding-inline: var(--wk-gutter);
}
.wk-main {
  min-width: 0;                              /* lets grids/truncation shrink */
  padding-block: var(--wk-s-6) var(--wk-s-12);
  display: flex;
  flex-direction: column;
  gap: var(--wk-s-10);
}
.wk-section { display: flex; flex-direction: column; gap: var(--wk-s-4); min-width: 0; }

.wk-stack   { display: flex; flex-direction: column; gap: var(--wk-stack-gap, var(--wk-s-4)); min-width: 0; }
.wk-stack--sm { --wk-stack-gap: var(--wk-s-2); }
.wk-stack--lg { --wk-stack-gap: var(--wk-s-6); }
.wk-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-cluster-gap, var(--wk-s-2)); min-width: 0; }
.wk-cluster--between { justify-content: space-between; }
.wk-cluster--end { justify-content: flex-end; }
.wk-cluster--nowrap { flex-wrap: nowrap; }
.wk-grow { flex: 1 1 auto; min-width: 0; }

/* 12-col-ish responsive grid: phone 1 col, >=768 2 cols, >=1024 the modifiers below */
.wk-grid { display: grid; gap: var(--wk-s-4); grid-template-columns: minmax(0, 1fr); min-width: 0; }
.wk-grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.wk-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); gap: var(--wk-s-3); }
.wk-grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
@media (min-width: 768px) {
  .wk-grid--2,
  .wk-grid--3,
  .wk-grid--7-5,
  .wk-grid--8-4,
  .wk-grid--5-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .wk-grid { gap: var(--wk-s-5); }
  .wk-grid--3   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wk-grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .wk-grid--8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .wk-grid--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.wk-span-all { grid-column: 1 / -1; }

.wk-divider { height: 1px; background: var(--wk-line); border: 0; margin: 0; }

/* gutters: 16 phone / 24 tablet / 32 desktop */
@media (min-width: 640px)  { :root { --wk-gutter: 1.5rem; } }
@media (min-width: 1024px) { :root { --wk-gutter: 2rem; } }

/* >=1024: rail + content */
@media (min-width: 1024px) {
  .wk-shell {
    display: grid;
    grid-template-columns: var(--wk-rail-w) minmax(0, 1fr);
    column-gap: var(--wk-s-8);
    align-items: start;
  }
  .wk-main { padding-block: var(--wk-s-8) var(--wk-s-16); gap: var(--wk-s-12); }
  .wk-title { font-size: var(--wk-fs-2xl); }
}

/* ---- coexistence with page-level things we do not own ------------------ */
/* (1) smooth in-page scrolling, only when the user has not asked for less motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* (2) below 1024 the fixed bottom bar must not cover the footer or Keeper */
@media (max-width: 1023.98px) {
  body:has(.wk-bottombar) {
    padding-bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px));
  }
  body:has(.wk-bottombar) .pk-root {
    bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
}

/* inline SVG sprite host (includes/profile/icons.php: wk_icon_sprite()) */
.wk-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ===== chrome.css ===== */
/* ==========================================================================
   chrome.css  -  VERBATIM legacy rules the SHARED site chrome still depends on.
   Why this file exists: render_navigation()/render_footer() do NOT ship the
   base nav/banner/mobile-menu CSS (verified: nav_functions.php inline <style>
   only adds toolbox/profile/notification extras). Every page's own stylesheet
   carries the .nav-container, .nav-content, the banner rules and the .mobile-menu rules, and the
   old profile1.css was where THIS page got them. Dropping them would unstyle
   the site nav. Source: backup-before/profile1.css lines 1-54, 132-411,
   733-887 (nav parts only), 888-960 (legacy + .button used by nav auth buttons).
   OWNER: SHELL. Allowed to contain colour literals and !important (allow-list).
   Do not add workspace styling here. When SHELL has a pixel-diff of nav+footer
   proving a rule is unused, delete it; do not "modernise" it.
   Deliberate omissions vs the old file (each is a behaviour change to verify):
   - html,body{overflow-x:hidden}  (masked real overflow; we want it visible)
   - body::before/::after animated fixed aurora blobs (replaced by .wk gradient)
   ========================================================================== */
:root {
  --primary-color: #4F46E5;
  --secondary-color: #7C3AED;
  --accent-primary: #A78BFA;
  
  /* Dark theme colors - matching main theme */
  --bg-primary: #0D0C1D;
  --bg-secondary: #1A1A2E;
  --surface-glass: rgba(255, 255, 255, 0.05);
  --surface-glass-hover: rgba(255, 255, 255, 0.08);
  
  /* Text colors */
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --text-headings: #E5E7EB;
  
  /* Borders and dividers */
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-hover: rgba(255, 255, 255, 0.2);
  
  /* Component backgrounds */
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-bg-hover: rgba(255, 255, 255, 0.06);
  --dropdown-bg: #0D0C1D;
  
  /* Additional colors for compatibility */
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  
  /* Transitions */
  --transition-speed: 0.3s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
}


/* --- base (from old section 2, minus overflow-x + aurora) --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
}
a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover {
  color: var(--accent-primary);
}

/* --- Reboot parity (SHELL) -------------------------------------------------------------------------------------------
   The site nav, footer, Keeper, the notification panel and the legacy feedback modal were written against Bootstrap 5.1.1
   "Reboot" and only look right with it. Measured (tests/shell/styldiff.mjs + chromecmp2.mjs): without Bootstrap the nav buttons
   fall back to Arial 13.33px / line-height normal, the notification error state loses its <p> margin (panel 16px shorter), the
   footer logo gains 7px (img baseline gap), headings/hr change, text-size-adjust becomes auto. These are the Reboot rules that
   matter for that chrome, reproduced from bootstrap@5.1.1 so Bootstrap CSS and JS can be dropped (docs/11-shell.md section 2).
   Selectors are element selectors (0,0,1): inside .wk they lose to base.css `.wk :where(...)` resets, so the workspace is unaffected.
   a{color}, body colours and .container/.row/.btn/... are NOT reproduced (chrome sets its own; the workspace does not use them). */
body { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
hr { margin: 1rem 0; color: inherit; background-color: currentColor; border: 0; opacity: 0.25; }
hr:not([size]) { height: 1px; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.5rem; font-weight: 500; line-height: 1.2; }
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
@media (min-width: 1200px) { h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.75rem; } h4 { font-size: 1.5rem; } }
p { margin-top: 0; margin-bottom: 1rem; }
abbr[title] { text-decoration: underline dotted; cursor: help; text-decoration-skip-ink: none; }
address { margin-bottom: 1rem; font-style: normal; line-height: inherit; }
ol, ul { padding-left: 2rem; }
ol, ul, dl { margin-top: 0; margin-bottom: 1rem; }
ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; }
dt { font-weight: 700; }
dd { margin-bottom: 0.5rem; margin-left: 0; }
blockquote { margin: 0 0 1rem; }
b, strong { font-weight: bolder; }
small { font-size: 0.875em; }
mark { padding: 0.2em; background-color: #fcf8e3; }
sub, sup { position: relative; font-size: 0.75em; line-height: 0; vertical-align: baseline; }
sub { bottom: -0.25em; }
sup { top: -0.5em; }
pre, code, kbd, samp { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 1em; direction: ltr; unicode-bidi: bidi-override; }
code { font-size: 0.875em; color: #d63384; word-wrap: break-word; }
a > code { color: inherit; }
kbd { padding: 0.2rem 0.4rem; font-size: 0.875em; color: #fff; background-color: #212529; border-radius: 0.2rem; }
kbd kbd { padding: 0; font-size: 1em; font-weight: 700; }
pre { display: block; margin-top: 0; margin-bottom: 1rem; overflow: auto; font-size: 0.875em; }
figure { margin: 0 0 1rem; }
img, svg { vertical-align: middle; }
table { caption-side: bottom; border-collapse: collapse; }
caption { padding-top: 0.5rem; padding-bottom: 0.5rem; text-align: left; }
th { text-align: inherit; text-align: -webkit-match-parent; }
thead, tbody, tfoot, tr, td, th { border-color: inherit; border-style: solid; border-width: 0; }
label { display: inline-block; }
button { border-radius: 0; }
button:focus:not(:focus-visible) { outline: 0; }
input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button, select { text-transform: none; }
[role="button"] { cursor: pointer; }
select { word-wrap: normal; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; }
button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) { cursor: pointer; }
::-webkit-datetime-edit-fields-wrapper, ::-webkit-datetime-edit-text, ::-webkit-datetime-edit-minute, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-year-field { padding: 0; }
::-webkit-inner-spin-button { height: auto; }
[type="search"] { outline-offset: -2px; -webkit-appearance: textfield; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-color-swatch-wrapper { padding: 0; }
::-webkit-file-upload-button { font: inherit; -webkit-appearance: button; }
textarea { resize: vertical; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 0.5rem; font-size: calc(1.275rem + 0.3vw); line-height: inherit; }
legend + * { clear: left; }
::file-selector-button { font: inherit; }
output { display: inline-block; }
iframe { border: 0; }
summary { display: list-item; cursor: pointer; }
progress { vertical-align: baseline; }
[hidden] { display: none !important; }

/* ==========================================================================
   3. BANNER COMPONENT
   ========================================================================== */
.banner-container {
  width: 100%;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.banner-content {
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.banner-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
  text-align: center;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

.banner-link:hover {
  opacity: 0.9;
  color: var(--text-primary);
}

/* ==========================================================================
   4. NAVIGATION & MOBILE MENU (Inherited from main theme)
   ========================================================================== */
.nav-container {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: 4rem;
}

.nav-links { display: none; }
.auth-buttons { display: none; }

.nav-link {
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.nav-link:hover {
  background-color: var(--surface-glass-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--surface-glass-hover);
  border: 1px solid var(--border-glass);
}

.nav-item.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle { cursor: pointer; }

.dropdown-arrow {
  margin-left: 0.4em;
  font-size: 0.7em;
  transition: transform var(--transition-speed) ease;
  display: inline-block;
  vertical-align: middle;
}

.nav-dropdown-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 0.5rem 0;
  background: var(--dropdown-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  pointer-events: none;
  transition: opacity var(--transition-speed) ease,
              visibility var(--transition-speed) ease,
              transform var(--transition-speed) ease;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-item {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus,
.nav-dropdown-item.active {
  background-color: var(--surface-glass-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-menu-button {
  display: block;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity var(--transition-speed);
  z-index: 51;
}

.mobile-menu-button:hover { opacity: 0.8; }

.mobile-menu {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  backdrop-filter: blur(12px);
  padding: 1rem 0;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform var(--transition-speed) ease-out;
  z-index: 49;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  transform: translateY(0);
  display: block;
}

.mobile-menu .nav-link:not(.sub-link),
.mobile-menu .mobile-submenu-toggle {
  display: block;
  padding: 0.9rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  text-decoration: none;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  color: var(--text-primary);
}

.mobile-menu > *:not(.mobile-menu-section):not(.auth-buttons-mobile):last-of-type {
  border-bottom: none;
}

.mobile-menu .mobile-menu-section:last-of-type > .mobile-submenu-toggle {
  border-bottom: none;
}

.mobile-submenu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-submenu-toggle .dropdown-arrow {
  transition: transform var(--transition-speed) ease;
  font-size: 0.9em;
}

.mobile-submenu-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.mobile-submenu {
  background-color: rgba(0, 0, 0, 0.1);
  padding-left: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.mobile-submenu .sub-link {
  display: block;
  padding: 0.75rem 1.5rem 0.75rem 2.5rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.mobile-submenu .sub-link:last-child { border-bottom: none; }

.mobile-submenu .sub-link:hover,
.mobile-submenu .sub-link.active {
  background-color: var(--surface-glass);
  color: var(--text-primary);
}

.mobile-menu .auth-buttons-mobile {
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
  margin-top: 1rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-bottom: 1rem;
}

.auth-buttons-mobile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
}

.nav-logo-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0.25rem 0;
  margin-right: 1rem;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  max-height: calc(100% - 0.5rem);
  transition: height var(--transition-speed) ease;
  display: block;
}


/* --- responsive: nav + banner parts only (old section 8) --- */
@media (max-width: 640px) {
  .banner-link {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
}
@media (max-width: 859px) {
  .nav-links,
  .auth-buttons {
    display: none;
  }
  .mobile-menu-button {
    display: block;
    margin-left: auto;
  }
  .nav-container {
    height: 4rem;
  }
  .mobile-menu {
    top: 3.5rem;
    max-height: calc(100vh - 3.5rem);
  }
  .nav-logo-img {
    height: 64px;
  }
  .nav-logo-link {
    margin-right: 0.5rem;
  }
}
@media (min-width: 860px) {
  .mobile-menu-button {
    display: none;
  }
  .mobile-menu {
    display: none !important;
  }
  .nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    margin-right: auto;
  }
  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  .auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
  }
  .nav-content {
    height: 4rem;
  }
  .nav-logo-img {
    height: 64px;
  }
  .nav-logo-link {
    margin-right: 1rem;
  }
}
@media (min-width: 1024px) {
  .nav-links {
    gap: 1rem;
  }
  .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
  .auth-buttons {
    gap: 0.75rem;
  }
}
@media (min-width: 1280px) {
  .nav-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .nav-links {
    gap: 1.5rem;
  }
}

/* ==========================================================================
   9. LEGACY COMPATIBILITY (for any remaining elements)
   ========================================================================== */
.profile-menu {
  background: var(--secondary-color) !important;
}

.profile-item.logout {
  color: var(--text-primary) !important;
}

.profile-icon, .submit-icon {
  width: 2.5rem !important;
  padding: 10px !important;
}

/* ==========================================================================
   5. BUTTONS - Consistent with main theme
   ========================================================================== */
.button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  text-decoration: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-primary);
  border: 1px solid transparent;
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
  color: var(--text-primary);
}

.button-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.button-outline:hover {
  background: var(--surface-glass-hover);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}

/* Navigation specific button styling */
.auth-buttons .button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
}

/* Mobile auth buttons */
.auth-buttons-mobile .button {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
}


/* --- legacy workspace rules that shaped the SHARED nav (verbatim from the old profile1.css; lost in the round-1 split) ---------------
   Round-1 critic L1/L2: without them the profile dropdown was 2px wider / 14px shorter and nav pills gained 0.19px letter-spacing
   compared with the live page. .plan-badge (old lines 615-623) sits under nav_functions' own inline .plan-badge rule; the
   letter-spacing reset is old line 964. */
.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.workspace-home .plan-badge,
.workspace-home .nav-item-pill {
  letter-spacing: 0;
}

/* ===== components.css ===== */
/* ==========================================================================
   components.css  -  the Workspace component library (prefix wk-, BEM-ish)
   Owner: DESIGN-LEAD.  Surfaces (shell/home/learn/library/explore/account)
   compose these; they add layout, not new looks.  Rules that hold everywhere:
   - colour comes only from tokens.css; no !important; no colour literals
   - every interactive target is >= 44px in its smaller dimension
   - hover/press = colour/border only (no lift, no scale); 120ms
   - status is never colour alone (icon + words)
   - every anchor-capable component sets colour on base AND :hover (BS a:hover)
   Sections: 1 icon . 2 button . 3 card . 4 section head . 5 stat/meter/progress
   6 badge/chip/status . 7 list row . 8 empty . 9 tabs . 10 form . 11 menu
   12 banner . 13 toast . 14 dialog . 15 palette . 16 skeleton . 17 plan card
   18 checklist . 19 resume/thumb/avatar . 20 shell foundation (rail, bottom bar,
   page header) . 21 keyframes . 22 forced-colors
   ========================================================================== */

/* ---- 1. icon ------------------------------------------------------------ */
.wk-icon {
  display: inline-block;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.wk-icon--sm { width: 1rem; height: 1rem; }
.wk-icon--lg { width: 1.5rem; height: 1.5rem; }
.wk-icon--xl { width: 2rem; height: 2rem; stroke-width: 1.25; }

/* ---- 2. button ----------------------------------------------------------
   <button class="wk-btn wk-btn--primary">  <a class="wk-btn wk-btn--secondary">
   sizes: default 44 | --sm (36px painted, 44px hit) | --icon (44 square)
   states: :hover :active :focus-visible [disabled]/[aria-disabled=true] [aria-busy=true] */
.wk-btn {
  --_bg: transparent;
  --_bg-hover: var(--wk-hover);
  --_bg-press: var(--wk-press);
  --_fg: var(--wk-text);
  --_ring: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wk-s-2);
  min-height: var(--wk-hit);
  min-width: var(--wk-hit);
  padding: 0 var(--wk-s-4);
  border: 1px solid transparent;
  border-radius: var(--wk-r-sm);
  background-color: var(--_bg);
  box-shadow: inset 0 0 0 1px var(--_ring);
  color: var(--_fg);
  font-size: var(--wk-fs-base);
  font-weight: var(--wk-fw-semi);
  line-height: 1.25rem;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--wk-dur-fast) var(--wk-ease),
    box-shadow var(--wk-dur-fast) var(--wk-ease),
    color var(--wk-dur-fast) var(--wk-ease);
}
.wk-btn:hover { background-color: var(--_bg-hover); color: var(--_fg); }
.wk-btn:active { background-color: var(--_bg-press); color: var(--_fg); }
.wk-btn .wk-icon { width: 1.125rem; height: 1.125rem; }

.wk-btn--primary {
  --_bg: var(--wk-accent);
  --_bg-hover: var(--wk-accent-hover);
  --_bg-press: var(--wk-accent-press);
  --_fg: var(--wk-text-on-accent);
  box-shadow: var(--wk-inset-top);
}
.wk-btn--secondary {
  --_bg: var(--wk-surface-2);
  --_bg-hover: var(--wk-surface-3);
  --_bg-press: var(--wk-surface-3);
  --_ring: var(--wk-line-strong);
}
.wk-btn--ghost { --_fg: var(--wk-text-2); }
.wk-btn--ghost:hover,
.wk-btn--ghost:active { --_fg: var(--wk-text); }
.wk-btn--danger {
  --_bg: var(--wk-danger-fill);
  --_bg-hover: var(--wk-danger-fill-hover);
  --_bg-press: var(--wk-danger-fill-hover);
  --_fg: var(--wk-text-on-accent);
}
.wk-btn--danger-quiet {                       /* destructive but not the main action */
  --_fg: var(--wk-danger);
  --_ring: var(--wk-danger-line);
  --_bg-hover: var(--wk-danger-soft);
  --_bg-press: var(--wk-danger-soft);
}

/* small: 36px painted inside a 44px hit box (transparent border + padding-box clip) */
.wk-btn--sm {
  padding: 0 var(--wk-s-3);
  border-block-width: 4px;
  background-clip: padding-box;
  font-size: var(--wk-fs-sm);
  border-radius: var(--wk-r-sm);
}
.wk-btn--icon { padding: 0; width: var(--wk-hit); }
.wk-btn--block { display: flex; width: 100%; }

.wk-btn[disabled],
.wk-btn[aria-disabled="true"] {
  --_bg: var(--wk-surface-2);
  --_bg-hover: var(--wk-surface-2);
  --_bg-press: var(--wk-surface-2);
  --_fg: var(--wk-text-3);
  --_ring: var(--wk-line);
  box-shadow: inset 0 0 0 1px var(--_ring);
  cursor: not-allowed;
}
/* loading: keep the label (layout stable), add a ring; pointer events off */
.wk-btn[aria-busy="true"] { pointer-events: none; }
.wk-btn[aria-busy="true"]::after {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  animation: var(--wk-spin-anim) 800ms linear infinite;
}

/* text-only link that still has a 44px hit area */
.wk-linkbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--wk-s-1);
  min-height: var(--wk-hit);
  padding-inline: var(--wk-s-1);
  color: var(--wk-accent-text);
  font-size: var(--wk-fs-sm);
  font-weight: var(--wk-fw-semi);
  border-radius: var(--wk-r-sm);
}
.wk-linkbtn:hover,
.wk-linkbtn:active { color: var(--wk-text); }
.wk-linkbtn .wk-icon { width: 1rem; height: 1rem; }

/* ---- 3. card -------------------------------------------------------------
   <section class="wk-card"><header class="wk-card__head"><h3 class="wk-card__title">..</h3>
   <div class="wk-card__action">..</div></header><div class="wk-card__body">..</div>
   <footer class="wk-card__foot">..</footer></section>
   modifiers: --raised --accent --flush (no body padding; for lists) --interactive
   --warn --danger */
.wk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--wk-surface-1);
  border: 1px solid var(--wk-line);
  border-radius: var(--wk-r-md);
  color: var(--wk-text);
}
.wk-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wk-s-3);
  min-height: 3.5rem;
  padding: var(--wk-s-2) var(--wk-s-5);
}
.wk-card__title {
  min-width: 0;
  font-size: var(--wk-fs-md);
  line-height: var(--wk-lh-snug);
  font-weight: var(--wk-fw-semi);
}
.wk-card__action { display: flex; align-items: center; gap: var(--wk-s-2); flex: none; }
.wk-card__body { padding: var(--wk-s-5); min-width: 0; flex: 1 1 auto; }
.wk-card__head + .wk-card__body { padding-top: var(--wk-s-1); }
.wk-card__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--wk-s-2);
  padding: var(--wk-s-3) var(--wk-s-5);
  border-top: 1px solid var(--wk-line);
}
.wk-card--flush > .wk-card__body { padding: 0; }
.wk-card--raised { background-color: var(--wk-surface-2); }
.wk-card--accent {
  background-color: var(--wk-surface-1);
  background-image: linear-gradient(135deg, var(--wk-accent-soft), transparent 55%);
  border-color: var(--wk-accent-line);
}
.wk-card--warn   { border-color: var(--wk-warn-line); }
.wk-card--danger { border-color: var(--wk-danger-line); }
.wk-card--interactive {
  transition: border-color var(--wk-dur-fast) var(--wk-ease), background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-card--interactive:hover { border-color: var(--wk-line-strong); background-color: var(--wk-surface-2); }
/* one whole-card link without nesting interactive content in <a> */
.wk-card__link { display: flex; align-items: center; min-height: var(--wk-hit); color: inherit; }
.wk-card__link:hover { color: inherit; }
.wk-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wk-card__link:focus-visible { outline: none; }
.wk-card__link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: 2px; }

/* ---- 4. section header --------------------------------------------------- */
.wk-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--wk-s-2) var(--wk-s-4);
  min-width: 0;
}
.wk-section-head__text { min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-1); }
.wk-section-head__desc { color: var(--wk-text-2); font-size: var(--wk-fs-base); max-width: 60ch; }
.wk-section-head__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--wk-s-2); }

/* ---- 5. stat / meter / progress ------------------------------------------ */
.wk-stat { display: flex; flex-direction: column; gap: var(--wk-s-1); min-width: 0; }
.wk-stat__label { font-size: var(--wk-fs-sm); color: var(--wk-text-2); line-height: 1.25rem; }
.wk-stat__value {
  font-size: var(--wk-fs-xl);
  line-height: 1.2;
  font-weight: var(--wk-fw-semi);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--wk-text);
}
.wk-stat__value--lg { font-size: var(--wk-fs-3xl); }
.wk-stat__unit { font-size: var(--wk-fs-base); font-weight: var(--wk-fw-regular); color: var(--wk-text-2); letter-spacing: 0; margin-inline-start: 0.25rem; }
.wk-stat__hint { font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-stat-row { display: grid; gap: var(--wk-s-4); grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }

/* meter: usage against a limit.  role=meter is the semantic (value inside a known range).
   <div class="wk-meter" data-level="ok|warn|full" style="--wk-pct:70">
     <div class="wk-meter__head"><span class="wk-meter__label" id="m1">Bookmarks</span>
       <span class="wk-meter__value wk-num">7 of 10</span></div>
     <div class="wk-meter__track" role="meter" aria-labelledby="m1" aria-valuemin="0" aria-valuemax="10" aria-valuenow="7" aria-valuetext="7 of 10 used"><span class="wk-meter__fill"></span></div>
     <p class="wk-meter__note">icon + words when warn/full</p></div> */
.wk-meter { --_fill: var(--wk-accent-text); display: flex; flex-direction: column; gap: var(--wk-s-2); min-width: 0; }
.wk-meter[data-level="warn"] { --_fill: var(--wk-warn); }
.wk-meter[data-level="full"] { --_fill: var(--wk-danger); }
.wk-meter__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--wk-s-3); font-size: var(--wk-fs-sm); }
.wk-meter__label { color: var(--wk-text-2); min-width: 0; }
.wk-meter__value { color: var(--wk-text); font-weight: var(--wk-fw-medium); white-space: nowrap; }
.wk-meter__track,
.wk-progress {
  position: relative;
  height: 0.375rem;
  border-radius: var(--wk-r-pill);
  background-color: var(--wk-surface-3);
  overflow: hidden;
}
.wk-meter__fill,
.wk-progress__fill {
  display: block;
  height: 100%;
  width: calc(var(--wk-pct, 0) * 1%);
  border-radius: inherit;
  background-color: var(--_fill, var(--wk-accent-text));
  transition: width var(--wk-dur-slow) var(--wk-ease);
}
.wk-meter__note {
  display: flex; align-items: center; gap: var(--wk-s-2);
  font-size: var(--wk-fs-sm); color: var(--_fill);
}
.wk-meter__note .wk-icon { width: 1rem; height: 1rem; }
.wk-progress { height: 0.25rem; }
.wk-progress--done { --_fill: var(--wk-success); }

/* ---- 6. badge / chip / status --------------------------------------------- */
.wk-badge {
  --_fg: var(--wk-text-2);
  --_bg: var(--wk-surface-2);
  --_line: var(--wk-line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.375rem;
  padding: 0 var(--wk-s-2);
  border: 1px solid var(--_line);
  border-radius: var(--wk-r-pill);
  background-color: var(--_bg);
  color: var(--_fg);
  font-size: var(--wk-fs-xs);
  font-weight: var(--wk-fw-medium);
  line-height: 1rem;
  white-space: nowrap;
}
.wk-badge .wk-icon { width: 0.875rem; height: 0.875rem; }
.wk-badge--accent  { --_fg: var(--wk-accent-text); --_bg: var(--wk-accent-soft);  --_line: var(--wk-accent-line); }
.wk-badge--success { --_fg: var(--wk-success);     --_bg: var(--wk-success-soft); --_line: var(--wk-success-line); }
.wk-badge--warn    { --_fg: var(--wk-warn);        --_bg: var(--wk-warn-soft);    --_line: var(--wk-warn-line); }
.wk-badge--danger  { --_fg: var(--wk-danger);      --_bg: var(--wk-danger-soft);  --_line: var(--wk-danger-line); }
.wk-badge--info    { --_fg: var(--wk-info);        --_bg: var(--wk-info-soft);    --_line: var(--wk-info-line); }
/* plan chip: text is always the plan name */
.wk-plan-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  min-height: 1.5rem; padding: 0 var(--wk-s-3);
  border-radius: var(--wk-r-pill);
  border: 1px solid var(--wk-line-strong);
  background-color: var(--wk-surface-2);
  color: var(--wk-text-2);
  font-size: var(--wk-fs-xs); font-weight: var(--wk-fw-semi); line-height: 1rem; letter-spacing: 0.01em;
}
.wk-plan-chip--basic { color: var(--wk-info); border-color: var(--wk-info-line); background-color: var(--wk-info-soft); }
.wk-plan-chip--pro   { color: var(--wk-accent-text); border-color: var(--wk-accent-line); background-color: var(--wk-accent-soft); }
.wk-plan-chip--warn  { color: var(--wk-warn); border-color: var(--wk-warn-line); background-color: var(--wk-warn-soft); }
.wk-plan-chip .wk-icon { width: 0.875rem; height: 0.875rem; }

/* submission status: icon is mandatory in markup (clock / check-circle / x-circle / pencil) */
.wk-status {
  display: inline-flex; align-items: center; gap: 0.25rem;
  min-height: 1.375rem; padding: 0 var(--wk-s-2);
  border: 1px solid var(--wk-line-strong); border-radius: var(--wk-r-pill);
  background-color: var(--wk-surface-2); color: var(--wk-text-2);
  font-size: var(--wk-fs-xs); font-weight: var(--wk-fw-medium); line-height: 1rem; white-space: nowrap;
}
.wk-status .wk-icon { width: 0.875rem; height: 0.875rem; }
.wk-status--pending  { color: var(--wk-warn);    background-color: var(--wk-warn-soft);    border-color: var(--wk-warn-line); }
.wk-status--approved { color: var(--wk-success); background-color: var(--wk-success-soft); border-color: var(--wk-success-line); }
.wk-status--rejected { color: var(--wk-danger);  background-color: var(--wk-danger-soft);  border-color: var(--wk-danger-line); }
.wk-status--draft    { color: var(--wk-text-2); }

/* filter chip (toggle button, aria-pressed).  44px hit, 32px painted */
.wk-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--wk-s-1);
  justify-content: center;
  min-height: var(--wk-hit);
  min-width: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  border-block: 0.375rem solid transparent;
  border-inline: 0;
  border-radius: var(--wk-r-pill);
  background-clip: padding-box;
  background-color: var(--wk-surface-2);
  box-shadow: inset 0 0 0 1px var(--wk-line-strong);
  color: var(--wk-text-2);
  font-size: var(--wk-fs-sm);
  font-weight: var(--wk-fw-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease), box-shadow var(--wk-dur-fast) var(--wk-ease);
}
.wk-chip:hover { background-color: var(--wk-surface-3); color: var(--wk-text); }
.wk-chip[aria-pressed="true"] {
  background-color: var(--wk-accent-soft);
  box-shadow: inset 0 0 0 1px var(--wk-accent-line);
  color: var(--wk-text);
}
.wk-chip .wk-icon { width: 1rem; height: 1rem; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 0 var(--wk-s-2); }

.wk-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
  border: 1px solid var(--wk-line-strong); border-radius: 0.25rem;
  background-color: var(--wk-surface-3);
  color: var(--wk-text-2);
  font-family: var(--wk-font-mono); font-size: var(--wk-fs-xs); line-height: 1;
}

/* ---- 7. list row ---------------------------------------------------------
   <ul class="wk-list"><li class="wk-row">
     <span class="wk-row__icon">icon</span>
     <div class="wk-row__main"><a class="wk-row__link" href><span class="wk-row__title wk-user-text">Title</span>
        <span class="wk-row__meta">meta</span></a></div>
     <div class="wk-row__trail">badge/time</div>
     <div class="wk-row__actions"><button class="wk-btn wk-btn--ghost wk-btn--icon">..</button></div>
   </li></ul>
   The link (title + meta INSIDE it, so its own box is >= 44px tall) stretches over the whole
   row (::after) so the row is one target and buttons in .wk-row__actions (z-index 1) stay separate valid targets. */
.wk-list { display: flex; flex-direction: column; min-width: 0; }
.wk-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--wk-s-3);
  min-height: 3.5rem;
  padding: var(--wk-s-2) var(--wk-s-4);
  border-top: 1px solid var(--wk-line);
  transition: background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-list > .wk-row:first-child { border-top: 0; }
.wk-row:hover { background-color: var(--wk-hover); }
.wk-row__icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--wk-r-sm);
  background-color: var(--wk-surface-2);
  border: 1px solid var(--wk-line);
  color: var(--wk-text-2);
}
.wk-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.wk-row__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: var(--wk-hit);
  color: var(--wk-text);
}
.wk-row__title {
  display: block;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: var(--wk-fw-medium);
  line-height: 1.375rem;
}
.wk-row__link:hover { color: var(--wk-text); }
.wk-row__link::after { content: ""; position: absolute; inset: 0; }
.wk-row__link:focus-visible { outline: none; }
.wk-row__link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: -2px; border-radius: var(--wk-r-sm); }
.wk-row__meta {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--wk-fs-sm); color: var(--wk-text-3); line-height: 1.25rem;
}
.wk-row__meta--wrap { white-space: normal; }
.wk-row__trail { flex: none; display: flex; align-items: center; gap: var(--wk-s-2); font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-row__actions { position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 0; margin-inline-end: calc(var(--wk-s-2) * -1); }
.wk-row--thumb .wk-row__icon { width: 3rem; height: 3rem; overflow: hidden; padding: 0; }
.wk-row--thumb .wk-row__icon img { width: 100%; height: 100%; object-fit: cover; }
.wk-row--compact { min-height: var(--wk-hit); padding-block: var(--wk-s-1); }
/* opt-in: hide actions until hover/focus on hover-capable pointers (never on touch) */
@media (hover: hover) {
  .wk-row--reveal .wk-row__actions { opacity: 0; transition: opacity var(--wk-dur-fast) var(--wk-ease); }
  .wk-row--reveal:hover .wk-row__actions,
  .wk-row--reveal:focus-within .wk-row__actions { opacity: 1; }
}
@media (max-width: 479.98px) {
  .wk-row__trail--hide-sm { display: none; }
}

/* ---- 8. empty state -------------------------------------------------------
   <div class="wk-empty"><span class="wk-empty__icon">icon</span><h3 class="wk-empty__title">..</h3>
   <p class="wk-empty__text">..</p><div class="wk-empty__actions">ONE primary button</div></div>
   variants: --boxed (dashed frame) --error --locked --filtered */
.wk-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--wk-s-2);
  padding: var(--wk-s-8) var(--wk-s-5);
  min-width: 0;
}
.wk-empty--boxed { border: 1px dashed var(--wk-line-strong); border-radius: var(--wk-r-md); }
.wk-empty__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; margin-bottom: var(--wk-s-1);
  border-radius: var(--wk-r-pill);
  background-color: var(--wk-surface-2);
  border: 1px solid var(--wk-line);
  color: var(--wk-text-2);
}
.wk-empty__icon .wk-icon { width: 1.375rem; height: 1.375rem; }
.wk-empty__title { font-size: var(--wk-fs-md); font-weight: var(--wk-fw-semi); }
.wk-empty__text { max-width: 38ch; color: var(--wk-text-2); }
.wk-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--wk-s-2); margin-top: var(--wk-s-3); }
.wk-empty--error .wk-empty__icon  { color: var(--wk-danger); border-color: var(--wk-danger-line); background-color: var(--wk-danger-soft); }
.wk-empty--locked .wk-empty__icon { color: var(--wk-accent-text); border-color: var(--wk-accent-line); background-color: var(--wk-accent-soft); }
.wk-empty--first .wk-empty__icon  { color: var(--wk-accent-text); border-color: var(--wk-accent-line); background-color: var(--wk-accent-soft); }

/* ---- 9. tabs / segmented control ------------------------------------------
   WAI-ARIA tabs: role=tablist > button[role=tab][aria-selected][aria-controls][tabindex=0|-1]
   + [role=tabpanel][aria-labelledby][tabindex=0].  Arrow Left/Right, Home, End move
   AND select (automatic activation); JS lives in profile-shell.js (data-wk-tabs).
   Deep link: #<panel id> opens that tab. */
.wk-tabs {
  display: flex;
  gap: var(--wk-s-1);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--wk-line);
}
.wk-tabs::-webkit-scrollbar { display: none; }
.wk-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--wk-s-2);
  flex: none;
  min-height: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  color: var(--wk-text-2);
  font-size: var(--wk-fs-base);
  font-weight: var(--wk-fw-medium);
  white-space: nowrap;
  border-radius: var(--wk-r-sm) var(--wk-r-sm) 0 0;
  transition: color var(--wk-dur-fast) var(--wk-ease), background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-tab:hover { color: var(--wk-text); background-color: var(--wk-hover); }
.wk-tab[aria-selected="true"] { color: var(--wk-text); }
.wk-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: var(--wk-s-3); right: var(--wk-s-3); bottom: -1px;
  height: 2px; border-radius: 2px; background-color: var(--wk-accent-text);
}
.wk-tab__count {
  min-width: 1.25rem; padding: 0 0.375rem; border-radius: var(--wk-r-pill);
  background-color: var(--wk-surface-3); color: var(--wk-text-2);
  font-size: var(--wk-fs-xs); line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums;
}
.wk-tab[aria-selected="true"] .wk-tab__count { background-color: var(--wk-accent-soft); color: var(--wk-accent-text); }
.wk-tabs--segmented {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 0 0.25rem; gap: 0.25rem;
  border: 1px solid var(--wk-line); border-radius: var(--wk-r-md);
  background-color: var(--wk-surface-1);
}
/* painted 36px inside a 44px hit box: transparent block border + padding-box clip */
.wk-tabs--segmented .wk-tab { border-radius: var(--wk-r-sm); border-block: 0.25rem solid transparent; background-clip: padding-box; }
.wk-tabs--segmented .wk-tab[aria-selected="true"] { background-color: var(--wk-surface-3); }
.wk-tabs--segmented .wk-tab[aria-selected="true"]::after { content: none; }
.wk-tabpanel { min-width: 0; }
.wk-tabpanel:focus-visible { outline-offset: -2px; border-radius: var(--wk-r-sm); }

/* ---- 10. form controls ------------------------------------------------------ */
.wk-field { display: flex; flex-direction: column; gap: var(--wk-s-2); min-width: 0; }
.wk-label { font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-medium); color: var(--wk-text); }
.wk-help  { font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-input,
.wk-select {
  width: 100%;
  min-height: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  border: 1px solid var(--wk-control-line);
  border-radius: var(--wk-r-sm);
  background-color: var(--wk-surface-2);
  color: var(--wk-text);
  font-size: var(--wk-fs-base);
  transition: border-color var(--wk-dur-fast) var(--wk-ease), background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-input::placeholder { color: var(--wk-text-3); opacity: 1; }
.wk-input:hover,
.wk-select:hover { border-color: var(--wk-text-3); }
.wk-input:focus-visible,
.wk-select:focus-visible { border-color: var(--wk-ring); }
.wk-input[aria-invalid="true"] { border-color: var(--wk-danger); }
.wk-input:disabled { color: var(--wk-text-3); background-color: var(--wk-surface-1); cursor: not-allowed; }
.wk-select { appearance: none; -webkit-appearance: none; padding-inline-end: var(--wk-s-8); }
.wk-search { position: relative; display: block; min-width: 0; }
.wk-search__icon { position: absolute; inset-inline-start: var(--wk-s-3); top: 50%; transform: translateY(-50%); color: var(--wk-text-3); pointer-events: none; }
.wk-search .wk-input { padding-inline-start: 2.5rem; }
/* search trigger that looks like an input and opens the palette */
.wk-search-trigger {
  display: inline-flex; align-items: center; gap: var(--wk-s-2);
  min-height: var(--wk-hit); min-width: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  border: 1px solid var(--wk-line-strong); border-radius: var(--wk-r-sm);
  background-color: var(--wk-surface-1);
  color: var(--wk-text-2);
  font-size: var(--wk-fs-base);
  cursor: pointer;
  transition: background-color var(--wk-dur-fast) var(--wk-ease), border-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-search-trigger:hover { background-color: var(--wk-surface-2); border-color: var(--wk-control-line); color: var(--wk-text); }
.wk-search-trigger__label { display: none; flex: 1 1 auto; text-align: start; }
.wk-search-trigger .wk-kbd { display: none; }
@media (min-width: 640px) {
  .wk-search-trigger { min-width: 16rem; }
  .wk-search-trigger__label { display: inline; }
  .wk-search-trigger .wk-kbd { display: inline-flex; }
}
@media (pointer: coarse) { .wk-search-trigger .wk-kbd { display: none; } }

/* ---- 11. menu (popover list; + New, row "more") -----------------------------
   <div class="wk-menu-wrap"><button aria-haspopup="menu" aria-expanded="false" aria-controls="m">..</button>
   <div class="wk-menu" id="m" role="menu" hidden><a role="menuitem" class="wk-menu__item">..</a></div></div>
   Arrow Up/Down/Home/End, Esc closes and returns focus, Tab closes. */
.wk-menu-wrap { position: relative; display: inline-block; }
.wk-menu {
  position: absolute;
  z-index: var(--wk-z-menu);
  inset-block-start: calc(100% + var(--wk-s-1));
  inset-inline-end: 0;
  min-width: 14rem;
  max-width: min(20rem, calc(100vw - 2 * var(--wk-gutter)));
  padding: var(--wk-s-1);
  border: 1px solid var(--wk-line-strong);
  border-radius: var(--wk-r-md);
  background-color: var(--wk-surface-2);
  box-shadow: var(--wk-shadow-pop);
  animation: wk-pop-in var(--wk-dur-base) var(--wk-ease);
}
.wk-menu--start { inset-inline-end: auto; inset-inline-start: 0; }
.wk-menu__item {
  display: flex; align-items: center; gap: var(--wk-s-3);
  width: 100%;
  min-height: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  border-radius: var(--wk-r-sm);
  color: var(--wk-text);
  font-size: var(--wk-fs-base);
  text-align: start;
  transition: background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-menu__item:hover,
.wk-menu__item:focus-visible { background-color: var(--wk-surface-3); color: var(--wk-text); }
.wk-menu__item .wk-icon { color: var(--wk-text-2); }
.wk-menu__item--danger,
.wk-menu__item--danger:hover { color: var(--wk-danger); }
.wk-menu__sep { height: 1px; margin: var(--wk-s-1) 0; background-color: var(--wk-line); }
.wk-menu__label { padding: var(--wk-s-2) var(--wk-s-3) var(--wk-s-1); }

/* ---- 12. banner (status strip) -------------------------------------------------
   role=status for info/success/warn (polite), role=alert only for danger.
   <div class="wk-banner wk-banner--warn" role="status"><span class="wk-banner__icon">icon</span>
   <div class="wk-banner__body"><p class="wk-banner__title">..</p><p class="wk-banner__text">..</p></div>
   <div class="wk-banner__actions">btn</div><button class="wk-banner__dismiss">x</button></div> */
.wk-banner {
  --_fg: var(--wk-info); --_bg: var(--wk-info-soft); --_line: var(--wk-info-line);
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: var(--wk-s-3);
  padding: var(--wk-s-3) var(--wk-s-4);
  border: 1px solid var(--_line);
  border-radius: var(--wk-r-md);
  background-color: var(--_bg);
}
.wk-banner--success { --_fg: var(--wk-success); --_bg: var(--wk-success-soft); --_line: var(--wk-success-line); }
.wk-banner--warn    { --_fg: var(--wk-warn);    --_bg: var(--wk-warn-soft);    --_line: var(--wk-warn-line); }
.wk-banner--danger  { --_fg: var(--wk-danger);  --_bg: var(--wk-danger-soft);  --_line: var(--wk-danger-line); }
.wk-banner__icon { flex: none; display: inline-flex; padding-top: 0.125rem; color: var(--_fg); }
.wk-banner__body { flex: 1 1 10rem; min-width: 0; order: 0; }
.wk-banner__title { font-weight: var(--wk-fw-semi); color: var(--wk-text); }
.wk-banner__text { color: var(--wk-text-2); }
.wk-banner__actions { order: 2; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-s-2); padding-inline-start: calc(1.25rem + var(--wk-s-3)); }
@media (min-width: 640px) { .wk-banner__actions { order: 1; flex: none; margin-inline-start: auto; padding-inline-start: 0; } .wk-banner__dismiss { order: 2; } }
.wk-banner__dismiss {
  order: 1; margin-inline-start: auto;
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--wk-hit); height: var(--wk-hit); margin-block: calc(var(--wk-s-3) * -1); margin-inline-end: calc(var(--wk-s-3) * -1);
  border-radius: var(--wk-r-sm); color: var(--wk-text-2);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-banner__dismiss:hover { background-color: var(--wk-hover); color: var(--wk-text); }

/* ---- 13. toast -------------------------------------------------------------------
   <div class="wk-toasts" role="region" aria-label="Notifications"><div class="wk-toasts__live" aria-live="polite"> ...
   toast: <div class="wk-toast wk-toast--success" role="status"> (errors: role="alert")
   JS: 6s, paused on hover/focus, Esc/close dismiss, max 3, Undo slot. */
.wk-toasts {
  position: fixed;
  z-index: var(--wk-z-toast);
  inset-inline: var(--wk-s-3);
  bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px) + var(--wk-s-3));
  pointer-events: none;
}
.wk-toasts__live { display: flex; flex-direction: column; gap: var(--wk-s-2); align-items: center; }
.wk-toast {
  --_fg: var(--wk-info);
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--wk-s-3);
  width: 100%; max-width: 28rem;
  padding: var(--wk-s-1) var(--wk-s-1) var(--wk-s-1) var(--wk-s-4);
  min-height: 3.25rem;
  border: 1px solid var(--wk-line-strong);
  border-radius: var(--wk-r-md);
  background-color: var(--wk-surface-2);
  box-shadow: var(--wk-shadow-pop);
  animation: wk-toast-in var(--wk-dur-base) var(--wk-ease);
}
.wk-toast--success { --_fg: var(--wk-success); }
.wk-toast--error   { --_fg: var(--wk-danger); }
.wk-toast--warn    { --_fg: var(--wk-warn); }
.wk-toast__icon { flex: none; color: var(--_fg); display: inline-flex; }
.wk-toast__msg { flex: 1 1 auto; min-width: 0; color: var(--wk-text); font-size: var(--wk-fs-base); overflow-wrap: anywhere; }
.wk-toast__action { flex: none; }
.wk-toast__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--wk-hit); height: var(--wk-hit); border-radius: var(--wk-r-sm);
  color: var(--wk-text-2);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-toast__close:hover { background-color: var(--wk-hover); color: var(--wk-text); }
.wk-toast.is-leaving { opacity: 0; transform: translateY(0.5rem); transition: opacity var(--wk-dur-out) var(--wk-ease), transform var(--wk-dur-out) var(--wk-ease); }
@media (min-width: 1024px) {
  .wk-toasts { bottom: var(--wk-s-6); inset-inline: var(--wk-s-6); }
}

/* ---- 14. dialog (native <dialog>; showModal() gives focus trap + inert + Esc) ------
   <dialog class="wk-dialog" aria-labelledby="t" aria-describedby="d"><div class="wk-dialog__panel">
   <header class="wk-dialog__head"><h2 id="t" class="wk-dialog__title">..</h2><button class="wk-dialog__close">..</button></header>
   <div class="wk-dialog__body" id="d">..</div><footer class="wk-dialog__foot">buttons</footer></div></dialog>
   Confirm: destructive action is NEVER the default focus; focus starts on Cancel.
   Phone: bottom sheet. */
.wk-dialog {
  width: min(32rem, calc(100vw - 2 * var(--wk-s-4)));
  max-width: none;
  max-height: calc(100dvh - 2 * var(--wk-s-4));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wk-text);
  overflow: visible;
}
.wk-dialog::backdrop { background-color: var(--wk-scrim); }
.wk-dialog[open] { animation: wk-pop-in var(--wk-dur-slow) var(--wk-ease); }
.wk-dialog__panel {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 2 * var(--wk-s-4));
  border: 1px solid var(--wk-line-strong);
  border-radius: var(--wk-r-lg);
  background-color: var(--wk-surface-2);
  box-shadow: var(--wk-shadow-dialog);
  overflow: hidden;
}
.wk-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--wk-s-3); padding: var(--wk-s-5) var(--wk-s-5) var(--wk-s-2); }
.wk-dialog__title { font-size: var(--wk-fs-lg); font-weight: var(--wk-fw-semi); line-height: 1.3; }
.wk-dialog__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--wk-hit); height: var(--wk-hit); margin: calc(var(--wk-s-2) * -1) calc(var(--wk-s-2) * -1) 0 0;
  border-radius: var(--wk-r-sm); color: var(--wk-text-2);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-dialog__close:hover { background-color: var(--wk-hover); color: var(--wk-text); }
.wk-dialog__body { padding: var(--wk-s-2) var(--wk-s-5) var(--wk-s-5); overflow-y: auto; color: var(--wk-text-2); }
.wk-dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--wk-s-2); padding: var(--wk-s-4) var(--wk-s-5); border-top: 1px solid var(--wk-line); background-color: var(--wk-surface-1); }
html:has(.wk-dialog[open]) { overflow: hidden; }
@media (max-width: 639.98px) {
  .wk-dialog--sheet { width: 100vw; max-width: 100vw; margin: auto 0 0 0; }
  .wk-dialog--sheet .wk-dialog__panel { border-radius: var(--wk-r-lg) var(--wk-r-lg) 0 0; }
  .wk-dialog--sheet .wk-dialog__foot { padding-bottom: calc(var(--wk-s-4) + env(safe-area-inset-bottom, 0px)); }
  .wk-dialog--sheet .wk-dialog__foot .wk-btn { flex: 1 1 auto; }
}
.wk-shortcuts { display: grid; grid-template-columns: 1fr auto; gap: var(--wk-s-2) var(--wk-s-4); align-items: center; }
.wk-shortcuts dt { color: var(--wk-text-2); }
.wk-shortcuts dd { display: flex; gap: var(--wk-s-1); justify-content: flex-end; }

/* ---- 15. command palette (dialog + combobox/listbox) ------------------------------
   input[role=combobox][aria-expanded][aria-controls][aria-activedescendant]
   ul[role=listbox] > li[role=group][aria-labelledby] > li[role=option][id][aria-selected]
   Searches ONLY what the page ships as JSON (recent items + every destination + actions). */
.wk-palette {
  width: min(40rem, calc(100vw - 2 * var(--wk-s-3)));
  max-width: none;
  max-height: min(34rem, calc(100dvh - 2 * var(--wk-s-4)));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--wk-line-strong);
  border-radius: var(--wk-r-lg);
  background-color: var(--wk-surface-2);
  color: var(--wk-text);
  box-shadow: var(--wk-shadow-dialog);
  overflow: hidden;
}
.wk-palette::backdrop { background-color: var(--wk-scrim); }
.wk-palette[open] { display: flex; flex-direction: column; animation: wk-pop-in var(--wk-dur-slow) var(--wk-ease); }
.wk-palette__field { display: flex; align-items: center; gap: var(--wk-s-3); padding: 0 var(--wk-s-4); border-bottom: 1px solid var(--wk-line); color: var(--wk-text-2); }
.wk-palette__input {
  flex: 1 1 auto; min-width: 0;
  height: 3.5rem;
  border: 0; background: transparent;
  color: var(--wk-text);
  font-size: var(--wk-fs-md);
}
.wk-palette__input::placeholder { color: var(--wk-text-3); opacity: 1; }
.wk-palette__input:focus-visible { outline: none; }          /* the field container shows focus instead */
.wk-palette__field:focus-within { box-shadow: inset 0 -2px 0 var(--wk-ring); }
.wk-palette__list { flex: 1 1 auto; overflow-y: auto; padding: var(--wk-s-2); overscroll-behavior: contain; }
.wk-palette__group { padding: 0; }
.wk-palette__group-label { padding: var(--wk-s-3) var(--wk-s-3) var(--wk-s-1); }
.wk-palette__item {
  position: relative;
  display: flex; align-items: center; gap: var(--wk-s-3);
  min-height: var(--wk-hit);
  padding: var(--wk-s-1) var(--wk-s-3);
  border-radius: var(--wk-r-sm);
  color: var(--wk-text);
  cursor: pointer;
}
.wk-palette__item .wk-icon { color: var(--wk-text-2); }
.wk-palette__item[aria-selected="true"] { background-color: var(--wk-surface-3); }
.wk-palette__item[aria-selected="true"]::before {
  content: ""; position: absolute; inset-block: 0.5rem; inset-inline-start: 0; width: 2px; border-radius: 2px; background-color: var(--wk-accent-text);
}
.wk-palette__item[aria-selected="true"] .wk-icon { color: var(--wk-accent-text); }
.wk-palette__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-palette__meta { flex: none; font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-palette__mark { padding: 0; background: transparent; color: var(--wk-accent-text); font-weight: var(--wk-fw-semi); }
.wk-palette__empty { padding: var(--wk-s-8) var(--wk-s-4); text-align: center; color: var(--wk-text-2); }
.wk-palette__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-s-2) var(--wk-s-4); padding: var(--wk-s-2) var(--wk-s-4); border-top: 1px solid var(--wk-line); background-color: var(--wk-surface-1); font-size: var(--wk-fs-xs); color: var(--wk-text-3); }
.wk-palette__foot span { display: inline-flex; align-items: center; gap: var(--wk-s-1); }
@media (max-width: 639.98px) {
  .wk-palette { width: 100vw; max-width: none; max-height: 100dvh; margin: 0 auto auto; border-radius: 0 0 var(--wk-r-lg) var(--wk-r-lg); border-top: 0; }
  .wk-palette__foot { display: none; }
}

/* ---- 16. skeleton --------------------------------------------------------------------
   Sized to the FINAL element (no layout shift). Container: aria-busy="true"; skeleton
   nodes aria-hidden="true"; add a .wk-sr "Loading ..." once. Reduced motion: static tint. */
.wk-skel {
  display: block;
  border-radius: var(--wk-r-sm);
  background-color: var(--wk-surface-2);
  background-image: linear-gradient(90deg, var(--wk-surface-2) 0%, var(--wk-surface-3) 50%, var(--wk-surface-2) 100%);
  background-size: 200% 100%;
  animation: var(--wk-skeleton-anim) var(--wk-skeleton-dur) linear infinite;
}
.wk-skel--line   { height: 0.75rem; width: 100%; }
.wk-skel--title  { height: 1.125rem; width: 60%; }
.wk-skel--w-40   { width: 40%; }
.wk-skel--w-60   { width: 60%; }
.wk-skel--w-80   { width: 80%; }
.wk-skel--thumb  { aspect-ratio: 1 / 1; width: 100%; }
.wk-skel--wide   { aspect-ratio: 16 / 10; width: 100%; }
.wk-skel--circle { border-radius: var(--wk-r-pill); width: 2.25rem; height: 2.25rem; }
.wk-skel--icon   { width: 2.25rem; height: 2.25rem; }
.wk-skel--btn    { height: var(--wk-hit); width: 7rem; }
.wk-skel-row { display: flex; align-items: center; gap: var(--wk-s-3); min-height: 3.5rem; padding: var(--wk-s-2) var(--wk-s-4); border-top: 1px solid var(--wk-line); }
.wk-skel-row:first-child { border-top: 0; }
.wk-skel-row__lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--wk-s-2); min-width: 0; }
.wk-spinner {
  display: inline-block; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--wk-text-2); border-inline-end-color: transparent;
  animation: var(--wk-spin-anim) 800ms linear infinite;
}

/* ---- 17. plan card ---------------------------------------------------------------------
   data-state = free | active | cancelling | past_due | expired  (from $wk['plan']['status'])
   <section class="wk-card wk-plan" data-state="cancelling"> header: plan chip + name;
   __status line (icon + words); __meters; __actions (ONE primary). */
.wk-plan[data-state="cancelling"],
.wk-plan[data-state="past_due"] { border-color: var(--wk-warn-line); }
.wk-plan[data-state="expired"]  { border-color: var(--wk-danger-line); }
.wk-plan__head { display: flex; align-items: center; justify-content: space-between; gap: var(--wk-s-3); flex-wrap: wrap; }
.wk-plan__name { font-size: var(--wk-fs-lg); font-weight: var(--wk-fw-semi); letter-spacing: -0.01em; }
.wk-plan__status { display: flex; align-items: flex-start; gap: var(--wk-s-2); color: var(--wk-text-2); }
.wk-plan__status .wk-icon { margin-top: 0.125rem; color: var(--wk-text-3); }
.wk-plan[data-state="cancelling"] .wk-plan__status .wk-icon,
.wk-plan[data-state="past_due"] .wk-plan__status .wk-icon { color: var(--wk-warn); }
.wk-plan[data-state="expired"] .wk-plan__status .wk-icon { color: var(--wk-danger); }
.wk-plan__status strong { color: var(--wk-text); font-weight: var(--wk-fw-semi); }
.wk-plan__meters { display: flex; flex-direction: column; gap: var(--wk-s-4); }
.wk-plan__list { display: flex; flex-direction: column; gap: var(--wk-s-2); color: var(--wk-text-2); }
.wk-plan__list li { display: flex; align-items: flex-start; gap: var(--wk-s-2); }
.wk-plan__list .wk-icon { margin-top: 0.15rem; color: var(--wk-success); width: 1rem; height: 1rem; }
.wk-plan__actions { display: flex; flex-wrap: wrap; gap: var(--wk-s-2); margin-top: auto; }

/* ---- 18. checklist ----------------------------------------------------------------------
   <ol class="wk-checklist"><li class="wk-check" data-state="done|next|todo">
     <span class="wk-check__box">check icon when done</span>
     <div class="wk-check__main"><a class="wk-check__link">Title</a><p class="wk-check__hint">..</p></div></li></ol>
   done state is announced in text: add <span class="wk-sr">(done)</span> */
.wk-checklist { display: flex; flex-direction: column; }
.wk-check { position: relative; display: flex; align-items: flex-start; gap: var(--wk-s-3); min-height: 3.5rem; padding: var(--wk-s-1) var(--wk-s-4); border-top: 1px solid var(--wk-line); transition: background-color var(--wk-dur-fast) var(--wk-ease); }
.wk-checklist > .wk-check:first-child { border-top: 0; }
.wk-check:hover { background-color: var(--wk-hover); }
.wk-check__box {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; margin-top: 0.625rem;
  border-radius: var(--wk-r-pill);
  border: 1.5px solid var(--wk-control-line);
  color: var(--wk-text-on-accent);
}
.wk-check__box .wk-icon { width: 0.875rem; height: 0.875rem; stroke-width: 2.25; }
.wk-check[data-state="done"] .wk-check__box { background-color: var(--wk-success); border-color: var(--wk-success); color: var(--wk-bg); }
.wk-check[data-state="next"] .wk-check__box { border-color: var(--wk-accent-text); box-shadow: 0 0 0 3px var(--wk-accent-soft); }
.wk-check__main { flex: 1 1 auto; min-width: 0; }
.wk-check__link { display: flex; align-items: center; flex-wrap: wrap; gap: var(--wk-s-2); min-height: var(--wk-hit); color: var(--wk-text); font-weight: var(--wk-fw-medium); line-height: 1.5rem; }
.wk-check__link:hover { color: var(--wk-text); }
.wk-check__link::after { content: ""; position: absolute; inset: 0; }
.wk-check__link:focus-visible { outline: none; }
.wk-check__link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: -2px; border-radius: var(--wk-r-sm); }
.wk-check[data-state="done"] .wk-check__link { color: var(--wk-text-2); }
.wk-check__hint { margin-top: -0.375rem; padding-bottom: var(--wk-s-3); font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-check__go { flex: none; align-self: center; color: var(--wk-text-3); }
.wk-check[data-state="next"] .wk-check__go { color: var(--wk-accent-text); }

/* ---- 19. resume card / thumbnail / avatar ------------------------------------------------ */
.wk-resume { padding: var(--wk-s-4); gap: var(--wk-s-3); }
.wk-resume__top { display: flex; align-items: center; gap: var(--wk-s-2); color: var(--wk-text-3); font-size: var(--wk-fs-xs); font-weight: var(--wk-fw-medium); letter-spacing: var(--wk-track-caps); text-transform: uppercase; }
.wk-resume__top .wk-icon { width: 1rem; height: 1rem; color: var(--wk-text-2); }
.wk-resume__title { font-size: var(--wk-fs-md); font-weight: var(--wk-fw-semi); line-height: 1.35; }
.wk-resume__meta { font-size: var(--wk-fs-sm); color: var(--wk-text-3); }
.wk-resume__cta { margin-top: auto; display: inline-flex; align-items: center; gap: var(--wk-s-1); font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-semi); color: var(--wk-accent-text); min-height: 1.75rem; }
.wk-resume.wk-card--interactive:hover .wk-resume__cta { color: var(--wk-text); }
.wk-thumb {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--wk-r-sm);
  border: 1px solid var(--wk-line);
  background-color: var(--wk-surface-2);
  overflow: hidden;
}
.wk-thumb--wide { aspect-ratio: 16 / 10; }
.wk-thumb--tall { aspect-ratio: 3 / 4; }
.wk-thumbs { display: grid; gap: var(--wk-s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); }
.wk-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2rem; height: 2rem; border-radius: var(--wk-r-pill);
  background-color: var(--wk-accent-soft); border: 1px solid var(--wk-accent-line);
  color: var(--wk-accent-text); font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-semi);
  text-transform: uppercase; user-select: none;
}

/* ---- 20. shell foundation: page header, rail, bottom bar (SHELL extends in shell.css) -------- */
.wk-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--wk-s-3) var(--wk-s-6); min-width: 0; }
.wk-page-header__text { display: flex; flex-direction: column; gap: var(--wk-s-1); min-width: 0; flex: 1 1 18rem; }
.wk-page-header__sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-s-2) var(--wk-s-3); color: var(--wk-text-2); }
.wk-page-header__actions { display: flex; align-items: center; gap: var(--wk-s-2); }

.wk-rail { display: none; }
@media (min-width: 1024px) {
  .wk-rail {
    display: flex; flex-direction: column; gap: var(--wk-s-6);
    position: sticky;
    top: calc(var(--wk-nav-h) + var(--wk-s-6));
    z-index: var(--wk-z-rail);
    max-height: calc(100dvh - var(--wk-nav-h) - var(--wk-s-12));
    overflow-y: auto;
    padding-block: var(--wk-s-8) var(--wk-s-4);
    align-self: start;
  }
}
.wk-rail__group { display: flex; flex-direction: column; gap: 2px; }
.wk-rail__label { padding: 0 var(--wk-s-3) var(--wk-s-1); }
.wk-rail__link {
  position: relative;
  display: flex; align-items: center; gap: var(--wk-s-3);
  min-height: var(--wk-hit);
  padding: 0 var(--wk-s-3);
  border-radius: var(--wk-r-sm);
  color: var(--wk-text-2);
  font-weight: var(--wk-fw-medium);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-rail__link:hover { background-color: var(--wk-hover); color: var(--wk-text); }
.wk-rail__link[aria-current] { background-color: var(--wk-surface-2); color: var(--wk-text); }
.wk-rail__link[aria-current]::before {
  content: ""; position: absolute; inset-block: 0.625rem; inset-inline-start: 0; width: 2px; border-radius: 2px; background-color: var(--wk-accent-text);
}
.wk-rail__link[aria-current] .wk-icon { color: var(--wk-accent-text); }
.wk-rail__text { flex: 1 1 auto; min-width: 0; }
.wk-rail__count { font-size: var(--wk-fs-xs); color: var(--wk-text-3); font-variant-numeric: tabular-nums; }

.wk-bottombar {
  position: fixed; inset-inline: 0; bottom: 0;
  z-index: var(--wk-z-bottombar);
  display: flex;
  height: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: var(--wk-surface-1);
  border-top: 1px solid var(--wk-line-strong);
}
.wk-bottombar__item {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--wk-hit);
  color: var(--wk-text-2);
  font-size: var(--wk-fs-xs); font-weight: var(--wk-fw-medium); line-height: 1rem;
  transition: color var(--wk-dur-fast) var(--wk-ease), background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-bottombar__item:hover { color: var(--wk-text); background-color: var(--wk-hover); }
.wk-bottombar__item[aria-current] { color: var(--wk-accent-text); }
.wk-bottombar__item:focus-visible { outline-offset: -3px; }
@media (min-width: 1024px) { .wk-bottombar { display: none; } }

/* ---- 21. keyframes ------------------------------------------------------------------------- */
@keyframes wk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes wk-spin    { to { transform: rotate(360deg); } }
@keyframes wk-pop-in  { from { opacity: 0; transform: translateY(0.375rem) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes wk-toast-in { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }

/* ---- 22. forced-colors (Windows High Contrast) ---------------------------------------------- */
@media (forced-colors: active) {
  .wk-card, .wk-banner, .wk-toast, .wk-dialog__panel, .wk-palette, .wk-menu, .wk-badge, .wk-status, .wk-plan-chip, .wk-input, .wk-select, .wk-search-trigger, .wk-kbd {
    border-color: CanvasText;
  }
  .wk-btn { border-color: ButtonText; }
  .wk-btn--primary { background-color: Highlight; color: HighlightText; forced-color-adjust: none; }
  .wk-btn[disabled], .wk-btn[aria-disabled="true"] { border-color: GrayText; color: GrayText; }
  .wk-chip { box-shadow: none; border: 1px solid ButtonText; border-block-width: 0.375rem; border-block-color: transparent; }
  .wk-chip[aria-pressed="true"], .wk-tab[aria-selected="true"], .wk-rail__link[aria-current], .wk-bottombar__item[aria-current] { outline: 2px solid Highlight; outline-offset: -2px; }
  .wk-meter__track, .wk-progress { border: 1px solid CanvasText; background: Canvas; }
  .wk-meter__fill, .wk-progress__fill { background-color: Highlight; forced-color-adjust: none; }
  .wk-skel { background: GrayText; }
  .wk-palette__item[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .wk-tab[aria-selected="true"]::after, .wk-palette__item[aria-selected="true"]::before, .wk-rail__link[aria-current]::before { background-color: Highlight; }
  .wk-check__box { border-color: CanvasText; }
  .wk-check[data-state="done"] .wk-check__box { background-color: Highlight; color: HighlightText; forced-color-adjust: none; }
  .wk-icon { stroke: currentColor; }
  .wk-row, .wk-check, .wk-skel-row { border-color: GrayText; }
}

/* ===== shell.css ===== */
/* ==========================================================================
   shell.css  -  Workspace frame: rail extras, notices, palette/help extras, switch,
   designed error page, skeleton groups, and the clearance rules for the third-party
   bottom-corner widgets (Prompt Keeper, feedback button). Owner: SHELL.
   Tokens only (lint enforces): no colour literals, no !important.
   ========================================================================== */

/* Reserve the scrollbar gutter so opening a dialog (which locks page scroll) or a short/long page never shifts the layout. */
html { scrollbar-gutter: stable; }
html:has(.wk-palette[open]) { overflow: hidden; }
/* Smooth scrolling only for in-page navigation the user just asked for (profile-shell.js adds .wk-smooth for ~1.2 s).
   Always-on smooth scrolling made a deep link (/profile.php#account) animate through the whole page on load (measured 1.2 s at 320 px). */
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) { html.wk-smooth { scroll-behavior: smooth; } }

/* The bottom-right ambient glow in base.css is anchored to the bottom edge of .wk, so it is cut off there and leaves a visible lighter
   block above the site footer (screenshots/shell-r1/seam). Keep only the top-left glow, which fades out inside the box. */
.wk { background-image: radial-gradient(60rem 34rem at 0% -8%, var(--wk-glow-1), transparent 62%); }

/* ---- keyboard focus must never end up under a fixed layer (round 6, e2e B1 / WCAG 2.4.11 Focus Not Obscured) -----------------------------
   Browsers scroll a focused control just into view; without scroll-padding it lands under the sticky nav (top) or the fixed bottom bar and the
   Prompt Keeper launcher (bottom): focus was invisible. Padding = the fixed layer + air. scroll-margin-top on [id] (base.css 5.5rem) ADDS to
   scroll-padding-top, so it is reduced by the same amount to keep anchors landing at 88px under the nav. */
html { scroll-padding-top: calc(var(--wk-nav-h) + 0.5rem); scroll-padding-bottom: 5rem; }
.wk [id] { scroll-margin-top: calc(var(--wk-anchor-offset) - var(--wk-nav-h) - 0.5rem); }
@media (max-width: 1023.98px) {
  html { scroll-padding-bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px) + 4.75rem); }   /* bar + Keeper launcher row */
}

/* the skip link slides IN on focus but must leave instantly on blur: its 120ms slide-out overlapped the next stop (nav logo) */
.wk-skip:not(:focus):not(:focus-visible) { transition: none; }

/* ---- notices / banners inside <main> ------------------------------------------------------- */
/* .wk-main is a flex column with a big gap between sections; a notice belongs to the header below it, so pull the gap in. */
.wk-frame-notices { display: block; margin-bottom: calc(var(--wk-s-3) - var(--wk-s-10)); }
.wk-frame-notices[hidden] { display: none; }
.wk-frame-notices + .wk-frame-notices { margin-top: calc(var(--wk-s-3) - var(--wk-s-10)); }
@media (min-width: 1024px) {
  .wk-frame-notices { margin-bottom: calc(var(--wk-s-3) - var(--wk-s-12)); }
  .wk-frame-notices + .wk-frame-notices { margin-top: calc(var(--wk-s-3) - var(--wk-s-12)); }
}
.wk-banners { min-width: 0; }
.wk-first-run-note { max-width: 60ch; }

/* ---- rail extras ---------------------------------------------------------------------------- */
.wk-rail__foot { margin-top: var(--wk-s-2); padding-top: var(--wk-s-3); border-top: 1px solid var(--wk-line); }
.wk-rail__tool { width: 100%; text-align: start; cursor: pointer; }
/* the rail scrolls (overflow-y:auto clips x too), so an outside focus ring loses its sides: draw it inside */
.wk-rail .wk-rail__link:focus-visible { outline-offset: -2px; }
.wk-rail__tool .wk-kbd { margin-inline-start: auto; }

/* ---- shared site chrome fix (integration): the bell button in the site nav has no focus indicator anywhere on the site
   (tab-walk finding #11 on every persona). Scoped to this page; the ring is the workspace ring. */
.workspace-home .notification-wrapper .button:focus-visible {
  outline: 2px solid var(--wk-ring);
  outline-offset: 2px;
}
.wk-rail__link[hidden],
.wk-bottombar__item[hidden] { display: none; }

/* ---- palette extras --------------------------------------------------------------------------- */
.wk-palette__limit { margin-inline-start: auto; }
.wk-palette__close {
  display: none;                                   /* phone/coarse only: desktop has Esc */
  flex: none; align-items: center; justify-content: center;
  width: var(--wk-hit); height: var(--wk-hit); margin-inline-end: calc(var(--wk-s-3) * -1);
  border-radius: var(--wk-r-sm); color: var(--wk-text-2);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), color var(--wk-dur-fast) var(--wk-ease);
}
.wk-palette__close:hover { background-color: var(--wk-hover); color: var(--wk-text); }
@media (max-width: 639.98px), (pointer: coarse) { .wk-palette__close { display: inline-flex; } }
.wk-palette__list > .wk-palette__empty { list-style: none; }
.wk-palette__group > ul { display: block; }

/* Taller palette on desktop so the empty state (3 recent + 3 pages + 2 create rows, three labels) fits without a half-cut group label. */
@media (min-width: 640px) { .wk-palette { max-height: min(38rem, calc(100dvh - 2 * var(--wk-s-4))); } }

/* ---- help dialog + switch (WCAG 2.1.4) ---------------------------------------------------------- */
.wk-help-note { margin-top: var(--wk-s-4); }
.wk-switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--wk-s-4); min-height: var(--wk-hit); margin-top: var(--wk-s-3); color: var(--wk-text); }
.wk-switch-row[hidden] { display: none; }
.wk-switch {
  position: relative; flex: none;
  width: 2.75rem; height: 2.75rem;                 /* 44px hit box; the painted track is smaller (below) */
  border-radius: var(--wk-r-pill);
}
.wk-switch::before {                               /* track */
  content: ""; position: absolute; inset-block: 0.6875rem; inset-inline: 0;
  border-radius: var(--wk-r-pill);
  background-color: var(--wk-surface-3); box-shadow: inset 0 0 0 1px var(--wk-control-line);
  transition: background-color var(--wk-dur-base) var(--wk-ease);
}
.wk-switch__thumb {
  position: absolute; top: 50%; inset-inline-start: 0.25rem; width: 1.125rem; height: 1.125rem; margin-top: -0.5625rem;
  border-radius: 50%; background-color: var(--wk-text);
  transition: transform var(--wk-dur-base) var(--wk-ease);
}
.wk-switch[aria-checked="true"]::before { background-color: var(--wk-accent); box-shadow: none; }
.wk-switch[aria-checked="true"] .wk-switch__thumb { transform: translateX(1.125rem); background-color: var(--wk-text-on-accent); }
[dir="rtl"] .wk-switch[aria-checked="true"] .wk-switch__thumb { transform: translateX(-1.125rem); }

/* ---- skeleton groups for client-fetched parts ------------------------------------------------------- */
.wk-skel-group { display: block; }
.wk-skel-card { display: flex; flex-direction: column; gap: var(--wk-s-3); padding: var(--wk-s-4); border: 1px solid var(--wk-line); border-radius: var(--wk-r-md); background-color: var(--wk-surface-1); }

/* ---- the designed error page ---------------------------------------------------------------------------- */
.wk-errorpage { min-height: calc(100dvh - var(--wk-nav-h) - 12rem); display: flex; align-items: center; justify-content: center; padding: var(--wk-s-10) var(--wk-gutter); }
.wk-errorpage__panel { width: 100%; max-width: 34rem; }
.wk-errorpage .wk-empty { padding: var(--wk-s-10) var(--wk-s-6); background-color: var(--wk-surface-1); }
.wk-errorpage .wk-title { font-size: var(--wk-fs-xl); }
.wk-errorpage__hint { max-width: 38ch; margin-top: var(--wk-s-3); }

/* ---- third-party widgets keep their own (light) theme ------------------------------------------------------------
   tokens.css sets color-scheme: dark on :root so native controls, scrollbars and dialogs match the workspace. That is inherited by
   Prompt Keeper's white panel and the legacy feedback modal, whose inputs then render with dark UA backgrounds (measured: Keeper
   message field rgb(59,59,59) on a white panel; it was white before). Scope them back to light. */
.pk-root, #feedbackModal { color-scheme: light; }

/* ---- toasts vs Prompt Keeper -------------------------------------------------------------------------------
   Below 1024 the bottom bar is showing and Keeper's launcher sits at bar + 12px, right-aligned (48px tall on phone). A toast
   at the same height would be covered by it (Keeper is z-index 2147483000). Lift the toast region one launcher-height above it.
   From 1024 the toast is bottom-centre (max 28rem) and Keeper is bottom-right: no shared x-range at any supported width. */
@media (max-width: 1023.98px) {
  .wk-toasts { bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px) + 4.5rem); }
}

/* ---- bottom-corner widgets ---------------------------------------------------------------------------------
   Third-party widgets that live in the same corner as our bottom bar / toasts:
   - Prompt Keeper (.pk-root, fixed right/bottom 20px, z-index 2147483000): base.css lifts it above the bottom bar below 1024.
   - Feedback button (#feedbackButton, fixed right/bottom 1.5rem, z 9999): it sat exactly under Keeper and under the bottom bar.
     It is lifted above Keeper's launcher (desktop) / above bar + Keeper (phone). ID + element beats its inline <style> (1,0,0) without !important. */
body #feedbackButton { bottom: 5.25rem; right: 1.25rem; }
@media (max-width: 1023.98px) {
  body:has(.wk-bottombar) #feedbackButton { bottom: calc(var(--wk-bottombar-h) + env(safe-area-inset-bottom, 0px) + 4.25rem); right: 0.75rem; }
}

/* ---- reduced motion for the shared chrome ----------------------------------------------------------------------------
   The site notification bell runs an infinite pulse-ring (css/notifications.css) that ignores prefers-reduced-motion
   (measured: the only infinite animation left on the page under reduce). Stop it here; the unread badge itself stays. */
@media (prefers-reduced-motion: reduce) {
  body .notification-icon.has-unread::after { animation: none; opacity: 0; }
}

/* ---- promo visibility (round-2 R3) -------------------------------------------------------------------------------------
   The controller/shell sets data-promo="eligible|none" on <body>. When it is not eligible (Pro/Basic, expired ex-customers, error pages)
   the shared "first month FREE" banner above the nav and the footer's "Claim your free month" card are hidden. Best-effort selectors on
   shared markup (.banner-container, .footer-promo-strip); shared files are not edited. Error pages also hide the nav's Upgrade link:
   the page does not know the plan. */
body[data-promo="none"] .banner-container,
body[data-promo="none"] .footer-promo-strip { display: none; }
body.workspace-error .nav-upgrade { display: none; }

/* (closed notification panel: see profile-shell.js "notification panel inert" - a CSS-only fix is impossible because the shared
   script sets an inline `visibility: visible` on .mark-all-read, which only !important could beat.) */

/* ---- bottom bar steps aside over the site footer (profile-shell.js toggles .is-away) ------------------------------------- */
.wk-bottombar { transition: transform var(--wk-dur-base) var(--wk-ease), visibility 0s linear 0s; }
.wk-bottombar.is-away { transform: translateY(100%); visibility: hidden; transition: transform var(--wk-dur-base) var(--wk-ease), visibility 0s linear var(--wk-dur-base); }

/* ---- Keeper vs modals (round-3 N1): the launcher (z-index 2147483000) floated above the open upgrade modal, undimmed. Hide it while a
   non-<dialog> modal is open (real <dialog>s are in the top layer and already cover it). */
body:has(.tpi-modal-overlay.is-open) .pk-root { display: none; }

/* ---- Prompt Keeper safe zone (round-2 R7) -----------------------------------------------------------------------------
   Keeper's fixed launcher (bottom-right) covered the right-edge action of whatever row scrolled beneath it. Desktop: collapse the pill
   to its round icon and reserve a right gutter so no content column ends under it. Phone/tablet: reserve space in flow above the bar. */
@media (min-width: 1024px) {
  body .pk-launcher-label { display: none; }
  body .pk-launcher { padding: 0.5rem; }
}
@media (min-width: 1024px) and (max-width: 1679.98px) {
  .wk-main { padding-inline-end: 4.5rem; }
}
@media (max-width: 1023.98px) {
  .wk-main { padding-bottom: calc(var(--wk-s-16) + 3rem); }
  body .pk-launcher-label { display: none; }
  body .pk-launcher { padding: 0.5rem; }
  .pk-root { transition: opacity var(--wk-dur-base) var(--wk-ease); }
  html.wk-scrolling .pk-root { opacity: 0; pointer-events: none; }   /* round-3: it rested on row actions; it steps aside while the page moves (profile-shell.js) */
}
@media (min-width: 640px) and (max-width: 1023.98px) {
  .wk-main { padding-inline-end: 4rem; }                            /* tablet: the gutter clears the round launcher, like desktop */
}
@media (prefers-reduced-motion: reduce) { .pk-root { transition: none; } }

/* ---- promo banner height reserve (round-3): the shared banner rotates six messages and grows 61 -> 82px at 320 (39 -> 61 at 480), shifting
   the whole page seconds after load. Reserve the tallest measured height per width band while the promo is shown. */
body[data-promo="eligible"] .banner-container { display: flex; align-items: center; min-height: 3.8125rem; }
body[data-promo="eligible"] .banner-container .banner-content { flex: 1 1 auto; }
@media (max-width: 359.98px) { body[data-promo="eligible"] .banner-container { min-height: 5.125rem; } }
@media (min-width: 640px) { body[data-promo="eligible"] .banner-container { min-height: 0; } }

/* ---- palette on phones: the meta column no longer eats the title (round-3 L-2) ---- */
@media (max-width: 479.98px) {
  .wk-palette__item { flex-wrap: wrap; row-gap: 0; }
  .wk-palette__title { flex: 1 1 calc(100% - 3.5rem); }
  .wk-palette__meta { flex: 1 0 100%; padding-inline-start: 2.25rem; margin-top: -0.25rem; padding-bottom: 0.25rem; }
}

/* ---- shared footer promo card at 320-400px (round 6): .footer-promo-copy has min-width:240px inside a 256px card with padding, so the title
   ran under the card's edge ("...first month of"). Scoped with body to beat the footer's own inline <style>; shared markup untouched. */
@media (max-width: 420px) {
  body .footer-promo-copy { min-width: 0; }
  body .footer-promo-text { min-width: 0; }
  body .footer-promo-title, body .footer-promo-sub { overflow-wrap: anywhere; }
}

/* ---- print (round-2 M2): a designed report, not a screen dump ---------------------------------------------------------
   Browsers strip backgrounds when printing, which left the dark theme's pale text on white. Switch the tokens to system colours
   (Canvas / CanvasText / GrayText resolve to black on white in print), drop every screen-only layer, keep cards whole. */
@media print {
  :root {
    color-scheme: light;
    --wk-bg: Canvas; --wk-surface-1: Canvas; --wk-surface-2: Canvas; --wk-surface-3: Canvas;
    --wk-text: CanvasText; --wk-text-2: CanvasText; --wk-text-3: GrayText; --wk-text-on-accent: Canvas;
    --wk-line: GrayText; --wk-line-strong: GrayText; --wk-control-line: GrayText;
    --wk-accent: CanvasText; --wk-accent-text: CanvasText; --wk-accent-soft: Canvas; --wk-accent-line: GrayText; --wk-ring: CanvasText;
    --wk-success: CanvasText; --wk-warn: CanvasText; --wk-danger: CanvasText; --wk-info: CanvasText;
    --wk-glow-1: transparent; --wk-glow-2: transparent;
  }
  .wk { background-image: none; }
  .wk-rail, .wk-bottombar, .wk-toasts, .wk-palette, .wk-search-trigger, #feedbackButton, .wk-skip, .pk-root,
  .banner-container, .nav-container, .footer-promo-strip, .wk-banner__dismiss, .wk-menu-wrap { display: none; }
  .wk *, .wk *::before, .wk *::after { transition: none; animation: none; }
  /* the footer function emits its own <style> after ours (same specificity, later wins): element+class beats its single-class rules */
  body footer.footer-v2, body .footer-promo-strip, body .footer-container-v2, body .footer-bottom-v2 { display: none; }
  .wk-cert, .wk-tool, .wk-lib__row, .wk-learn__cert { break-inside: avoid; }
  /* Round-5 B-1: the round-3 promo reserve is `body[data-promo=eligible] .banner-container` (0,2,1) and beat the plain print rule above, so the
     FREE banner printed for free/new users. `html body[data-promo] ...` is (0,2,2) whatever the promo attribute says; no !important needed. */
  html body[data-promo] .banner-container, html body .banner-container, html body .nav-container { display: none; min-height: 0; }
  /* in-content promo/upgrade pitches are screen furniture too (plan-card sentence, Upgrade to Pro / See upgrade options buttons) */
  html body .wk .hm-promo, html body .wk a[href*="upgrade.php"], html body .wk [data-hm-upgrade-cta], html body .wk .wk-plan__promo, html body .wk .wk-plan__actions { display: none; }   /* plan-card buttons (Upgrade to Pro, Manage) are not report content */
  .wk-shell { display: block; }
  html body .wk-main { padding-bottom: 0; }
  html body .wk .acct-strip, html body .wk .acct-strip__hint, html body .wk [data-acct-kbd-hint] { display: none; }   /* workspace footer strip + "Press ? for keyboard shortcuts": screen-only; the strip alone could spill onto a blank last page */
  .wk-main { padding: 0; gap: var(--wk-s-6); }
  .wk .wk-card, .wk .wk-row, .wk .wk-banner, .wk .wk-btn, .wk .wk-badge, .wk .wk-tab, .wk .wk-chip, .wk .wk-empty { background-color: Canvas; background-image: none; color: CanvasText; }
  .wk .wk-card, .wk .wk-btn { border: 1px solid GrayText; }
  .wk-row, .wk-banner, .wk-resume { break-inside: avoid; }                /* small items stay whole; big cards may break (blank areas at page ends, round 4) */
  .wk-card { break-inside: auto; }
  .wk-card__head, .wk-section-head { break-after: avoid; }
  .wk-section > :first-child { break-after: avoid; }
  a { color: CanvasText; text-decoration: underline; }
  html { scrollbar-gutter: auto; }
}

/* ===== home.css ===== */
/* ==========================================================================
   home.css - Overview (HOME). Layout-only extras on top of components.css.
   Prefix hm-. Tokens only: no colour literals, no !important (build-css.sh lints).
   ========================================================================== */

.hm { gap: var(--wk-s-6); }
.hm > .wk-section-head { margin-bottom: calc(var(--wk-s-2) * -1); }   /* heading hugs its cards; sections keep the 24px rhythm */

/* ---- header: the first five seconds. Name big, plan and billing in one calm line. */
.hm-header { padding-bottom: var(--wk-s-1); }
.hm-header .wk-title { overflow-wrap: anywhere; }
.hm-header__line { min-width: 0; }
.hm-strip { margin-top: calc(var(--wk-s-1) * -1); }

/* ---- resume row */
.hm-resume .wk-resume { gap: var(--wk-s-2); }
.hm-resume .wk-resume__title { min-width: 0; }
.hm-resume__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--wk-s-2); min-width: 0; }
.hm-resume__meta > span + span::before { content: "\00b7"; margin-inline-end: var(--wk-s-2); }
.hm-resume__when { color: var(--wk-text-3); }
.hm-clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  color: var(--wk-text-2);
}
.hm-resume--suggested { background-color: transparent; border-style: dashed; border-color: var(--wk-line-strong); }
.hm-resume--suggested:hover { background-color: var(--wk-surface-1); border-style: dashed; }

/* ---- new account: one clear start */
.hm-first { padding: var(--wk-s-6); gap: var(--wk-s-3); justify-content: center; }
.hm-first__title { font-size: var(--wk-fs-xl); line-height: var(--wk-lh-tight); font-weight: var(--wk-fw-semi); letter-spacing: -0.015em; }
.hm-first__text { color: var(--wk-text-2); max-width: 46ch; }
.hm-first__actions { display: flex; flex-wrap: wrap; gap: var(--wk-s-2); margin-top: var(--wk-s-2); }
@media (min-width: 1024px) { .hm-first__title { font-size: var(--wk-fs-2xl); } }
.hm-check { min-width: 0; }

/* ---- lower row: plan | checklist-or-recent (or the plan alone) */
.hm-lower { align-items: stretch; }
/* integration r2: the recents card is short; stretching it to the plan card's height left a half-empty box */
.hm-lower > [aria-labelledby="hm-recent-title"] { align-self: start; }
.hm-lower--solo { display: block; }

/* ---- plan and usage */
.hm-plan__body { display: flex; flex-direction: column; gap: var(--wk-s-5); }
.hm-plan__main { display: flex; flex-direction: column; gap: var(--wk-s-3); min-width: 0; }
.hm-plan__usage { display: flex; flex-direction: column; gap: var(--wk-s-3); min-width: 0; }
.hm-plan__actions { align-items: center; margin-top: 0; }
.hm-plan .wk-plan__name { line-height: 1.3; }
.hm-sub { font-size: var(--wk-fs-xs); line-height: 1rem; font-weight: var(--wk-fw-medium); letter-spacing: var(--wk-track-caps); text-transform: uppercase; color: var(--wk-text-3); }
.hm-sub--gap { margin-top: var(--wk-s-3); }
.hm-plain { display: flex; align-items: flex-start; gap: var(--wk-s-2); color: var(--wk-text-2); max-width: 42ch; }
.hm-plain .wk-icon { margin-top: 0.125rem; flex: none; }
.hm-plain--muted { color: var(--wk-text-3); }

.hm-allow { display: flex; flex-direction: column; margin: 0; }
.hm-allow__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--wk-s-3); padding: var(--wk-s-2) 0; border-top: 1px solid var(--wk-line); font-size: var(--wk-fs-sm); }
.hm-allow__row:first-child { border-top: 0; padding-top: 0; }
.hm-allow dt { color: var(--wk-text-2); font-weight: var(--wk-fw-regular); min-width: 0; }
.hm-allow dd { margin: 0; color: var(--wk-text); text-align: right; }

/* ---- promo (rendered only when plan.promo.eligible) */
.hm-promo {
  display: flex; align-items: flex-start; gap: var(--wk-s-3);
  padding: var(--wk-s-3) var(--wk-s-4);
  border: 1px solid var(--wk-accent-line); border-radius: var(--wk-r-sm); background-color: var(--wk-accent-soft);
}
.hm-promo__icon { flex: none; display: inline-flex; padding-top: 0.125rem; color: var(--wk-accent-text); }
.hm-promo__text { color: var(--wk-text-2); min-width: 0; }
.hm-promo__text strong { color: var(--wk-text); font-weight: var(--wk-fw-semi); }
.hm-code {
  display: inline-block; padding: 0 var(--wk-s-2); border-radius: var(--wk-r-sm);
  border: 1px solid var(--wk-accent-line); background-color: var(--wk-surface-2);
  font-family: var(--wk-font-mono); font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-semi); letter-spacing: 0.04em; color: var(--wk-text);
}

.hm-meter__cta { align-self: flex-start; }

/* tablet: 2 columns, so an odd third card spans instead of orphaning */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .hm-resume > .wk-resume:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ================= round 2 ================= */
.hm-auto { text-align: start; unicode-bidi: plaintext; overflow-wrap: anywhere; min-width: 0; }
.hm-resume__row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--wk-s-3); min-width: 0; }
.hm-resume__row .wk-resume__title { flex: 1 1 auto; min-width: 0; }
.hm-resume__thumb { flex: none; width: 3rem; height: 3rem; object-fit: cover; border-radius: var(--wk-r-sm); border: 1px solid var(--wk-line); background-color: var(--wk-surface-2); }
.wk-resume[hidden] { display: none; }
.wk-meter__note--calm { color: var(--wk-text-2); }
.wk-meter__note--calm .wk-icon { color: var(--wk-text-3); }
.hm-winback { margin-top: calc(var(--wk-s-1) * -1); }
.hm-plan--winback { background-image: linear-gradient(135deg, var(--wk-warn-soft), transparent 60%); }
html[data-hm-ck="hidden"] .hm-check { display: none; }
html[data-hm-ck="hidden"] .hm-lower { grid-template-columns: minmax(0, 1fr); }



/* first-run card: title, buttons, one sentence; compact on phones so the buttons sit in the first screen */
.hm-first__text { font-size: var(--wk-fs-sm); }
@media (max-width: 639.98px) {
  .hm-first { padding: var(--wk-s-4); gap: var(--wk-s-3); }
  .hm-first__title { font-size: var(--wk-fs-lg); }
  .hm-first__text { display: none; }
  .hm-first .wk-first-run-note { display: none; }
  .hm-first__actions { margin-top: 0; }
  .hm-first__actions .wk-btn { flex: 1 1 auto; justify-content: center; }
}


/* ================= round 3 =================
   Plan card (R11): ONE column at every width: copy, action, then a full-width usage block whose tiles/meters wrap with auto-fit,
   so no column is ever shorter than its neighbour and nothing is pinned to a far edge. */
.hm-plan__body { display: flex; flex-direction: column; gap: var(--wk-s-4); }
.hm-plan__main { max-width: 46rem; }
.hm-plan__actions { margin-top: 0; }
.hm-plan__usage { display: flex; flex-direction: column; gap: var(--wk-s-3); padding-top: var(--wk-s-4); border-top: 1px solid var(--wk-line); }
.hm-tile { display: flex; flex-direction: column; gap: var(--wk-s-1); min-width: 0; padding: var(--wk-s-3) var(--wk-s-4); border: 1px solid var(--wk-line); border-radius: var(--wk-r-sm); background-color: var(--wk-surface-2); }
.hm-tile dt { color: var(--wk-text-2); font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-regular); }
.hm-tile dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--wk-s-2); min-width: 0; }
.hm-tile__n { font-size: var(--wk-fs-xl); line-height: 1.2; font-weight: var(--wk-fw-semi); color: var(--wk-text); }
.hm-tile__u { color: var(--wk-text-3); font-size: var(--wk-fs-sm); }
.wk-meter__head { flex-wrap: wrap; }
@media (max-width: 767.98px) {
  /* the Keeper bubble floats bottom-right on phones: keep numbers beside their label, not at the far right edge */
  .hm-plan .wk-meter__head { justify-content: flex-start; column-gap: var(--wk-s-3); }
}

/* payer stat row (R12): big tabular figures, real numbers only */
.hm-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: var(--wk-s-1); min-width: 0; padding: var(--wk-s-3) var(--wk-s-4); border: 1px solid var(--wk-line); border-radius: var(--wk-r-md); background-color: var(--wk-surface-1); }
.hm-stat__n { margin: 0; font-size: var(--wk-fs-2xl); line-height: 1.1; font-weight: var(--wk-fw-semi); letter-spacing: -0.02em; color: var(--wk-text); }
.hm-stat__l { color: var(--wk-text-2); font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-regular); }
@media (max-width: 639.98px) {
  .hm-stats { order: 1; }   /* phones: the first action (resume) stays above the numbers */
  .hm-lower:not(.hm-winback) { order: 2; }
  .hm-stat { padding: var(--wk-s-2) var(--wk-s-3); }
  .hm-stat__n { font-size: var(--wk-fs-xl); }
}

/* the Keeper launcher must not float over an open upgrade modal */
html[data-hm-modal-open] .pk-root { visibility: hidden; }

/* ================= round 5: no orphan tile rows, at ANY width =================
   Column counts come from the CONTAINER width (not the viewport: the rail and card padding change what a card gets) and from the
   item count (data-n), so a grid is always 1 row of n, or an even 2-column grid; an odd last item spans the row. 3+1 / 4+1 cannot happen. */
.hm { container-type: inline-size; }
.hm-plan__usage { container-type: inline-size; }
.hm-stats, .hm-tiles, .hm-meters, .hm-includes { display: grid; gap: var(--wk-s-3); grid-template-columns: minmax(0, 1fr); margin: 0; }
.hm-meters { gap: var(--wk-s-4) var(--wk-s-6); }
.hm-includes { gap: var(--wk-s-2) var(--wk-s-6); }
/* narrow default: even counts 2 columns, 3 and 1 stay single column */
.hm-stats[data-n="2"], .hm-stats[data-n="4"], .hm-stats[data-n="5"], .hm-stats[data-n="6"],
.hm-tiles[data-n="2"], .hm-tiles[data-n="4"], .hm-tiles[data-n="5"], .hm-tiles[data-n="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-stats[data-n="5"] > :last-child, .hm-tiles[data-n="5"] > :last-child { grid-column: 1 / -1; }
.hm-stats[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* three short figures fit even on a phone */
@container (min-width: 34rem) {
  .hm-stats[data-n="4"], .hm-tiles[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hm-tiles[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-meters[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-includes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 46rem) {
  .hm-stats[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hm-stats[data-n="5"] > :last-child { grid-column: auto; }
  .hm-tiles[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hm-tiles[data-n="5"] > :last-child { grid-column: auto; }
  .hm-meters[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hm-check .wk-check__link { flex-wrap: nowrap; }
.hm-check .wk-check__link .wk-badge { flex: none; }

/* integration r5: at 1024px (three cards beside the rail) the title sharing a row with the 3rem thumbnail was squeezed to ~100px
   ("Image Labs library" in 3 slivers). The title asks for 9rem; when the thumbnail does not fit beside it, it drops under the title. */
.hm-resume__row { flex-wrap: wrap; row-gap: var(--wk-s-2); }
.hm-resume__row .wk-resume__title { flex: 1 1 9rem; }

/* ===== learn.css ===== */
/* ==========================================================================
   learn.css - S5 LEARN surface (Learning section: courses + certificates)
   Layout-only extras on top of components.css. Tokens only: no colour literal,
   no !important. Does NOT use the legacy .learning-record-* / .certificate-gallery-*
   classes, so ai-courses/course-progress.css cannot paint anything on this page.
   Round 2: #learning-record now WRAPS the section header (anchor lands on the heading).
   ========================================================================== */

.wk-learn { gap: var(--wk-s-5); }
.wk-learn__anchor { display: flex; flex-direction: column; gap: var(--wk-s-4); min-width: 0; }
.wk-learn__grid { min-width: 0; }
.wk-learn__grid.wk-grid { align-items: start; }
/* ROUND 5: every card header in Learning may wrap; the title keeps >= 8rem (or its whole text) and badges/counts drop below it */
.wk-learn .wk-card__head { flex-wrap: wrap; row-gap: var(--wk-s-2); }
.wk-learn .wk-card__head > .wk-card__title { flex: 1 1 8rem; min-width: min(8rem, 100%); overflow-wrap: break-word; }
.wk-learn .wk-card__head > .wk-badge,
.wk-learn .wk-card__head > .wk-text-sm { white-space: normal; max-width: 100%; height: auto; min-height: 1.5rem; }
.wk-learn__note { margin: 0; padding: 0 var(--wk-s-5) var(--wk-s-3); }
.wk-card__head + .wk-learn__note { padding-top: var(--wk-s-1); }
.wk-learn__none {
  margin: 0; display: flex; align-items: center; gap: var(--wk-s-2);
  min-height: var(--wk-hit); padding: var(--wk-s-3) var(--wk-s-4);
  border: 1px dashed var(--wk-line-strong); border-radius: var(--wk-r-md);
}
.wk-learn__none .wk-icon { flex: none; width: 1rem; height: 1rem; color: var(--wk-text-3); }

/* ---- thumbnails: calm, palette-toned, fixed 16:10 -------------------------------------- */
.wk-course__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--wk-r-sm);
  border: 1px solid var(--wk-line);
  background-color: var(--wk-surface-2);
}
.wk-course__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.6) brightness(0.9); }
.wk-course__thumb::after { content: ""; position: absolute; inset: 0; background-color: var(--wk-scrim); opacity: 0.32; pointer-events: none; }
.wk-course__thumb--none { display: flex; align-items: center; justify-content: center; color: var(--wk-text-3); }
.wk-course__thumb--none::after { content: none; }
.wk-course__thumb--none .wk-icon { width: 1.75rem; height: 1.75rem; }

/* ---- featured "continue" block ---------------------------------------------------------- */
.wk-learn__progress { container-type: inline-size; container-name: wkprog; }
.wk-continue { display: grid; gap: var(--wk-s-4); padding: var(--wk-s-2) var(--wk-s-5) var(--wk-s-5); grid-template-columns: minmax(0, 1fr); }
.wk-continue > .wk-course__thumb { max-width: 20rem; }
.wk-continue__body { min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-2); }
.wk-continue__title {
  margin: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: var(--wk-fs-lg); font-weight: var(--wk-fw-semi); line-height: var(--wk-lh-snug);
}
.wk-continue__meta { margin: 0; }
.wk-continue__actions { margin-top: var(--wk-s-1); }
/* side-by-side ONLY when the CARD itself is wide (the workspace gives it ~350px at 768-1100 viewports) */
@container wkprog (min-width: 29rem) {
  .wk-continue { grid-template-columns: 13rem minmax(0, 1fr); align-items: center; }
}
.wk-continue__actions .wk-btn { max-width: 100%; height: auto; padding-block: var(--wk-s-2); white-space: normal; text-align: start; }

/* ---- compact rows ------------------------------------------------------------------------ */
.wk-learn__rest { border-top: 1px solid var(--wk-line); }
.wk-course { align-items: center; gap: var(--wk-s-3); padding: var(--wk-s-3) var(--wk-s-5); }
.wk-course__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-2); }
.wk-course__link { gap: 0; }
.wk-course__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-weight: var(--wk-fw-medium); line-height: 1.375rem;
}
p.wk-course__title { margin: 0; }
.wk-course__progress { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; align-items: center; gap: var(--wk-s-3); min-width: 0; }
.wk-course__pct { text-align: end; font-size: var(--wk-fs-sm); color: var(--wk-text-2); }
.wk-course__go { flex: none; display: inline-flex; align-items: center; color: var(--wk-text-3); }
.wk-course__go .wk-icon { width: 1rem; height: 1rem; }
.wk-course:hover .wk-course__go { color: var(--wk-text); }
.wk-course--static:hover { background-color: transparent; }

/* ---- Up next: compact, capped poster ---------------------------------------------------- */
.wk-learn__side { display: flex; flex-direction: column; gap: var(--wk-s-4); min-width: 0; }
.wk-learn__next { min-width: 0; }
.wk-learn__record .wk-stat-row { gap: var(--wk-s-3); margin: 0; }
.wk-learn__record dd { margin: 0; }
.wk-learn__next .wk-course__thumb { width: min(100%, 12rem); }
.wk-learn__next-link { display: flex; flex-direction: column; gap: var(--wk-s-1); justify-content: center; min-height: var(--wk-hit); color: var(--wk-text); }
.wk-learn__next-link:hover { color: var(--wk-text); }
.wk-learn__next-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--wk-text); font-weight: var(--wk-fw-semi); font-size: var(--wk-fs-md); line-height: var(--wk-lh-snug);
}
.wk-learn__next-link:hover .wk-learn__next-title { color: var(--wk-accent-text); }
.wk-learn__next-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wk-learn__next-link:focus-visible { outline: none; }
.wk-learn__next-link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: 2px; }
.wk-learn__blurb { margin: 0; }

/* ---- certificates: slim single-action tiles ----------------------------------------------- */
.wk-cert-grid {
  list-style: none; margin: 0;
  padding: var(--wk-s-1) var(--wk-s-5) var(--wk-s-5);
  display: grid; gap: var(--wk-s-3);
  grid-template-columns: minmax(0, 1fr);   /* columns are decided by tile count + card width below, never auto-fill (no orphan rows) */
}
.wk-cert {
  position: relative;
  min-width: 0;
  display: flex; align-items: center; gap: var(--wk-s-3);
  min-height: 4.25rem;
  padding: var(--wk-s-3) var(--wk-s-3) var(--wk-s-3) var(--wk-s-4);
  border: 1px solid var(--wk-line);
  border-radius: var(--wk-r-md);
  background-color: var(--wk-surface-2);
  transition: border-color var(--wk-dur-fast) var(--wk-ease), background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-cert:hover { border-color: var(--wk-line-strong); background-color: var(--wk-surface-3); }
.wk-cert__icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: var(--wk-r-pill);
  border: 1px solid var(--wk-line-strong); background-color: var(--wk-surface-3); color: var(--wk-text-2);
}
.wk-cert__icon .wk-icon { width: 1.125rem; height: 1.125rem; }
.wk-cert__id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.wk-cert__link { display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; min-height: var(--wk-hit); color: var(--wk-text); }
.wk-cert__link:hover { color: var(--wk-text); }
.wk-cert__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wk-cert__link:focus-visible { outline: none; }
.wk-cert__link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: 2px; }
.wk-cert__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  font-weight: var(--wk-fw-semi); line-height: 1.375rem;
}
.wk-cert__meta { display: flex; flex-wrap: wrap; gap: 0 var(--wk-s-3); color: var(--wk-text-3); }
.wk-cert__code { font-size: var(--wk-fs-xs); overflow-wrap: anywhere; }
.wk-cert__pub { position: relative; z-index: 1; flex: none; }
.wk-cert-more { padding: 0 var(--wk-s-5) var(--wk-s-3); }
.wk-cert-more > summary { list-style: none; cursor: pointer; }
.wk-cert-more > summary::-webkit-details-marker { display: none; }
.wk-cert-more .wk-cert-grid { padding-inline: 0; }
.wk-more > summary { display: inline-flex; }
.wk-more__close { display: none; }
.wk-more[open] > summary .wk-more__open { display: none; }
.wk-more[open] > summary .wk-more__close { display: inline; }
.wk-learn__more { padding: 0 var(--wk-s-5) var(--wk-s-3); border-top: 1px solid var(--wk-line); padding-top: var(--wk-s-2); }
.wk-learn__more .wk-list { margin-inline: calc(var(--wk-s-5) * -1); }
.wk-learn__more > summary { list-style: none; cursor: pointer; }
.wk-learn__more > summary::-webkit-details-marker { display: none; }
@media (max-width: 479.98px) {
  .wk-cert__icon { display: none; }
}

@media (forced-colors: active) {
  .wk-progress { border: 1px solid CanvasText; }
  .wk-progress__fill { background-color: Highlight; forced-color-adjust: none; }
  .wk-cert, .wk-course__thumb { border-color: CanvasText; }
  .wk-course__thumb::after { content: none; }
}

/* Balanced columns. The card (.wk-cert-card) is the container; data-r2 / data-r3 (learn.php) are the tile-count remainders.
   Two columns: an odd last tile spans the row. Three columns (a 6-track grid, each tile spans 2): one tile over spans the row,
   two over share it half and half. No lone tile, no gap, no tall single column. */
.wk-cert-card { container-type: inline-size; }
@container (min-width: 36rem) {
  .wk-cert-grid[data-r2] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-cert-grid[data-r2="1"] > :last-child { grid-column: 1 / -1; }
}
@container (min-width: 56rem) {
  .wk-cert-grid[data-r3] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .wk-cert-grid[data-r3] > *, .wk-cert-grid[data-r3][data-r2="1"] > :last-child { grid-column: span 2; }
  .wk-cert-grid[data-r3="1"] > :last-child, .wk-cert-grid[data-r3="1"][data-r2="1"] > :last-child { grid-column: 1 / -1; }
  .wk-cert-grid[data-r3="2"] > :nth-last-child(-n+2), .wk-cert-grid[data-r3="2"][data-r2] > :nth-last-child(-n+2) { grid-column: span 3; }
}

/* "Your record": the column count is the STAT count (data-n), or one column when the card is too narrow for it. Never 2+1. */
.wk-learn__record { container-type: inline-size; }
.wk-learn__record .wk-stat-row { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 14rem) { .wk-learn__record .wk-stat-row[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 20rem) { .wk-learn__record .wk-stat-row[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media print {
  .wk-progress { border: 1px solid GrayText; background-color: transparent; }
  .wk-progress__fill { background-color: GrayText; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* the extra certificates are part of the record: print them, and do not print an inert "Show N more" button */
  @supports selector(::details-content) {
    .wk-more > summary { display: none; }
    .wk-more::details-content { content-visibility: visible; display: block; }
  }
}

/* ===== library.css ===== */
/* ==========================================================================
   library.css  -  S6 LIBRARY (section #library). Layout-only extras on top of components.css.
   Tokens only: no colour literals, no !important. Markup: includes/profile/library.php.
   ========================================================================== */

.wk-lib { min-width: 0; scroll-margin-top: var(--wk-anchor-offset); container: wklib / inline-size; }
.wk-lib__bar { padding: var(--wk-s-2) var(--wk-s-3) 0; border-bottom: 1px solid var(--wk-line); }
.wk-lib__bar .wk-tabs { border-bottom: 0; }

/* the tab count slot doubles as the "could not load" warning: colour + icon + hidden words */
.wk-lib__tabwarn { display: inline-flex; align-items: center; color: var(--wk-warn); background-color: var(--wk-warn-soft); }
.wk-lib__tabwarn .wk-icon { width: 0.875rem; height: 0.875rem; }
.wk-tab[aria-selected="true"] .wk-lib__tabwarn { background-color: var(--wk-warn-soft); color: var(--wk-warn); }

/* filter + sort */
.wk-lib__tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 11rem) auto;
  gap: var(--wk-s-2);
  padding: var(--wk-s-3) var(--wk-s-4);
  border-bottom: 1px solid var(--wk-line);
}
.wk-lib__tools[hidden] { display: none; }
.wk-lib__search, .wk-lib__sort { min-width: 0; }
.wk-lib__sort { position: relative; display: block; }
.wk-lib__sort::after {
  content: ""; position: absolute; inset-inline-end: var(--wk-s-3); top: 50%;
  width: 0.5rem; height: 0.5rem; margin-top: -0.375rem;
  border-inline-end: 2px solid var(--wk-text-2); border-block-end: 2px solid var(--wk-text-2);
  transform: rotate(45deg); pointer-events: none;
}
@media (max-width: 639.98px) {
  .wk-lib__tools { grid-template-columns: minmax(0, 1fr) auto; }
  .wk-lib__search { grid-column: 1 / -1; }
}
@media (max-width: 479.98px) {
  .wk-lib__tools { grid-template-columns: minmax(0, 1fr); }
}
.wk-lib__searchall[hidden] { display: none; }
.wk-lib__searchall { white-space: nowrap; }
.wk-lib__scope { margin: 0; padding: var(--wk-s-2) var(--wk-s-4) 0; }
.wk-lib__scope[hidden] { display: none; }
.wk-lib__manual { height: auto; min-height: 8rem; padding: var(--wk-s-3); font-family: inherit; resize: vertical; }

.wk-lib__panel { min-width: 0; }
.wk-lib__panel[hidden] { display: none; }
.wk-lib__list { border-top: 0; }
.wk-lib__panel > .wk-empty { padding-block: var(--wk-s-10); }

/* an unsaving row: dimmed and inert, same height (no layout shift) */
.wk-lib-row.is-busy { opacity: 0.55; pointer-events: none; }
.wk-lib-row[hidden] { display: none; }
.wk-lib-row.is-open, .wk-lib__tile.is-open { z-index: var(--wk-z-menu); }
.wk-lib-actions .wk-menu { min-width: 12.5rem; }
.wk-lib-actions .wk-menu--up { inset-block-start: auto; inset-block-end: calc(100% + var(--wk-s-1)); }

/* footer under each list */
.wk-lib__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--wk-s-2) var(--wk-s-4);
  min-height: 3rem;
  padding: var(--wk-s-1) var(--wk-s-4);
  border-top: 1px solid var(--wk-line);
}
.wk-lib__note { padding: 0 var(--wk-s-4) var(--wk-s-3); max-width: 70ch; }

/* partial-failure note inside an otherwise working tab */
.wk-lib__partial {
  display: flex; align-items: flex-start; gap: var(--wk-s-2);
  margin: var(--wk-s-3) var(--wk-s-4) 0; padding: var(--wk-s-2) var(--wk-s-3);
  border: 1px solid var(--wk-warn-line); border-radius: var(--wk-r-sm);
  background-color: var(--wk-warn-soft); color: var(--wk-text); font-size: var(--wk-fs-sm);
}
.wk-lib__partial .wk-icon { flex: none; margin-top: 0.125rem; color: var(--wk-warn); }

/* submissions header */
.wk-lib__subhead {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--wk-s-1) var(--wk-s-3);
  padding: var(--wk-s-2) var(--wk-s-4) 0;
}

/* image tiles */
.wk-lib__group { padding: var(--wk-s-3) var(--wk-s-4) var(--wk-s-1); }
.wk-lib__group[hidden] { display: none; }
.wk-lib__grouphead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--wk-s-1) var(--wk-s-3); margin-bottom: var(--wk-s-2); }
.wk-lib__h { font-size: var(--wk-fs-base); font-weight: var(--wk-fw-semi); color: var(--wk-text); }
.wk-lib__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* phones: 2-up, never one 3,600px column */
  gap: var(--wk-s-3);
  padding-bottom: var(--wk-s-3);
}
.wk-lib__tile { position: relative; min-width: 0; }
.wk-lib__tile[hidden] { display: none; }
.wk-lib__tilelink { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; color: var(--wk-text); border-radius: var(--wk-r-sm); }
.wk-lib__tilelink:hover { color: var(--wk-text); }
.wk-lib__tilelink:focus-visible { outline: 2px solid var(--wk-ring); outline-offset: 2px; }
.wk-lib__thumb {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; width: 100%; overflow: hidden;
  border: 1px solid var(--wk-line); border-radius: var(--wk-r-sm);
  color: var(--wk-text-3);
}
.wk-lib__thumb > .wk-icon { position: absolute; }
.wk-lib__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background-color: var(--wk-surface-2); }
.wk-lib__tilelink:hover .wk-lib__thumb { border-color: var(--wk-control-line); }
.wk-lib__cap {
  min-width: 0; font-size: var(--wk-fs-sm); font-weight: var(--wk-fw-medium); line-height: 1.25rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-lib__capmeta { min-width: 0; font-size: var(--wk-fs-xs); color: var(--wk-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* reload skeleton (shown while the page reloads after "Reload") */
.wk-lib-skel { padding: 0; }

.wk-lib__nomatch[hidden], [data-lib-emptied][hidden] { display: none; }
.wk-lib__nomatch > .wk-empty, [data-lib-emptied] > .wk-empty { padding-block: var(--wk-s-8); }

/* phones: the status pill drops under the title so long titles keep the full row width */
@media (max-width: 479.98px) {
  .wk-lib-row { flex-wrap: wrap; row-gap: 0; }
  .wk-lib-row .wk-row__main { flex: 1 1 0; }
  .wk-lib-row .wk-row__trail { flex: 0 0 100%; padding-inline-start: 3rem; padding-bottom: var(--wk-s-1); margin-top: calc(var(--wk-s-1) * -1); }
}

/* integration: at phone width the meta line ("PromptShare - 2 days ago") was ellipsised to "2 days a..."; the title keeps its
   ellipsis, the meta wraps instead (a time that reads "a..." is worse than a second line) */
@media (max-width: 479.98px) {
  .wk-lib-row .wk-row__meta { white-space: normal; }
}

/* R9: scroll cue on the tab strip (edge fades appear only while there is more to scroll to; mask uses the alpha of an opaque token) */
.wk-lib__bar.has-more-end .wk-tabs { -webkit-mask-image: linear-gradient(to right, var(--wk-text) calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, var(--wk-text) calc(100% - 2.5rem), transparent); }
.wk-lib__bar.has-more-start .wk-tabs { -webkit-mask-image: linear-gradient(to left, var(--wk-text) calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, var(--wk-text) calc(100% - 2.5rem), transparent); }
.wk-lib__bar.has-more-start.has-more-end .wk-tabs { -webkit-mask-image: linear-gradient(to right, transparent, var(--wk-text) 2.5rem, var(--wk-text) calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, transparent, var(--wk-text) 2.5rem, var(--wk-text) calc(100% - 2.5rem), transparent); }

/* titles wrap to two lines (full text in the title attribute); meta stays one line */
.wk-lib-row .wk-row__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  white-space: normal; overflow-wrap: anywhere;
}
.wk-lib__excerpt { display: block; color: var(--wk-text-2); }

/* R7: the quick copy action is revealed on hover / focus on hover-capable pointers, always present on touch */
@media (hover: hover) {
  .wk-lib-quick { opacity: 0; transition: opacity var(--wk-dur-fast) var(--wk-ease); }
  .wk-lib-row:hover .wk-lib-quick, .wk-lib-row:focus-within .wk-lib-quick, .wk-lib-quick:focus-visible { opacity: 1; }
}
@media (max-width: 479.98px) { .wk-lib-quick { display: none; } }   /* phones: Copy prompt stays in the row menu (row width) */

/* integration r2: my phone rule above lets the meta wrap; the excerpt line is decoration, so it gets two lines then an ellipsis
   (twelve five-line rows made the tab 2,000px tall on a phone) */
@media (max-width: 479.98px) {
  .wk-lib-row .wk-lib__excerpt {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  }
}

/* R15 / e2e M1: the tab strip is sized by the CARD width (container query), not the viewport, because the rail gives the card a different width at every breakpoint.
   >= 940px card: icons + counts; 830-939: no icons; < 830: the six tabs wrap into a 3-column then 2-column grid, so no tab is ever cut or scrolled off. */
@container wklib (max-width: 939.98px) { .wk-lib__bar .wk-tab > .wk-icon { display: none; } }
@container wklib (max-width: 829.98px) {
  .wk-lib__bar .wk-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 0 var(--wk-s-1); }
  .wk-lib__bar .wk-tab { justify-content: center; min-width: 0; }
  .wk-lib__bar .wk-tab > .wk-icon { display: inline-block; }
}
@container wklib (max-width: 479.98px) { .wk-lib__bar .wk-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wk-lib__bar .wk-tab > .wk-icon { display: none; } }
@container wklib (max-width: 829.98px) {
  .wk-lib__bar .wk-tab[aria-selected="true"]::after { left: var(--wk-s-3); right: var(--wk-s-3); }
}
/* image grid: column counts chosen per group size (PHP sets --lib-c-md / --lib-c-lg) so 6 tiles never leave an orphan row */
@container wklib (min-width: 480px) { .wk-lib__grid { grid-template-columns: repeat(var(--lib-c-md, 3), minmax(0, 1fr)); } }
@container wklib (min-width: 900px) { .wk-lib__grid { grid-template-columns: repeat(var(--lib-c-lg, 6), minmax(0, 1fr)); } }
/* the panel is a script/fragment focus target, not a Tab stop: no ring around the whole list (N5) */
.wk-lib__panel:focus { outline: none; }
/* Keeper launcher lives bottom-right: keep the list foot's link clear of it up to tablet width */
@media (max-width: 1023.98px) { .wk-lib__foot { padding-inline-end: 4.75rem; } }

/* round 5 L2: 4+ digit tab counts (class from PHP): icons drop and the grid wraps earlier, and grid tabs may wrap the count under the label */
@container wklib (max-width: 1099.98px) { .wk-lib--dense .wk-lib__bar .wk-tab > .wk-icon { display: none; } }
@container wklib (max-width: 999.98px) {
  .wk-lib--dense .wk-lib__bar .wk-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 0 var(--wk-s-1); }
  .wk-lib--dense .wk-lib__bar .wk-tab { justify-content: center; min-width: 0; }
}
@container wklib (max-width: 479.98px) { .wk-lib--dense .wk-lib__bar .wk-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container wklib (max-width: 999.98px) {
  .wk-lib__bar .wk-tab { flex-wrap: wrap; white-space: normal; text-align: center; row-gap: 0; }
}
/* round 5 L3: an unbroken category/meta string wraps instead of truncating the "saved ... ago" part */
.wk-lib-row .wk-row__meta:not(.wk-lib__excerpt) { white-space: normal; overflow-wrap: anywhere; }

/* ===== explore.css ===== */
/* explore.css - "Tools & studio" (#tools). Layout-only extras; every colour, size and space is a token. */

.wk-explore { scroll-margin-top: var(--wk-anchor-offset); }

/* ---- image studio ------------------------------------------------------- */
.wk-explore__studio-body { padding: 0 var(--wk-s-5) var(--wk-s-5); display: flex; flex-direction: column; gap: var(--wk-s-4); min-width: 0; }
.wk-explore__studio-body .wk-tabs { max-width: 100%; }   /* round 2: same underline tabs as Library (was a segmented control) */
.wk-explore__studio--empty {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--wk-s-3) var(--wk-s-4);
  padding: var(--wk-s-4) var(--wk-s-5);
}
.wk-explore__studio-text { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-1); }
.wk-explore__studio > .wk-card__head { flex-wrap: wrap; }
.wk-explore__studio-body { container-type: inline-size; }
/* Columns follow the CARD width (container query) AND the item count so the last row is never short: 6 -> 2/3/6, 4 -> 2/4, 3 -> 3, 2 -> 2, 1 -> 1 (5 is trimmed to 4 in PHP). */
.wk-explore__thumbs { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wk-explore__thumbs[data-n="1"] { grid-template-columns: minmax(0, 1fr); max-width: 12rem; }
.wk-explore__thumbs[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (min-width: 28rem) { .wk-explore__thumbs[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 38rem) { .wk-explore__thumbs[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 46rem) { .wk-explore__thumbs[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.wk-explore__thumb { min-width: 0; }
.wk-explore__thumblink {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--wk-s-1);
  min-width: 0;
  min-height: var(--wk-hit);
  color: var(--wk-text);
  border-radius: var(--wk-r-sm);
}
.wk-explore__thumblink:hover { color: var(--wk-text); }
.wk-explore__thumblink:hover .wk-thumb { border-color: var(--wk-line-strong); }
.wk-explore__cap {
  display: block;
  overflow-wrap: anywhere;
  font-size: var(--wk-fs-sm);
  font-weight: var(--wk-fw-medium);
  line-height: 1.25rem;
}
.wk-explore__sub-cap {
  display: block;
  overflow-wrap: anywhere;
  font-size: var(--wk-fs-xs);
  line-height: 1rem;
  color: var(--wk-text-3);
}
.wk-explore__note { margin-top: var(--wk-s-2); font-size: var(--wk-fs-xs); line-height: 1rem; color: var(--wk-text-3); }
.wk-explore__empty { padding-block: var(--wk-s-6); }

/* ---- tools grid --------------------------------------------------------- */
.wk-explore__tools { display: flex; flex-direction: column; gap: var(--wk-s-3); min-width: 0; }
.wk-explore__tools { container-type: inline-size; }
.wk-explore__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-s-2) var(--wk-s-4); min-width: 0; }
.wk-explore__search { flex: 1 1 14rem; max-width: 20rem; min-width: 0; }
/* Chips: never cropped at rest. The strip asks for its whole width (max-content), so the bar drops it UNDER the search whenever it does not fit
   beside it. If even that row is narrower than the chips, the chips wrap onto a second row (>= 30rem card). Only in a phone-narrow card
   (< 30rem) do they scroll sideways, and then a fade at the edge says so (it goes away at the end of the strip; explore.js sets data-end). */
.wk-explore__chipwrap { position: relative; flex: 1 1 max-content; min-width: 0; }
.wk-explore__chips {
  position: relative;
  min-width: 0;
  flex-wrap: wrap;
  overflow: visible;
}
.wk-explore__chips .wk-chip { flex: none; }
.wk-explore__chipwrap::after {
  content: "";
  display: none;
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 2.5rem;
  pointer-events: none;
  background-image: linear-gradient(to left, var(--wk-bg), transparent);
}
@container (max-width: 29.99rem) {
  .wk-explore__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block: var(--wk-s-1);
    margin-block: calc(var(--wk-s-1) * -1);
    padding-inline: var(--wk-s-1) 2.5rem;
    margin-inline-start: calc(var(--wk-s-1) * -1);
    scrollbar-width: none;
    scroll-padding-inline: var(--wk-s-1);
  }
  .wk-explore__chips::-webkit-scrollbar { display: none; }
  .wk-explore__chipwrap::after { display: block; }
  .wk-explore__chipwrap[data-end]::after { display: none; }
  .wk-explore__chipwrap[data-end] .wk-explore__chips { padding-inline-end: var(--wk-s-1); }
}
.wk-explore__label {
  margin-top: var(--wk-s-2);
  font-size: var(--wk-fs-sm);
  font-weight: var(--wk-fw-semi);
  line-height: 1.25rem;
  color: var(--wk-text-2);
}
.wk-explore__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--wk-s-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.wk-explore__grid:empty { display: none; }

.wk-tool {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--wk-s-3);
  padding: var(--wk-s-3) var(--wk-s-4);
  min-height: 4.5rem;
}
.wk-tool__icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--wk-r-sm);
  border: 1px solid var(--wk-line);
  background-color: var(--wk-surface-2);
  color: var(--wk-accent-text);
}
.wk-tool__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-1); align-self: stretch; }
.wk-tool__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wk-s-1) var(--wk-s-2); min-width: 0; }
.wk-tool__name { font-weight: var(--wk-fw-semi); line-height: 1.375rem; overflow-wrap: anywhere; }
.wk-tool__link {
  display: flex;
  flex-direction: column;
  gap: var(--wk-s-1);
  min-width: 0;
  min-height: var(--wk-hit);
  justify-content: flex-start;
  flex: 1 1 auto;
  color: var(--wk-text);
}
.wk-tool__link:hover { color: var(--wk-text); }
/* the whole card is the target; ring on the card, not the text */
.wk-tool__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wk-tool__link:focus-visible { outline: none; }
.wk-tool__link:focus-visible::after { outline: 2px solid var(--wk-ring); outline-offset: 2px; }
.wk-tool__desc { display: block; color: var(--wk-text-2); font-size: var(--wk-fs-sm); line-height: 1.25rem; }
.wk-tool__meta { display: block; margin-top: auto; padding-top: var(--wk-s-1); color: var(--wk-text-3); font-size: var(--wk-fs-xs); line-height: 1rem; }
/* category tint on the icon tile (tokens only): a quiet cue for the chip groups, not a status colour */
.wk-tool[data-group="prompts"] .wk-tool__icon { color: var(--wk-accent-text); background-color: var(--wk-accent-soft); border-color: var(--wk-accent-line); }
.wk-tool[data-group="agents"] .wk-tool__icon { color: var(--wk-info); background-color: var(--wk-info-soft); border-color: var(--wk-info-line); }
.wk-tool[data-group="writing"] .wk-tool__icon { color: var(--wk-success); background-color: var(--wk-success-soft); border-color: var(--wk-success-line); }
.wk-tool[data-group="research"] .wk-tool__icon { color: var(--wk-warn); background-color: var(--wk-warn-soft); border-color: var(--wk-warn-line); }
.wk-tool[data-group="media"] .wk-tool__icon { color: var(--wk-accent-text); background-color: var(--wk-surface-3); }
.wk-tool[data-group="study"] .wk-tool__icon { color: var(--wk-text-2); }
.wk-tool[data-locked] .wk-tool__icon { color: var(--wk-text-3); background-color: var(--wk-surface-2); border-color: var(--wk-line); }
.wk-tool[hidden] { display: none; }
.wk-explore__nomatch { padding-block: var(--wk-s-8); }

/* phone: collapsed to the featured tools BY DEFAULT in CSS (no JS needed, no jump when explore.js arrives late).
   [data-expanded] = "Show all" pressed; [data-filtering] = search/chip active. From 640px everything shows and the button is gone. */
.wk-explore__more { display: block; }
.wk-explore__more .wk-btn { scroll-margin-block: var(--wk-anchor-offset); }
@media (max-width: 639.98px) {
  [data-wk-tools]:not([data-expanded]):not([data-filtering]) .wk-tool[data-more] { display: none; }
  [data-wk-tools][data-filtering] .wk-explore__more { display: none; }
  .wk-tool { min-height: 0; padding-block: var(--wk-s-3); }
}
@media (min-width: 640px) {
  .wk-explore__more { display: none; }
}

/* row titles in the database/community cards wrap (no ellipsis + hidden title) */
.wk-row__title--wrap { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* ---- lower row ---------------------------------------------------------- */
.wk-explore__lower { align-items: start; }

/* ===== account.css ===== */
/* ==========================================================================
   account.css - layout-only extras for the ACCOUNT surface + footer strip.
   Components come from components.css; tokens only, no colour literals, no !important.
   ========================================================================== */
.acct-email { overflow-wrap: anywhere; color: var(--wk-text); }
/* M2 (docs/49): the workspace gives cards less width than the viewport (rail), so columns follow the CONTAINER via auto-fit,
   not viewport breakpoints; align-items:start = no void below short cards. */
/* Columns follow the CONTAINER (the workspace column, not the viewport): 1 column, 2x2 from 39rem, 3 columns + full-width data card from 60rem. */
.acct { container-type: inline-size; container-name: acct; }
.acct-grid { display: grid; gap: var(--wk-s-4); grid-template-columns: minmax(0, 1fr); align-items: start; min-width: 0; }
@container acct (min-width: 39rem) { .acct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container acct (min-width: 60rem) { .acct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .acct-data { grid-column: 1 / -1; } }
.acct-actions--2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.acct-actions--2 .wk-btn { justify-content: center; }
/* R7: the CTA sits directly under the copy (components.css pins .wk-plan__actions to the card bottom = dead space) */
.acct .wk-plan__actions { margin-top: 0; }
.acct-rowbtn { width: 100%; align-items: flex-start; text-align: start; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.acct-rowbtn .wk-row__title, .acct-rowbtn .wk-row__meta { width: 100%; text-align: start; }
.acct-form { display: flex; margin: 0; }
.acct-inline { color: var(--wk-accent-text); text-decoration: underline; text-underline-offset: 0.15em; }
.acct-inline:hover { color: var(--wk-text); }
.acct-stale .wk-icon { color: var(--wk-warn); }
.wk-dialog__foot[data-acct-confirm] { margin: 0; }
.acct-kbd-row[hidden] { display: none; }
/* a keyboard row has no place on touch or phone-width screens (the shell's help dialog still has the switch) */
@media (hover: none), (pointer: coarse), (max-width: 479.98px) { .acct-kbd-row { display: none; } }

.acct-data__body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--wk-s-4) var(--wk-s-6); }
.acct-data__text { flex: 1 1 24rem; min-width: 0; display: flex; flex-direction: column; gap: var(--wk-s-2); }
.acct-data__text p { max-width: 68ch; }
.acct-data__cta { flex: none; }

.acct-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--wk-s-2) var(--wk-s-4);
  padding-top: var(--wk-s-3);
  border-top: 1px solid var(--wk-line);
  color: var(--wk-text-3); font-size: var(--wk-fs-sm);
}
.acct-strip__hint { display: flex; align-items: center; gap: var(--wk-s-2); margin: 0; }
.acct-strip__hint[hidden] { display: none; }
@media (hover: none) { .acct-strip__hint { display: none; } }
/* L8: keep the last rows clear of the fixed Prompt Keeper launcher on phones */
@media (max-width: 1023.98px) { .acct { padding-bottom: var(--wk-s-16); } }

.acct-strip .wk-linkbtn { display: inline-flex; align-items: center; min-height: var(--wk-hit); }
@media (forced-colors: active) {
  .acct .wk-row__meta, .acct .wk-help, .acct .wk-muted, .acct .wk-plan__status { color: CanvasText; }
  .acct .wk-plan-chip, .acct .wk-btn { border: 1px solid ButtonText; }
}

/* wk-eof */
