/* =========================================================
   Plexxa primitive components — the only shared CSS layer.

   Class prefix is `plx-` — every shared visual primitive
   namespaces here so it stops colliding with Radzen / Bootstrap
   / page-local CSS. Pages compose these classes; pages do not
   override them.

   When you need a new primitive, add it here. Don't reach for
   another library. The point of this file is that the entire
   shared visual language fits in a few hundred lines.
   ========================================================= */

/* ----- Reset-ish baseline ----------------------------------- */

.plx, .plx * { box-sizing: border-box; }

body.plx-body {
    margin: 0;
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: var(--t-base);
    line-height: var(--t-base-lh);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Skip-to-content link — visually hidden until focused. Renders
   inside MainLayout immediately after <body>. Single biggest
   keyboard a11y win. */
.plx-skip {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-size: var(--t-sm);
    text-decoration: none;
    z-index: 10000;
    transition: top var(--motion-quick);
}
.plx-skip:focus { top: 8px; }

/* ----- Material Symbols helper ----------------------------- */

.mi {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    user-select: none;
}

/* ----- Typography helpers ---------------------------------- */

.plx-eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 var(--s-2);
}
.plx-page-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0;
}
.plx-page-sub {
    color: var(--muted);
    font-size: var(--t-sm);
    margin: var(--s-2) 0 0;
    max-width: 640px;
}
.plx-num {
    font-family: var(--serif);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

/* ----- Buttons (.plx-btn) ---------------------------------- */

.plx-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--motion-quick), border-color var(--motion-quick),
                color var(--motion-quick), box-shadow var(--motion-quick);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.plx-btn .mi { font-size: 16px; }

.plx-btn-primary {
    background: var(--grad-cta);
    color: #fff;
    border: 0;
    box-shadow: 0 6px 16px -4px rgba(109, 40, 217, .5),
                0 0 0 1px rgba(255, 255, 255, .18) inset,
                0 1px 0 rgba(255, 255, 255, .25) inset;
    text-shadow: 0 1px 0 rgba(46, 16, 101, .3);
}
.plx-btn-primary:hover:not(:disabled) {
    background: var(--grad-cta-hover);
}

.plx-btn-secondary {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}
.plx-btn-secondary:hover:not(:disabled) {
    background: var(--line-2);
}

.plx-btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: transparent;
}
.plx-btn-ghost:hover:not(:disabled) { background: var(--line-2); }

.plx-btn-danger {
    background: var(--paper);
    color: var(--bad);
    border-color: #f1c5c0;
}
.plx-btn-danger:hover:not(:disabled) {
    background: var(--bad-soft);
    border-color: #ec9d96;
}

.plx-btn-sm { padding: 6px 10px; font-size: 12px; }
.plx-btn-lg { padding: 10px 18px; font-size: var(--t-base); }

.plx-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.plx-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
}

/* Icon-only round button — used in top bar, table actions. */
.plx-icon-btn {
    appearance: none;
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: background var(--motion-quick), color var(--motion-quick);
}
.plx-icon-btn:hover { background: var(--line-2); color: var(--ink-2); }
.plx-icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
}

/* ----- Inputs (.plx-input) --------------------------------- */

.plx-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font: inherit;
    font-size: var(--t-sm);
    color: var(--ink-2);
    background: var(--paper);
    transition: border-color var(--motion-quick), box-shadow var(--motion-quick);
}
.plx-input::placeholder { color: #94a3b8; }
.plx-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.plx-input:disabled {
    background: var(--line-2);
    color: var(--muted);
    cursor: not-allowed;
}
.plx-input.plx-input-error {
    border-color: var(--bad);
}
.plx-input.plx-input-error:focus {
    box-shadow: 0 0 0 3px var(--bad-soft);
}
.plx-help {
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: var(--s-1);
}
.plx-help.plx-help-error { color: var(--bad); }

/* Search input variant with leading icon */
.plx-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}
.plx-search .mi {
    position: absolute;
    left: 10px;
    color: var(--muted);
    font-size: 16px;
    pointer-events: none;
}
.plx-search .plx-input { padding-left: 32px; }

/* ----- Cards (.plx-card) ----------------------------------- */

.plx-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    transition: box-shadow var(--motion-quick);
}
.plx-card.plx-card-elevated { box-shadow: var(--shadow-2); }

.plx-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}
.plx-card-title {
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.plx-card-sub {
    font-size: var(--t-sm);
    color: var(--muted);
    margin: var(--s-1) 0 0;
}
.plx-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line-2);
}

