/* === components/features/organizations/orgs_shared/orgs-shared.css === */
/*
 * orgs-shared.css — single source of truth for orgs UI primitives
 *
 * Naming: orgs- prefix (BEM-like) throughout.
 *   - Global style.css has a .btn primitive, but it uses border:none and
 *     double-dash BEM modifiers (--primary). Orgs buttons have a visible border
 *     and were historically defined locally per pane. Namespacing avoids
 *     collisions without touching global styles.
 *   - All pane/modal CSS files were updated to drop duplicates; they now
 *     contain only component-specific layout and overrides.
 *
 * Load order: this file BEFORE per-pane stylesheets so pane overrides win.
 */

/* ── Page heading ────────────────────────────────────────── */
.orgs-page-head { margin-bottom: 24px; }
.orgs-page-head .breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--font-size-xs); margin-bottom: 6px; }
.orgs-page-head .breadcrumb .material-symbols-rounded { font-size: 14px; opacity: .7; }
.orgs-page-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.orgs-page-head .sub { color: var(--text-muted); font-size: var(--font-size-sm); margin-top: 4px; }
.orgs-page-head .head-row { display: flex; align-items: center; gap: 14px; }
.orgs-page-head .head-row .head-text { flex: 1; }

/* ── Card overrides ───────────────────────────────────────── */
.overview-pane .px-card,
.settings-pane .px-card,
.invites-pane .px-card,
.audit-pane .px-card {
  --px-card-bg: var(--surface);
  --px-card-radius: var(--radius-lg);
  --px-card-padding: 20px 24px;
  --px-card-header-sep: transparent;
  margin-bottom: 20px;
  overflow: visible;
}

/* ── Buttons ──────────────────────────────────────────────── */
.orgs-btn { padding: 7px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; font-size: var(--font-size-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); text-decoration: none; }
.orgs-btn:hover { background: var(--bg); border-color: var(--brand-muted); }
.orgs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.orgs-btn:disabled:hover { background: var(--surface-alt); border-color: var(--border); }
.orgs-btn .material-symbols-rounded { font-size: 16px; }
.orgs-btn--primary { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }
.orgs-btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.orgs-btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.orgs-btn--ghost:hover { background: var(--surface-alt); color: var(--text); border-color: transparent; }
.orgs-btn--danger { color: var(--error); border-color: var(--error-border); }
.orgs-btn--danger:hover { background: var(--error-bg); border-color: var(--error); }
.orgs-btn--sm { padding: 4px 9px; font-size: var(--font-size-xs); }

/* icon-only close/action button used inside modals */
.orgs-icon-btn { background: transparent; border: 0; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); }
.orgs-icon-btn:hover { background: var(--surface-alt); color: var(--text); }

/* ── Role pills ───────────────────────────────────────────── */
.orgs-role-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-full); background: var(--surface-alt); color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: filter var(--transition), border-color var(--transition), box-shadow var(--transition); }
.orgs-role-pill:hover { filter: brightness(1.1); border-color: var(--border); box-shadow: var(--shadow-sm); }
.orgs-role-pill .material-symbols-rounded { font-size: 14px; }
.orgs-role-pill--owner  { background: var(--role-owner-bg); color: var(--role-owner-fg); }
.orgs-role-pill--admin  { background: var(--role-admin-bg); color: var(--role-admin-fg); }
.orgs-role-pill--editor { background: var(--brand-subtle);  color: var(--brand-accent); }
.orgs-role-pill--viewer { background: var(--surface-alt);   color: var(--text-muted); }
.orgs-role-pill.active { box-shadow: 0 0 0 2px var(--brand-accent); font-weight: 700; }
.orgs-role-pill:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.perms-table .orgs-role-pill:not(.active) { opacity: 0.5; }
.orgs-role-pill-row { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Modal scaffold ───────────────────────────────────────── */
.orgs-modal-bd { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.orgs-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 480px; max-width: 90vw; color: var(--text); box-shadow: var(--shadow-md); }
.orgs-modal--wide { width: 600px; }
.orgs-modal__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.orgs-modal__head .title { flex: 1; font-size: var(--font-size-md); font-weight: 600; }
.orgs-modal__body { padding: 16px 20px; }
.orgs-modal__foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); align-items: center; }

/* ── Form fields ──────────────────────────────────────────── */
.orgs-field { margin-bottom: 14px; }
.orgs-field label { display: block; font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.orgs-field input[type=text],
.orgs-field input[type=email],
.orgs-field input[type=password],
.orgs-field select,
.orgs-field textarea { width: 100%; padding: 9px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: inherit; font-size: var(--font-size-sm); outline: 0; transition: border-color var(--transition); }
.orgs-field input:focus,
.orgs-field select:focus,
.orgs-field textarea:focus { border-color: var(--border-focus); }
.orgs-field input:focus-visible,
.orgs-field select:focus-visible,
.orgs-field textarea:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.orgs-field input:disabled { color: var(--text-muted); cursor: not-allowed; }
.orgs-field .hint { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 5px; }
.orgs-field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.orgs-field__row { display: flex; align-items: center; gap: 8px; }
.orgs-field__row input { flex: 1; min-width: 0; }
.orgs-field__row .orgs-btn { flex-shrink: 0; }

/* ── Avatar pile ──────────────────────────────────────────── */
.orgs-av-stack { display: flex; }
.orgs-av-stack .av { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-on-brand); margin-left: -6px; }
.orgs-av-stack .av:first-child { margin-left: 0; }
.orgs-av-stack .av.more { background: var(--surface-alt); color: var(--text-muted); }
.orgs-av-stack .empty { font-size: var(--font-size-xxs); color: var(--text-muted); }

/* ── Layout utilities ─────────────────────────────────────── */
/* spacer that absorbs leftover horizontal flex space, replacing inline
   `style="flex: 1;"` on `<span>` separators inside .orgs-modal__foot. */
.orgs-flex-spacer { flex: 1; }

/* ── Empty states ─────────────────────────────────────────── */
.orgs-empty-line { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 12px 0; font-size: var(--font-size-sm); justify-content: center; }
.orgs-empty-state { text-align: center; padding: 30px 16px; color: var(--text-muted); font-size: var(--font-size-sm); display: flex; flex-direction: column; gap: 12px; align-items: center; grid-column: 1 / -1; }

/* ── Team grid / card (shared by overview and teams panes) ── */
.orgs-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.orgs-team-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; position: relative; color: var(--text); }
.orgs-team-card .ribbon { height: 4px; border-radius: var(--radius-sm); margin: -16px -16px 14px; }
.orgs-team-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.orgs-team-card .team-avatar { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-on-brand); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.orgs-team-card .team-name { font-size: var(--font-size-sm); font-weight: 600; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgs-team-card .desc { font-size: var(--font-size-xs); color: var(--text-muted); line-height: 1.45; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.orgs-team-card .members-strip { display: flex; align-items: center; gap: 0; margin-top: 12px; }

/* ── Clickable affordances (overview stat cards, role slices, team cards) ── */
.overview-pane .stat--clickable { font: inherit; text-align: left; width: 100%; cursor: pointer; transition: var(--transition); }
.overview-pane .stat--clickable:hover { border-color: var(--brand-accent); background: var(--surface-alt); }
.overview-pane .stat--clickable:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.overview-pane__role-dist-seg--clickable { cursor: pointer; font: inherit; transition: var(--transition); }
.overview-pane__role-dist-seg--clickable:hover { filter: brightness(1.06); }
.overview-pane__role-dist-seg--clickable:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.orgs-team-card--clickable { cursor: pointer; transition: var(--transition); }
.orgs-team-card--clickable:hover { border-color: var(--brand-accent); }
.orgs-team-card--clickable:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* ── Team modal: blocked-delete hint ──────────────────────── */
.team-modal__delete-hint { font-size: var(--font-size-xs); color: var(--text-muted); align-self: center; }

/* ── Audit sentence entities (overview + audit panes) ─────── */
.audit-actor { font-weight: 600; color: var(--text); }
.audit-detail { color: var(--text); font-weight: 500; }
.audit-slug { font-family: ui-monospace, monospace; color: var(--text-muted); }
.audit-pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; font-size: 0.92em; font-weight: 600; line-height: 1.6; vertical-align: baseline; }
.audit-pill__icon { font-size: 13px; }
.audit-pill__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.audit-pill--user { background: var(--brand-subtle); color: var(--brand-accent); }
.audit-pill--team { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.audit-pill--role { background: var(--surface-alt); color: var(--text-muted); }
.orgs-field__error { margin-top: 4px; color: var(--error); font-size: var(--font-size-xs); }

/* === components/layout/navbar/navbar.css === */
/* ── Navbar sidebar toggle ───────────────────────────────── */
.nav-sidebar-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--cream);
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.nav-sidebar-toggle:hover { color: var(--text-on-brand); }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1.5rem;
    height: 3.25rem;
    background: var(--brand);
    color: var(--cream);
    flex-shrink: 0;
}

.site-logo {
    height: 1.75rem;
    width: auto;
    display: block;
}

.nav-left {
    display: flex; align-items: center; gap: 1.5rem;
    justify-self: start;
}
.nav-right {
    display: flex; align-items: center; gap: 0.5rem;
    justify-self: end;
}

.nav-user-dropdown__pop form { margin: 0; }

.nav-theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--cream);
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.nav-theme-toggle:hover { color: var(--text-on-brand); }

/* ── Navbar search button ────────────────────────────────── */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    color: var(--cream);
    cursor: pointer;
    font-family: inherit; font-size: var(--font-size-sm);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.nav-search-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-on-brand);
    border-color: rgba(255, 255, 255, 0.18);
}
.nav-search-btn__label { font-weight: 500; }
.nav-search-btn__kbd {
    font-family: inherit; font-size: var(--font-size-xxs); font-weight: 600;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--cream); opacity: 0.75;
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.4;
}

