* { box-sizing: border-box; }
  html, body { margin: 0; }
  body { background: var(--bg); }

  /* ── App frame ───────────────────────────────────────────── */
  .cx-app {
    position: relative; min-height: 100dvh; overflow-x: hidden;
    background: var(--grad-twilight);
    color: var(--text-primary); font-family: var(--font-sans);
  }
  .cx-app[data-theme="day"] {
    background: radial-gradient(125% 120% at 50% -12%, oklch(0.992 0.004 300), var(--twilight-50) 70%);
  }
  .cx-aurora {
    position: fixed; inset: -22% -10% auto -10%; height: 78vh; pointer-events: none; z-index: 0;
    background:
      radial-gradient(40% 45% at 16% 10%, oklch(0.446 0.195 304/.34), transparent 70%),
      radial-gradient(34% 40% at 84% 6%, oklch(0.540 0.196 304/.22), transparent 70%),
      radial-gradient(26% 34% at 62% 22%, oklch(0.711 0.198 145/.14), transparent 70%);
    filter: blur(22px); animation: cx-drift 16s var(--ease-soft) infinite alternate;
  }
  .cx-app[data-theme="day"] .cx-aurora { opacity: .45;
    background:
      radial-gradient(40% 45% at 16% 10%, oklch(0.540 0.196 304/.16), transparent 70%),
      radial-gradient(34% 40% at 84% 6%, oklch(0.446 0.195 304/.12), transparent 70%),
      radial-gradient(26% 34% at 62% 22%, oklch(0.711 0.198 145/.12), transparent 70%);
  }
  @keyframes cx-drift {
    0%   { transform: translate3d(0,0,0) scale(1); }
    100% { transform: translate3d(2%, 2.5%, 0) scale(1.06); }
  }
  .cx-screen { position: relative; z-index: 1; }

  /* ── Brand mark + wordmark ───────────────────────────────── */
  .cx-mark-orbit { stroke: var(--brand-text); stroke-width: 1.4; fill: none; opacity: .55; }
  .cx-mark-orbit-2 { opacity: .3; }
  .cx-mark-halo { fill: var(--accent); opacity: .22; }
  .cx-mark-core { fill: var(--accent); }
  .cx-mark-node { fill: var(--accent); }
  .cx-mark { filter: drop-shadow(0 0 6px oklch(0.711 0.198 145 / 0.5)); }

  /* DS brand emblem (cosmic nexus) */
  .cx-emblem { display: block; flex: 0 0 auto; background: url('assets/wisp-emblem.png') center/contain no-repeat; }
  .cx-emblem--glow { filter: drop-shadow(0 0 10px oklch(0.540 0.196 304 / 0.45)) drop-shadow(0 0 16px oklch(0.711 0.198 145 / 0.30)); }

  .cx-brand { display: inline-flex; align-items: center; gap: 11px; }
  .cx-brand-text { display: inline-flex; flex-direction: column; line-height: 1; }
  .cx-word { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: .2px; }
  .cx-word-sub { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); color: var(--text-faint); margin-top: 3px; }

  /* ── Centered layouts (auth screens) ─────────────────────── */
  .cx-center {
    position: relative; min-height: 100dvh; display: grid; place-items: center;
    padding: clamp(20px, 5vw, 48px) clamp(16px, 5vw, 40px) 140px;
  }
  .cx-ring-deco {
    position: absolute; top: 50%; left: 50%; width: min(640px, 90vw); aspect-ratio: 1; pointer-events: none; z-index: 0;
    transform: translate(-50%, -54%);
    background:
      radial-gradient(circle, transparent 38%, oklch(0.711 0.198 145/.05) 38.4%, transparent 40%),
      radial-gradient(circle, transparent 56%, oklch(0.540 0.196 304/.07) 56.4%, transparent 58%),
      radial-gradient(circle, transparent 74%, oklch(0.540 0.196 304/.05) 74.4%, transparent 76%);
  }
  [data-theme="day"] .cx-ring-deco { opacity: .7; }

  /* ── Card base ───────────────────────────────────────────── */
  .cx-card {
    position: relative; z-index: 1; width: 100%;
    background: oklch(0.232 0.034 306 / 0.66);
    backdrop-filter: blur(var(--blur-lg)); -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid oklch(0.70 0.04 305 / 0.14);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), var(--ring-hairline);
    padding: clamp(28px, 4vw, 40px);
  }
  [data-theme="day"] .cx-card {
    background: oklch(0.992 0.004 300 / 0.82);
    border-color: oklch(0.660 0.026 304 / 0.20);
  }

  /* ── Sign in ─────────────────────────────────────────────── */
  .cx-signin { max-width: 25.5rem; text-align: center; }
  .cx-signin-head { display: flex; flex-direction: column; align-items: center; gap: 14px; }
  .cx-signin-word { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: .3px; margin: 4px 0 0; }
  .cx-signin-prop { margin: 0; color: var(--text-secondary); font-size: var(--text-md); line-height: var(--leading-snug); max-width: 19rem; text-wrap: balance; }

  .cx-return {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin: 26px 0 0; padding: 11px 14px;
    background: var(--surface-inset); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-secondary);
  }
  [data-theme="day"] .cx-return { background: var(--surface-3); }
  .cx-return-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent-text); flex: 0 0 auto; }
  .cx-host { font-family: var(--font-mono); font-size: .92em; color: var(--text-primary); }

  .cx-secure { display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 16px 0 0; color: var(--text-faint); font-size: var(--text-xs); }
  .cx-secure svg { color: var(--accent-text); }

  .cx-signin-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 24px;
    padding-top: 18px; border-top: 1px solid var(--border-subtle); }
  .cx-eyebrow { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wider);
    text-transform: uppercase; color: var(--text-faint); margin: 0; }
  .cx-eyebrow--center { text-align: center; }

  .cx-textlink { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
    font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary);
    padding: 4px 6px; border-radius: var(--radius-sm); transition: color var(--dur-fast); }
  .cx-textlink:hover { color: var(--accent-text); }

  /* ── Google button ───────────────────────────────────────── */
  .cx-gbtn {
    display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
    margin-top: 20px;
    height: 50px; padding: 0 18px; border-radius: var(--radius-md);
    background: #ffffff; color: #3c4043; border: 1px solid #dadce0;
    font-family: var(--font-sans); font-weight: 600; font-size: var(--text-base); cursor: pointer;
    box-shadow: 0 1px 2px rgba(60,64,67,.16); user-select: none;
    transition: background var(--dur-fast), box-shadow var(--dur-base), transform var(--dur-fast);
  }
  .cx-gbtn:hover { background: #f7f8f8; box-shadow: 0 2px 6px rgba(60,64,67,.22); }
  .cx-gbtn:active { transform: translateY(0.5px) scale(.99); }
  .cx-gbtn[disabled] { cursor: default; opacity: .92; }
  .cx-gbtn-ic { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; }
  .cx-gbtn-label { white-space: nowrap; }
  .cx-gspin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #dadce0; border-top-color: #4285F4;
    animation: cx-spin .8s linear infinite; }
  @keyframes cx-spin { to { transform: rotate(360deg); } }

  /* ── OAuth redirect interstitial ─────────────────────────── */
  .cx-redirect { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
  .cx-redirect-orbit { position: relative; display: grid; place-items: center; width: 116px; height: 116px; }
  .cx-redirect-orbit::before, .cx-redirect-orbit::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 1.5px solid transparent; border-top-color: var(--accent); border-right-color: oklch(0.540 0.196 304 / .6);
    animation: cx-spin 2.4s linear infinite;
  }
  .cx-redirect-orbit::after { inset: 14px; border-top-color: oklch(0.540 0.196 304 / .7); border-right-color: transparent;
    animation-duration: 3.4s; animation-direction: reverse; }
  .cx-redirect-title { margin: 0; font-size: var(--text-xl); font-weight: 600; letter-spacing: var(--tracking-snug); white-space: nowrap; }
  .cx-progress { width: min(260px, 70vw); height: 4px; border-radius: var(--radius-pill); background: var(--surface-inset); overflow: hidden; }
  .cx-progress span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--grad-wisp);
    box-shadow: var(--glow-wisp); animation: cx-load 1.7s var(--ease-soft) infinite; }
  @keyframes cx-load { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
  .cx-redirect-route { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text-faint);
    font-family: var(--font-mono); font-size: var(--text-xs); flex-wrap: wrap; justify-content: center; }
  .cx-route-arrow { color: var(--accent-text); }

  /* ── State screens (403 / signed out) ────────────────────── */
  .cx-state { max-width: 27rem; text-align: center; }
  .cx-state-badge { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 20px;
    border-radius: var(--radius-pill); }
  .cx-state-badge--protected { background: var(--brand-soft); color: var(--brand-text); box-shadow: 0 0 0 1px var(--border-subtle), var(--glow-dusk); }
  .cx-state-badge--neutral { background: var(--surface-inset); color: var(--text-secondary); box-shadow: 0 0 0 1px var(--border-subtle); }
  .cx-state-title { margin: 8px 0 0; font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-snug); }
  .cx-state-body { margin: 14px auto 0; color: var(--text-secondary); font-size: var(--text-md); line-height: var(--leading-normal); max-width: 23rem; text-wrap: pretty; }
  .cx-whoami { display: inline-flex; align-items: center; gap: 9px; margin: 16px auto 0; padding: 7px 14px 7px 7px;
    background: var(--surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
    font-size: var(--text-sm); color: var(--text-secondary); }
  .cx-whoami strong { color: var(--text-primary); font-weight: 600; font-family: var(--font-mono); font-size: .92em; }
  .cx-state-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }

  /* ── Portal ──────────────────────────────────────────────── */
  .cx-portal { position: relative; z-index: 1; }
  .cx-bar {
    position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4); padding: 14px clamp(16px, 4vw, 40px);
    background: oklch(0.168 0.030 307 / 0.66); backdrop-filter: blur(var(--blur-lg)); -webkit-backdrop-filter: blur(var(--blur-lg));
    border-bottom: 1px solid var(--border-subtle);
  }
  [data-theme="day"] .cx-bar { background: oklch(0.992 0.004 300 / 0.74); }
  .cx-bar-actions { display: flex; align-items: center; gap: var(--space-3); }

  .cx-account { position: relative; }
  .cx-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; background: transparent;
    border: 1px solid transparent; border-radius: var(--radius-pill); cursor: pointer; font: inherit; color: inherit;
    transition: background var(--dur-fast), border-color var(--dur-fast); }
  .cx-chip:hover { background: var(--surface-2); border-color: var(--border-subtle); }
  .cx-chip-meta { display: none; flex-direction: column; line-height: 1.15; text-align: left; }
  .cx-chip-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
  .cx-chip-mail { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }
  .cx-chip-chev { display: grid; place-items: center; color: var(--text-muted); transition: transform var(--dur-base) var(--ease-glide); }
  .cx-chip-chev[data-open] { transform: rotate(180deg); }
  @media (min-width: 560px) { .cx-chip-meta { display: flex; } }

  .cx-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 256px; z-index: 200;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), var(--ring-hairline); padding: 8px; animation: cx-pop var(--dur-base) var(--ease-float); }
  [data-theme="day"] .cx-menu { background: var(--surface-1); }
  @keyframes cx-pop { from { transform: translateY(-6px) scale(.97); } to { transform: none; } }
  .cx-menu-id { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; }
  .cx-menu-id-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
  .cx-menu-id-text .cx-chip-mail { overflow: hidden; text-overflow: ellipsis; }
  .cx-menu-sep { height: 1px; background: var(--border-subtle); margin: 2px 6px 6px; }
  .cx-menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; background: none; border: none;
    border-radius: var(--radius-md); cursor: pointer; font: inherit; font-size: var(--text-sm); font-weight: 500;
    color: var(--text-secondary); text-align: left; transition: background var(--dur-fast), color var(--dur-fast); }
  .cx-menu-item:hover { background: var(--surface-3); color: var(--text-primary); }
  .cx-menu-item--danger:hover { background: var(--danger-soft); color: var(--rose-400); }

  .cx-main { position: relative; max-width: var(--container-lg); margin: 0 auto; padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 40px) 150px; }
  .cx-main-head { margin-bottom: clamp(24px, 4vw, 36px); }
  .cx-greeting { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.04;
    letter-spacing: -.015em; margin: 8px 0 0; }
  .cx-greeting em { font-style: italic; color: var(--accent-text); }
  .cx-statusline { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; color: var(--text-secondary); font-size: var(--text-md); }
  .cx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow-wisp); flex: 0 0 auto; }
  .cx-dot--off { background: var(--text-faint); box-shadow: none; }
  .cx-dot--load { background: var(--brand-text); box-shadow: none; animation: cx-pulse 1.4s var(--ease-soft) infinite; }
  @keyframes cx-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

  .cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-4); }

  /* ── Service tile ────────────────────────────────────────── */
  .cx-tile { width: 100%; min-height: 178px; text-align: left; -webkit-appearance: none; appearance: none; font: inherit;
    color: var(--text-primary); gap: 0; }
  .cx-tile--off { opacity: .62; }
  .cx-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .cx-tile-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-md);
    box-shadow: var(--ring-hairline); flex: 0 0 auto; }
  .cx-tile-body { margin-top: 16px; }
  .cx-tile-name { font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-snug); }
  .cx-tile-desc { margin-top: 3px; font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-snug); }
  .cx-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; }
  .cx-tile-host { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-faint);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-tile-cta { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); font-weight: 600;
    color: var(--text-secondary); flex: 0 0 auto; transition: color var(--dur-fast), gap var(--dur-fast); }
  .cx-tile:hover .cx-tile-cta { color: var(--accent-text); gap: 7px; }
  .cx-tile--off:hover .cx-tile-cta, .cx-tile[disabled] .cx-tile-cta { color: var(--text-faint); }

  /* ── Skeleton ────────────────────────────────────────────── */
  .cx-skel { pointer-events: none; }
  .cx-sk { display: block; border-radius: var(--radius-sm); background: var(--surface-inset); position: relative; overflow: hidden; }
  .cx-sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, oklch(0.70 0.04 305 / 0.10), transparent); animation: cx-shimmer 1.4s infinite; }
  @keyframes cx-shimmer { 100% { transform: translateX(100%); } }
  .cx-sk-ic { width: 46px; height: 46px; border-radius: var(--radius-md); }
  .cx-sk-badge { width: 64px; height: 22px; border-radius: var(--radius-pill); }
  .cx-sk-line { height: 13px; margin-top: 10px; }
  .cx-skel .cx-tile-body { margin-top: 16px; }

  /* ── Empty state ─────────────────────────────────────────── */
  .cx-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(40px, 8vw, 80px) 20px;
    border: 1px dashed var(--border); border-radius: var(--radius-2xl); background: oklch(0.232 0.034 306 / 0.3); }
  [data-theme="day"] .cx-empty { background: oklch(0.992 0.004 300 / 0.5); }
  .cx-empty-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent-text); margin-bottom: 20px; box-shadow: var(--glow-wisp); }
  .cx-empty-title { margin: 0; font-size: var(--text-xl); font-weight: 600; }
  .cx-empty-body { margin: 12px auto 0; max-width: 30rem; color: var(--text-secondary); font-size: var(--text-md); line-height: var(--leading-normal); text-wrap: pretty; }

  /* ── Hero emblem on the portal ───────────────────────────── */
  .cx-main-head { position: relative; }
  .cx-head-text { min-width: 0; padding-right: 132px; }
  .cx-hero-emblem { position: absolute; top: 50%; right: 0; transform: translateY(-50%); display: grid; place-items: center; opacity: .96; pointer-events: none; }
  .cx-hero-emblem .cx-emblem { animation: cx-float 7s var(--ease-soft) infinite alternate; }
  @keyframes cx-float { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
  @media (max-width: 720px) { .cx-hero-emblem { display: none; } .cx-head-text { padding-right: 0; } }
  .cx-role-badge { display: inline-flex; margin-left: 6px; vertical-align: middle; }

  /* ── Sections ────────────────────────────────────────────── */
  .cx-section { margin-top: clamp(28px, 4vw, 40px); }
  .cx-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: var(--space-4); }
  .cx-sec-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-snug); margin: 0; }
  .cx-sec-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill);
    background: var(--surface-2); border: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-muted); }
  .cx-sec-hint { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide);
    text-transform: uppercase; color: var(--text-faint); }
  .cx-note { padding: 18px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); font-size: var(--text-sm);
    background: oklch(0.232 0.034 306 / 0.28); }
  [data-theme="day"] .cx-note { background: oklch(0.992 0.004 300 / 0.5); }

  /* ── System status panel (CKPC · gateway · host) ─────────── */
  .cx-status .cx-sec-head { align-items: center; }
  .cx-status .cx-sec-hint { margin-left: 0; }
  .cx-st-refresh { margin-left: auto; }
  .cx-st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: var(--space-4); align-items: start; }
  .cx-st-card { background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; }
  [data-theme="day"] .cx-st-card { background: var(--surface-1); }
  .cx-st-card-head { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide);
    text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
  .cx-st-rows { display: flex; flex-direction: column; gap: 9px; }
  .cx-st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
  .cx-st-label { font-size: var(--text-sm); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ── Action cards (RPC) ──────────────────────────────────── */
  .cx-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-3); }
  .cx-action { gap: 14px; transition: border-color var(--dur-base) var(--ease-glide), box-shadow var(--dur-base) var(--ease-glide); }
  .cx-action.is-confirm { border-color: oklch(0.790 0.155 78 / 0.5); box-shadow: var(--shadow-md), 0 0 0 1px oklch(0.790 0.155 78 / 0.35); }
  .cx-action.is-done { border-color: oklch(0.711 0.198 145 / 0.4); box-shadow: var(--shadow-md), var(--glow-wisp); }
  .cx-action.is-unavailable { opacity: .68; border-color: var(--border-subtle); box-shadow: none; }
  .cx-action-main { display: flex; align-items: flex-start; gap: 12px; }
  .cx-action-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); box-shadow: var(--ring-hairline); flex: 0 0 auto;
    transition: background var(--dur-base), color var(--dur-base); }
  .cx-action.is-unavailable .cx-action-ic { background: var(--surface-3) !important; color: var(--text-faint) !important; }
  .cx-action-text { min-width: 0; }
  .cx-action-name { font-size: var(--text-base); font-weight: 600; letter-spacing: var(--tracking-snug); }
  .cx-action-desc { margin-top: 2px; font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-snug); }
  .cx-action.is-unavailable .cx-action-name { color: var(--text-secondary); }
  .cx-action.is-unavailable .cx-action-desc { color: var(--text-faint); }
  .cx-action.is-done .cx-action-desc { color: var(--accent-text); }
  .cx-action.is-confirm .cx-action-desc { color: var(--amber-400); }
  .cx-action-value { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 9px; border-radius: var(--radius-sm);
    background: var(--surface-inset); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); }
  .cx-action-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
  .cx-action-ep { min-width: 0; flex: 1 1 auto; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-action-confirm { display: flex; justify-content: flex-end; gap: 6px; flex: 0 0 auto; }
  .cx-arun { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; flex: 0 0 auto;
    background: var(--accent); color: var(--text-on-accent); border: 1px solid transparent; transition: background var(--dur-fast), box-shadow var(--dur-base), opacity var(--dur-fast); }
  .cx-arun:hover { background: var(--wisp-400); box-shadow: var(--glow-wisp); }
  .cx-arun[disabled] { opacity: .6; cursor: default; box-shadow: none; }
  .cx-action.is-unavailable .cx-arun { background: var(--surface-3); color: var(--text-muted); border-color: var(--border-subtle); }
  .cx-action.is-unavailable .cx-arun:hover { background: var(--surface-3); box-shadow: none; }
  .cx-arun--warn { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
  .cx-arun--warn:hover { background: var(--warning-soft); border-color: var(--amber-500); color: var(--amber-400); box-shadow: none; }
  .cx-arun--ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
  .cx-arun--ghost:hover { background: var(--surface-2); color: var(--text-primary); box-shadow: none; }
  .cx-arun--danger { background: var(--warning-soft); color: var(--amber-400); border-color: oklch(0.790 0.155 78 / 0.5); }
  .cx-arun--danger:hover { background: oklch(0.790 0.155 78 / 0.25); box-shadow: none; }
  .cx-arun--done { background: var(--accent-soft); color: var(--accent-text); }
  .cx-arun--done:hover { background: var(--accent-soft); box-shadow: none; }
  .cx-arun-spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid oklch(0.128 0.026 308 / 0.35); border-top-color: var(--text-on-accent); animation: cx-spin .7s linear infinite; }

  /* ── Account switcher rows in the menu ───────────────────── */
  .cx-menu-role { margin-top: 6px; }
  .cx-menu-label { margin: 4px 8px 4px; font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide);
    text-transform: uppercase; color: var(--text-faint); }
  .cx-menu-acct { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: none; border-radius: var(--radius-md);
    cursor: pointer; font: inherit; text-align: left; transition: background var(--dur-fast); }
  .cx-menu-acct:hover { background: var(--surface-3); }
  .cx-menu-acct-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
  .cx-menu-acct-text .cx-chip-mail { overflow: hidden; text-overflow: ellipsis; }

  /* ── Harness user selector ───────────────────────────────── */
  .cx-seg--user { background: oklch(0.711 0.198 145 / 0.12); }
  .cx-seg--user .cx-seg-btn.is-active { background: var(--accent); color: var(--text-on-accent); }

  /* ── Footer ──────────────────────────────────────────────── */
  .cx-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border-subtle);
    color: var(--text-faint); font-size: var(--text-xs); }
  .cx-foot-mono { font-family: var(--font-mono); }

  /* ── Prototype harness ───────────────────────────────────── */
  .cx-harness {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px);
    padding: 8px 8px 8px 14px; border-radius: var(--radius-pill);
    background: oklch(0.150 0.028 308 / 0.86); backdrop-filter: blur(var(--blur-lg)); -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid oklch(0.70 0.04 305 / 0.16); box-shadow: var(--shadow-xl);
  }
  .cx-harness-tag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide); text-transform: uppercase; color: oklch(0.812 0.016 303); white-space: nowrap; }
  .cx-harness-spark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow-wisp); }
  .cx-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-pill);
    background: oklch(0.128 0.026 308 / 0.7); border: 1px solid oklch(0.70 0.04 305 / 0.08); }
  .cx-seg--sub { background: oklch(0.446 0.195 304 / 0.16); }
  .cx-seg-btn { padding: 6px 12px; border: none; background: none; border-radius: var(--radius-pill); cursor: pointer;
    font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; color: oklch(0.812 0.016 303);
    white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast); }
  .cx-seg-btn:hover { color: #fff; background: oklch(0.272 0.038 305 / 0.6); }
  .cx-seg-btn.is-active { background: var(--accent); color: var(--text-on-accent); }
  .cx-seg--sub .cx-seg-btn.is-active { background: var(--brand); color: var(--text-on-brand); }

  /* ── Focus & motion ──────────────────────────────────────── */
  .cx-gbtn:focus-visible, .cx-textlink:focus-visible, .cx-chip:focus-visible,
  .cx-menu-item:focus-visible, .cx-seg-btn:focus-visible {
    outline: none; box-shadow: var(--glow-focus);
  }
  .cx-gbtn:focus-visible { box-shadow: 0 0 0 3px oklch(0.711 0.198 145 / 0.6); }

  @media (prefers-reduced-motion: reduce) {
    .cx-aurora, .cx-screen, .cx-menu, .cx-dot--load { animation: none !important; }
    .cx-gspin, .cx-redirect-orbit::before, .cx-redirect-orbit::after { animation-duration: 0s; }
    .cx-progress span { animation: none; width: 70%; }
    .cx-sk::after { animation: none; }
    .cx-tile:hover .cx-tile-cta { gap: 5px; }
  }

  /* ── Action error state (added for live RPC) ─────────────── */
  .cx-action.is-error { border-color: oklch(0.640 0.21 18 / 0.45); box-shadow: var(--shadow-md), 0 0 0 1px oklch(0.640 0.21 18 / 0.3); }
  .cx-action.is-error .cx-action-desc { color: var(--rose-400, oklch(0.7 0.17 16)); }