/* ----- Tables (.plx-table) --------------------------------- */

.plx-table-wrap {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.plx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--t-sm);
}
.plx-table thead th {
    text-align: left;
    padding: 10px 16px;
    background: var(--line-2);
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.plx-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    color: var(--ink-2);
}
.plx-table tbody tr:last-child td { border-bottom: 0; }
.plx-table tbody tr:hover td { background: #fafbfc; }
.plx-table .plx-table-name {
    color: var(--ink);
    font-weight: 500;
}
.plx-table .plx-table-meta {
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: 2px;
}
.plx-table .plx-table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

/* Stack tables into card rows on narrow viewports. */
@media (max-width: 600px) {
    .plx-table-wrap { border: 0; background: transparent; }
    .plx-table thead { display: none; }
    .plx-table, .plx-table tbody, .plx-table tr, .plx-table td { display: block; width: 100%; }
    .plx-table tr {
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        margin-bottom: var(--s-2);
        padding: var(--s-2) 0;
    }
    .plx-table td {
        border-bottom: 0;
        padding: 6px 14px;
    }
    .plx-table td::before {
        content: attr(data-label);
        font-family: var(--mono);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        display: block;
        margin-bottom: 2px;
    }
}

/* ----- Badges (.plx-badge) --------------------------------- */

.plx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: var(--r-sm);
    background: var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}
.plx-badge-ok       { background: var(--ok-soft);    color: var(--ok); }
.plx-badge-warn     { background: var(--warn-soft);  color: var(--warn); }
.plx-badge-bad      { background: var(--bad-soft);   color: var(--bad); }
.plx-badge-brand    { background: var(--brand-soft); color: var(--brand); }
.plx-badge-muted    { background: var(--line-2);     color: var(--muted); }

/* Soft "pill" variants (rounded full) */
.plx-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--t-xs);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}
.plx-pill-brand    { background: var(--brand-soft); color: var(--brand); }
.plx-pill-ok       { background: var(--ok-soft);    color: var(--ok); }
.plx-pill-warn     { background: var(--warn-soft);  color: var(--warn); }
.plx-pill-bad      { background: var(--bad-soft);   color: var(--bad); }

/* ----- Tabs (.plx-tabs) ------------------------------------ */

.plx-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.plx-tabs::-webkit-scrollbar { display: none; }
.plx-tab {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 12px 16px 10px;
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color var(--motion-quick), border-color var(--motion-quick);
    text-decoration: none;
}
.plx-tab:hover { color: var(--ink-2); }
.plx-tab[aria-selected="true"],
.plx-tab.active {
    color: var(--ink);
    border-bottom-color: var(--brand);
    font-weight: 600;
}
.plx-tab-count {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    background: var(--line-2);
    color: var(--muted);
}
.plx-tab[aria-selected="true"] .plx-tab-count,
.plx-tab.active .plx-tab-count { background: var(--brand-soft); color: var(--brand); }

/* ----- Empty state (.plx-empty) ---------------------------- */

.plx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s-12) var(--s-6);
    color: var(--muted);
}
.plx-empty .plx-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    margin-bottom: var(--s-3);
}
.plx-empty .plx-empty-icon .mi { font-size: 24px; }
.plx-empty .plx-empty-title {
    color: var(--ink);
    font-size: var(--t-md);
    font-weight: 600;
    margin: 0 0 var(--s-1);
}
.plx-empty .plx-empty-desc {
    font-size: var(--t-sm);
    color: var(--muted);
    margin: 0 0 var(--s-3);
    max-width: 360px;
}

/* ----- Usage bar (.plx-bar) -------------------------------- */