/* ── Navbar nav links (Chat, Documentos) ─────────────────── */
.nav-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: center;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--cream);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-on-brand);
}
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--text-on-brand);
}
.nav-link svg { flex-shrink: 0; }

/* ── User dropdown (right side) ──────────────────────────── */
.navbar .nav-user-dropdown__trigger {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--cream);
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.nav-user-dropdown__trigger:hover,
.nav-user-dropdown__trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-on-brand);
}
.nav-user-dropdown__trigger:focus { outline: none; box-shadow: none; }
.nav-user-dropdown__trigger:focus-visible {
    outline: 2px solid var(--text-on-brand);
    outline-offset: 2px;
}

.nav-user-dropdown__avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--cream);
    color: var(--brand);
    font-weight: 800;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.nav-user-dropdown__email {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-user-dropdown__caret { flex-shrink: 0; opacity: 0.8; }

.nav-user-dropdown__pop {
    top: calc(100% + 6px);
    min-width: 240px;
    padding: 6px;
}
.nav-user-dropdown__item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}
.nav-user-dropdown__item:hover { background: var(--surface-alt); color: var(--brand-accent); }
.nav-user-dropdown__item svg { flex-shrink: 0; }
.nav-user-dropdown__item .material-symbols-rounded { font-size: 1rem; flex-shrink: 0; }
.nav-user-dropdown__divider { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }

/* ── Orgs dropdown ───────────────────────────────────────── */
.nav-orgs-dropdown { position: relative; }
.nav-orgs-dropdown .nav-link-btn {
    background: transparent; border: 0; cursor: pointer;
    color: var(--cream); font: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: var(--font-size-sm); font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.nav-orgs-dropdown .nav-link-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-on-brand); }
.nav-orgs-dropdown .nav-link-btn.is-active { background: rgba(255,255,255,0.16); color: var(--text-on-brand); }
.nav-orgs-dropdown .nav-link-btn:focus { outline: none; box-shadow: none; }
.nav-orgs-dropdown .nav-link-btn:focus-visible {
    outline: 2px solid var(--text-on-brand);
    outline-offset: 2px;
}
.nav-orgs-dropdown .nav-link-btn:active { transform: none; }
.nav-orgs-dropdown .nav-link-btn svg { flex-shrink: 0; }

.nav-orgs-dropdown__pop {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 280px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 6px;
    box-shadow: var(--shadow-md); z-index: var(--z-dropdown);
}
.nav-orgs-dropdown__item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; cursor: pointer;
}
.nav-orgs-dropdown__item:hover { background: var(--surface-alt); }
.nav-orgs-dropdown__item.is-current { background: var(--brand-subtle); color: var(--brand-accent); }
.nav-orgs-dropdown__avatar {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--swatch-ink); font-weight: 800; font-size: var(--font-size-xs);
    flex-shrink: 0;
}
.nav-orgs-dropdown__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-orgs-dropdown__name { font-size: var(--font-size-sm); font-weight: 600; }
.nav-orgs-dropdown__role { font-size: var(--font-size-xxs); color: var(--text-muted); text-transform: capitalize; }
.nav-orgs-dropdown__loading,
.nav-orgs-dropdown__empty { padding: 12px; color: var(--text-muted); font-size: var(--font-size-sm); text-align: center; }
.nav-orgs-dropdown__divider { height: 1px; background: var(--border); margin: 4px 6px; }
.nav-orgs-dropdown__create {
    width: 100%; text-align: left; background: transparent; border: 0;
    padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 600;
    font-family: inherit;
}
.nav-orgs-dropdown__create:hover { background: var(--surface-alt); color: var(--text); }
.nav-orgs-dropdown__current-avatar {
    width: 1.25rem; height: 1.25rem; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--swatch-ink); font-weight: 800; font-size: 0.7rem;
    flex-shrink: 0;
}
.nav-orgs-dropdown__current-name {
    font-weight: 600; max-width: 180px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}

/* ── team switcher ─────────────────────────────────────── */
.nav-team-dropdown { position: relative; }
.nav-team-dropdown__label {
    font-weight: 600; max-width: 140px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.nav-team-dropdown__pop {
    position: absolute; top: calc(100% + 4px); left: 0;
    min-width: 220px; max-height: 360px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 4px; z-index: var(--z-dropdown);
}
.nav-team-dropdown__group {
    padding: 6px 10px 4px; font-size: var(--font-size-xxs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted);
}
.nav-team-dropdown__item {
    width: 100%; text-align: left; background: transparent; border: 0;
    padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; color: var(--text); font-size: var(--font-size-sm);
    font-family: inherit;
}
.nav-team-dropdown__item:hover { background: var(--surface-alt); }
.nav-team-dropdown__item.is-current { font-weight: 700; color: var(--accent); }
.nav-team-dropdown__name {
    flex: 1; min-width: 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}

/* ── nav-active-org ──────────────────────────────────────────────── */
.navbar .nav-active-org__trigger,
.navbar .nav-team-filter__trigger {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent; border: 0;
    border-radius: var(--radius-md);
    color: var(--cream);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-sm); font-weight: 600;
    transition: background var(--transition), color var(--transition);
    max-width: 22rem;
}
.navbar .nav-team-filter__trigger { max-width: 14rem; }
.nav-active-org__trigger:hover,
.nav-team-filter__trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-on-brand);
}
.nav-active-org__trigger > svg,
.nav-team-filter__trigger > svg { flex-shrink: 0; }

.nav-active-org__badge {
    display: inline-block; flex-shrink: 0; max-width: 12rem;
    padding: 1px 10px; border-radius: 9999px;
    color: var(--swatch-ink); font-size: var(--font-size-xs); font-weight: 600; line-height: 1.5;
    border: 1px solid rgba(0, 0, 0, 0.15);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: middle;
}
.nav-active-org__trigger-avatar {
    display: none;
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    align-items: center; justify-content: center;
    color: var(--swatch-ink); font-size: 0.7rem; font-weight: 800;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0; text-transform: uppercase;
}
.nav-active-org__placeholder { color: var(--cream); }
.nav-active-org__pop {
    top: calc(100% + 6px);
    min-width: 260px; max-height: 360px; overflow-y: auto;
    padding: 6px;
}
.nav-active-org__row {
    display: flex; align-items: stretch; gap: 2px;
    border-radius: var(--radius-sm);
}
.nav-active-org__row:not(.is-current):hover { background: var(--surface-alt); }
.nav-active-org__row.is-current { background: var(--brand-subtle); }
.nav-active-org__pick.is-static { cursor: default; }
.nav-active-org__switch { flex: 1 1 auto; min-width: 0; margin: 0; }
.nav-active-org__pick {
    width: 100%; text-align: left; background: transparent; border: 0;
    padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    color: var(--text); font-size: var(--font-size-sm); font-family: inherit;
}
.nav-active-org__row.is-current .nav-active-org__pick {
    color: var(--brand-accent); font-weight: 600;
}
.nav-active-org__avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--font-size-xxs); font-weight: 700; color: var(--swatch-ink-inverse);
    flex-shrink: 0;
}
.nav-active-org__meta {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.nav-active-org__name-text {
    font-size: var(--font-size-sm); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-active-org__role {
    font-size: var(--font-size-xxs); color: var(--text-muted);
    text-transform: capitalize;
}
.nav-active-org__check { color: var(--brand-accent); flex-shrink: 0; }
.nav-active-org__nav {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 10px; border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none;
    flex-shrink: 0;
}
.nav-active-org__nav:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.nav-active-org__divider { height: 1px; background: var(--border); margin: 4px 6px; }
.nav-active-org__create {
    width: 100%; text-align: left; background: transparent; border: 0;
    padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: var(--font-size-sm); font-family: inherit;
}
.nav-active-org__create:hover { background: var(--surface-alt); color: var(--text); }

/* ── nav-team-filter ─────────────────────────────────────────────── */
.nav-team-filter__chips {
    flex: 0 1 auto; min-width: 0;
    display: inline-flex; align-items: center; gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
    line-height: 1.6;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}
.nav-team-filter__chips::-webkit-scrollbar { display: none; }
.nav-team-filter__chips.is-overflowing {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 1rem), transparent);
            mask-image: linear-gradient(to right, black calc(100% - 1rem), transparent);
}
.nav-team-filter__chip {
    flex-shrink: 0;
    padding: 1px 8px; border-radius: 9999px;
    color: var(--swatch-ink); font-size: var(--font-size-xxs); font-weight: 600; line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.15);
    max-width: 10rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-team-filter__placeholder {
    color: var(--cream); font-style: italic; opacity: 0.75;
    white-space: nowrap;
}
.nav-team-filter__pop {
    top: calc(100% + 6px);
    min-width: 260px; padding: 12px;
}
.nav-team-filter__hint {
    margin-bottom: 8px; color: var(--text-muted); font-size: var(--font-size-xs);
}
.nav-team-filter__options {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 12px; max-height: 18rem; overflow-y: auto;
}
.nav-team-filter__option {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text); font-size: var(--font-size-sm);
}
.nav-team-filter__option:hover { background: var(--surface-alt); }
.nav-team-filter__swatch {
    display: inline-block; width: 12px; height: 12px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15); flex-shrink: 0;
}
.nav-team-filter__name { flex: 1; }
.nav-team-filter__actions {
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1200px) {
    .navbar { padding: 0 1rem; }

    .nav-search-btn { padding: 0.375rem 0.5rem; }
    .nav-search-btn__label,
    .nav-search-btn__kbd { display: none; }

    .nav-team-filter__chips { display: none; }
    .navbar .nav-team-filter__trigger { padding: 0.375rem 0.5rem; }

    .nav-user-dropdown__email,
    .nav-user-dropdown__caret { display: none; }
    .navbar .nav-user-dropdown__trigger { padding: 4px; }

    .nav-active-org__badge { max-width: 8rem; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 0.5rem; }
    .nav-left { gap: 0.75rem; }

    .nav-link { padding: 0.375rem 0.5rem; gap: 0; font-size: 0; }
    .nav-link svg { font-size: initial; }

    .nav-active-org__badge { display: none; }
    .nav-active-org__trigger-avatar { display: inline-flex; }
}