.plx-bar {
    width: 100%;
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--line-2);
    overflow: hidden;
    display: flex;
}
.plx-bar > .plx-bar-plan,
.plx-bar > .plx-bar-pack {
    display: block;
    height: 100%;
    transition: width var(--motion-base);
}
.plx-bar > .plx-bar-plan { background: var(--brand); }
.plx-bar > .plx-bar-pack { background: var(--brand-soft); border-left: 1px solid #fff; }

.plx-bar.is-warn > .plx-bar-plan { background: var(--warn); }
.plx-bar.is-warn > .plx-bar-pack { background: var(--warn-soft); }
.plx-bar.is-bad  > .plx-bar-plan { background: var(--bad); }
.plx-bar.is-bad  > .plx-bar-pack { background: var(--bad-soft); }

/* ----- Banners (.plx-banner) ------------------------------- */

.plx-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: var(--t-sm);
}
.plx-banner .mi { color: var(--brand); flex-shrink: 0; }
.plx-banner-warn { background: var(--warn-soft); color: #7c4a00; border-color: #f1eacc; }
.plx-banner-warn .mi { color: var(--warn); }
.plx-banner-bad  { background: var(--bad-soft);  color: #872929; border-color: #f5d8d4; }
.plx-banner-bad .mi { color: var(--bad); }

/* ----- Skeleton placeholder -------------------------------- */

.plx-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, var(--line-2), #ebedf0, var(--line-2));
    background-size: 200% 100%;
    border-radius: var(--r-sm);
    animation: plx-skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes plx-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----- Blazor error UI ------------------------------------
   The <div id="blazor-error-ui"> is rendered into every page by
   MainLayout. It must be hidden by default; Blazor flips it to
   `display: block` when an unhandled circuit exception fires.
   The legacy site.css carried this rule but isn't loaded any
   more — moving it here so the rule survives the migration. */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ----- Focus visible (global) -----------------------------
   Replaces ad-hoc `outline: none !important` rules that exist
   across the codebase. Pages should not override this. */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
    border-radius: var(--r-sm);
}
.plx-darksurface :focus-visible {
    /* Inset-style focus on dark backgrounds (e.g. sidebar items) */
    box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px rgba(124, 58, 237, .55);
}

/* =========================================================
   App shell — the 232px sidebar + 56px topbar grid layout
   used by MainLayout.razor.

   These rules used to live in MainLayout.razor.css with
   `::deep` prefixes, but Blazor scoped CSS can't style a
   component's own root element via `::deep` (it compiles
   to `[scope] .selector` which requires the scope attribute
   on an ANCESTOR, but `.plx-shell` is itself a root of the
   layout component). Moved here so the rules actually
   apply.
   ========================================================= */

.plx-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    background: var(--surface);
}
.plx-shell-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ----- Sidebar -------------------------------------------- */

.plx-sidebar {
    background: var(--grad-rail);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    border-right: 1px solid rgba(167, 139, 250, .08);
}

.plx-sb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
}

.plx-sb-logo {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--grad-cta);
    box-shadow: 0 4px 14px rgba(167, 139, 250, .45),
                0 0 0 1px rgba(255, 255, 255, .12) inset;
    display: grid; place-items: center;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}
.plx-sb-name {
    font-weight: 600;
    font-size: var(--t-base);
    letter-spacing: -0.01em;
    flex: 1;
}
.plx-sb-close-mobile { display: none; color: rgba(255, 255, 255, .65); }

.plx-sb-ws {
    appearance: none;
    margin: 4px 12px 12px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--motion-quick);
    text-align: left;
}
.plx-sb-ws:hover { background: rgba(255, 255, 255, .08); }
.plx-sb-ws-init {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: var(--brand);
    color: #fff;
    display: grid; place-items: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.plx-sb-ws-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-sb-ws .mi { color: rgba(255, 255, 255, .5); font-size: 14px; }

.plx-sb-search {
    margin: 0 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 12px;
}
.plx-sb-search .mi { color: rgba(255, 255, 255, .5); font-size: 16px; }
.plx-sb-search input {
    flex: 1;
    appearance: none;
    background: transparent;
    border: 0;
    color: #fff;
    font: inherit;
    font-size: 12px;
    outline: none;
    min-width: 0;
}
.plx-sb-search input::placeholder { color: rgba(255, 255, 255, .5); }
.plx-sb-search .plx-kbd {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(255, 255, 255, .4);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 1px 5px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}

.plx-sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    scrollbar-width: thin;
}
.plx-sb-nav::-webkit-scrollbar { width: 4px; }
.plx-sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 2px; }

.plx-sb-group {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, .4);
    padding: 14px 10px 6px;
    font-weight: 500;
}

.plx-sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--r-md);
    /* Spec (handoff §App-shell): items are 13px Inter / 500. The
       earlier `font: inherit` shorthand was clobbering size + weight
       to body defaults (14px / 400). Set explicitly so <button>
       (which doesn't inherit font in Chrome) and <a> render
       identically. */
    font-family: var(--sans);
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.2;
    color: rgba(255, 255, 255, .85);
    cursor: pointer;
    transition: background var(--motion-quick), color var(--motion-quick);
    margin-bottom: 1px;
    text-decoration: none;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}
.plx-sb-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.plx-sb-item.active {
    background: rgba(167, 139, 250, .10);
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .28);
    color: #fff;
}
.plx-sb-item .mi { font-size: 18px; opacity: .85; flex-shrink: 0; }
.plx-sb-item.active .mi { opacity: 1; color: var(--brand-bright); }
.plx-sb-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-sb-item-parent .plx-sb-item-chev { font-size: 16px; opacity: .5; }

.plx-sb-children {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0 4px 22px;
}
.plx-sb-item-child {
    font-size: 12.5px;
    font-weight: 400;     /* Children quieter than parents per the mockup. */
    padding: 5px 10px;
    color: rgba(255, 255, 255, .7);
}
.plx-sb-item-child:hover { color: #fff; }
.plx-sb-item-child.active { font-weight: 500; }

.plx-sb-foot {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.plx-sb-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.plx-sb-foot-name {
    flex: 1;
    font-weight: 500;
    color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plx-sb-foot .plx-icon-btn { color: rgba(255, 255, 255, .5); }
.plx-sb-foot .plx-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* ----- Main + topbar -------------------------------------- */

.plx-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.plx-topbar {
    height: var(--topbar-h);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 var(--content-x);
    gap: 12px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.plx-topbar-toggle-mobile { display: none; }

.plx-crumbs {
    font-size: var(--t-sm);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.plx-crumbs-parent { color: var(--muted); }
.plx-crumbs-sep { color: #cbd5e1; }
.plx-crumbs-here { color: var(--ink); font-weight: 500; }

.plx-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plx-topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: var(--t-xs);
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--motion-quick);
}
.plx-topbar-avatar:hover { opacity: .85; }

/* RadzenMenu surface theming for the avatar dropdown — kept for
   click-outside / keyboard mechanics; chrome themed via tokens. */
.plx-topbar-menu .rz-navigation-menu {
    background: var(--paper) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--shadow-2) !important;
    padding: 4px !important;
    min-width: 180px;
}
.plx-topbar-menu .rz-navigation-item-text { color: var(--ink-2) !important; font-family: var(--sans) !important; }
.plx-topbar-menu .rz-navigation-item-icon { color: var(--muted) !important; }
.plx-topbar-menu .rz-navigation-item-wrapper:hover { background: var(--line-2) !important; border-radius: var(--r-sm); }

/* ----- Content + footer ----------------------------------- */

.plx-content {
    flex: 1;
    padding: var(--content-y) var(--content-x) 40px;
    min-width: 0;
}

/* Pages that need to fill the content area edge-to-edge (Chat, future
   full-bleed surfaces) wrap their outer element in `.plx-content` and
   add `.plx-flush` — the helper negates the standard padding via
   negative margins so the page can paint into the bleed area while
   sibling pages keep the comfortable gutters. */
.plx-flush {
    margin: calc(var(--content-y) * -1) calc(var(--content-x) * -1) -40px;
    height: calc(100vh - var(--topbar-h));
    display: flex;
    min-height: 0;
}

.plx-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px var(--content-x);
    color: var(--muted);
    font-size: var(--t-xs);
    border-top: 1px solid var(--line);
    background: var(--paper);
    flex-wrap: wrap;
}
.plx-footer a { color: var(--muted); text-decoration: none; }
.plx-footer a:hover { color: var(--ink-2); }
.plx-footer-sep { opacity: .5; }

/* ----- Subhero (.plx-subhero) ----------------------------- */
/* Inner-page header — gradient panel that replaces the previous
   flat eyebrow + serif h1 + grey lede pattern. Lives at the top
   of every inner page (Library, People, Plan & billing, etc.).
   The dashboard uses the larger .plx-hero instead. */

.plx-subhero {
    background: var(--grad-hero);
    border-radius: 14px;
    padding: 24px 28px;
    color: #fff;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 36px -16px rgba(46, 16, 101, .4);
}
.plx-subhero::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(50% 80% at 100% 0%,
                  rgba(167, 139, 250, .18), transparent 70%);
    pointer-events: none;
}
.plx-subhero-text { position: relative; min-width: 0; }
.plx-subhero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-bright);
    margin-bottom: 6px;
}
.plx-subhero-eyebrow::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--brand-bright);
    box-shadow: 0 0 6px var(--brand-bright);
}
.plx-subhero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: #fff;
}
.plx-subhero p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}
.plx-subhero-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}
/* Secondary buttons inside the subhero need a dark-surface skin so
   they read on the gradient. Primary keeps its puffy gradient — it
   reads fine against the deep purple. */