/* === components/layout/app_shell/app-shell.css === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand);
    color: var(--text-on-brand);
    padding: 0.5rem 1rem;
    z-index: var(--z-overlay);
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
    top: 0;
}

/* body.page-body is `display: flex; flex-direction: column; height: 100dvh; overflow: hidden`
   (see static/style.css). Navbar sits above; app-shell takes the remaining vertical
   space exactly. `min-height: 0` lets the inner overflow-auto regions actually scroll. */
.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.app-main__primary {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#app-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar-backdrop { display: none; }

@media (max-width: 768px) {
    #sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: var(--z-modal-backdrop);
        background: var(--backdrop-modal);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }
    #sidebar-backdrop.sidebar-backdrop--visible {
        opacity: 1;
        pointer-events: auto;
    }
}

/* === components/layout/sidebar_shell/sidebar-shell.css === */
/* SidebarShell — shared layout for /chat and /docs sidebars.
   Domain-specific styles live in each consumer's own CSS. */

.sidebar {
    width: 260px;
    flex-shrink: 0;
    align-self: stretch;          /* explicit — fight any inherited align-items override */
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 200ms ease, opacity 200ms ease;
}

.sidebar--closed {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

/* Pre-paint collapse — set by an inline script in <head> when localStorage
   says the sidebar should start closed. Cleared by x-init once Alpine
   hydrates, after which `.sidebar--closed` is the sole source of truth.
   `transition: none` avoids a flash if Alpine's class lands a frame late. */
html[data-sidebar-initial="closed"] .sidebar {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

#sidebar-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar__header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar__footer {
    margin-top: auto;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* ── "New X" button used by every header (Nova conversa /
   Novo documento + Nova pasta / Novo formulário) ───────────────── */
.sidebar-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--brand-subtle);
    color: var(--brand);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.sidebar-new-btn:hover {
    background: var(--brand-subtle);
    border-color: var(--brand-muted);
}
.sidebar-new-btn .material-symbols-rounded {
    font-size: 1.125rem;
}

/* ── Search input (used by docs + forms) ──────────────────────────── */
.sidebar-search {
    position: relative;
    margin: 0.5rem 0.5rem 0.25rem;
}
.sidebar-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}
.sidebar-search-input {
    width: 100%;
    padding: 0.375rem 0.5rem 0.375rem 2rem;
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-sm);
    outline: 0;
    transition: background var(--transition), border-color var(--transition);
}
.sidebar-search-input::placeholder { color: var(--text-muted); }
.sidebar-search-input:focus {
    border-color: var(--brand-muted);
    background: var(--surface);
}
.sidebar-search-input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.sidebar-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 14px;
    width: 14px;
    margin-left: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    background:
        linear-gradient(45deg, transparent 45%, var(--text-muted) 45%, var(--text-muted) 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, var(--text-muted) 45%, var(--text-muted) 55%, transparent 55%);
    background-color: var(--surface-alt);
    background-size: 60% 60%;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-color var(--transition);
}
.sidebar-search-input::-webkit-search-cancel-button:hover {
    background:
        linear-gradient(45deg, transparent 45%, var(--brand) 45%, var(--brand) 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, var(--brand) 45%, var(--brand) 55%, transparent 55%);
    background-color: var(--brand-subtle);
    background-size: 60% 60%;
    background-repeat: no-repeat;
    background-position: center;
}

/* ── Section label (chat "Administração", forms "Todos os
   formulários" — small uppercase muted divider) ───────────────── */
.sidebar-section-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Empty-list message (used by chat + forms) ────────────────────── */
.sidebar__empty {
    padding: 1rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
}
.sidebar__empty p { margin: 0; }

/* ── Footer link (Lixeira on /docs and /forms) ────────────────────── */
.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: background var(--transition), color var(--transition);
}
.sidebar-footer-link:hover {
    background: var(--surface-alt);
    color: var(--text);
}
.sidebar-footer-link .material-symbols-rounded {
    font-size: 1.125rem;
}

/* ── Folder groups (used by /docs and /forms sidebars) ───────────── */
.folder-group { list-style: none; margin: 0.125rem 0; }
.folder-group-header {
    display: flex; align-items: center; gap: 0.375rem; width: 100%;
    padding: 0.375rem 0.5rem; border: 0; background: transparent;
    color: var(--text); cursor: pointer; border-radius: var(--radius-md);
    font-size: var(--font-size-sm); font-family: inherit; text-align: left;
    transition: background var(--transition);
}
.folder-group-header:hover { background: var(--surface-alt); }
.folder-group-chevron {
    transition: transform 150ms ease;
    color: var(--text-muted); flex-shrink: 0; font-size: 1rem;
}
.folder-group[data-collapsed="false"] > .folder-group-header > .folder-group-chevron {
    transform: rotate(90deg);
}
.folder-group-icon { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }
.folder-group-name {
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: 600;
    user-select: none;
}
.folder-group-name[hidden] { display: none; }
.folder-group-name-input {
    flex: 1; min-width: 0;
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--brand-muted); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-family: inherit; font-size: var(--font-size-sm); font-weight: 600;
    outline: none;
}
.folder-group-name-input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
.folder-group-name-input[hidden] { display: none; }
.folder-group-count {
    font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0;
    margin-left: -0.125rem;
}
.folder-group-header > .folder-group-action:first-of-type { margin-left: auto; }
.folder-group-action {
    width: 1.5rem; height: 1.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--text-muted);
    border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
    opacity: 0; transition: opacity var(--transition), background var(--transition), color var(--transition);
}
.folder-group-action .material-symbols-rounded { font-size: 1rem; }
.folder-group-action:hover { background: var(--surface-alt); color: var(--text); }
.folder-group-action--danger:hover { background: var(--error-bg); color: var(--error); }
.folder-group:hover .folder-group-action,
.folder-group-header:focus-within .folder-group-action { opacity: 1; }
.folder-group-docs {
    list-style: none; margin: 0; padding: 0 0 0 0.875rem;
    border-left: 1px solid var(--border); margin-left: 0.875rem;
}
.folder-group-docs[hidden] { display: none; }
.folder-group--unfiled > .folder-group-docs { padding-left: 0; border-left: 0; margin-left: 0; }

.folder-group-header--static { cursor: default; }
.folder-group-header--static:hover { background: transparent; }
.folder-group-header--static .folder-group-name { font-weight: 600; color: var(--text-muted); }

/* Hint row inside an empty unfiled bucket — gives the drop zone substance. */
.folder-group-empty-hint {
    list-style: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    margin: 0.25rem 0.5rem;
}

.folder-group.drag-over > .folder-group-header,
.folder-group--unfiled.drag-over { background: var(--brand-subtle); }

/* Empty named regions collapse so domains can opt out of header/footer
   without us emitting border/padding for an empty slot. */
.sidebar__header:empty,
.sidebar__footer:empty { display: none; }

/* ── Mobile overlay drawer ────────────────────────────────────────
   On narrow viewports the sidebar slides out from the left as an
   overlay drawer (instead of the desktop "shrink to width: 0"
   collapse). Lifted from the legacy chat-sidebar.css so all
   AppShell-hosted pages share the behaviour. */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: var(--z-sidebar-mobile);
        width: 260px;
        transform: translateX(0);
        transition: transform 200ms ease;
    }

    .sidebar--closed {
        width: 260px;
        opacity: 1;
        transform: translateX(-100%);
    }
}

/* === components/layout/sidebar_shell/primitives/item_row/item-row.css === */
/* item-row.css — visual rhythm matches features/library/.doc-row so
   nav-style sidebars (orgs) and file-style sidebars (library) feel
   like one component family. */
.sidebar-item { list-style: none; margin: 0.0625rem 0; }
.sidebar-item-link {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    color: var(--text); text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sidebar-item-link:hover { background: var(--surface-alt); }
.sidebar-item--active > .sidebar-item-link {
    background: var(--brand-subtle); color: var(--brand);
}
.sidebar-item-icon {
    width: 2rem; height: 2rem;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--brand-accent);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sidebar-item-icon .material-symbols-rounded { font-size: 1.125rem; }
.sidebar-item--active > .sidebar-item-link .sidebar-item-icon {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--text-on-brand);
}
.sidebar-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 0.125rem; }
.sidebar-item-label {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: 600;
}
.sidebar-item-meta { font-size: var(--font-size-xs); color: var(--text-muted); }
.sidebar-item-count {
    font-size: var(--font-size-xs); color: var(--text-muted); flex-shrink: 0;
    margin-left: auto;
}

/* === components/layout/sidebar_shell/primitives/identity_card/identity-card.css === */
/* identity-card.css — avatar swatch is delegated to <Avatar> (ui-avatar.css).
   The shared <Avatar> is circular, but in this card we want the existing
   rounded-square look (matches the legacy orgs-sidebar-avatar). */
.sidebar-identity-card {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-alt);
}
.sidebar-identity-card .ui-avatar { border-radius: var(--radius-md); }
.sidebar-identity-meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar-identity-primary {
    font-size: var(--font-size-sm); font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-identity-secondary {
    font-size: var(--font-size-xs); color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* === components/features/organizations/audit_pane/audit-pane.css === */
/* audit-pane — layout and pane-specific rules only.
   Shared primitives (buttons, page-head, empty-line) live in orgs-shared.css. */

.audit-pane #audit-events-card { --px-card-padding: 8px 24px; }
.audit-pane .audit-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.audit-pane .audit-row:last-child { border-bottom: 0; }
.audit-pane .audit-row .icw { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-alt); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.audit-pane .audit-row .body { flex: 1; min-width: 0; }
.audit-pane .audit-row .desc { font-size: var(--font-size-sm); color: var(--text); line-height: 1.5; }
.audit-pane .audit-row .desc .strong { font-weight: 600; }
.audit-pane .audit-row .when { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 4px; }
.audit-pane .load-more { width: 100%; margin-top: 12px; padding: 10px; background: transparent; border: 1px dashed var(--border); color: var(--text-muted); border-radius: var(--radius-md); cursor: pointer; font-size: var(--font-size-sm); }

/* === components/features/organizations/create_org_modal/create-org-modal.css === */
/* create-org-modal — relies on AppModal scaffolding from orgs-shared.css. */

/* === components/features/organizations/danger_pane/danger-pane.css === */
/* danger-pane — layout and pane-specific rules only.
   Shared primitives (buttons, modal scaffold, page-head) live in orgs-shared.css. */

.danger-pane .card.danger-zone { background: var(--surface); border: 1px solid var(--error-border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px; }
.danger-pane .card-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 8px; }
.danger-pane .card-head h2 { margin: 0; font-size: var(--font-size-md); font-weight: 600; color: var(--text); }
.danger-pane .card-head .sub { margin-top: 2px; font-size: var(--font-size-xs); color: var(--text-muted); }
.danger-pane .card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.danger-pane .hint { font-size: var(--font-size-xs); color: var(--text-muted); }
.danger-pane .transfer-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.danger-pane .transfer-select { flex: 1; padding: 9px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--font-size-sm); outline: 0; }
.danger-pane .transfer-select:focus { border-color: var(--error); }
.danger-pane .transfer-select:focus-visible { outline: 2px solid var(--error); outline-offset: 1px; }
.danger-pane .warn { color: var(--error); font-size: var(--font-size-sm); line-height: 1.5; margin-bottom: 12px; }
.danger-pane .confirm-input { width: 100%; padding: 9px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--font-size-sm); outline: 0; font-family: ui-monospace, monospace; }
.danger-pane .confirm-input:focus { border-color: var(--error); }
.danger-pane .confirm-input:focus-visible { outline: 2px solid var(--error); outline-offset: 1px; }

/* === components/features/organizations/invite_modal/invite-modal.css === */
/* invite-modal — no modal-specific overrides needed beyond orgs-shared.css.
   All structure (scaffold, fields, buttons) is provided by orgs-shared.css. */

/* === components/features/organizations/invites_pane/invites-pane.css === */
/* invites-pane — layout and pane-specific rules only.
   Shared primitives (buttons, role pills, page-head, etc.) live in orgs-shared.css. */

.invites-pane #invites-list-card { --px-card-padding: 12px 24px; }
.invites-pane .invite-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.invites-pane .invite-row:last-child { border-bottom: 0; }
.invites-pane .invite-row .av { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-alt); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.invites-pane .invite-row .meta { flex: 1; min-width: 0; }
.invites-pane .invite-row .e { font-size: var(--font-size-sm); color: var(--text); }
.invites-pane .invite-row .s { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.invites-pane .invite-row .actions { display: flex; gap: 6px; }
.invites-pane .team-tag { display: inline-flex; align-items: center; gap: 4px; }
.invites-pane .team-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* === components/features/organizations/members_pane/members-pane.css === */
/* members-pane — layout and pane-specific rules only.
   Shared primitives (buttons, role pills, page-head, etc.) live in orgs-shared.css. */

.members-pane .members-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.members-pane .toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.members-pane .search-mini { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 10px; flex: 0 0 320px; }
.members-pane .search-mini:focus-within { border-color: var(--border-focus); outline: 2px solid var(--border-focus); outline-offset: 1px; }
.members-pane .search-mini input { background: transparent; border: 0; color: var(--text); font-size: var(--font-size-sm); outline: 0; flex: 1; }
.members-pane .search-mini .material-symbols-rounded { color: var(--text-muted); font-size: 18px; }
.members-pane .filter-select { padding: 5px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: var(--font-size-xs); cursor: pointer; }
.members-pane .filter-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.members-pane .counter { font-size: var(--font-size-xs); color: var(--text-muted); }
.members-pane .members-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); color: var(--text); }
.members-pane .members-table thead { background: var(--bg); }
.members-pane .members-table th { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 700; font-size: var(--font-size-xxs); letter-spacing: 0.06em; text-transform: uppercase; }
.members-pane .members-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.members-pane .members-table tr:hover td { background: var(--surface-alt); }
.members-pane .members-table tr.you td { background: var(--brand-subtle); }
.members-pane .person { display: flex; align-items: center; gap: 11px; }
.members-pane .person .av { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--font-size-xs); color: var(--text-on-brand); flex-shrink: 0; }
.members-pane .person .meta { min-width: 0; }
.members-pane .person .name { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.members-pane .person .name .you-tag { font-size: var(--font-size-xxs); font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); background: var(--brand-subtle); color: var(--brand-accent); border: 1px solid var(--brand-muted); }
.members-pane .person .email { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }
.members-pane .role-pop { position: relative; }
.members-pane .role-pop-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
    min-width: 180px;
}
.members-pane .role-pop-menu .orgs-role-pill {
    justify-content: flex-start;
    width: 100%;
}
.members-pane .team-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.members-pane .team-role-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: var(--font-size-xxs); cursor: pointer; }
.members-pane .team-role-chip:hover { background: var(--surface-alt); }
.members-pane .team-role-chip .dot { width: 8px; height: 8px; border-radius: 2px; }
.members-pane .team-role-chip .role-mini { font-weight: 600; color: var(--text-muted); }
.members-pane .team-role-chip .role-mini.admin { color: var(--role-admin-fg); }
.members-pane .team-role-chip .role-mini.editor { color: var(--brand-accent); }
.members-pane .team-role-chip .role-mini.viewer { color: var(--text-muted); }
.members-pane .no-teams { color: var(--text-muted); font-size: var(--font-size-xs); }
.members-pane .add-team-chip { width: 24px; height: 24px; border-radius: 50%; background: transparent; border: 1px dashed var(--border); color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.members-pane .add-team-chip .material-symbols-rounded { font-size: 14px; }
.members-pane .members-empty-row td { text-align: center; padding: 28px 14px; color: var(--text-muted); font-size: var(--font-size-sm); }
.members-pane .row-actions { text-align: right; }
.members-pane .icon-btn { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--text-muted); }
.members-pane .icon-btn.danger:hover { color: var(--error); background: var(--error-bg); }

/* === components/features/organizations/org_switcher/org-switcher.css === */
/* org-switcher — switcher button, dropdown, and create-org modal.
   Shared primitives (orgs-btn, orgs-field, orgs-icon-btn, x-cloak) live in orgs-shared.css.
   Outer scaffold (.popover positioning, .popover__panel border/shadow)
   lives in app/adapters/web/components/ui/popover/popover.css. */

.org-switcher { margin-left: auto; }
.org-switcher-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: var(--text-on-brand); padding: 5px 10px 5px 6px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: var(--font-size-sm); font-weight: 600;
}
.org-switcher-btn:hover { background: rgba(255,255,255,.14); }
.org-switcher .org-avatar {
  width: 24px; height: 24px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: var(--text-on-brand);
}
.org-switcher-pop {
  /* Variant overrides — outer scaffold lives in popover.css. */
  top: calc(100% + 6px);
  min-width: 280px; padding: 6px;
}
.org-switcher-pop .item {
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
}
.org-switcher-pop .item:hover { background: var(--surface-alt); }
.org-switcher-pop .item .org-avatar { width: 30px; height: 30px; border-radius: 6px; font-size: 13px; }
.org-switcher-pop .item .meta { flex: 1; min-width: 0; }
.org-switcher-pop .item .name { font-size: var(--font-size-sm); font-weight: 600; }
.org-switcher-pop .item .sub { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 2px; }
.org-switcher-pop .item .check { color: var(--brand); }
.org-switcher-pop .divider { height: 1px; background: var(--border); margin: 4px 6px; }
.org-switcher-pop .new-org {
  width: 100%; text-align: left; background: transparent; border: 0;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 600;
}
.org-switcher-pop .new-org:hover { background: var(--surface-alt); color: var(--text); }