.plx-subhero .plx-btn-secondary {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-color: rgba(167, 139, 250, .28);
}
.plx-subhero .plx-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .14);
}
.plx-subhero .plx-btn-ghost {
    color: rgba(255, 255, 255, .85);
}
.plx-subhero .plx-btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

@media (max-width: 720px) {
    .plx-subhero { flex-direction: column; align-items: flex-start; padding: 20px 22px; }
    .plx-subhero-actions { width: 100%; flex-wrap: wrap; }
    .plx-subhero h1 { font-size: 24px; }
}

/* ----- Hero (.plx-hero) — dashboard only ------------------ */
/* The big gradient panel that opens the workspace overview.
   Inner pages use the smaller .plx-subhero instead. */

.plx-hero {
    position: relative;
    background: var(--grad-hero);
    border-radius: 18px;
    padding: 40px 44px;
    color: #fff;
    overflow: hidden;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: center;
    box-shadow: 0 24px 60px -20px rgba(46, 16, 101, .45);
}
.plx-hero::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(60% 60% at 90% 100%,
                  rgba(167, 139, 250, .18), transparent 70%);
    pointer-events: none;
}
.plx-hero-text { position: relative; min-width: 0; }
.plx-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-bright);
    background: rgba(167, 139, 250, .14);
    border: 1px solid rgba(167, 139, 250, .28);
    padding: 4px 10px;
    border-radius: var(--r-pill);
    margin-bottom: 18px;
}
.plx-hero-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-bright);
    box-shadow: 0 0 8px var(--brand-bright);
}
.plx-hero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0 0 14px;
    color: #fff;
    max-width: 18ch;
}
.plx-hero-sub {
    margin: 0 0 24px;
    font-size: 14px;
    color: rgba(255, 255, 255, .72);
    max-width: 42ch;
    line-height: 1.55;
}
.plx-hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--grad-cta);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 28px -6px rgba(167, 139, 250, .55),
                0 0 0 1px rgba(255, 255, 255, .22) inset,
                0 1px 0 rgba(255, 255, 255, .3) inset;
    text-shadow: 0 1px 0 rgba(46, 16, 101, .35);
    transition: background var(--motion-quick);
}
.plx-hero-cta:hover { background: var(--grad-cta-hover); color: #fff; text-decoration: none; }

.plx-hero-aside {
    position: relative;
    background: rgba(15, 5, 40, .45);
    border: 1px solid rgba(167, 139, 250, .18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.plx-hero-aside-title {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-bright);
    margin: 0 0 4px;
}
.plx-hero-way {
    display: flex; align-items: flex-start; gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 6px 0;
}
.plx-hero-way:hover { color: #fff; text-decoration: none; }
.plx-hero-way:hover .plx-hero-way-name { color: var(--brand-bright); }
.plx-hero-way-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(167, 139, 250, .14);
    border: 1px solid rgba(167, 139, 250, .22);
    color: var(--brand-bright);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.plx-hero-way-icon .mi { font-size: 18px; }
.plx-hero-way-text { min-width: 0; }
.plx-hero-way-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    transition: color var(--motion-quick);
}
.plx-hero-way-desc {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .6);
    line-height: 1.45;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .plx-hero { grid-template-columns: 1fr; padding: 28px 24px; gap: 20px; }
    .plx-hero h1 { font-size: 32px; max-width: none; }
}

/* ----- Onboarding checklist (.plx-checklist) — dashboard ---- */

.plx-checklist {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.plx-checklist-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.plx-checklist-head h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    margin: 0;
    color: var(--ink);
}
.plx-checklist-head .plx-checklist-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.plx-checklist-progress {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}
.plx-checklist-progress strong { color: var(--ink); font-weight: 600; }

.plx-ck-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--line-2);
}
.plx-ck-row:first-of-type { border-top: 0; }
.plx-ck-tick {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--paper);
    flex-shrink: 0;
    display: grid; place-items: center;
    color: transparent;
}
.plx-ck-row.done .plx-ck-tick {
    background: var(--grad-cta);
    border-color: transparent;
    color: #fff;
}
.plx-ck-row.done .plx-ck-tick .mi { font-size: 14px; }
.plx-ck-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.plx-ck-icon .mi { font-size: 18px; }
.plx-ck-text { flex: 1; min-width: 0; }
.plx-ck-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.plx-ck-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
    line-height: 1.45;
}
.plx-ck-row.done .plx-ck-name { color: var(--muted); text-decoration: line-through; }
.plx-ck-action {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}
.plx-ck-action:hover { background: var(--brand-soft); text-decoration: none; }