/* === components/features/organizations/orgs_card_header/orgs-card-header.css === */
.orgs-card-header { display: flex; align-items: flex-end; gap: 14px; }
.orgs-card-header__text { flex: 1; min-width: 0; }
.orgs-card-header__title { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.orgs-card-header__sub { margin-top: 2px; font-size: var(--font-size-xs); color: var(--text-muted); }
.orgs-card-header__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* === components/features/organizations/overview_pane/overview-pane.css === */
/* overview-pane — layout and pane-specific rules only.
   Shared primitives (buttons, cards, role pills, av-stack, etc.) live in orgs-shared.css. */

.overview-pane .stat-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 24px; }
.overview-pane .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.overview-pane .stat .icw { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-alt); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--brand-muted); flex-shrink: 0; }
.overview-pane .stat .v { font-family: ui-monospace, monospace; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.overview-pane .stat .lab { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

.overview-pane .invite-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.overview-pane .invite-row:last-child { border-bottom: 0; }
.overview-pane .invite-row .av { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-alt); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.overview-pane .invite-row .meta { flex: 1; min-width: 0; }
.overview-pane .invite-row .e { font-size: var(--font-size-sm); color: var(--text); }
.overview-pane .invite-row .s { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.overview-pane .team-tag { display: inline-flex; align-items: center; gap: 4px; }
.overview-pane .team-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Role distribution bar — the segment background / colour / flex grow
   come from CSS custom properties set on the segment element so the
   template never carries presentational literals. */
.overview-pane__role-dist { display: flex; width: 100%; min-height: 40px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.overview-pane__role-dist-seg { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; font-size: var(--font-size-xs); font-weight: 600; min-width: 88px; background: var(--seg-bg, var(--surface-alt)); color: var(--seg-fg, var(--text-muted)); flex: var(--seg-flex, 0); border: 0; }
.overview-pane__role-dist-seg:not(:last-child) { border-right: 1px solid var(--border); }
.overview-pane__role-dist-seg[style*="--seg-flex: 0"] { flex: 0 0 0; min-width: 0; padding: 0; border-right: 0; overflow: hidden; }
.overview-pane__role-dist-label { text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview-pane__role-dist-count { font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* Inline activity rows reuse the audit-pane .audit-row styling. Tighten the
   vertical rhythm so the overview card stays compact. */
.overview-pane__activity .audit-row { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 14px; }
.overview-pane__activity .audit-row:last-child { border-bottom: 0; }
.overview-pane__activity .audit-row .icw { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-alt); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.overview-pane__activity .audit-row .icw .material-symbols-rounded { font-size: 16px; }
.overview-pane__activity .audit-row .body { flex: 1; min-width: 0; }
.overview-pane__activity .audit-row .desc { font-size: var(--font-size-sm); color: var(--text); line-height: 1.45; }
.overview-pane__activity .audit-row .when { font-size: var(--font-size-xxs); color: var(--text-muted); margin-top: 3px; }

.overview-pane__more-cue { font-size: var(--font-size-xs); color: var(--text-muted); padding: 10px 0 2px; text-align: center; }

@media (max-width: 1100px) {
    .overview-pane .stat-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .overview-pane .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

/* === components/features/organizations/perms_modal/perms-modal.css === */
/* perms-modal — modal-specific rules only.
   Modal scaffold, buttons, and role pills live in orgs-shared.css. */

.perms-modal__subtitle { font-size: var(--font-size-xxs); color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.orgs-modal .hint-block { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.orgs-modal .perms-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.orgs-modal .perms-table th,
.orgs-modal .perms-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; }
.orgs-modal .perms-table th { background: var(--bg); color: var(--text-muted); font-size: var(--font-size-xxs); text-transform: uppercase; letter-spacing: 0.06em; }
.orgs-modal .team-cell { display: flex; align-items: center; gap: 10px; }
.orgs-modal .team-cell .team-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.orgs-modal .team-cell .team-name { font-weight: 600; color: var(--text); }
.orgs-modal .perms-modal__error { color: var(--error); font-size: var(--font-size-sm); margin-right: auto; }

/* === components/features/organizations/rag_trace_detail_pane/rag-trace-detail-pane.css === */
.rag-trace-detail-pane { padding: 1rem; max-width: 960px; margin: 0 auto; }
.rag-trace-detail-pane__header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.rag-trace-detail-pane__meta { display: flex; gap: 1rem; align-items: baseline; color: var(--text-muted); font-size: var(--font-size-sm); margin-bottom: 0.5rem; }
.rag-trace-detail-pane__trace-id { font-family: var(--font-mono, monospace); }
.rag-trace-detail-pane__actor { display: flex; gap: 1.5rem; font-size: var(--font-size-sm); margin-bottom: 0.75rem; }
.rag-trace-detail-pane__question-label { margin: 0 0 4px 0; font-size: var(--font-size-sm); color: var(--text-muted); font-weight: 500; }
.rag-trace-detail-pane__question p { margin: 0; }
.rag-trace-detail-pane__section { margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.rag-trace-detail-pane__section summary { padding: 0.75rem 1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.rag-trace-detail-pane__section[open] summary { border-bottom: 1px solid var(--border); }
.rag-trace-detail-pane__section-title { font-weight: 600; }
.rag-trace-detail-pane__duration { color: var(--text-muted); font-size: var(--font-size-sm); }
.rag-trace-detail-pane__hint { color: var(--text-muted); font-size: var(--font-size-sm); font-style: italic; }
.rag-trace-detail-pane__table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.rag-trace-detail-pane__table th, .rag-trace-detail-pane__table td { padding: 0.5rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.rag-trace-detail-pane__table th { color: var(--text-muted); font-weight: 500; }
.rag-trace-detail-pane__kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 1rem; padding: 0.75rem 1rem; margin: 0; }
.rag-trace-detail-pane__kv dt { color: var(--text-muted); font-size: var(--font-size-sm); }
.rag-trace-detail-pane__kv dd { margin: 0; }
.rag-trace-detail-pane__response-text { padding: 0.75rem 1rem; white-space: pre-wrap; }
.rag-trace-detail-pane__citations { padding: 0 1rem 0.75rem 1rem; color: var(--text-muted); font-size: var(--font-size-sm); }
.rag-trace-detail-pane__citation { font-family: var(--font-mono, monospace); margin-right: 4px; }
.rag-trace-detail-pane__feedback { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; }
.rag-trace-detail-pane__feedback .vote-up { color: var(--success); }
.rag-trace-detail-pane__feedback .vote-down { color: var(--error); }
.rag-trace-detail-pane__payload { margin: 0; padding: 0.75rem 1rem; font-family: var(--font-mono, monospace); font-size: var(--font-size-sm); white-space: pre-wrap; }
.rag-trace-detail-pane__empty { color: var(--text-muted); padding: 0.75rem 1rem; }

.rag-trace-detail-pane__rerank-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-family: var(--font-mono, monospace);
    font-size: var(--font-size-sm);
}
.rag-trace-detail-pane__rerank-table th,
.rag-trace-detail-pane__rerank-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}
.rag-trace-detail-pane__rerank-row--kept { background: var(--brand-subtle); }
.rag-trace-detail-pane__rerank-cut td {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    border-top: 2px dashed var(--border);
    border-bottom: 2px dashed var(--border);
    padding: 0.25rem 0;
}
.rag-trace-detail-pane__rerank-delta--up { color: var(--brand); }
.rag-trace-detail-pane__rerank-delta--down { color: var(--error); }
.rag-trace-detail-pane__rerank-delta--zero { color: var(--text-muted); }
.rag-trace-detail-pane__mode-badge {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rag-trace-detail-pane__mode-badge--shadow { background: var(--brand-subtle); color: var(--brand-accent); }
.rag-trace-detail-pane__mode-badge--active { background: var(--brand); color: var(--text-on-brand); }
.rag-trace-detail-pane__hint--error { color: var(--error); }
.rag-trace-detail-pane .px-tooltip { --px-tooltip-max-width: 32ch; }
.rag-trace-detail-pane__retrieval-row { cursor: pointer; }
.rag-trace-detail-pane__retrieval-row:hover { background: var(--brand-subtle); }
.rag-trace-detail-pane__retrieval-expansion > td { padding: 0; background: var(--surface-alt); border-bottom: 2px solid var(--border); }
.rag-trace-detail-pane__chunk-expansion { padding: 0.75rem 1rem; }
.rag-trace-detail-pane__chunk-text pre { margin: 0; white-space: pre-wrap; font-family: var(--font-mono, monospace); font-size: var(--font-size-sm); }
.rag-trace-detail-pane__chunk-meta { color: var(--text-muted); font-size: var(--font-size-xs); margin-bottom: 0.5rem; }
.rag-trace-detail-pane__tool-chip {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--brand-subtle);
    color: var(--brand-accent);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-family: var(--font-mono, monospace);
    margin: 0 0.15rem 0.15rem 0;
}

/* === components/features/organizations/rag_traces_pane/rag-traces-pane.css === */
.rag-traces-pane { padding: 1rem; }
.rag-traces-pane__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.rag-traces-pane__title { font-family: var(--font-display); font-size: 22px; margin: 0; }
.rag-traces-pane__filters { display: inline-flex; gap: 0.25rem; align-items: center; }
.rag-traces-pane .filter-chip { padding: 0.25rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer; font-size: var(--font-size-sm); color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.rag-traces-pane .filter-chip.is-active { background: var(--surface-alt); border-color: var(--brand); color: var(--text); }
.rag-traces-pane .filter-chip .material-symbols-rounded { font-size: 16px; }
.rag-traces-pane__table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.rag-traces-pane__table th { text-align: left; font-weight: 500; padding: 0.5rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.rag-traces-pane__table td { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.rag-traces-pane__table td.ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rag-traces-pane__table .vote-up { color: var(--success, #2ea043); }
.rag-traces-pane__table .vote-down { color: var(--error, #d1242f); }
.rag-traces-pane__row { cursor: pointer; }
.rag-traces-pane__row:hover { background: var(--brand-subtle); }
.rag-traces-pane__expansion > td { padding: 0; background: var(--surface-alt); border-bottom: 2px solid var(--border); }
.rag-traces-pane__expansion-inner { padding: 1rem; }
.rag-traces-pane__more { margin-top: 1rem; width: 100%; padding: 10px; background: transparent; border: 1px dashed var(--border); color: var(--text-muted); border-radius: var(--radius-md); cursor: pointer; font-size: var(--font-size-sm); }
.rag-traces-pane__empty { color: var(--text-muted); padding: 2rem; text-align: center; }

/* === components/features/organizations/settings_pane/settings-pane.css === */
/* settings-pane — layout and pane-specific rules only.
   Shared primitives (buttons, cards, fields, page-head) live in orgs-shared.css. */

.settings-pane .logo-upload { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.settings-pane .logo-upload .preview { width: 64px; height: 64px; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: var(--text-on-brand); flex-shrink: 0; }
.settings-pane .logo-upload .logo-meta .title { font-size: var(--font-size-sm); font-weight: 600; color: var(--text); }
.settings-pane .logo-upload .logo-meta .hint { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 3px; margin-bottom: 8px; }
.settings-pane .toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; }
.settings-pane .toggle-row .body { flex: 1; }
.settings-pane .toggle-row .body .lab { font-size: var(--font-size-sm); color: var(--text); font-weight: 600; }
.settings-pane .toggle-row .body .desc { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.settings-pane .toggle-row .body .warn { font-size: var(--font-size-xs); color: var(--error); margin-top: 6px; }
.settings-pane .toggle { width: 38px; height: 22px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background var(--transition); flex-shrink: 0; }
.settings-pane .toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: all var(--transition); }
.settings-pane .toggle.on { background: var(--brand-muted); border-color: var(--brand-muted); }
.settings-pane .toggle.on::after { left: 18px; background: var(--text-on-brand); }
.settings-pane .toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.settings-pane__form-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* === components/features/organizations/team_modal/team-modal.css === */
/* team-modal — modal-specific rules only.
   Modal scaffold, buttons, and fields live in orgs-shared.css. */

.orgs-modal .color-swatches { display: flex; gap: 8px; }
.orgs-modal .swatch { width: 32px; height: 32px; border-radius: var(--radius-md); border: 2px solid transparent; cursor: pointer; }
.orgs-modal .swatch.active { border-color: var(--text); }

/* === components/features/organizations/teams_pane/teams-pane.css === */
/* teams-pane — layout and pane-specific rules only.
   Shared primitives (buttons, team cards, av-stack, etc.) live in orgs-shared.css. */

/* add-team placeholder card — teams_pane-specific variant */
.orgs-team-card.add-team { border-style: dashed; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--text-muted); min-height: 156px; background: transparent; }
.orgs-team-card.add-team:hover { border-color: var(--brand-muted); color: var(--text); }
.orgs-team-card.add-team .material-symbols-rounded { font-size: 24px; }

/* hover lift for clickable team cards in teams pane */
.teams-pane .orgs-team-card { cursor: default; transition: all var(--transition); }
.teams-pane .orgs-team-card:hover { border-color: var(--brand); transform: translateY(-1px); }

/* team-menu button (three-dot in card head) */
.orgs-team-card .team-menu { width: 28px; height: 28px; border-radius: 7px; background: transparent; border: 0; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.orgs-team-card .team-menu:hover { background: var(--surface-alt); color: var(--text); }

/* footer action buttons inside team cards */
.orgs-team-card .footer-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.orgs-team-card .footer-actions .orgs-btn { padding: 5px 8px; font-size: var(--font-size-xs); }

/* === components/features/chat/workspace/workspace.css === */
.workspace {
  --ws-body-height: 280px;
  --ws-resize-handle-height: 6px;

  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: relative;
}

.workspace--dragging {
  user-select: none;
  cursor: row-resize;
}

.workspace__resize-handle {
  height: var(--ws-resize-handle-height);
  cursor: row-resize;
  background: transparent;
  border-top: 1px solid transparent;
  transition: background var(--transition),
              border-color var(--transition);
}

.workspace__resize-handle:hover,
.workspace--dragging .workspace__resize-handle {
  background: var(--brand-subtle);
  border-top-color: var(--brand-muted);
}

.workspace__strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.workspace__strip-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.workspace__strip-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, black 0, black calc(100% - 32px), transparent 100%);
}

.workspace__strip-tabs::-webkit-scrollbar {
  display: none;
}

.workspace__tab {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  max-width: 220px;
  transition: background var(--transition),
              border-color var(--transition);
}

.workspace__tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.workspace__tab:hover {
  background: var(--brand-subtle);
}

.workspace__tab.is-active {
  background: var(--brand-subtle);
  border-color: var(--brand-muted);
}

.workspace__tab.is-active .workspace__tab-btn {
  color: var(--text);
  font-weight: 600;
}

.workspace__tab-btn {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.375rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.workspace__tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--surface);
  flex-shrink: 0;
}

.workspace__tab-icon--document {
  background: var(--kind-document);
}

.workspace__tab-icon--form {
  background: var(--kind-form);
}

.workspace__tab-icon--scope {
  background: transparent;
  color: var(--brand-dark);
}

.workspace__tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  padding: 0 0.25rem;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition),
              color var(--transition);
}

.workspace__tab-close:hover {
  background: var(--brand-subtle);
  color: var(--text);
}

.workspace__toggle {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: background var(--transition),
              color var(--transition);
  white-space: nowrap;
}

.workspace__toggle:hover {
  background: var(--brand-subtle);
  color: var(--text);
}

.workspace__body {
  height: var(--ws-body-height);
  overflow: auto;
  /* Vertical padding scales with body height so dragging to the floor
     leaves a truly imperceptible strip — at 1px height, padding-top/
     padding-bottom each become ~0.25px. Above ~12px height, padding
     locks at its normal 0.75rem. */
  padding: min(0.75rem, calc(var(--ws-body-height) / 4)) 0.875rem;
  background: var(--surface-alt);
  transition: height 200ms ease,
              padding-top 200ms ease,
              padding-bottom 200ms ease;
}

.workspace--collapsed .workspace__body {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.workspace--dragging .workspace__body {
  /* Direct gesture — animation would lag behind the cursor. */
  transition: none;
}

.workspace__body-tab {
  height: 100%;
  overflow-y: auto;
}

.workspace__loading {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .workspace__resize-handle,
  .workspace__tab,
  .workspace__tab-close,
  .workspace__toggle,
  .workspace__body {
    transition: none;
  }
}

.workspace__body-tab .cited-highlight {
  animation: ws-cited-flash 2.6s ease;
  border-radius: var(--radius-sm);
}

@keyframes ws-cited-flash {
  0%,
  55% {
    background: var(--brand-subtle);
    box-shadow: -0.5rem 0 0 var(--brand-subtle), 0.5rem 0 0 var(--brand-subtle);
  }
  100% {
    background: transparent;
    box-shadow: -0.5rem 0 0 transparent, 0.5rem 0 0 transparent;
  }
}

.workspace__persist-error {
  margin: 0;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-sm);
  color: var(--error);
  background: var(--error-bg);
  border-top: 1px solid var(--error-border);
}

@media (prefers-reduced-motion: reduce) {
  .workspace__body-tab .cited-highlight {
    animation: none;
  }
}

/* === components/features/chat/workspace/scope_tab/scope-tab.css === */
.scope-tab {
  position: relative;
  display: flex;
  height: 100%;
  --scope-rail-width: 280px;
  --scope-skeleton-bg: var(--surface-alt);
}

.scope-tab__map {
  flex: 1;
  min-height: 0;
  position: relative;
}

.scope-tab__map-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.scope-tab__rail {
  width: var(--scope-rail-width);
  flex-shrink: 0;
}

.scope-tab__skeleton {
  position: absolute;
  inset: 0;
  background: var(--scope-skeleton-bg);
  opacity: 0.5;
  pointer-events: none;
}

.scope-tab__error,
.scope-tab__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  padding: var(--space-2, 8px);
}

@media (prefers-reduced-motion: reduce) {
  .scope-tab__skeleton { opacity: 0.5; transition: none; }
}

.scope-tab__building {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  padding: var(--space-2, 8px);
  pointer-events: none;
}

.scope-tab__density {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-2, 8px) 6px;
  width: 56px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.scope-tab__density-slider {
  writing-mode: vertical-lr;
  width: 4px;
  flex: 1;
  min-height: 0;
  cursor: pointer;
  accent-color: var(--brand);
}

.scope-tab__density .px-tooltip__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-focus);
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  line-height: 1;
  cursor: help;
  transition: opacity var(--transition);
}

.scope-tab__density .px-tooltip__trigger:hover {
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .scope-tab__density .px-tooltip__trigger {
    transition: none;
  }
}

.scope-tab__density-slider[orient="vertical"] {
  writing-mode: initial;
  appearance: slider-vertical;
}

.scope-tab__lens {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-2, 8px);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.scope-tab__lens-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.scope-tab__lens-inner:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.scope-tab__lens-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: var(--font-size-sm);
  color: var(--text);
  outline: none;
}
.scope-tab__lens-input::placeholder { color: var(--text-muted); }
.scope-tab__lens-input:disabled { opacity: 0.5; cursor: not-allowed; }

.scope-tab__lens-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--brand);
  color: var(--text-on-brand);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.scope-tab__lens-submit:hover:not(:disabled) { background: var(--brand-dark); }
.scope-tab__lens-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.scope-tab__lens-submit:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.scope-tab__lens-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: scope-tab__lens-spin 0.8s linear infinite;
}
@keyframes scope-tab__lens-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .scope-tab__lens-spinner {
    animation: none;
    border-top-color: currentColor;
    opacity: 0.5;
  }
}

/* === components/features/chat/workspace/scope_tab/scope_map/scope-map.css === */
.scope-map {
  --scope-map-node-stroke: rgba(0, 0, 0, 0.55);
  --scope-map-node-stroke-hover: rgba(255, 255, 255, 0.7);
  --scope-map-hub-fill: rgba(20, 30, 26, 0.85);
  --scope-map-query: #ffd166;
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.scope-map__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scope-map .chunk-node {
  opacity: 0.9;
  stroke: var(--scope-map-node-stroke);
  stroke-width: 1;
  transition: opacity 0.15s, stroke 0.15s, stroke-width 0.15s;
}
.scope-map .chunk-node:hover {
  opacity: 1;
  stroke: var(--scope-map-node-stroke-hover);
  stroke-width: 2;
}
.scope-map .chunk-node.is-match { opacity: 1; }
.scope-map .chunk-node.is-dim { opacity: 0.18; }
.scope-map .chunk-node.is-selected {
  stroke: var(--surface);
  stroke-width: 2.5;
}

.scope-map .cluster-hub {
  fill: var(--scope-map-hub-fill);
  stroke-width: 3;
  opacity: 0.95;
}
.scope-map .cluster-hub.is-staged { stroke-width: 4; opacity: 1; }
.scope-map .cluster-label.is-staged { font-weight: 700; }
.scope-map .chunk-node.is-already-open { opacity: 0.4; }

.scope-map .cluster-edge {
  stroke-opacity: 0.22;
  stroke-width: 1;
  fill: none;
}

.scope-map .cluster-label {
  font-size: 13px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4;
  stroke-linejoin: round;
  pointer-events: none;
}

.scope-map .query-node {
  fill: var(--scope-map-query);
  stroke: var(--bg);
  stroke-width: 2;
}
.scope-map .tether {
  stroke: var(--scope-map-query);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  fill: none;
}

.scope-map__zoom-fit {
  position: absolute;
  bottom: 10px;
  right: 10px;
}
.scope-map__zoom-fit:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.scope-map .cluster-hub.is-search-result {
  stroke-width: 4;
  filter: url(#scope-map-glow);
  animation: scope-map__pulse 0.8s ease-out 2;
}

.scope-map .cluster-label.is-search-result {
  font-weight: 700;
}

@keyframes scope-map__pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.6; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .scope-map .cluster-hub.is-search-result {
    animation: none;
  }
}

/* === components/features/chat/workspace/scope_tab/staging_rail/staging-rail.css === */
.staging-rail {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-2, 8px);
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
}
.staging-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 8px);
}
.staging-rail__title { font-size: var(--font-size-sm); color: var(--text-muted); }
.staging-rail__clear {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.staging-rail__clear:hover:not(:disabled) {
  color: var(--text);
  text-decoration-color: currentColor;
}
.staging-rail__clear:disabled { opacity: 0.4; cursor: not-allowed; }
.staging-rail__clear:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}
.staging-rail__list { flex: 1; overflow-y: auto; list-style: none; padding: 0; margin: var(--space-2, 8px) 0; }
.staging-rail__item { display: flex; align-items: center; gap: var(--space-1, 4px); padding: var(--space-1, 4px) 0; }
.staging-rail__item-label { flex: 1; font-size: var(--font-size-sm); }
.staging-rail__item-kind { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.staging-rail__item-kind--document { background: var(--kind-document); }
.staging-rail__item-kind--form { background: var(--kind-form); }
.staging-rail__legend {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: var(--space-2, 8px);
  list-style: none;
  padding: 0;
  margin: var(--space-1, 4px) 0 var(--space-2, 8px);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.staging-rail__legend li { display: inline-flex; align-items: center; gap: var(--space-1, 4px); }
.staging-rail__item-open,
.staging-rail__item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--font-size-md);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.staging-rail__item-open:hover,
.staging-rail__item-remove:hover { background: var(--surface); color: var(--text); }
.staging-rail__item-open:focus-visible,
.staging-rail__item-remove:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.staging-rail__empty { flex: 1; color: var(--text-muted); font-size: var(--font-size-xs); margin: var(--space-2, 8px) 0; }
.staging-rail__commit { justify-content: center; }

/* === components/features/chat/workspace/table_chart/table-chart.css === */
.table-chart {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
}

.table-chart__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.table-chart__seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.table-chart__seg-btn {
  padding: 4px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: var(--font-size-xs);
  cursor: pointer;
}

.table-chart__seg-btn.is-active { background: var(--brand); color: var(--text-on-brand); }
.table-chart__seg-btn:disabled { opacity: .45; cursor: not-allowed; }

.table-chart__pickers { display: flex; gap: 10px; align-items: center; font-size: var(--font-size-xs); }
.table-chart__pickers label { display: inline-flex; gap: 4px; align-items: center; opacity: .9; }

.table-chart__table-wrap { overflow: auto; flex: 1; }

.table-chart__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table-chart__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  text-align: left;
  padding: 7px 14px;
  font-size: var(--font-size-xxs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table-chart__table tbody td {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-subtle, rgba(125, 125, 125, .14));
  vertical-align: top;
}

.table-chart__table tbody tr:nth-child(even) { background: rgba(125, 125, 125, .035); }
.table-chart__table tbody tr:hover { background: var(--brand-subtle); }

.table-chart__cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-chart__pills { display: flex; flex-wrap: wrap; gap: 4px; }

.table-chart__pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--brand-subtle);
  color: var(--brand-accent);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.table-chart__truncated {
  padding: 7px 14px;
  font-size: var(--font-size-xxs);
  color: var(--text-muted);
}

.table-chart__chart-wrap { flex: 1; min-height: 0; padding: 10px; }
.table-chart__chart-error { color: var(--text-muted); }

/* === components/features/chat/message_citations/message-citations.css === */
.message-citations {
  margin-top: var(--space-2, 0.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
}

.message-citations__label {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message-citations__docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
}

.message-citations__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 0.25rem);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border, var(--surface-alt));
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface-alt);
  color: var(--text);
  font-size: var(--font-size-sm, 0.8125rem);
  cursor: pointer;
  transition: background var(--transition, 0.15s ease);
}