/* ----- Loading splash ------------------------------------- */

.plx-app-loading {
    position: fixed;
    inset: 0;
    background: var(--surface);
    display: grid;
    place-items: center;
    z-index: 10000;
}
.plx-app-loading-spinner {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    animation: plx-spin 0.8s linear infinite;
}
@keyframes plx-spin { to { transform: rotate(360deg); } }

/* ----- Mobile + tablet ------------------------------------ */

@media (max-width: 1100px) {
    .plx-shell {
        grid-template-columns: var(--sidebar-w-collapsed) 1fr;
    }
    .plx-shell .plx-sb-name,
    .plx-shell .plx-sb-ws-name,
    .plx-shell .plx-sb-ws .mi:last-child,
    .plx-shell .plx-sb-search input,
    .plx-shell .plx-sb-search .plx-kbd,
    .plx-shell .plx-sb-group,
    .plx-shell .plx-sb-item-label,
    .plx-shell .plx-sb-item-chev,
    .plx-shell .plx-sb-foot-name {
        display: none;
    }
    .plx-shell .plx-sb-children { padding-left: 0; }
    .plx-shell .plx-sb-item { justify-content: center; }
    .plx-shell-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
}

@media (max-width: 768px) {
    .plx-shell {
        grid-template-columns: 1fr;
    }
    .plx-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform var(--motion-base);
        z-index: 200;
        box-shadow: var(--shadow-3);
    }
    .plx-shell-mobile-open .plx-sidebar { transform: translateX(0); }
    .plx-shell-mobile-open .plx-sb-name,
    .plx-shell-mobile-open .plx-sb-ws-name,
    .plx-shell-mobile-open .plx-sb-ws .mi:last-child,
    .plx-shell-mobile-open .plx-sb-search input,
    .plx-shell-mobile-open .plx-sb-search .plx-kbd,
    .plx-shell-mobile-open .plx-sb-group,
    .plx-shell-mobile-open .plx-sb-item-label,
    .plx-shell-mobile-open .plx-sb-item-chev,
    .plx-shell-mobile-open .plx-sb-foot-name {
        display: revert;
    }
    .plx-shell-mobile-open .plx-sb-children { padding-left: 22px; }
    .plx-shell-mobile-open .plx-sb-item { justify-content: flex-start; }

    .plx-sb-close-mobile { display: inline-grid; }
    .plx-topbar-toggle-mobile { display: inline-grid; }
    .plx-topbar-toggle { display: none; }

    .plx-shell-scrim {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 150;
    }
}

/* ----- Table empty cell (.plx-table-empty) ------------------ */

.plx-table .plx-table-empty {
    text-align: center;
    color: var(--muted);
    padding: var(--s-8) var(--s-4);
    font-size: var(--t-sm);
}

/* ----- Dialog shell (.plx-dialog) --------------------------- */
/* Sits inside Radzen DialogService's overlay; replaces its chrome. */

.plx-dialog {
    background: var(--paper);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-width: 320px;
    overflow: hidden;
}
.plx-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-6) var(--s-3);
    border-bottom: 1px solid var(--line-2);
}
.plx-dialog-titlewrap { min-width: 0; }
.plx-dialog-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.plx-dialog-sub {
    margin: var(--s-1) 0 0;
    font-size: var(--t-sm);
    color: var(--muted);
}
.plx-dialog-close {
    appearance: none;
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: background var(--motion-quick), color var(--motion-quick);
}
.plx-dialog-close:hover {
    background: var(--line-2);
    color: var(--ink-2);
}
.plx-dialog-body {
    padding: var(--s-6);
    color: var(--ink-2);
    font-size: var(--t-base);
    line-height: 1.55;
}
.plx-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-6) var(--s-4);
    border-top: 1px solid var(--line-2);
    background: var(--surface);
}

/* ----- Role badges (.plx-role-badge) ------------------------ */
/* Used wherever a workspace role is rendered. Replaces the legacy
   pink capsule. Palette per Phase 2 handoff Screen 05. */