.message-citations__chip:hover {
  background: var(--surface-hover, var(--surface-alt));
}

.message-citations__chip-icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  background: var(--text-muted);
}

.message-citations__chip[data-kind="document"] .message-citations__chip-icon {
  background: var(--kind-document);
}

.message-citations__chip[data-kind="form"] .message-citations__chip-icon {
  background: var(--kind-form);
}

.message-citations__chip-caret {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-muted);
}

.message-citations__headings {
  list-style: none;
  margin: 0.15rem 0 0.35rem 0.9rem;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  border-left: 1px solid var(--border, var(--surface-alt));
  padding-left: var(--space-2, 0.5rem);
}

.message-citations__doc.is-open .message-citations__headings {
  display: flex;
}

.message-citations__heading {
  border: none;
  background: none;
  padding: 0.1rem 0;
  text-align: left;
  color: var(--brand, var(--text));
  font-size: var(--font-size-sm, 0.8125rem);
  cursor: pointer;
}

.message-citations__heading:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .message-citations__chip {
    transition: none;
  }
}

/* === components/pages/home/home-page.css === */
/* page-body, .app-shell, .app-main, .app-main__primary, and the mobile
   sidebar backdrop now live in static/style.css so any page (chat, docs,
   …) gets the layout without depending on home-page.css being loaded. */

/* ── Chat sidebar conversation list ──────────────────────────────
   The legacy chat-sidebar.css component is gone now that the chat
   sidebar is composed via build_chat_sidebar_layout — the rules
   below were the chat-specific bits (the rest, including the mobile
   overlay drawer behaviour, lifted into sidebar-shell.css). */
#chat-sidebar-list { padding: 0.5rem 0; }

.conv-item {
    display: block;
    width: 100%;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.conv-item:hover { background: var(--surface-alt); }

.conv-item--active {
    background: var(--brand-subtle);
    color: var(--brand);
    font-weight: 600;
}

.conv-item--active:hover { background: var(--brand-subtle); }

.px-panel-trigger[aria-selected="true"] .conv-item {
    background: var(--brand-subtle);
    color: var(--brand);
    font-weight: 600;
}

.px-panel-trigger[aria-selected="true"] .conv-item:hover {
    background: var(--brand-subtle);
}

.conv-item__title {
    display: block;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-item.conv-item--icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chat column: Panel host fills height so .chat-view can pin input to the
   bottom. The selectors target `#app-content > .px-panel` directly because
   AppShell wraps every page's content in `<div id="app-content">…</div>`,
   so the chat panel host sits one level deeper than the legacy
   `.app-main__primary > .px-panel` shape. Without these rules the panel
   host gets default `min-height: auto` and the input bar runs off the
   viewport bottom. */
#app-content > .px-panel {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

#app-content .px-panel__panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app-content .px-panel__panel > .chat-view {
    flex: 1;
    min-height: 0;
}

/* ── Welcome dialog ──────────────────────────────────────── */
.welcome-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: 0;
    width: min(580px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    outline: none;
}
.welcome-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.welcome-dialog__card {
    display: flex;
    flex-direction: column;
}
.welcome-dialog__body {
    padding: 1.5rem;
    overflow-y: auto;
}
.welcome-dialog__content {
    min-width: 0;
}
.welcome-dialog__intro {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.875rem;
}
.welcome-dialog__intro .welcome-dialog__alpha-banner {
    margin-bottom: 0;
}
.welcome-dialog__mascot {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.welcome-dialog__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.625rem;
    text-align: start;
}
.welcome-dialog__text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.6;
}
.welcome-dialog__section-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text);
    margin: 0.75rem 0 0.25rem;
}
.welcome-dialog__list {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}
.welcome-dialog__alpha-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.875rem;
    border-radius: var(--radius-md);
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.5;
}
.welcome-dialog__alpha-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 0.1em 0.5em;
    border-radius: var(--radius-full);
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a16207;
    margin-top: 0.1em;
}
.welcome-dialog__info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-top: 0.625rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.5;
}
.welcome-dialog__info-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 0.1em 0.5em;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1d4ed8;
    margin-top: 0.1em;
}
.welcome-dialog__actions {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* #sidebar-backdrop rules moved to static/style.css (shared by all pages). */

/* === components/pages/library/library-page.css === */
/* Library page — content pane host. Shell + body layout come from
   style.css / app-shell.css; only library-specific overrides here. */

.library-pane-host {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
}

.library-pane-host__placeholder {
    color: var(--text-muted);
}

/* ── Sidebar tree ─────────────────────────────────────────────────── */

.library-sidebar-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.library-folder-group,
.library-folder-node {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 3px solid transparent;
    transition: border-color var(--transition);
}

.library-folder-group__label {
    display: block;
    padding: 0.5rem 0.875rem 0.25rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.library-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ── Folder node (recursive <details>) ───────────────────────────── */

.library-folder-node[open] > .library-folder-node__summary .library-folder-node__chevron {
    transform: rotate(90deg);
}

.library-folder-node__summary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    font-size: var(--font-size-sm);
    user-select: none;
    transition: background var(--transition);
    list-style: none;
}

/* Hide native disclosure triangle (Webkit + standards-track). */
.library-folder-node__summary::-webkit-details-marker {
    display: none;
}
.library-folder-node__summary::marker {
    display: none;
    content: "";
}

.library-folder-node__summary:hover {
    background: var(--brand-subtle);
}

.library-folder-node__chevron {
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.library-folder-node__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-folder-node__body {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.5rem;
}

/* === components/pages/organizations/orgs_page.css === */
.orgs-main {
    flex: 1;
    padding: 28px 36px 60px;
    overflow-y: auto;
    min-width: 0;
}

/* Orgs sidebar nav — orgs-specific overrides on top of the shared
   ItemRow chrome. Alpine toggles `.sidebar-item--active` on the wrapper
   <li>; these selectors layer the orgs look (left-border + brand pill
   counts; danger-palette overrides) on top of the primitive's defaults. */
#orgs-sidebar-nav .sidebar-item.sidebar-item--active > .sidebar-item-link {
    background: var(--brand-subtle);
    color: var(--text);
    font-weight: 600;
    border-left: 3px solid var(--brand);
    padding-left: calc(0.75rem - 3px);
}

#orgs-sidebar-nav .sidebar-item.orgs-nav-item--danger > .sidebar-item-link { color: var(--error); }
#orgs-sidebar-nav .sidebar-item.orgs-nav-item--danger > .sidebar-item-link:hover { background: var(--error-bg); }
#orgs-sidebar-nav .sidebar-item.orgs-nav-item--danger .sidebar-item-icon { color: var(--error); }
#orgs-sidebar-nav .sidebar-item.orgs-nav-item--danger.sidebar-item--active > .sidebar-item-link {
    background: var(--error-bg);
    border-left-color: var(--error);
    color: var(--error);
}
#orgs-sidebar-nav .sidebar-item.orgs-nav-item--danger.sidebar-item--active > .sidebar-item-link .sidebar-item-icon {
    background: var(--error);
    border-color: var(--error);
    color: var(--text-on-brand);
}