.plx-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: var(--t-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
.plx-role-icon { flex-shrink: 0; }

.plx-role-owner   { background: #FEF3C7; color: #92400E; }
.plx-role-admin   { background: var(--brand-soft); color: var(--brand-deep); }
.plx-role-member  { background: var(--line-2); color: var(--ink-2); }
.plx-role-pending { background: var(--line-2); color: var(--muted); }

/* ----- Drawer (.plx-drawer) --------------------------------- */
/* Right- (or left-) anchored slide-in panel. Renders always; the
   .plx-drawer-open class on the scrim + drawer toggles visibility +
   transform. transform-only animation keeps the GPU happy. */

.plx-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base);
    z-index: 300;
}
.plx-drawer-scrim.plx-drawer-open {
    opacity: 1;
    pointer-events: auto;
}

.plx-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    background: var(--paper);
    box-shadow: var(--shadow-3, 0 18px 40px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08));
    display: flex;
    flex-direction: column;
    transition: transform var(--motion-base);
    z-index: 301;
    outline: none;
    max-width: 100vw;
}
.plx-drawer-right {
    right: 0;
    transform: translateX(100%);
}
.plx-drawer-left {
    left: 0;
    transform: translateX(-100%);
}
.plx-drawer.plx-drawer-open { transform: translateX(0); }

.plx-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-6) var(--s-3);
    border-bottom: 1px solid var(--line-2);
}
.plx-drawer-titlewrap { min-width: 0; }
.plx-drawer-title {
    margin: var(--s-1) 0 0;
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.plx-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--s-6);
}
.plx-drawer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-6) var(--s-4);
    border-top: 1px solid var(--line-2);
    background: var(--surface);
}

/* ----- Chip input (.plx-chip-input) ------------------------- */
/* Multi-chip text field. Wraps on small widths; each chip is a pill
   with an X button. Invalid chips get a red border + the title-attr
   tooltip carries the validation message. */

.plx-chip-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--paper);
    cursor: text;
    transition: border-color var(--motion-quick), box-shadow var(--motion-quick);
}
.plx-chip-input:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.plx-chip-input-disabled {
    background: var(--line-2);
    cursor: not-allowed;
}

.plx-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 8px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: var(--t-sm);
    line-height: 1.4;
}
.plx-chip-label { font-weight: 500; }
.plx-chip-remove {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--motion-quick), background var(--motion-quick);
}
.plx-chip-remove:hover {
    opacity: 1;
    background: rgba(91, 33, 182, .12);
}
.plx-chip-invalid {
    background: var(--bad-soft);
    color: var(--bad);
    box-shadow: inset 0 0 0 1px var(--bad);
}
.plx-chip-invalid .plx-chip-remove:hover { background: rgba(220, 38, 38, .12); }

.plx-chip-input-field {
    flex: 1 1 120px;
    min-width: 120px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: var(--t-sm);
    color: var(--ink-2);
    padding: 4px 0;
}
.plx-chip-input-field::placeholder { color: #94a3b8; }

/* ----- Stat strip (.plx-stat-strip / .plx-stat) ------------- */
/* Headline-numbers row at the top of admin pages. Auto-collapses
   to 2 columns < 1100px and 1 column < 600px, matching the rest
   of the admin grid behaviour. Each .plx-stat is a flex column
   with label (12 muted), serif value, optional mono trend. */

.plx-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1100px) { .plx-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .plx-stat-strip { grid-template-columns: 1fr; } }

.plx-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.plx-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--t-xs);
    color: var(--muted);
    font-weight: 500;
}
.plx-stat-label .mi { font-size: 14px; color: var(--brand); }
.plx-stat-value {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}
.plx-stat-trend {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}
.plx-stat-trend.up   { color: var(--ok); }
.plx-stat-trend.down { color: var(--bad); }

/* ----- Upgrade banner (.plx-upgrade-banner) ---------------- */
/* Informational, non-blocking — gated content renders underneath. */

.plx-upgrade-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--brand-soft), #FAF5FF);
    border: 1px solid #E0D4F7;
    border-radius: var(--r-lg);
    margin-bottom: var(--s-4);
}
@media (max-width: 760px) {
    .plx-upgrade-banner {
        grid-template-columns: auto 1fr;
    }
    .plx-upgrade-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

.plx-upgrade-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--brand);
    color: white;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.plx-upgrade-icon .mi { font-size: 22px; }

.plx-upgrade-title {
    margin: 0 0 2px;
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--ink);
}
.plx-upgrade-desc {
    margin: 0;
    font-size: var(--t-sm);
    color: var(--ink-2);
    line-height: 1.5;
}