#orgs-sidebar-nav .sidebar-item-count {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 1px 7px;
    font-weight: 700;
}
#orgs-sidebar-nav .sidebar-item.sidebar-item--active .sidebar-item-count {
    color: var(--brand);
    border-color: var(--brand-muted);
}

/* === components/features/library/library_file_row/library-file-row.css === */
/* LibraryFileRow — visually identical to main's `.doc-row`. The class
   names re-use `doc-row*` so this CSS is the single source of truth
   (the legacy doc-row.css was deleted when the doc_row component was). */

.doc-row {
    list-style: none;
    border-left: 3px solid transparent;
    transition: background var(--transition), border-color var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    color: var(--text);
    text-decoration: none;
}
.doc-row:hover { background: var(--brand-subtle); }
.doc-row--active {
    background: var(--brand-subtle);
    border-left-color: var(--brand);
}
/* Drag-and-drop affordances. The .dragging class is applied to the
   row being dragged; .drag-over to the folder-group hovered as a
   drop target. Both are cleared on dragend. */
.doc-row[draggable="true"] {
    -webkit-user-drag: element;
}
.doc-row.dragging {
    opacity: 0.4;
}
.folder-group.drag-over {
    background: var(--brand-subtle);
    outline: 2px dashed var(--brand);
    outline-offset: -2px;
}

.doc-row-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--brand-accent);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.doc-row-icon .material-symbols-rounded { font-size: 1.125rem; }
.doc-row--active .doc-row-icon {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--text-on-brand);
}

.doc-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.doc-row-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    min-width: 0;
}
.doc-row-author,
.doc-row-time {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-row-avatar {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: var(--text-on-brand);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
}
.doc-row-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
    flex-shrink: 0;
}

/* Kind label inside the meta row — same neutral chip style on hover/active. */
.doc-row-kind {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0 0.375rem;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.doc-row-kind--form {
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ── Novo dropdown (header create-menu) ───────────────────────── */
.sidebar-new-split {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    flex: 1 1 auto;
}
.sidebar-new-btn--main {
    flex: 1 1 auto;
    justify-content: center;
    position: relative;
}
.sidebar-new-btn__caret {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
}
.sidebar-new-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    padding: 0.25rem;
}
.sidebar-new-menu[hidden] { display: none; }
.sidebar-new-menu__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
    transition: background var(--transition);
}
.sidebar-new-menu__item:hover { background: var(--brand-subtle); }
.sidebar-new-menu__item .material-symbols-rounded {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* === components/features/library/library_file_index_status/library-file-index-status.css === */
.library-file-index-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-muted);
    pointer-events: none;
}
.library-file-index-status .material-symbols-rounded {
    font-size: 1rem;
    line-height: 1;
}
.library-file-index-status--pending { color: var(--text-muted); }
.library-file-index-status--indexed { color: var(--brand); }
.library-file-index-status--failed  { color: var(--error); }

/* Stalled / failed — both render as a clickable button that re-enqueues
 * indexing. Stalled = DB says pending but the indexer worker isn't
 * actually processing this file (e.g. lost on restart). Failed = the
 * worker tried and errored out. Either way the affordance is the same:
 * pointer-events restored over the row's parent, explicit interactive
 * styling. The icon (refresh vs error) and label carry the distinction. */
button.library-file-index-status--stalled,
button.library-file-index-status--failed {
    pointer-events: auto;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--error);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
button.library-file-index-status--stalled:hover,
button.library-file-index-status--failed:hover {
    color: var(--brand);
    background: var(--brand-subtle);
}
button.library-file-index-status--stalled:focus-visible,
button.library-file-index-status--failed:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* === components/features/library/library_index_poller/library-index-poller.css === */
.library-index-poller { display: none; }

/* === components/features/library/library_trash_view/library-trash-view.css === */
/* LibraryTrashView — trash list of soft-deleted files. Re-uses the
   `.doc-row*` icon/body/title classes that ship with library_file_row,
   so the visual rhythm matches the live file rows on /library. The
   wrapper / preview / actions live under `.library-trash-view*`. */

.library-trash-view {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.library-trash-view__header {
    max-width: 900px;
    margin: 0 auto 1rem;
}

.library-trash-view__header h1 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text);
}

.library-trash-view__hint {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin: 0.25rem 0 0;
}

.library-trash-view__list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* The trash row inherits `.doc-row` (icon-box, body) but overrides
   the cursor and the row-click affordance (no row-level hx-get). */
.library-trash-view__row.doc-row {
    cursor: default;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.library-trash-view__row.doc-row:hover {
    background: var(--surface);
}

.library-trash-view__preview {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.45;
    margin: 0.25rem 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Allow up to 2 lines of preview before clipping. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.library-trash-view__actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}

.library-trash-view__action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-family: inherit;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.library-trash-view__action:hover {
    background: var(--brand-subtle);
    border-color: var(--brand-muted);
}

.library-trash-view__action--purge {
    color: var(--error);
}

.library-trash-view__action--purge:hover {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.library-trash-view__empty {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

/* Typed-confirmation modal (mirrors danger_pane). */
.library-trash-view__warn {
    color: var(--error);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.library-trash-view__confirm-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: ui-monospace, monospace;
    outline: 0;
}
.library-trash-view__confirm-input:focus {
    border-color: var(--error);
}
.library-trash-view__confirm-input:focus-visible {
    outline: 2px solid var(--error);
    outline-offset: 1px;
}
.library-trash-view__action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === components/features/library/upload_button/upload-button.css === */
/* ── Library Upload Button ─────────────────────────────────── */
#library-upload-btn .material-symbols-rounded {
    font-size: var(--font-size-lg);
}

/* === components/features/library/upload_dialog/upload-dialog.css === */
/* ── Library Upload Dialog ─────────────────────────────────── */
/* Modal frame styles come from orgs-shared.css (.orgs-modal-bd /
   .orgs-modal / .orgs-modal__head / __body / __foot). This sheet
   only styles the upload-specific body content. */

.upload-dialog__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 1.5rem;
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.upload-dialog__dropzone:hover,
.upload-dialog__dropzone--over {
    border-color: var(--brand);
    background: var(--surface-alt);
    color: var(--text);
}
.upload-dialog__dropzone:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.upload-dialog__dropzone .material-symbols-rounded {
    font-size: 2rem;
}

.upload-dialog__list {
    list-style: none;
    margin: 0.75rem 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 220px;
    overflow-y: auto;
}
.upload-dialog__item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    font-size: var(--font-size-sm);
}
.upload-dialog__item-icon {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
}
.upload-dialog__item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.upload-dialog__item-size,
.upload-dialog__item-kind {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}
.upload-dialog__item-remove {
    background: transparent;
    border: 0;
    padding: 0.125rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.upload-dialog__item-remove:hover {
    background: var(--surface);
    color: var(--error);
}

.upload-dialog__errors {
    list-style: none;
    margin: 0.75rem 0 0 0;
    padding: 0.5rem 0.75rem;
    background: color-mix(in srgb, var(--error) 8%, transparent);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: var(--font-size-sm);
}

/* === components/features/library/upload_status/upload-status.css === */
/* ── Library Upload Status ─────────────────────────────────── */
.upload-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
}
.upload-status:empty {
    display: none;
}

.upload-status-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    font-size: var(--font-size-sm);
}
.upload-status-row__icon {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
}
.upload-status-row__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.upload-status-row__badge {
    font-size: var(--font-size-xs);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
}
.upload-status-row__badge--failed {
    color: var(--error);
    border-color: var(--error);
}
.upload-status-row__btn {
    background: transparent;
    border: 0;
    padding: 0.125rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.upload-status-row__btn:hover {
    background: var(--surface);
    color: var(--text);
}

/* === components/ui/avatar/avatar.css === */
.ui-avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #1A2110;
    flex-shrink: 0;
}

/* === components/ui/toast/toast.css === */
.orgs-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.orgs-toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.orgs-toast .material-symbols-rounded { color: var(--brand); font-size: 18px; }

/* === components/ui/popover/popover.css === */
/*
 * Popover primitive — scaffold-only.
 *
 * Variant-specific styling (chip preview, search inputs, role pills,
 * etc.) lives in each feature's CSS via the `class_name` prop on
 * Popover / PopoverTrigger / PopoverPanel.
 */

.popover {
    position: relative;
    display: inline-block;
}

.popover__trigger {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.popover__trigger:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.popover__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: var(--z-dropdown);
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.popover--align-end .popover__panel {
    left: auto;
    right: 0;
}