.plx-upgrade-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ----- Burn-rate forecast line (.plx-burnrate) ------------- */
/* Threshold-coloured one-liner under the usage bar on the
   billing hero. Caller supplies pre-computed Used / Limit /
   ForecastDaysRemaining; this is purely presentational. */

.plx-burnrate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: var(--t-xs);
    line-height: 1.5;
}
.plx-burnrate-headroom { color: var(--muted); }
.plx-burnrate-warn     { color: var(--warn); }
.plx-burnrate-bad      { color: var(--bad); }
.plx-burnrate-exceeded { color: var(--bad); font-weight: 600; }

.plx-burnrate-pack {
    appearance: none;
    background: var(--bad);
    color: white;
    border: 0;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font: inherit;
    font-family: var(--sans);
    font-size: var(--t-xs);
    font-weight: 500;
    transition: opacity var(--motion-quick);
}
.plx-burnrate-pack:hover { opacity: 0.88; }

/* ----- Pulse-glow keyframe (.plx-pulse) -------------------- */
/* Used by /workspace/billing when arriving via ?highlight=pro
   from the modules page "Upgrade to unlock" CTA. Caller adds
   the class on first render and removes it on animationend. */

@keyframes plx-pulse-glow {
    0%   { box-shadow: 0 0 0 0   rgba(107, 72, 209, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(107, 72, 209, 0); }
}
.plx-pulse {
    animation: plx-pulse-glow 0.6s ease-out 2;
}

/* ----- Category header (.plx-category-header) -------------- */
/* Per-category banner on /workspace/agent-training. The icon
   palette is set inline (see PlxCategoryHeader) so new categories
   don't need a CSS change. */

.plx-category-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--s-3);
}
.plx-category-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--r-md);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.plx-category-icon .mi { font-size: 18px; }
.plx-category-titles { flex: 1 1 auto; min-width: 0; }
.plx-category-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.2;
}
.plx-category-desc {
    margin: 2px 0 0;
    font-size: var(--t-xs);
    color: var(--muted);
}
.plx-category-actions { flex-shrink: 0; }

/* ----- Rule card (.plx-rule-card) -------------------------- */

.plx-rule-card {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 12px;
    align-items: flex-start;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color var(--motion-quick);
}
.plx-rule-card:hover { border-color: var(--brand); }

.plx-rule-card-draft {
    border-left: 3px solid var(--warn);
    background: var(--warn-soft);
    padding-left: 13px; /* compensate the thicker left border */
}
.plx-rule-card-disabled { opacity: 0.55; }
.plx-rule-card-add {
    grid-template-columns: 1fr;
    border: 1px dashed var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    padding: 12px;
}
.plx-rule-card-add:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.plx-rule-card-add .plx-rule-body {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.plx-rule-handle {
    color: var(--muted);
    opacity: 0.4;
    user-select: none;
    cursor: grab;
    line-height: 1.2;
    font-size: 12px;
    letter-spacing: 1px;
    padding-top: 2px;
}
.plx-rule-card .plx-rule-body { min-width: 0; }
.plx-rule-titlerow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.plx-rule-name {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--ink);
}
.plx-rule-name.muted { color: var(--muted); font-weight: 500; }
.plx-rule-name-deleted { text-decoration: line-through; color: var(--muted); }
.plx-rule-meta {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: 4px;
}
.plx-rule-actions { flex-shrink: 0; }

/* ----- Lint row (.plx-lint) -------------------------------- */

.plx-lint {
    display: grid;
    grid-template-columns: 8px 36px 1fr auto;
    column-gap: 8px;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: var(--t-sm);
    line-height: 1.45;
}
.plx-lint + .plx-lint { margin-top: 4px; }
.plx-lint-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    transform: translateY(2px);
}
.plx-lint-line {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--muted);
    text-align: right;
}
.plx-lint-msg { color: var(--ink-2); }
.plx-lint-action {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0 4px;
    font: inherit;
    font-size: var(--t-xs);
    color: var(--brand);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.plx-lint-action:hover { color: var(--brand-deep); }

.plx-lint-ok   { background: rgba(0, 0, 0, 0); }
.plx-lint-ok   .plx-lint-dot { background: var(--good, #047857); }
.plx-lint-warn { background: var(--warn-soft); border-color: #f1eacc; }
.plx-lint-warn .plx-lint-dot { background: var(--warn); }
.plx-lint-bad  { background: var(--bad-soft);  border-color: #f5d8d4; }
.plx-lint-bad  .plx-lint-dot { background: var(--bad); }
.plx-lint-bad  .plx-lint-msg { color: #872929; }

