/* Helio Meet — Modern light theme (Aero)
   White surfaces with a faint blue tint, vivid blue primary
   accent, and a light-purple secondary for badges / gradients.
   The --accent and --pink variable names are kept so existing
   gradients keep resolving without a site-wide rename. */

:root {
    /* Surfaces — bright white at the top of the stack, slight
       grey-blue tinting as we go up the elevation scale. */
    --bg-deep: #f5f7fb;          /* outermost — page background */
    --bg-sidebar: #ffffff;        /* sidebars / panels */
    --bg-main: #ffffff;           /* primary content surface */
    --bg-elevated: #ffffff;       /* cards, modals */
    --bg-hover: #f1f5fb;          /* row hover */
    --bg-active: #e0e7ff;         /* selected row / active state — soft blue */

    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-default: rgba(15, 23, 42, 0.10);

    /* Neutral text — slate scale, no colour bias. */
    --text-primary: #0f172a;      /* slate-900 */
    --text-secondary: #475569;    /* slate-600 */
    --text-muted: #94a3b8;        /* slate-400 */

    /* Primary accent: vivid blue (close to Microsoft Fluent / Tailwind blue-500). */
    --accent: #2470D3;            /* the logo blue */
    --accent-hover: #1B5DB4;
    --accent-soft: rgba(36, 112, 211, 0.10);
    --accent-glow: rgba(36, 112, 211, 0.25);

    /* Light-purple secondary — used on the logo gradient, status
       pills, and chart highlights. */
    --pink: #7A22C9;              /* the logo violet (name kept for existing rules) */

    /* Brand washes. The sign-in shell, the desktop auth pages and several
       app-shell surfaces paint themselves with translucent purple/pink
       gradients. Those used to be hardcoded, which is why a workspace's
       colour never reached the sign-in page or the app after login.
       They are RGB TRIPLETS, not colours, so each call site can pick its
       own alpha — rgba(var(--brand-wash-1-rgb), 0.30).

       These defaults reproduce the stock Helio purple/pink exactly, so the
       unbranded platform is unchanged; BrandTheme overrides them for a
       branded workspace. */
    --brand-wash-1-rgb: 122, 34, 201;   /* logo violet */
    --brand-wash-2-rgb: 36, 112, 211;   /* logo blue   */
    --brand-pulse-rgb:  124, 58, 237;   /* violet-600 — ring/pulse shadows */
    --brand-chip-bg:    #ede9fe;        /* soft chip background (role pills) */
    --brand-chip-fg:    #6d28d9;        /* chip text / bot badge */
    --green: #10b981;
    --red: #ef4444;
    --amber: #f59e0b;
    --blue: #3b82f6;

    /* Slightly larger radii read as more modern/friendly. */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    /* Layered, soft shadows — a tight contact shadow + a wide ambient one
       reads far more "2025" than a single flat drop shadow. */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.04), 0 24px 48px rgba(15, 23, 42, 0.14);

    /* Focus ring — a soft accent halo used on every interactive control. */
    --ring: 0 0 0 3px var(--accent-soft);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);

    /* Brand gradient — single source of truth for logos/primary buttons. */
    --brand-gradient: linear-gradient(135deg, var(--accent), var(--pink));

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dark theme. Opt-in via <html data-theme="dark"> (set from the
   "theme" cookie server-side, or by the app-only init script that
   honours the OS prefers-color-scheme on first visit). The light
   :root palette above is the untouched default — marketing pages
   never set data-theme, so they stay light regardless of OS.
   Only the surface / text / border / shadow tokens flip; the brand
   accent + semantic colours are kept (they read well on dark). */
:root[data-theme="dark"] {
    --bg-deep: #0b0d12;          /* page background */
    --bg-sidebar: #12151c;        /* sidebars / panels */
    --bg-main: #0f1117;           /* primary content surface */
    --bg-elevated: #181b23;       /* cards, modals */
    --bg-hover: #1e222c;          /* row hover */
    --bg-active: #1e2a4a;         /* selected row — soft blue on dark */

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.12);

    --text-primary: #e8edf5;
    --text-secondary: #aab4c4;
    --text-muted: #6b7686;

    --accent: #4A8DE8;            /* the logo blue, lifted for contrast on dark */
    --accent-hover: #74A9EF;
    --accent-soft: rgba(74, 141, 232, 0.16);
    --accent-glow: rgba(74, 141, 232, 0.35);

    /* Brand + semantic colours unchanged — they sit on dark fine. */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 50px rgba(0, 0, 0, 0.6);

    color-scheme: dark; /* native form controls + scrollbars follow */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    /* Fluid typographic baseline. viewport-fit.js sets --ui-scale per
       device class (phone=1.0, scaling up to ~1.12 on ultra-wide). */
    font-size: calc(14px * var(--ui-scale, 1));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* Modern form controls & focus — global baseline (2025 refresh)
   Applies a smooth transition + soft accent focus-ring to every
   text input, textarea and select across every page, and a clear
   keyboard-focus ring on interactive elements. Component-specific
   styles below still override colours/padding where needed. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select {
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible,
textarea:focus, textarea:focus-visible,
select:focus, select:focus-visible {
    border-color: var(--accent) !important;
    box-shadow: var(--ring);
    outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* Keyboard focus ring for buttons & links (mouse clicks stay clean). */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* App Shell — three-column layout */
.app-shell {
    display: grid;
    /* Width priority: user-saved (--sb-w) > viewport-fluid default
       (--sb-default, set by viewport-fit.js) > hardcoded 280px fallback. */
    grid-template-columns: var(--sb-w, var(--sb-default, 280px)) 6px 1fr;
    height: var(--app-vh, 100vh);
    background: var(--bg-deep);
}

@media (max-width: 1024px) {
    .members-panel { display: none; }
}

@media (max-width: 640px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-shell > .sb-resizer { display: none; }

    /* Mobile drawer mode: the sidebar slides in over the chat surface
       from the left when the hamburger button toggles it. */
    .sidebar {
        display: flex;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(82vw, 320px);
        max-width: 360px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 220ms ease;
        box-shadow: 8px 0 30px rgba(0,0,0,0.45);
        will-change: transform;
    }
    .sidebar.is-open { transform: translateX(0); }
    .mobile-menu-btn { display: inline-flex !important; }
}

/* Mobile drawer chrome — backdrop + hamburger button.
   The hamburger lives in the top bar of pages with a sidebar; CSS
   keeps it hidden until a phone-class media query enables it. */
.mobile-menu-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bg-elevated, rgba(255,255,255,0.06));
    color: var(--text-primary, #fff);
    font-size: 18px;
    cursor: pointer;
    margin-inline-end: 8px;
    flex-shrink: 0;
}
.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
    background: var(--accent, #2563eb);
    color: #fff;
    outline: none;
}

.mobile-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
}
.mobile-backdrop.is-visible { opacity: 1; visibility: visible; }

/* Lock body scroll while a drawer is open so swiping inside the drawer
   doesn't also scroll the page underneath. */
body.drawer-open { overflow: hidden; }

/* Language picker — floating top-right (top-left in RTL).
   Drops down a list of supported UI cultures. */
.lang-picker {
    /* Floats in the BOTTOM-end corner (right in LTR, left in RTL) with the
       menu opening upward — this keeps it clear of every page's top header
       and right-aligned header buttons, on all pages and in all languages. */
    position: fixed;
    bottom: 16px; right: 16px; top: auto;
    z-index: 1400;
}
[dir="rtl"] .lang-picker { right: auto; left: 16px; }
/* The inline picker sits in the flow: no corner offsets in either direction. */
[dir="rtl"] .lang-picker.lang-picker-inline { left: auto; right: auto; }
/* Floating variant: the dropdown opens UPWARD so it never runs off the
   bottom of the viewport. */
.lang-picker:not(.lang-picker-inline) .lang-menu { top: auto; bottom: calc(100% + 6px); }

/* When the floating Virtual Agent button is on the page (marketing + sign-in
   pages) it sits bottom-right and would cover the bottom-right language
   picker. Lift the picker to the TOP of the page so both stay reachable,
   and flip its dropdown to open downward. */
body:has(.hm-agent-btn) .lang-picker:not(.lang-picker-inline) { top: 16px; bottom: auto; }
body:has(.hm-agent-btn) .lang-picker:not(.lang-picker-inline) .lang-menu { top: calc(100% + 6px); bottom: auto; }

/* Per-row delete button for channels & groups (🗑). Hidden until the row is
   hovered; red affordance on hover. Delete permission is enforced server-side
   (workspace owner or the channel's own owner only). */
.channel-delete {
    background: transparent; border: 0; cursor: pointer;
    opacity: 0; font-size: 12px; line-height: 1; padding: 2px 4px;
    margin-inline-start: 2px; border-radius: 4px; transition: opacity .12s, background .12s;
}
.channel-item:hover .channel-delete { opacity: .5; }
.channel-delete:hover { opacity: 1; background: rgba(220,38,38,.16); }
/* Inline variant — sits inside a flex nav (e.g. the landing page top
   bar), not fixed-positioned. Used via <partial name="_LanguagePicker"
   model="@true" />. */
.lang-picker-inline {
    /* relative (not static) so the absolutely-positioned .lang-menu anchors
       directly under the toggle button instead of a far-up ancestor. */
    position: relative;
    top: auto; right: auto; left: auto; bottom: auto;
    z-index: auto;
    display: inline-block;
}
/* Inside the landing-page nav the picker sits on a white surface, so
   use a light-themed toggle that matches the surrounding nav buttons.
   `.lp-nav-actions` is the marketing nav's right-side action group; the
   picker should look like a peer of the "Sign in" / "Sign up" buttons. */
.lp-nav-actions .lang-picker .lang-toggle {
    background: transparent;
    color: #0c0820;
    border: 1px solid rgba(12,8,32,0.12);
}
.lp-nav-actions .lang-picker .lang-toggle:hover {
    background: rgba(12,8,32,0.05);
    color: #0c0820;
}
.lp-nav-actions .lang-picker .lang-menu {
    background: #fff;
    border-color: rgba(12,8,32,0.12);
    box-shadow: 0 14px 32px rgba(12,8,32,0.12);
}
.lp-nav-actions .lang-picker .lang-menu a {
    color: #0c0820;
}
.lp-nav-actions .lang-picker .lang-menu a:hover {
    background: #f5f3ff;
    color: var(--brand-chip-fg);
}
.lp-nav-actions .lang-picker .lang-menu a.active {
    background: var(--brand-chip-bg); color: var(--brand-chip-fg);
}
.lang-toggle {
    background: var(--bg-elevated, rgba(255,255,255,0.08));
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.lang-toggle:hover { background: var(--accent, #2563eb); color: #fff; }
.lang-current { font-weight: 600; }
.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1201;
    min-width: 180px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-elevated, #1a1830);
    border: 1px solid var(--border-default, rgba(255,255,255,0.12));
    border-radius: 10px;
    list-style: none;
    padding: 4px;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
[dir="rtl"] .lang-menu { right: auto; left: 0; }
.lang-picker.open .lang-menu { display: block; }

/* RTL flips for the app-shell dropdowns so they open under their trigger
   instead of off-screen when the UI culture is right-to-left. */
[dir="rtl"] .platform-menu { right: auto; left: 0; }
[dir="rtl"] .status-menu { left: auto; right: 60px; }
.lang-menu li { margin: 0; }
.lang-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary, #fff);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13.5px;
}
.lang-menu a:hover { background: var(--accent, #2563eb); color: #fff; }
.lang-menu a.active { background: rgba(37,99,235,0.18); font-weight: 600; }

/* The picker overlaps the meeting room header — hide it inside the
   full-screen meeting room where vertical space is precious. The
   language is still picked up from the cookie set elsewhere. */
.room-shell ~ .lang-picker,
.meeting-body .lang-picker { display: none; }

/* When a page renders an INLINE picker (e.g. the authenticated app's top
   bar, placed next to the "Apps" button), suppress the floating fixed
   picker from _Layout so the two don't overlap. Self-targeting: only
   affects pages that have both. */
body:has(.lang-picker-inline) .lang-picker:not(.lang-picker-inline) { display: none; }

/* The top-of-page language bar from _Layout. In normal flow at the very top, so
   it pushes the page down instead of covering its header; full-height layouts
   subtract its height so the page still fits the window. A page with its own
   inline picker (chat's top bar, the landing nav, the assistant header) keeps
   that one and the bar is not shown. */
body { --page-topbar-h: 0px; }
body:has(> .page-topbar) { --page-topbar-h: 40px; }
body:has(.lang-picker-inline:not(.page-topbar *)) { --page-topbar-h: 0px; }
.page-topbar {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    height: 40px; padding: 0 16px; box-sizing: border-box;
    position: relative; z-index: 1300;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}
body:has(.lang-picker-inline:not(.page-topbar *)) > .page-topbar { display: none; }
.page-topbar .lang-toggle {
    background: var(--bg-deep, #fff);
    color: var(--text-primary, #0c0820);
    border: 1px solid var(--border-default, rgba(12,8,32,0.12));
    padding: 4px 12px;
    white-space: nowrap;
}
.page-topbar .lang-toggle:hover { background: var(--accent, #2563eb); color: #fff; }
body:has(> .page-topbar) .app-shell { height: calc(var(--app-vh, 100vh) - var(--page-topbar-h)); }
body:has(> .page-topbar) :is(.auth-shell, .admin-page, .auth-split, .auth-form-pane) { min-height: calc(100vh - var(--page-topbar-h)); }

/* Inline picker sitting in the app top bar — match the neutral pill look
   of the search/Apps controls rather than the dark translucent toggle. */
/* Lift the inline picker into its own high stacking context so its
   dropdown paints above the chat header, call buttons and message list
   (which otherwise cover the top language options). */
.top-search-bar .lang-picker-inline { flex: 0 0 auto; position: relative; z-index: 1200; }
.top-search-bar .lang-toggle {
    background: var(--bg-elevated, #fff);
    color: var(--text-primary, #0c0820);
    border: 1px solid var(--border-default, rgba(12,8,32,0.12));
    white-space: nowrap;
}

/* RTL adjustments — when <html dir="rtl">, the chat sidebar lives
   on the right and the resize handle flips sides. CSS Grid auto
   reverses column order in RTL mode for explicit grid-column
   layouts, so most of the layout takes care of itself. These rules
   just clean up the directional padding/borders. */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border-subtle); }
[dir="rtl"] .members-panel { border-left: none; border-right: 1px solid var(--border-subtle); }
[dir="rtl"] .meeting-side { border-left: none; border-right: 1px solid rgba(255,255,255,0.06); }
/* (Flex rows already run right-to-left here, so the search icon stays next to its box.) */

/* Sidebar resize handle — vertical grab bar between sidebar
   and main content. Cursor + hover styles make it discoverable
   without being a visible UI element at rest. */
.sb-resizer {
    cursor: col-resize;
    background: transparent;
    transition: background-color 120ms ease;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    position: relative;
    z-index: 5;
}
.sb-resizer:hover,
.sb-resizer:focus-visible {
    background: var(--accent, #2563eb);
    outline: none;
}
.sb-resizer:focus-visible { box-shadow: 0 0 0 2px rgba(37,99,235,0.4); }
/* While the user is dragging, lock the cursor and stop text selection
   across the whole document — otherwise dragging fast highlights random
   text in the chat / participant list. */
body.sb-resizing { cursor: col-resize !important; -webkit-user-select: none !important; user-select: none !important; }
body.sb-resizing * { -webkit-user-select: none !important; user-select: none !important; }

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-inline-end: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.workspace-logo {
    /* Fallback mark (no brand-logo-slot): the WHOLE logo, fitted with contain - never cover, which crops. The logo is transparent, so no chip, glow or rounded corners behind it. ?v= is a new URL, so browsers and Cloudflare fetch the current file instead of a stale cached one. */
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: none;
    border-radius: 0;
    font-size: 0;
    box-shadow: none;
}

.workspace-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.user-card {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    margin: 12px;
    border-radius: var(--radius-md);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }

.logout-form { display: contents; }
.icon-btn {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.section { padding: 0 12px; margin-top: 16px; }

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
}

.channel-list { list-style: none; }
.channel-item {
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    transition: background 0.12s;
}
.channel-item a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-sm);
}
.channel-item:hover { background: var(--bg-hover); }
.channel-item:hover a { color: var(--text-primary); }
.channel-item.active { background: var(--accent-soft); }
.channel-item.active a { color: var(--text-primary); font-weight: 600; }

.channel-icon {
    color: var(--text-muted);
    font-weight: 600;
    width: 16px; text-align: center;
}

.empty-hint {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.empty-hint a:hover { color: var(--accent); }

/* Avatars */
.avatar, .mini-avatar {
    display: grid; place-items: center;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
}
.avatar { width: 38px; height: 38px; font-size: 15px; }
.avatar.small { width: 36px; height: 36px; font-size: 14px; }
.avatar.large { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }

/* A profile picture in place of the initial (js/avatars.js adds the class and
   the image). The initial stays in the markup for screen readers and as the
   fallback, only made invisible; presence dots inside the avatar stay visible. */
.has-photo {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: var(--bg-hover) !important;
    color: transparent !important;
    text-shadow: none !important;
}

.mini-avatar {
    width: 22px; height: 22px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.presence-dot {
    position: absolute;
    bottom: -2px; inset-inline-end: -2px;
    width: 10px; height: 10px;
    background: var(--green);
    border: 2px solid var(--bg-sidebar);
    border-radius: 50%;
}
.presence-dot.large {
    width: 16px; height: 16px;
    bottom: 0; inset-inline-end: 0;
    border-width: 3px;
}

/* Chat Main */
.chat-main {
    display: flex; flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}
.chat-main.full { grid-column: 1 / -1; }

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-main);
    z-index: 1;
}

.chat-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.chat-topic { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.member-count {
    font-size: 12px; color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: 100px;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex; flex-direction: column; gap: 4px;
}

.messages::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb {
    background: var(--bg-hover); border-radius: 4px;
}

.message {
    display: flex; gap: 12px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: background 0.1s;
}
.message:hover { background: var(--bg-elevated); }

.message-body { flex: 1; min-width: 0; }
.message-meta {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 2px;
}
.sender-name { font-weight: 700; font-size: 14px; }
.message-meta time { font-size: 11px; color: var(--text-muted); }
.message-content {
    font-size: 14px;
    color: var(--text-primary);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.own .sender-name { color: var(--accent); }

.empty-state {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.empty-state.full { width: 100%; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 6px; color: var(--text-primary); }
.empty-state p { font-size: 14px; }

.typing-indicator {
    height: 18px;
    padding: 0 24px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Composer */
.composer {
    padding: 12px 24px 18px;
    display: flex; gap: 10px; align-items: flex-end;
    background: var(--bg-main);
}

.composer textarea {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 200px;
    transition: border-color 0.15s;
}
.composer textarea::placeholder { color: var(--text-muted); }
.composer textarea:focus { border-color: var(--accent); }

.send-btn {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    transition: transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Members Panel */
.members-panel {
    background: var(--bg-sidebar);
    border-inline-start: 1px solid var(--border-subtle);
    padding: 20px 16px;
    overflow-y: auto;
}
.members-panel h3 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
    padding: 0 10px 12px;
}

.members-list { list-style: none; }
.members-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: background 0.1s;
}
.members-list li:hover { background: var(--bg-hover); }

.member-name { flex: 1; color: var(--text-secondary); }
.role-badge {
    font-size: 9px;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none; place-items: center;
    z-index: 100;
}
.modal-backdrop.open { display: grid; }

.modal {
    background: var(--bg-elevated);
    padding: 28px;
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 440px;
    /* Never grow past the viewport: scroll the modal instead of clipping its
       content (and making the top unreachable when the backdrop centres it). */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-default);
}
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 12px 0 6px;
    font-weight: 600;
}
.modal input, .modal select {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 14px;
}
.modal input:focus, .modal select:focus { border-color: var(--accent); }

.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 22px;
}

/* A choice between two things, each with a line of explanation under it.
   Checkable inputs are exempt from the full-width rule above — a radio that
   fills the row leaves nothing for the label. */
.modal input[type="radio"],
.modal input[type="checkbox"] {
    width: auto;
    flex: none;
    padding: 0;
    margin: 0;
    accent-color: var(--accent);
}
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.modal .choice,
.choice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-deep);
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    transition: border-color .12s ease, background .12s ease;
}
.modal .choice:hover,
.choice:hover { border-color: var(--border-strong, var(--accent)); }
.modal .choice:has(input:checked),
.choice:has(input:checked) { border-color: var(--accent); background: var(--bg-elevated); }
.choice > input { margin-top: 2px; }
/* min-width:0 so a long line wraps inside the card instead of widening it. */
.choice-body { flex: 1; min-width: 0; }
.choice-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.choice-hint {
    display: block;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}
.choice-body input:is([type="password"],[data-pw-toggle]),
.choice-body input[type="text"] {
    width: 100%;
    margin-top: 10px;
    font-size: 13.5px;
    padding: 9px 12px;
}
.choice-body input:disabled { opacity: .45; cursor: not-allowed; }
.modal-note {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 16px 0 0;
}

/* Scrollbars — a visible, consistent "slider" wherever content
   overflows (long pages, side panels, modals, dropdowns) so the user
   always has a grab-handle to scroll up and down through clipped content. */
* {
    scrollbar-width: thin;                                  /* Firefox */
    scrollbar-color: var(--border-strong, rgba(148, 163, 184, 0.55)) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong, rgba(148, 163, 184, 0.5));
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, rgba(148, 163, 184, 0.8));
    background-clip: content-box;
}

/* Feature 2 — component modernization layer
   Additive polish on top of the already-modern design system:
   a smooth modal entrance and consistent hover-elevation on cards.
   (Respects prefers-reduced-motion via the global rule above.) */
/* Generic modals now animate in like the command palette / call-ring do:
   the backdrop fades and the dialog pops up from slightly below. */
.modal-backdrop.open { animation: modal-backdrop-in 0.16s ease-out; }
.modal-backdrop.open > .modal { animation: modal-pop-in 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop-in {
    from { opacity: 0; transform: translateY(12px) scale(0.975); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cards lift slightly on hover for a tactile, contemporary feel. */
.adaptive-card, .tenant-card {
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.adaptive-card:hover, .tenant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn-primary {
    position: relative;
    background: var(--brand-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.97); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }
.btn-primary.full-width { width: 100%; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-ghost:active { background: var(--bg-active); }

/* Auth Pages */
.auth-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(var(--brand-wash-1-rgb), 0.18), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(var(--brand-wash-2-rgb), 0.15), transparent 40%),
        var(--bg-deep);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    /* Fallback mark (no brand-logo-slot): the WHOLE logo, fitted with contain - never cover, which crops. The logo is transparent, so no chip, glow or rounded corners behind it. ?v= is a new URL, so browsers and Cloudflare fetch the current file instead of a stale cached one. */
    width: 56px; height: 56px;
    margin: 0 auto 20px;
    display: grid; place-items: center;
    background: url('/img/logo.png?v=fdf955ed') center / contain no-repeat;
    border-radius: 0;
    font-size: 0;
    box-shadow: none;
}

.auth-card h1 { text-align: center; font-size: 24px; letter-spacing: -0.01em; }
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 14px; margin-top: 4px; margin-bottom: 28px; }

.auth-card form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 14px 0 6px;
}
.auth-card form input[type="email"],
.auth-card form input:is([type="password"],[data-pw-toggle]),
.auth-card form input[type="text"] {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
}
.auth-card form input:focus { border-color: var(--accent); }

.auth-card .checkbox {
    display: flex; align-items: center; gap: 8px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.auth-card .checkbox input { width: auto; }

.auth-card .btn-primary { margin-top: 8px; padding: 12px; }

.auth-foot {
    text-align: center;
    margin-top: 22px;
    color: var(--text-secondary);
    font-size: 13px;
}
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-foot a:hover { color: var(--accent-hover); }

.auth-error {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 12px;
}
.auth-error:empty, .auth-error ul:empty { display: none; }
/* asp-validation-summary always renders a wrapping <div> + <ul>, so :empty
   above never matches. Hide the box when ASP.NET tags it as "valid". */
.auth-error.validation-summary-valid { display: none; }
.auth-error ul { list-style: none; }

/* People Grid */
.people-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-content: start;
}

.person-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: transform 0.15s, border-color 0.15s;
}
.person-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.person-name { font-weight: 700; font-size: 15px; margin-top: 8px; }
.person-status { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meet-btn {
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: transform 0.1s;
}

    .meet-btn:hover {
        transform: translateY(-1px);
    }

.meet-link {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
}

    .meet-link:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

/* Platform pages — Admin, Compliance, Apps, Connectors, Search */
.admin-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    color: var(--text-primary);
    min-height: 100vh;
}
.admin-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 24px;
}
.admin-header h1 { flex: 1; font-size: 24px; letter-spacing: -0.01em; }

.muted-text { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }
.banner {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
}
.banner.banner-error {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.55);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 18px;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.action-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 22px;
    color: var(--text-primary);
    transition: border-color 0.15s, transform 0.15s;
    display: block;
}
.action-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.action-card.form { display: flex; flex-direction: column; gap: 8px; }
.action-icon { font-size: 28px; margin-bottom: 8px; }
.action-card h3 { font-size: 15px; margin-bottom: 4px; }
.action-card p { font-size: 13px; color: var(--text-secondary); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-default);
}
.admin-table th, .admin-table td {
    padding: 10px 14px;
    text-align: start;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    vertical-align: top;
}
.admin-table th {
    background: var(--bg-deep);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table code { background: var(--bg-deep); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.admin-table code.small { font-size: 11px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 40px !important; }

.pill {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
}
/* Status pills — dark text on light tinted background. Light-on-dark
   wouldn't read on the new white surfaces. */
.pill.on  { background: rgba(16, 185, 129, 0.14); color: #047857; }
.pill.off { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }

.filter-bar {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.filter-bar input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
}
.filter-bar input:focus { border-color: var(--accent); }

.install-form {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    margin: 12px 0;
    max-width: 480px;
}
.install-form label { font-size: 11px; color: var(--text-secondary); font-weight: 600; margin-top: 6px; }
.install-form input, .install-form select, .install-form textarea {
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 13px;
}
.install-form textarea { line-height: 1.5; resize: vertical; }
.install-form input:focus, .install-form textarea:focus { border-color: var(--accent); }

.aii { max-width: 1160px; }
.aii [hidden] { display: none !important; }
.aii .back-link { display: inline-block; color: var(--text-secondary); font-size: 13px; padding: 6px 10px; margin-inline-start: -10px; border-radius: 8px; text-decoration: none; }
.aii .back-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.aii-hero {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
    padding: 22px 24px; margin-bottom: 18px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(var(--brand-wash-1-rgb), 0.12), transparent 60%),
        radial-gradient(120% 140% at 100% 100%, rgba(var(--brand-wash-2-rgb), 0.10), transparent 60%),
        var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}
.aii-hero .back-link { flex-basis: 100%; width: max-content; }
.aii-hero-main { display: flex; align-items: center; gap: 16px; flex: 1 1 360px; min-width: 0; }
.aii-hero-icon {
    width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center;
    font-size: 28px; border-radius: 16px; background: var(--brand-gradient); box-shadow: 0 8px 24px var(--accent-glow);
}
.aii-hero h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 4px; }
.aii-hero p { color: var(--text-secondary); font-size: 14px; }
.aii-hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
    border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
}
.aii-hero-badge.ok { background: rgba(16, 185, 129, 0.12); color: #047857; }
.aii-hero-badge.wait { background: rgba(245, 158, 11, 0.14); color: #92400e; }
:root[data-theme="dark"] .aii-hero-badge.ok { color: #6ee7b7; }
:root[data-theme="dark"] .aii-hero-badge.wait { color: #fcd34d; }

.aii-guide {
    padding: 18px 22px 20px; margin-bottom: 18px;
    border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--bg-elevated);
}
.aii-guide-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 14px; }
.aii-guide-head h2 { font-size: 16px; }
.aii-guide-time { font-size: 12px; color: var(--text-muted); }
/* "How installing works" folds away: the form is what people came for. */
.aii-how { padding: 12px 18px; }
.aii-how > summary { list-style: none; cursor: pointer; margin-bottom: 0; align-items: center; font-weight: 600; font-size: 14px; }
.aii-how > summary::-webkit-details-marker { display: none; }
.aii-how > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.aii-how > summary::after { content: "▾"; margin-inline-start: auto; color: var(--text-muted); transition: transform .15s; }
.aii-how[open] > summary::after { transform: rotate(180deg); }
.aii-how[open] > summary { margin-bottom: 14px; }
.aii-how > summary:focus-visible, .aii-manifest > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* A developer's manifest file is the less common way in: offered, not shown. */
.aii-manifest { margin-top: 14px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.aii-manifest > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.aii-manifest > summary::-webkit-details-marker { display: none; }
.aii-manifest-text { font-size: 13px; color: var(--text-secondary); margin: 8px 0 10px; }
@media (prefers-reduced-motion: reduce) { .aii-how > summary::after { transition: none; } }
.aii-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.aii-steps li {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px;
    border-radius: var(--radius-md); background: var(--bg-deep); border: 1px solid var(--border-subtle);
}
.aii-steps strong { display: block; font-size: 13px; margin-bottom: 3px; }
.aii-steps p { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.aii-step-n {
    flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center;
    border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}

.aii-alert {
    padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.35); color: var(--text-primary); font-size: 13px;
}
.aii-alert ul { margin: 6px 0 0; padding-inline-start: 18px; }
.aii-alert a { color: inherit; text-decoration: underline; }

.aii-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.aii-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.aii-card {
    flex-shrink: 0;
    padding: 18px 20px 20px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-default); background: var(--bg-elevated); box-shadow: var(--shadow-sm);
}
.aii-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.aii-card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aii-card-head p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.aii-card-n {
    flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
    border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px;
}
.aii-optional { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: 1px 8px; }
.aii-req { color: var(--red); font-weight: 700; }

.aii-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.aii-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.aii-field + .aii-field { margin-top: 0; }
.aii-card > .aii-field + .aii-field { margin-top: 14px; }
.aii-field.wide { grid-column: 1 / -1; }
.aii-field label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.aii-field small { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.aii-field input, .aii-field textarea, .aii-drop textarea {
    width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
    color: var(--text-primary); background: var(--bg-deep);
    border: 1px solid var(--border-default); border-radius: var(--radius-sm); outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.aii-field textarea, .aii-drop textarea { resize: vertical; line-height: 1.5; }
.aii-drop textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.aii-field input:focus, .aii-field textarea:focus, .aii-drop textarea:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--bg-elevated); }
.aii-field.bad input, .aii-field.bad textarea { border-color: var(--red); }
.aii-err { font-size: 12px; color: #b91c1c; font-weight: 500; }
:root[data-theme="dark"] .aii-err { color: #fca5a5; }
.aii-count { align-self: flex-end; }
.aii-drop { display: block; }

.aii-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.aii-btn-soft {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    background: var(--bg-deep); border: 1px solid var(--border-default); border-radius: var(--radius-md);
    transition: border-color var(--transition), background var(--transition);
}
.aii-btn-soft:hover { border-color: var(--accent); background: var(--accent-soft); }
.aii-fill { margin-inline-start: auto; }
.aii-json-status { font-size: 12.5px; margin-top: 8px; min-height: 1em; }
.aii-json-status.ok { color: #047857; }
.aii-json-status.bad { color: #b91c1c; }
:root[data-theme="dark"] .aii-json-status.ok { color: #6ee7b7; }
:root[data-theme="dark"] .aii-json-status.bad { color: #fca5a5; }

.aii-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aii-chips:empty { display: none; }
.aii-chip { font-size: 12px; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--text-primary); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aii-glyph {
    width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; cursor: pointer;
    border-radius: 9px; background: var(--bg-deep); border: 1px solid var(--border-subtle);
}
.aii-glyph:hover { border-color: var(--accent); }
.aii-color { display: flex; gap: 8px; align-items: center; }
.aii-color input[type="color"] { width: 44px; height: 40px; padding: 3px; flex: 0 0 auto; cursor: pointer; }
.aii-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid var(--bg-elevated); box-shadow: 0 0 0 1px var(--border-default); }
.aii-swatch:hover { transform: scale(1.1); }

.aii-caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aii-caps.bad .aii-cap-box { border-color: rgba(239, 68, 68, 0.5); }
.aii-cap { position: relative; display: flex; cursor: pointer; }
.aii-cap input { position: absolute; opacity: 0; inset-inline-start: 12px; top: 12px; }
.aii-cap-box {
    flex: 1; display: flex; gap: 10px; align-items: flex-start; padding: 12px;
    border-radius: var(--radius-md); border: 1.5px solid var(--border-default); background: var(--bg-deep);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.aii-cap:hover .aii-cap-box { border-color: var(--accent); }
.aii-cap input:focus-visible + .aii-cap-box { box-shadow: var(--ring); border-color: var(--accent); }
.aii-cap input:checked + .aii-cap-box { border-color: var(--accent); background: var(--accent-soft); }
.aii-cap-icon { font-size: 20px; line-height: 1.2; }
.aii-cap-text { flex: 1; min-width: 0; }
.aii-cap-text strong { display: block; font-size: 13.5px; }
.aii-cap-text small { display: block; font-size: 12px; color: var(--text-secondary); line-height: 1.45; margin-top: 2px; }
.aii-cap-check {
    width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; font-size: 12px; color: transparent;
    border-radius: 6px; border: 1.5px solid var(--border-default); background: var(--bg-elevated);
}
.aii-cap input:checked + .aii-cap-box .aii-cap-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.aii-actions {
    position: sticky; bottom: 12px; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-default); background: var(--bg-elevated); box-shadow: var(--shadow-md);
}
.aii-actions-note { margin-inline-end: auto; font-size: 12.5px; color: var(--text-secondary); }
.aii-actions .btn-ghost { text-decoration: none; }

.aii-side { position: sticky; top: calc(var(--page-topbar-h, 0px) + 16px); display: flex; flex-direction: column; gap: 14px; }
.aii-preview, .aii-note {
    padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--bg-elevated);
}
.aii-preview { box-shadow: var(--shadow-sm); }
.aii-side-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.aii-tile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.aii-tile-icon {
    width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: 13px; color: #fff; font-size: 22px; font-weight: 700; line-height: 1;
}
.aii-tile-text { min-width: 0; }
.aii-tile-text strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aii-tile-text small { font-size: 12px; color: var(--text-muted); }
.aii-tile-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 12px 0; overflow-wrap: anywhere; }
.aii-preview .aii-chips { margin-bottom: 12px; }
.aii-tile-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.aii-dot { width: 8px; height: 8px; border-radius: 50%; }
.aii-tile-status.ok .aii-dot { background: var(--green); }
.aii-tile-status.wait .aii-dot { background: var(--amber); }
.aii-note ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; }
.aii-note li { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 1100px) {
    .aii-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .aii-steps li { align-items: center; }
    .aii-steps strong { display: inline; margin-inline-end: 6px; }
    .aii-steps p { display: inline; }
}
.aii-tile-icon img, .aii-upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.aii-tile-icon { overflow: hidden; }
.aii-upload { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.aii-upload-thumb {
    width: 64px; height: 64px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
    border-radius: 16px; color: #fff; font-size: 28px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.aii-upload-body { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.aii-subhead { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 12px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.aii-subhead strong { font-size: 13.5px; }
.aii-subhead span { font-size: 12.5px; color: var(--text-secondary); }
.aii-secret { display: flex; gap: 8px; }
.aii-secret input { flex: 1; min-width: 0; }
.aii-field select {
    width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text-primary);
    background: var(--bg-deep); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
}
.aii-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }

@media (max-width: 960px) {
    .aii-layout { grid-template-columns: minmax(0, 1fr); }
    .aii-side { position: static; order: -1; }
    .aii-note { display: none; }
}
@media (max-width: 640px) {
    .aii-grid, .aii-caps { grid-template-columns: minmax(0, 1fr); }
    .aii-hero { padding: 18px; }
    .aii-hero h1 { font-size: 22px; }
    .aii-fill { margin-inline-start: 0; }
    .aii-actions-note { flex-basis: 100%; }
}

/* Developer apps list */
.dev-apps-glyph { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-size: 17px; font-weight: 700; vertical-align: middle; margin-inline-end: 10px; overflow: hidden; }
.dev-apps-glyph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dev-apps-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.dev-apps-status.ok { background: rgba(16, 185, 129, 0.12); color: #047857; }
.dev-apps-status.wait { background: rgba(245, 158, 11, 0.14); color: #92400e; }
:root[data-theme="dark"] .dev-apps-status.ok { color: #6ee7b7; }
:root[data-theme="dark"] .dev-apps-status.wait { color: #fcd34d; }

details summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
}
.json-preview {
    background: var(--bg-deep);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 600px;
    white-space: pre-wrap;
    word-break: break-word;
}

.tenant-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.tenant-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.tenant-card dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.tenant-card dt { color: var(--text-secondary); font-size: 13px; }
.tenant-card dd { font-size: 13px; }

.app-glyph {
    display: inline-grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    color: white;
    margin-inline-end: 8px;
    font-size: 14px;
    vertical-align: middle;
}

.search-results { list-style: none; }
.search-results li {
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.search-results li a { display: block; color: var(--text-primary); }
.search-results .snippet { font-size: 14px; margin-bottom: 4px; }

.platform-nav { margin-top: auto; padding-bottom: 16px; }

/* Adaptive Card rendering — inline message-content rendering */
.adaptive-card {
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-inline-start: 3px solid var(--accent);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-top: 6px;
    max-width: 520px;
}
.adaptive-card.error { border-inline-start-color: var(--red); color: var(--text-muted); }
.adaptive-card h4 { font-size: 15px; margin-bottom: 6px; }
.adaptive-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.adaptive-card .card-text.size-Large { font-size: 16px; }
.adaptive-card .card-img { max-width: 100%; border-radius: var(--radius-sm); margin: 6px 0; }
.adaptive-card .card-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12px; }
.adaptive-card .card-facts dt { color: var(--text-muted); }
.adaptive-card .card-actions { display: flex; gap: 8px; margin-top: 10px; }
.card-btn {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.card-btn:hover { background: var(--accent); color: white; }

/* Origin badges on messages */
.origin-badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-inline-start: 6px;
    font-weight: 700;
    background: var(--bg-elevated);
    color: var(--text-muted);
}
/* Origin badges — soft tinted fills with the matching darker hue
   for the text so each origin reads at a glance on white. */
.origin-badge.bot        { background: rgba(var(--brand-wash-1-rgb), 0.14); color: var(--brand-chip-fg); }
.origin-badge.connector  { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.origin-badge.federation { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.legal-hold-form { margin: 12px 0 24px; }

/* Auth — two-pane layout (brand panel + form) */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    background:
        radial-gradient(circle at 25% 20%, rgba(var(--brand-wash-1-rgb), 0.30), transparent 45%),
        radial-gradient(circle at 80% 85%, rgba(var(--brand-wash-2-rgb), 0.26), transparent 45%),
        var(--bg-sidebar);
    border-inline-end: 1px solid var(--border-subtle);
}
.auth-brand-home {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.auth-brand-home:hover { color: var(--text-primary); }
.auth-brand-body {
    margin: auto 0;
    max-width: 420px;
}
.auth-brand-logo {
    /* Fallback mark (no brand-logo-slot): the WHOLE logo, fitted with contain - never cover, which crops. The logo is transparent, so no chip, glow or rounded corners behind it. ?v= is a new URL, so browsers and Cloudflare fetch the current file instead of a stale cached one. */
    width: 56px; height: 56px;
    display: grid; place-items: center;
    background: none;
    border-radius: 0;
    font-size: 0;
    box-shadow: none;
    margin-bottom: 22px;
}
.auth-brand-body h2 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.auth-brand-body > p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 12px 0 26px;
}
.auth-brand-points { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-brand-points li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; color: var(--text-primary);
}
.auth-brand-points li span {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: rgba(var(--brand-wash-1-rgb), 0.14);
    border-radius: 10px; font-size: 17px;
    flex-shrink: 0;
}

.auth-form-pane {
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--bg-deep);
}
.auth-form-pane .auth-card {
    width: 100%;
    max-width: 400px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

@media (max-width: 860px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form-pane { min-height: 100vh; }
}

/* Chosen-plan card shown in the sign-up brand aside when the visitor arrives
   from a pricing card. Uses theme variables so it reads on the light or dark
   brand panel. On mobile the aside is hidden, so reveal a compact version
   (logo + the picked plan only) when it carries a plan. */
.rg-brand-plan { margin-top: 24px; max-width: 340px; }
@media (max-width: 860px) {
    .auth-brand.has-plan { display: flex; padding: 18px 20px; }
    .auth-brand.has-plan .auth-brand-home,
    .auth-brand.has-plan .auth-brand-body h2,
    .auth-brand.has-plan .auth-brand-body > p,
    .auth-brand.has-plan .auth-brand-points { display: none; }
    .auth-brand.has-plan .auth-brand-body { margin: 0; }
    .auth-brand.has-plan .auth-brand-logo { margin-bottom: 12px; width: 40px; height: 40px; }
    .rg-brand-plan { margin-top: 12px; max-width: none; }
}

/* Chat header — audio / video call buttons */
.call-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600; font-size: 12px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}
.call-btn.audio {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}
.call-btn.audio:hover { border-color: var(--accent); transform: translateY(-1px); }
.call-btn.video {
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: #fff; border: none;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.call-btn.video:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }

/* Composer — file attachments */
.composer { flex-direction: column; align-items: stretch; gap: 8px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }

.attach-btn {
    width: 44px; height: 44px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    display: grid; place-items: center;
    transition: border-color 0.15s, color 0.15s;
}
.attach-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.composer-attachments { display: none; flex-wrap: wrap; gap: 8px; }
.composer-attachments.has-items { display: flex; }
.pending-att {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 6px 8px;
    max-width: 220px;
}
.pending-att img {
    width: 30px; height: 30px;
    object-fit: cover; border-radius: 5px;
}
.pending-att .pend-ic { font-size: 18px; }
.pending-att .pend-name {
    font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-att .pend-remove {
    color: var(--text-muted); font-size: 16px;
    line-height: 1; padding: 0 2px;
}
.pending-att .pend-remove:hover { color: var(--red); }

/* Message attachments */
.msg-attachments {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 6px;
}
.msg-att-image img {
    max-width: 280px; max-height: 220px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    display: block;
}
.msg-att-image:hover img { border-color: var(--accent); }
.msg-att-file {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 220px; max-width: 320px;
    transition: border-color 0.15s;
}
.msg-att-file:hover { border-color: var(--accent); }
.msg-att-file .att-ic { font-size: 20px; }
.msg-att-file .att-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-att-file .att-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-att-file .att-size { font-size: 11px; color: var(--text-muted); }
.msg-att-file .att-dl { color: var(--accent); font-size: 16px; }

/* Unread badge in the channel list */
.channel-item a .channel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.unread-badge {
    flex-shrink: 0;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: #fff;
    font-size: 11px; font-weight: 700;
    display: inline-grid; place-items: center;
}

/* Message hover actions (react / edit / delete) */
.message { position: relative; }
.message-actions {
    position: absolute;
    top: -10px; inset-inline-end: 10px;
    display: none;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 2px;
    box-shadow: var(--shadow-md);
}
.message:hover .message-actions { display: flex; }
.msg-act {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}
.msg-act:hover { background: var(--bg-hover); }

.edited-tag { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Reactions */
.msg-reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.msg-reactions:empty { display: none; }
.reaction-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.reaction-pill:hover { border-color: var(--accent); }
.reaction-pill.mine {
    background: var(--accent-soft);
    border-color: var(--accent);
}
.reaction-pill .re-count { color: var(--text-secondary); font-weight: 600; }
.reaction-pill.mine .re-count { color: var(--accent); }

.emoji-picker {
    position: fixed;
    z-index: 300;
    display: flex; gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 5px;
    box-shadow: var(--shadow-lg);
}
.emoji-picker button {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 7px;
    font-size: 18px;
}
.emoji-picker button:hover { background: var(--bg-hover); }

/* Inline message edit box */
.edit-box { margin-top: 4px; }
.edit-box .edit-text {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 14px; font-family: inherit;
    resize: vertical; min-height: 60px;
    outline: none;
}
.edit-box .edit-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 6px;
}
.edit-box .edit-actions .btn-ghost,
.edit-box .edit-actions .btn-primary {
    padding: 6px 14px; font-size: 12px; border-radius: 7px;
}

/* Threaded replies, pinned messages, paging sentinel, mention popup */
.reply-preview {
    display: flex; align-items: center; gap: 6px;
    margin: 0 0 6px 0; padding: 4px 8px 4px 6px;
    background: var(--bg-elevated);
    border-radius: 7px;
    font-size: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    max-width: 520px;
    cursor: pointer;
}
.reply-preview:hover { background: var(--bg-hover); }
.reply-preview .reply-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--accent); }
.reply-preview .reply-author { font-weight: 700; color: var(--text-primary); }
.reply-preview .reply-snippet {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 380px;
}

.pinned-tag { margin-inline-start: 6px; font-size: 11px; opacity: 0.75; }
.message.pinned { background: var(--accent-soft-2, rgba(var(--brand-wash-1-rgb), 0.06)); border-radius: 8px; }
.message.flash { animation: msg-flash 1s ease-in-out; }
@keyframes msg-flash {
    0% { background: var(--accent-soft); }
    100% { background: transparent; }
}

.composer-reply {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border-inline-start: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.composer-reply .cr-snippet {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.composer-reply .cr-close {
    background: transparent; border: 0; color: var(--text-secondary);
    cursor: pointer; font-size: 16px; padding: 0 4px;
}
.composer-reply .cr-close:hover { color: var(--text-primary); }

.paging-sentinel {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* @mention popup */
.mention-popup {
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.3));
    max-height: 220px; overflow-y: auto;
    z-index: 400;
    min-width: 220px;
}
.mention-popup .m-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; cursor: pointer;
    font-size: 13px;
}
.mention-popup .m-item.active,
.mention-popup .m-item:hover { background: var(--bg-hover); }
.mention-popup .m-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700;
}
.message-content .mention {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}
.message-content code {
    background: var(--bg-deep);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}
.message-content pre {
    background: var(--bg-deep);
    padding: 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 6px 0;
}
.message-content pre code {
    background: transparent; padding: 0;
}

/* Channel bookmarks + pinned messages panel */
.bookmark-toggle {
    background: transparent; border: 0; cursor: pointer;
    color: var(--text-secondary); opacity: 0.0;
    margin-inline-start: auto; padding: 0 4px;
    font-size: 13px; transition: opacity 0.1s, color 0.1s;
}
.channel-item:hover .bookmark-toggle { opacity: 0.55; }
.bookmark-toggle:hover { color: #b45309; opacity: 1; }
.bookmark-toggle.on { opacity: 1; color: #b45309; }
.bookmark-toggle.on:hover { color: #fcd34d; }

.header-act {
    background: transparent; border: 0; cursor: pointer;
    padding: 6px 10px; border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}
.header-act:hover { background: var(--bg-hover); color: var(--text-primary); }

.pinned-panel {
    position: absolute; top: 64px; inset-inline-end: 280px;
    width: 340px; max-height: 60vh; overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.25));
    z-index: 200; padding: 0;
}
.pinned-panel .pp-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--border-default);
}
.pinned-panel .pp-close {
    background: transparent; border: 0; font-size: 18px;
    color: var(--text-secondary); cursor: pointer;
}
.pinned-panel .pp-body { padding: 6px 0; }
.pinned-panel .pp-item {
    display: flex; gap: 8px; padding: 10px 12px;
    border-top: 1px solid transparent; cursor: pointer;
}
.pinned-panel .pp-item:hover { background: var(--bg-hover); }
.pinned-panel .pp-text { flex: 1; min-width: 0; }
.pinned-panel .pp-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.pinned-panel .pp-content {
    font-size: 13px; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.pinned-panel .pp-empty {
    padding: 20px; text-align: center; color: var(--text-secondary); font-size: 13px;
}

/* /ai slash command chip */
.ai-slash-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    margin: 0 0 6px 0;
    width: fit-content;
}
.ai-slash-chip .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    animation: ai-pulse 1s infinite ease-in-out;
}
@keyframes ai-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Command palette (Ctrl/Cmd+K) */
/* Command palette (Ctrl/Cmd+K) — flipped to the light theme. The
   backdrop dim is still dark slate (low alpha) so the palette pops
   over the page; the card itself is white with a blue accent ring. */
.cpal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 2000;
    align-items: flex-start; justify-content: center;
    padding-top: 12vh;
}
.cpal-backdrop.open { display: flex; animation: cpal-fade 0.14s ease-out; }
@keyframes cpal-fade { from { opacity: 0; } to { opacity: 1; } }
.cpal-card {
    width: min(640px, calc(100vw - 32px));
    background: var(--bg-elevated);
    border: 1px solid var(--accent-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}
.cpal-input {
    width: 100%;
    background: transparent;
    border: 0; outline: 0;
    color: var(--text-primary);
    padding: 18px 22px;
    font-size: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.cpal-input::placeholder { color: var(--text-muted); }
.cpal-list {
    list-style: none; padding: 6px; margin: 0;
    max-height: 50vh; overflow-y: auto;
}
.cpal-empty {
    padding: 22px; text-align: center;
    color: var(--text-muted); font-size: 13.5px;
}
.cpal-row {
    display: grid; grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.cpal-row.on { background: var(--accent-soft); }
.cpal-icon {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.cpal-title { font-weight: 600; }
.cpal-sub   { color: var(--text-muted); font-size: 12.5px; text-align: end; }
.cpal-footer {
    display: flex; justify-content: center; gap: 16px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11.5px; color: var(--text-muted);
}
.cpal-footer kbd {
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    margin-inline-end: 4px;
}

/* Desktop-shell-only overrides. The Helio Meet Windows app sets
   <body class="helio-desktop"> via _Layout.cshtml when it detects
   the HelioMeet/x User-Agent. These rules restructure the
   marketing-flavoured auth split layout into a single centered
   card on a Helio Meet gradient backdrop — the look Teams and
   Zoom use for their desktop sign-in screens (no marketing copy,
   no nav, just the form). Browser visitors are unaffected. */
body.helio-desktop .auth-split {
    grid-template-columns: 1fr;
    background:
        radial-gradient(circle at 20% 15%, rgba(var(--brand-wash-1-rgb), 0.32), transparent 50%),
        radial-gradient(circle at 80% 85%, rgba(var(--brand-wash-2-rgb), 0.28), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.12), transparent 60%),
        var(--bg-deep);
}

body.helio-desktop .auth-brand {
    display: none;
}

body.helio-desktop .auth-form-pane {
    background: transparent;
    padding: 32px;
}

/* Re-elevate the form card. The base .auth-form-pane .auth-card
   rule strips its background to blend with the brand panel; on
   desktop we want it as a discrete card again, like the Teams
   sign-in card. */
body.helio-desktop .auth-form-pane .auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(30, 23, 48, 0.78);
    border: 1px solid rgba(var(--brand-wash-1-rgb), 0.22);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 30px 80px -20px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
}

/* Sharper heading + logo treatment to match the dense, focused
   feel of native-app login cards. */
body.helio-desktop .auth-form-pane .auth-logo {
    margin: 0 auto 18px;
    box-shadow: 0 0 36px var(--accent-glow);
}

body.helio-desktop .auth-form-pane .auth-card h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 4px 0 6px;
}

body.helio-desktop .auth-form-pane .auth-sub {
    margin-bottom: 24px;
}

body.helio-desktop .auth-form-pane .auth-card form input[type="email"],
body.helio-desktop .auth-form-pane .auth-card form input:is([type="password"],[data-pw-toggle]),
body.helio-desktop .auth-form-pane .auth-card form input[type="text"] {
    background: rgba(15, 11, 20, 0.55);
    border-color: rgba(var(--brand-wash-1-rgb), 0.20);
}

body.helio-desktop .auth-form-pane .auth-card .btn-primary {
    margin-top: 14px;
    padding: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* The footer link ("New to Helio Meet? Create an account") sits
   outside the card on the original layout — pull it back in so
   the card reads as one self-contained sign-in surface. */
body.helio-desktop .auth-form-pane .auth-foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(var(--brand-wash-1-rgb), 0.14);
}

@media (max-height: 700px) {
    body.helio-desktop .auth-form-pane { padding: 16px; }
    body.helio-desktop .auth-form-pane .auth-card { padding: 28px 32px; }
}

/* Call ring UI — modal + ringtone + toast
   Used by /js/ring.js for incoming/outgoing call dialogs. */
.hm-ring-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 3000;
    display: grid; place-items: center;
    animation: hm-ring-fade .14s ease-out;
}
@keyframes hm-ring-fade { from { opacity: 0; } to { opacity: 1; } }
.hm-ring-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 18px;
    padding: 32px 36px;
    width: min(380px, calc(100vw - 32px));
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}
.hm-ring-avatar {
    width: 72px; height: 72px;
    margin: 0 auto 18px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: #fff;
    border-radius: 50%;
    font-size: 30px; font-weight: 800;
}
.hm-ring-avatar.pulsing {
    box-shadow: 0 0 0 0 var(--accent-soft);
    animation: hm-ring-pulse 1.4s ease-out infinite;
}
@keyframes hm-ring-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(var(--brand-pulse-rgb), 0.45); }
    70%  { box-shadow: 0 0 0 24px rgba(var(--brand-pulse-rgb), 0);    }
    100% { box-shadow: 0 0 0 0   rgba(var(--brand-pulse-rgb), 0);    }
}
.hm-ring-card h3 { margin: 0 0 4px; font-size: 18px; }
.hm-ring-card .hm-ring-sub {
    color: var(--text-muted); font-size: 13px; margin: 0 0 22px;
}
.hm-ring-actions {
    display: flex; gap: 10px; justify-content: center;
}
.hm-ring-actions button {
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 700; font-size: 14px;
    cursor: pointer; border: 0;
    min-width: 110px;
}
.hm-ring-actions .hm-ring-accept {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.hm-ring-actions .hm-ring-accept:hover { transform: translateY(-1px); }
.hm-ring-actions .hm-ring-decline {
    background: #ef4444; color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.30);
}
.hm-ring-actions .hm-ring-decline:hover { transform: translateY(-1px); }

.hm-ring-toast {
    position: fixed;
    left: 50%; bottom: 36px;
    transform: translateX(-50%);
    background: var(--text-primary); color: var(--bg-deep);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px; font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 3001;
    transition: opacity .3s ease;
}

/* DM-mode chat header: clickable user-title + presence avatar */
.chat-title.dm-title {
    display: inline-flex; align-items: center; gap: 10px;
    cursor: pointer;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    transition: background 0.15s;
}
.chat-title.dm-title:hover,
.chat-title.dm-title:focus-visible {
    background: var(--bg-hover);
    outline: none;
}
.dm-title-avatar {
    position: relative;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
}
.dm-title-avatar .presence-dot {
    position: absolute; inset-inline-end: -1px; bottom: -1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--bg-elevated);
}
.dm-title-hint {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.6;
}

/* User-info popup (clicking the DM header opens this) */
.user-info-modal { position: relative; max-width: 420px; padding: 24px; }
.modal-close {
    position: absolute; top: 12px; inset-inline-end: 14px;
    background: transparent; border: 0;
    color: var(--text-muted);
    font-size: 22px; line-height: 1; cursor: pointer;
    padding: 4px 10px; border-radius: 8px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.ui-head {
    display: flex; gap: 16px; align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 18px;
}
.ui-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-size: 28px; font-weight: 700;
    background: var(--accent);
}
.ui-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.ui-presence { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.ui-presence.online { color: #047857; font-weight: 600; }

.ui-rows {
    display: grid;
    grid-template-columns: 110px 1fr;
    row-gap: 10px; column-gap: 12px;
    margin: 0 0 18px;
    font-size: 13.5px;
}
.ui-rows dt { color: var(--text-muted); }
.ui-rows dd { margin: 0; color: var(--text-primary); word-break: break-all; }

/* Voice-message recorder + playback bubble */
.voice-record-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.voice-record-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.voice-record-btn.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: voice-pulse 1.4s ease-in-out infinite;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50%      { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}
.voice-recording-bar {
    display: none;
    align-items: center; gap: 10px;
    padding: 8px 12px;
    margin: 0 0 8px;
    background: var(--bg-deep);
    border: 1px solid #ef4444;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
}
.voice-recording-bar.active { display: inline-flex; }
.voice-rec-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: voice-pulse 1.4s ease-in-out infinite;
}
.voice-rec-cancel {
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 8px; border-radius: 6px;
}
.voice-rec-cancel:hover { color: #ef4444; }

.msg-voice {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    max-width: 340px;
    margin-top: 4px;
}
.msg-voice audio {
    height: 32px;
    max-width: 260px;
}
.msg-voice .voice-ic {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid; place-items: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* DM / channel list unread state
   - has-unread bolds the row + colors the name + shows the badge */
.channel-item.has-unread > a .dm-name,
.channel-item.has-unread > a .channel-label {
    font-weight: 700;
    color: var(--text-primary);
}
.channel-item.has-unread > a::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-inline-end: 6px;
    flex-shrink: 0;
}

/* Global top-bar search + per-chat search */
.top-search-bar {
    display: flex; align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}
.top-search-bar .ts-icon { font-size: 16px; color: var(--text-muted); }
.top-search-bar input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13.5px;
    outline: none;
}
.top-search-bar input:focus { border-color: var(--accent); }
/* Let the search box shrink, so the language button always fits. */
.top-search-bar input { min-width: 0; }

/* Chat header on narrow screens: the title shrinks (ellipsis) and the call
   buttons keep their place, so nothing is pushed past the screen edge —
   in Arabic as well, where the longer labels used to overflow. */
.chat-header { gap: 10px; min-width: 0; }
.chat-header > div:first-child { min-width: 0; flex: 1 1 auto; }
.chat-header .chat-title { min-width: 0; }
.chat-header .chat-title > span:not(.dm-title-avatar):not(.dm-title-hint) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-header .chat-topic { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .header-actions { flex: 0 0 auto; }
@media (max-width: 640px) {
    .top-search-bar { padding: 8px 12px; gap: 8px; }
    .chat-header { padding: 10px 12px; }
    .chat-header .header-actions { gap: 6px; }
    /* Icons only: the button keeps its name for screen readers via title/aria. */
    .chat-header .call-btn { padding: 8px 10px; }
    .chat-header .call-btn > span,
    .chat-header .meet-btn > span { display: none; }
    .chat-title { font-size: 16px; }
}

.top-search-results {
    position: absolute;
    top: 52px; left: 24px; right: 24px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 50;
    display: none;
}
.top-search-results.open { display: block; }
.top-search-results .ts-group {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 12px 4px;
    letter-spacing: 0.04em;
}
.top-search-results .ts-row {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
}
.top-search-results .ts-row:hover, .top-search-results .ts-row.active { background: var(--bg-hover); }
.top-search-results .ts-meta { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.top-search-results .ts-row .ts-snippet {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.top-search-results .ts-empty {
    padding: 16px 12px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
}

.chat-search-btn {
    background: transparent; border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
}
.chat-search-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.chat-search-inline {
    display: none;
    align-items: center; gap: 8px;
    padding: 10px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}
.chat-search-inline.open { display: flex; }
.chat-search-inline input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: 8px; font-size: 13px;
    outline: none;
}
.chat-search-inline input:focus { border-color: var(--accent); }
.chat-search-inline .csi-close {
    background: transparent; border: 0; color: var(--text-muted);
    cursor: pointer; font-size: 18px;
}

/* Pinned-messages slider (chip strip under the chat header) */
.pinned-strip {
    display: none;
    align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}
.pinned-strip.has-pins { display: flex; }
.pinned-strip .ps-icon { font-size: 14px; color: var(--accent); flex-shrink: 0; }
.pinned-strip .ps-track {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.pinned-strip .ps-track::-webkit-scrollbar { display: none; }
.pinned-strip .ps-chip {
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 320px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 5px 12px;
    margin-inline-end: 6px;
    color: var(--text-primary);
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.12s;
}
.pinned-strip .ps-chip:hover { background: var(--bg-hover); border-color: var(--accent-soft); }
.pinned-strip .ps-chip .ps-author { font-weight: 700; flex-shrink: 0; }
.pinned-strip .ps-chip .ps-text {
    color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis;
}
.pinned-strip .ps-nav {
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer; font-size: 14px;
    width: 26px; height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pinned-strip .ps-nav:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Notifications page */
.notif-page { max-width: 760px; margin: 0 auto; padding: 24px; }
.notif-page h2 { font-size: 20px; margin: 0 0 16px; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-row {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.notif-row:hover { background: var(--bg-hover); }
.notif-row.unread {
    border-inline-start: 3px solid var(--accent);
}
.notif-row .nf-ic {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-size: 16px; flex-shrink: 0;
}
.notif-row .nf-ic.mention  { background: #2563eb; }
.notif-row .nf-ic.reaction { background: #ef4444; }
.notif-row .nf-ic.call     { background: #10b981; }
.notif-row .nf-body { flex: 1; min-width: 0; }
.notif-row .nf-title { font-weight: 600; color: var(--text-primary); }
.notif-row .nf-snippet {
    color: var(--text-muted); font-size: 13px;
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-row .nf-time { color: var(--text-muted); font-size: 11.5px; margin-top: 4px; }
.notif-empty {
    background: var(--bg-elevated);
    border: 1px dashed var(--border-default);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}
.notif-bell-dot {
    position: relative;
    display: inline-block;
}
.notif-bell-dot::after {
    content: '';
    position: absolute; top: -2px; inset-inline-end: -4px;
    width: 7px; height: 7px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-elevated);
}

/* Clips — grid, recorder, watch page */
.clips-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.clips-empty {
    grid-column: 1 / -1;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-default);
    border-radius: 14px;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}
.clip-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}
.clip-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}
.clip-thumb video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.clip-thumb .clip-play {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: #fff;
    font-size: 36px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
}
.clip-thumb .clip-duration {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px; font-weight: 700;
}
.clip-meta {
    padding: 12px 14px 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.clip-title {
    color: var(--text-primary);
    font-weight: 700; font-size: 14.5px;
    text-decoration: none;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.clip-title:hover { color: var(--accent); }
.clip-sub {
    color: var(--text-muted);
    font-size: 12.5px;
    display: flex; flex-wrap: wrap; gap: 4px;
}

.clip-record {
    padding: 32px 24px;
    max-width: 920px; margin: 0 auto;
}
.clip-setup h3 { font-size: 18px; margin: 0 0 16px; }
.clip-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.clip-tog {
    display: flex; flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    gap: 4px;
}
.clip-tog:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.clip-tog input { margin-inline-end: 8px; transform: translateY(1px); }
.clip-tog span { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.clip-tog small { color: var(--text-muted); font-size: 12.5px; }
.clip-title-row {
    display: flex; flex-direction: column;
    gap: 6px; margin: 6px 0 18px;
}
.clip-title-row label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.clip-title-row input {
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px; outline: none;
}
.clip-title-row input:focus { border-color: var(--accent); }
.clip-hint {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 14px;
}

.clip-live { text-align: center; }
.clip-preview-wrap {
    position: relative;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin: 0 auto 20px;
}
.clip-preview-wrap video {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.clip-rec-dot {
    position: absolute; top: 14px; left: 14px;
    width: 14px; height: 14px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35);
    animation: voice-pulse 1.4s ease-in-out infinite;
}
.clip-timer {
    position: absolute; top: 12px; right: 14px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13.5px; font-weight: 700;
}
.clip-live-actions {
    display: flex; gap: 10px; justify-content: center;
}

.clip-upload {
    text-align: center;
    padding: 40px 20px;
}
.clip-spinner {
    width: 44px; height: 44px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 4px solid var(--border-default);
    border-top-color: var(--accent);
    animation: clip-spin 0.9s linear infinite;
}
@keyframes clip-spin { to { transform: rotate(360deg); } }

.clip-watch {
    padding: 24px;
    max-width: 1080px; margin: 0 auto;
}
.clip-watch-video {
    width: 100%;
    border-radius: 14px;
    background: #000;
    display: block;
    aspect-ratio: 16 / 9;
}
.clip-watch-tools {
    margin-top: 18px;
    display: flex;
    align-items: center; gap: 16px;
    flex-wrap: wrap;
}
.clip-share-row {
    display: inline-flex; align-items: center; gap: 8px;
    flex: 1; min-width: 280px;
}
.clip-share-label {
    color: var(--text-muted); font-size: 12.5px; font-weight: 600;
}
.clip-share-row input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px; outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.clip-owner-actions {
    display: inline-flex; gap: 8px;
}

.msg-clip {
    margin-top: 6px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
    max-width: 480px;
}
.msg-clip video {
    width: 100%;
    background: #000;
    display: block;
    aspect-ratio: 16 / 9;
}
.msg-clip-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 12.5px;
}
.msg-clip-head a { color: var(--accent); text-decoration: none; }
.msg-clip-head a:hover { text-decoration: underline; }

/* Hover-card — reused by clip viewers list + chat read receipts.
   Shown on mouseenter, hidden on mouseleave (no click needed). */
.hm-hover-card {
    position: absolute;
    z-index: 200;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}
.hm-hover-card.open { opacity: 1; pointer-events: auto; }
.hm-hover-title {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    padding: 0 4px;
}
.hm-hover-row {
    display: flex; gap: 8px; align-items: center;
    padding: 6px 4px;
    color: var(--text-primary);
    font-size: 13px;
}
.hm-hover-row .mini-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px; font-weight: 700;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.hm-hover-meta { color: var(--text-muted); font-size: 11.5px; }
.hm-hover-empty { color: var(--text-muted); font-size: 12.5px; padding: 6px 4px; }
.hm-hover-tag {
    display: inline-block;
    background: var(--bg-deep);
    color: var(--text-muted);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    margin-inline-start: 4px;
}

/* Message author hover-card (incl. external guests). */
.hm-msg-card .hm-hover-head { display: flex; gap: 10px; align-items: center; }
.hm-msg-card .hm-hover-av {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%; color: #fff;
    font-size: 16px; font-weight: 700;
    display: grid; place-items: center;
}
.hm-msg-card .hm-hover-title {
    font-size: 14px; font-weight: 700;
    color: var(--text-primary);
    text-transform: none; letter-spacing: 0;
    margin: 0 0 2px; padding: 0;
}
.hm-msg-card .hm-hover-row { font-size: 12.5px; color: var(--text-secondary); }
.hm-msg-card .hm-hover-status {
    margin-top: 6px; padding: 6px 8px;
    background: var(--bg-deep); border-radius: 8px;
    font-size: 12.5px; font-style: italic; color: var(--text-secondary);
}
/* Hover affordance on message authors. */
.message .avatar, .message .sender-name { cursor: pointer; }
.message .sender-name:hover { text-decoration: underline; }

/* Admin → Users — modern table view */
.users-toolbar {
    margin: 14px 0 12px;
    display: flex; gap: 10px;
}
.users-toolbar input[type="search"] {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    outline: none;
}
.users-toolbar input[type="search"]:focus { border-color: var(--accent); }

.users-table-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.users-table thead th {
    text-align: start;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-subtle);
}
.users-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr.user-row { transition: background 0.12s; }
.users-table tbody tr.user-row:hover { background: var(--bg-hover); }

.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    position: relative;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}
.user-avatar .presence-dot {
    position: absolute; inset-inline-end: -2px; bottom: -2px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--bg-elevated);
}
.user-id { min-width: 0; }
.user-name { font-weight: 600; color: var(--text-primary); }
.user-email { color: var(--text-muted); font-size: 12.5px; margin-top: 1px; }

.role-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.role-pill.role-owner  { background: #fce7f3; color: #be185d; }
.role-pill.role-admin  { background: var(--brand-chip-bg); color: var(--brand-chip-fg); }
.role-pill.role-member { background: #e0f2fe; color: #075985; }

.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.active   { background: #d1fae5; color: #065f46; }
.status-badge.idle     { background: var(--bg-deep); color: var(--text-muted); }
.status-badge.inactive { background: #fee2e2; color: #991b1b; }

.col-actions { text-align: end; }

/* Ticking people to change several passwords at once. */
.col-pick { width: 34px; text-align: center; }
.col-pick input { width: 15px; height: 15px; cursor: pointer; }
.pw-bulk {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}
.pw-bulk[hidden] { display: none; }
.pw-bulk-count { font-size: 13px; color: var(--text-primary); }

.btn-sm {
    padding: 5px 12px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
}

.users-empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}

/* Plan-change request card (Admin → Billing) */
.plan-change-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 24px 26px;
    margin: 16px 0;
    box-shadow: var(--shadow-md);
}
.pc-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
}
.pc-current-pill {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px; font-weight: 700;
    white-space: nowrap;
}
.pc-form { display: grid; gap: 18px; }
.pc-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.pc-plan {
    display: block;
    background: var(--bg-deep);
    border: 1.5px solid var(--border-default);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.pc-plan:hover:not(.pc-current) {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--brand-pulse-rgb), 0.12);
}
.pc-plan:has(input:checked):not(.pc-current) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.pc-plan.pc-current {
    opacity: 0.65;
    cursor: not-allowed;
    border-style: dashed;
}
.pc-plan input[type="radio"] {
    position: absolute; opacity: 0; pointer-events: none;
}
.pc-plan-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.pc-plan-name {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
}
.pc-plan-tag {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pc-plan-tag.current { background: var(--bg-elevated); color: var(--text-muted); }
.pc-plan-tag.biz     { background: #fce7f3; color: #be185d; }
.pc-plan-price {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}
.pc-plan-list {
    list-style: none;
    padding: 0; margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.pc-note-row {
    display: flex; flex-direction: column;
    gap: 6px;
}
.pc-note-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.pc-note-row textarea {
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    outline: none;
    resize: vertical;
    font-family: inherit;
}
.pc-note-row textarea:focus { border-color: var(--accent); }

.pc-actions {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap;
    padding-top: 4px;
}

/* Settings → Notifications (modernized) */
.notif-prefs {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 24px 26px;
    max-width: 640px;
    box-shadow: var(--shadow-md);
}
.notif-prefs-head h3 { margin: 0 0 4px; font-size: 18px; color: var(--text-primary); }
.notif-prefs-form {
    display: flex; flex-direction: column;
    margin-top: 18px;
    gap: 4px;
}
.notif-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.notif-row:last-of-type { border-bottom: 0; }
.notif-row-text { flex: 1; min-width: 0; }
.notif-row-title { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.notif-row-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

/* Toggle switch — cleaner than a bare checkbox. */
.notif-switch {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
    flex-shrink: 0;
}
.notif-switch input {
    position: absolute; opacity: 0; pointer-events: none;
}
.notif-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border-default);
    border-radius: 999px;
    transition: background 0.18s;
}
.notif-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.18s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.notif-switch input:checked + .notif-slider { background: var(--accent); }
.notif-switch input:checked + .notif-slider::before { transform: translateX(18px); }

/* How notifications are delivered: one choice for everything, then per kind. */
.notif-delivery {
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}
.notif-via { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notif-via-opt { position: relative; cursor: pointer; }
.notif-via-opt input { position: absolute; opacity: 0; pointer-events: none; }
.notif-via-opt > span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--border-default); background: var(--bg-deep);
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    transition: background .15s, border-color .15s, color .15s;
}
.notif-via-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.notif-via-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.notif-kinds-title { margin: 18px 0 2px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.notif-prefs .notif-row { border-width: 0 0 1px; border-radius: 0; background: none; margin-bottom: 0; cursor: default; }
.notif-kind { padding: 10px 0; flex-wrap: wrap; }
.notif-kind .notif-row-text { flex: 1 1 220px; }
.notif-kind select {
    width: auto; min-width: 180px; flex: 0 0 auto;
    padding: 7px 10px; border-radius: 10px; font-size: 13px; max-width: 100%;
    border: 1px solid var(--border-default); background: var(--bg-elevated); color: var(--text-primary);
}

/* Quiet-hours block */
.notif-quiet {
    margin-top: 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 18px 16px;
}
.notif-quiet-times {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding-top: 10px;
    transition: opacity 0.15s;
}
.notif-quiet-times.disabled { opacity: 0.4; pointer-events: none; }
.notif-time-field {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.notif-time-field label {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.notif-time-field input[type="time"] {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    outline: none;
    width: 100%;
    font-family: inherit;
}
.notif-time-field input[type="time"]:focus { border-color: var(--accent); }
.notif-time-arrow {
    align-self: center;
    color: var(--text-muted);
    font-size: 18px;
    padding-bottom: 6px;
}
.notif-quiet-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* Attach popup menu (chat composer +) */
.attach-menu-wrap { position: relative; display: inline-block; }
.attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    padding: 6px;
    min-width: 260px;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    display: none;
    animation: am-pop 0.14s ease-out;
}
.attach-menu.open { display: block; }
@keyframes am-pop {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.attach-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: start;
    color: var(--text-primary);
    transition: background 0.12s;
}
.attach-menu button:hover { background: var(--bg-hover); }
.attach-menu .am-ic {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 17px;
    flex-shrink: 0;
}
.attach-menu .am-text {
    display: flex; flex-direction: column;
    min-width: 0;
}
.attach-menu .am-title { font-weight: 600; font-size: 13.5px; }
.attach-menu .am-sub   { color: var(--text-muted); font-size: 12px; margin-top: 1px; }

/* Platform dropdown — replaces the old sidebar "Platform" section.
   Sits next to the global search bar at the top of the chat surface. */
.platform-menu-wrap { position: relative; flex-shrink: 0; }
.platform-menu-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13.5px; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.platform-menu-btn:hover { background: var(--bg-hover); border-color: var(--accent-soft); }
.platform-menu-btn[aria-expanded="true"] { background: var(--bg-hover); border-color: var(--accent); }
.platform-menu-grid {
    font-size: 16px;
    line-height: 1;
    color: var(--accent);
}
.platform-menu-dot {
    position: absolute;
    top: 6px; inset-inline-end: 10px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid var(--bg-deep);
}

.platform-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    /* RTL: anchor to the left edge of the wrap so it opens rightward and
       stays on-screen when the Apps button sits on the left. */
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    padding: 8px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    animation: am-pop 0.14s ease-out;
}
.platform-menu.open { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.platform-menu-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.12s;
    text-align: center;
}
.platform-menu-item:hover { background: var(--bg-hover); }
.platform-menu-item .pm-ic {
    font-size: 22px;
    line-height: 1;
    position: relative;
}
.platform-menu-item .pm-ic.notif-bell-dot::after {
    content: '';
    position: absolute;
    top: -2px; inset-inline-end: -6px;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-elevated);
}
.platform-menu-item .pm-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Pin button on every sidebar row (channel / group / DM) */
.channel-item .bookmark-toggle {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
    margin-inline-start: auto;
    transition: opacity 0.12s, color 0.12s;
}
.channel-item:hover .bookmark-toggle,
.channel-item .bookmark-toggle.on { opacity: 1; }
.channel-item .bookmark-toggle:hover { color: var(--text-primary); }
.channel-item .bookmark-toggle.on   { color: var(--accent); }
.channel-item.is-pinned > a { /* subtle "stuck to top" hint */
    border-inline-start: 2px solid var(--accent);
}

/* Channel/Group detail popup */
.channel-title-clickable {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 8px 2px 4px;
    border-radius: 8px;
    transition: background 0.12s;
}
.channel-title-clickable:hover,
.channel-title-clickable:focus-visible {
    background: var(--bg-hover);
    outline: none;
}
.channel-title-clickable .dm-title-hint { font-size: 14px; }

.cd-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.cd-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid; place-items: center;
    font-size: 26px;
    flex-shrink: 0;
}
.cd-id { flex: 1; min-width: 0; }
.cd-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.cd-sub  { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

.cd-section { margin-top: 4px; }
.cd-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.cd-member-list {
    list-style: none;
    padding: 0; margin: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
.cd-member {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 13.5px;
}
.cd-member:last-child { border-bottom: 0; }
.cd-member-id { flex: 1; min-width: 0; cursor: help; }
.cd-member-name { font-weight: 600; }
.cd-member-email { color: var(--text-muted); font-size: 12px; margin-top: 1px; }
.cd-role-pill {
    background: var(--brand-chip-bg); color: var(--brand-chip-fg);
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.cd-ext-tag {
    background: #fce7f3; color: #be185d;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.cd-member-remove {
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px; border-radius: 6px;
    line-height: 1;
}
.cd-member-remove:hover { background: #fee2e2; color: #b91c1c; }

.cd-add-picker {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 10px;
}
.cd-add-picker input[type="search"] {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.cd-add-picker input[type="search"]:focus { border-color: var(--accent); }
.cd-add-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.cd-add-row {
    display: flex; gap: 10px; align-items: center;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}
.cd-add-row:hover { background: var(--bg-hover); }

/* Presence-status chip + picker menu (sidebar user card) */
.user-card { position: relative; }
.user-card .avatar .status-dot {
    position: absolute; inset-inline-end: -2px; bottom: -2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 0 0 1px var(--border-default);
}
.user-status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 0;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    margin-top: 1px;
    line-height: 1.3;
}
.user-status-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-status-chip .status-icon { font-size: 12px; }

.status-menu {
    position: absolute;
    /* Opens DOWNWARD from the chip. Anchored from the left edge of the
       user-info column (~60px from the card's left edge). */
    top: calc(100% + 4px);
    left: 60px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 6px;
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    display: none;
    animation: am-pop 0.14s ease-out;
}
.status-menu.open { display: block; }
.status-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: transparent; border: 0;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    text-align: start;
    transition: background 0.12s;
}
.status-menu-item:hover { background: var(--bg-hover); }
.status-menu-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Custom-status row at the top of the menu */
.status-menu-custom {
    display: flex; gap: 6px; align-items: center;
    padding: 6px 6px 8px;
}
.status-menu-custom input[type="text"] {
    flex: 1; min-width: 0;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    outline: none;
}
.status-menu-custom input[type="text"]:focus { border-color: var(--accent); }
.status-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 2px 6px 6px;
}

/* Location-picker modal (Leaflet + OSM) */
#locationPickerModal .modal { padding: 22px 22px 20px; }
/* Leaflet bakes in its own z-index stack (control = 1000); make sure
   our modal sits above it. Without this the search dropdown and the
   pin can render on top of the modal backdrop on some browsers. */
.modal-backdrop#locationPickerModal { z-index: 200; }
#locPickMap .leaflet-control-attribution { font-size: 10px; }
#locPickMap { z-index: 1; }
.loc-row:hover { background: var(--bg-hover); }

@media (max-width: 720px) {
    .users-table thead { display: none; }
    .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
    .users-table tr { padding: 12px 16px; }
    .users-table td { padding: 6px 0; border: 0; }
    .col-actions { text-align: start; }
    .col-pick { width: auto; text-align: start; }
    .col-pick:not(:empty)::after {
        content: attr(data-pick-label);
        margin-inline-start: 8px; font-size: 12.5px; color: var(--text-muted);
        vertical-align: middle;
    }
}

/* Inline "seen" indicator used on individual chat messages. */
.msg-seen {
    display: inline-flex; align-items: center; gap: 4px;
    margin-inline-start: 8px;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: help;
    -webkit-user-select: none;
    user-select: none;
}
.msg-seen .seen-ic {
    color: var(--accent);
    font-weight: 700;
}
.msg-seen:hover { color: var(--text-primary); }

/* Teams-style left app rail (_Layout, authenticated only) */
body:has(.app-rail) { padding-inline-start: 64px; box-sizing: border-box; }
.app-rail {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1200;
    width: 64px; display: flex; flex-direction: column; justify-content: space-between;
    background: var(--bg-elevated, #201f2e); border-inline-end: 1px solid var(--border-default, rgba(255,255,255,0.08));
    padding: 8px 0; overflow-y: auto; scrollbar-width: none;
}
.app-rail::-webkit-scrollbar { display: none; }
.app-rail-top, .app-rail-bottom { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 2px 6px; margin: 0 6px; border-radius: 10px; border: 0; background: transparent;
    color: var(--text-secondary, rgba(255,255,255,0.7)); cursor: pointer; text-decoration: none;
    font-size: 9.5px; line-height: 1.1; text-align: center; position: relative; transition: background .12s, color .12s;
}
.rail-item:hover { background: rgba(255,255,255,0.08); color: var(--text-primary, #fff); }
.rail-item.active { color: var(--accent, #2470D3); }
.rail-item.active::before { content: ""; position: absolute; inset-inline-start: -6px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent, #2470D3); }
.rail-ic { font-size: 20px; line-height: 1; }
.rail-label { display: block; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Helio Voice rail button: a soft pulse while listening, a spin while the
   command is being transcribed and classified. */
.rail-voice.listening { color: #ef4444; }
.rail-voice.listening .rail-ic { animation: railVoicePulse 1s ease-in-out infinite; }
.rail-voice.thinking .rail-ic { animation: railVoiceSpin .9s linear infinite; }
@keyframes railVoicePulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .65; } }
@keyframes railVoiceSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .rail-voice.listening .rail-ic, .rail-voice.thinking .rail-ic { animation: none; }
}
.rail-apps-menu {
    position: fixed; inset-inline-start: 70px; bottom: 70px; z-index: 1300;
    background: var(--bg-elevated, #201f2e); border: 1px solid var(--border-default, rgba(255,255,255,0.1));
    border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,0.45); padding: 12px; display: none;
}
.rail-apps-menu.open { display: block; }
.rail-apps-grid { display: grid; grid-template-columns: repeat(3, 88px); gap: 6px; }
.rail-apps-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 10px; text-decoration: none; color: var(--text-primary, #fff); font-size: 12px; text-align: center; }
.rail-apps-item:hover { background: rgba(var(--brand-pulse-rgb),0.18); }
.rail-apps-ic { font-size: 26px; }
@media (max-width: 640px) { body:has(.app-rail) { padding-inline-start: 0; } .app-rail { display: none; } }

[dir="rtl"] .attach-menu { left: auto; right: 0; }
[dir="rtl"] .notif-slider::before { left: auto; right: 3px; }
[dir="rtl"] .notif-switch input:checked + .notif-slider::before { transform: translateX(-18px); }
@media (max-width: 640px) {
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); box-shadow: -8px 0 30px rgba(0,0,0,0.45); }
  [dir="rtl"] .sidebar.is-open { transform: translateX(0); }
}

.rail-notif { position: relative; }
.rail-notif-dot { position: absolute; top: -2px; inset-inline-end: -2px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--bg-elevated, #201f2e); display: none; }
.rail-notif-menu { position: fixed; inset-inline-start: 70px; top: 12px; z-index: 1300; width: 340px; max-width: calc(100vw - 84px); max-height: 72vh; display: none; flex-direction: column; background: var(--bg-elevated, #201f2e); border: 1px solid var(--border-default, rgba(255,255,255,0.1)); border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,0.45); overflow: hidden; }
.rail-notif-menu.open { display: flex; }
.rail-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.rail-notif-head strong { font-size: 14px; color: var(--text-primary); }
.rail-notif-markall { background: transparent; border: 0; color: var(--accent); font-size: 12px; cursor: pointer; font-weight: 600; }
.rail-notif-markall:hover { text-decoration: underline; }
.rail-notif-list { overflow-y: auto; padding: 6px; }
.rail-notif-empty { padding: 28px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.rail-notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text-primary); }
.rail-notif-item:hover { background: var(--bg-hover); }
.rail-notif-item.unread { background: var(--accent-soft); }
.rni-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.rni-body { flex: 1; min-width: 0; }
.rni-from { display: block; font-size: 12.5px; font-weight: 600; }
.rni-verb { color: var(--text-muted); font-weight: 400; }
.rni-text { display: block; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rni-time { flex: 0 0 auto; font-size: 11px; color: var(--text-muted); }
@media (max-width: 640px) { .rail-notif-menu { inset-inline-start: 8px; inset-inline-end: 8px; width: auto; top: 8px; } }

/* 2025 MODERNIZATION LAYER (appended — wins via the cascade)
   Global scrollbars, modern selects, and deeper polish for
   modals/popups, cards, tables and the chat composer. Kept at
   the end so it refines existing components without editing
   their scattered rules. */

/* Firefox standard properties — guarded with @supports so engines that don't
   implement them (Safari/WebKit, which use ::-webkit-scrollbar below) skip the
   block entirely instead of flagging an unsupported property. */
@supports (scrollbar-width: thin) {
    * { scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }
}
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 55%, transparent);
    border-radius: var(--radius-pill);
    border: 3px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-secondary) 70%, transparent);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* Make sure long content can ALWAYS be scrolled: the app surfaces and
   any modal/popup get a usable scroll region rather than clipping. */
html, body { overflow: hidden auto; }
.chat-main, .chat-messages, .sidebar, .members-panel,
.settings-main, .admin-main, .notes-list, .note-body, #noteItems { overflow-y: auto; }

.modal, .modal-card, .dialog, .popup, .sheet, .menu-popup, .ts-results {
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

select, .auth-select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 11px 38px 11px 14px;
    font-size: 14px;
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
[dir="rtl"] select, [dir="rtl"] .auth-select { padding: 11px 14px 11px 38px; background-position: left 14px center; }

.card, .clip-card, .panel-card, .stat-card, .settings-card, .admin-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.clip-card:hover, .panel-card:hover, .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

table { border-collapse: collapse; width: 100%; }
table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
    text-align: start; padding: 11px 14px;
    border-bottom: 1px solid var(--border-default);
}
table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }
table tbody tr { transition: background var(--transition); }
table tbody tr:hover { background: var(--bg-hover); }

.composer, .chat-composer, .message-input-wrap {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    background: var(--bg-deep);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.composer:focus-within, .chat-composer:focus-within, .message-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.sidebar .nav-item, .sidebar .channel-item, .sidebar a.sb-link {
    border-radius: var(--radius-md);
    transition: background var(--transition), color var(--transition);
}

/* Global toggle switches (green when ON) — updated 2026-08-10
   Every checkbox renders as an animated on/off switch matching
   the design: grey track + "O" when off, green track + "|" when
   on, white knob with shadow. Radios/other inputs untouched.
   !important wins over any earlier per-checkbox sizing rules. */
input[type="checkbox"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    position: relative !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 26px !important;
    margin: 0 !important;
    margin-inline-end: 8px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    background: #d1d5db !important;
    cursor: pointer;
    vertical-align: middle !important;
    transition: background .18s ease;
    flex: 0 0 auto;
}
/* the sliding white knob */
input[type="checkbox"]::before {
    content: "" !important;
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .28), 0 0 1px rgba(0, 0, 0, .25);
    transition: transform .18s ease;
    transform: none !important;
    z-index: 2;
}
/* the on/off glyph, sitting opposite the knob */
input[type="checkbox"]::after {
    content: "\25CB" !important;              /* hollow O when off */
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #9ca3af !important;
    z-index: 1;
}
input[type="checkbox"]:checked {
    background: #00c281 !important;           /* green when active */
}
input[type="checkbox"]:checked::before {
    transform: translateX(20px) !important;
}
input[type="checkbox"]:checked::after {
    content: "\7C" !important;                /* | when on */
    right: auto !important;
    left: 11px !important;
    color: #ffffff !important;
}
/* Right-to-left: the switch mirrors — the knob starts on the right and slides left. */
[dir="rtl"] input[type="checkbox"]::before { left: auto !important; right: 3px !important; }
[dir="rtl"] input[type="checkbox"]:checked::before { transform: translateX(-20px) !important; }
[dir="rtl"] input[type="checkbox"]::after { right: auto !important; left: 8px !important; }
[dir="rtl"] input[type="checkbox"]:checked::after { left: auto !important; right: 11px !important; }
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"]:focus-visible { outline: 2px solid #00c281; outline-offset: 2px; }
[data-theme="dark"] input[type="checkbox"] { background: #4b5563 !important; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) input[type="checkbox"] { background: #4b5563 !important; }
}

/* Button visibility safety net (#14)
   Several utility button classes were used in markup but never
   defined (btn-tiny ×89, btn-danger ×3, …), so those buttons
   rendered unstyled and could show invisible/low-contrast text.
   `:where(.btn)` has ZERO specificity, so it gives EVERY .btn a
   readable, theme-aware default WITHOUT overriding the real
   variants (.btn-primary / .btn-ghost keep winning). The named
   variants below fill the gaps so danger/secondary/outline/link
   buttons are always legible in both light and dark themes. */
:where(.btn) {
    /* Zero-specificity fallback: only guarantees readable text + a pointer.
       It must NOT set background/border/padding — those would leak onto
       .btn-primary / .btn-ghost (which don't reset them) and draw an unwanted
       box around every button. The named variants below carry the real look. */
    color: var(--text-primary);
    cursor: pointer;
}
:where(.pill) { color: var(--text-primary); }

.btn-tiny { padding: 4px 10px !important; font-size: 12px !important; border-radius: 8px !important; }
.btn-danger { background: var(--red, #ef4444); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* An uploaded logo keeps its own proportions and is never cropped or
   squashed. The original slots were fixed squares built for a one-glyph
   mark (.lp-logo 32x32, .auth-logo / .auth-brand-logo 56x56,
   .workspace-logo 36x36), which letterboxed a wide logo down to a sliver
   of its height.

   Each slot now fixes only the HEIGHT and lets the width follow the real
   aspect ratio, so a 474x384 logo and a 474x237 wordmark both render at
   full height, undistorted. max-width is a guard rail so an extreme
   wordmark cannot push a nav row off screen — it is not a resize.

   Sizing by height (rather than by nothing at all) is what keeps the page
   layout intact: an unconstrained logo renders at its raw pixel size and
   takes over the header. */
.brand-logo-slot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: 40px;
    max-width: 240px;
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
}

.brand-logo-img {
    height: 100%;
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.brand-logo-slot--center { justify-content: center; margin-inline-start: auto; margin-inline-end: auto; }
.brand-logo-slot--center .brand-logo-img { object-position: center; }

/* Two-class selectors so these beat the original single-class rules no
   matter the stylesheet order — landing.css loads after this file. The
   chip background and rounded corners are dropped: they frame a glyph
   nicely but look wrong behind a real logo. */
.lp-logo.brand-logo-slot,
.lp-logo-lg.brand-logo-slot,
.workspace-logo.brand-logo-slot,
.auth-logo.brand-logo-slot,
.auth-brand-logo.brand-logo-slot {
    /* display MUST be reset here. .lp-logo is `display: grid; place-items:
       center`, and a percentage height on a centred grid item does not
       resolve — the image ignored height:100% and fell back to being sized
       by max-width, rendering it several times the slot height and clipped.
       A flex box with a definite height resolves height:100% reliably. */
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    place-items: normal;
    width: auto;
    min-width: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
    font-size: 0;
}

/* Per-slot heights, chosen so the logo reads at the same optical weight as
   the glyph it replaces. */
.lp-logo.brand-logo-slot         { height: 40px; max-width: 220px; }
.lp-logo-lg.brand-logo-slot      { height: 64px; max-width: 260px; }
.workspace-logo.brand-logo-slot  { height: 36px; max-width: 180px; }
.auth-logo.brand-logo-slot       { height: 64px; max-width: 260px; }
.auth-brand-logo.brand-logo-slot { height: 72px; max-width: 300px; }

/* The sign-in card centres its mark. */
.auth-logo.brand-logo-slot {
    margin-inline-start: auto;
    margin-inline-end: auto;
    justify-content: center;
}
.auth-logo.brand-logo-slot .brand-logo-img { object-position: center; }

/* Follow-ups (/FollowUps) — the review surface for extracted
   decisions and commitments.

   The layout leans on one idea: a row is a CLAIM, and every claim
   carries its evidence next to it. Confidence, auto-accept and the
   "Show the words" button are given equal visual weight to the text
   itself, so the reader is never asked to trust an assertion whose
   basis is hidden a click away in small grey type. */
.fu-shell { display: flex; flex-direction: column; min-height: 0; }

.fu-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-main);
    overflow-x: auto;
    scrollbar-width: none;
}
.fu-tabs::-webkit-scrollbar { display: none; }

.fu-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.fu-tab:hover { color: var(--text-primary); }
.fu-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.fu-badge {
    min-width: 18px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
}
.fu-tab.active .fu-badge { background: var(--accent); color: #fff; }

.fu-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fu-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 15px 17px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), opacity 0.2s, transform 0.2s;
}
.fu-card:hover { box-shadow: var(--shadow-md); }

/* Un-reviewed items get a left edge rather than a loud background: they
   need to be findable in a scan, not to shout over the accepted ones. */
.fu-card.proposed { border-inline-start: 3px solid var(--amber); }
.fu-card.overdue  { border-inline-start: 3px solid var(--red); }

.fu-card.busy { opacity: 0.55; pointer-events: none; }
.fu-card.leaving { opacity: 0; transform: translateY(-6px); }

.fu-card-main { flex: 1; min-width: 0; }

.fu-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.fu-rationale {
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.fu-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.fu-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fu-chip.link   { color: var(--accent); text-decoration: none; }
.fu-chip.subtle { color: var(--text-muted); }
.fu-chip.warn   { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.fu-chip.danger { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.fu-chip.ok     { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.fu-chip.ext    { background: var(--brand-chip-bg); color: var(--brand-chip-fg); }

.fu-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.fu-actions > * { font-size: 12.5px; padding: 7px 13px; white-space: nowrap; }

/* Editing a commitment's owner and due date, opened under the card. */
.fu-card:has(.fu-edit-form:not([hidden])) { flex-wrap: wrap; }
.fu-edit-form {
    flex-basis: 100%;
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
    padding-top: 12px; border-top: 1px dashed var(--border-subtle);
}
.fu-edit-form[hidden] { display: none; }
.fu-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.fu-edit-form select, .fu-edit-form input { padding: 6px 8px; font-size: 13px; border-radius: 8px; min-width: 160px; }
.fu-edit-form button { padding: 7px 13px; font-size: 12.5px; }
.fu-edit-said { font-size: 12px; color: var(--text-muted); align-self: center; }
.fu-edit-form input:disabled { opacity: .6; cursor: not-allowed; }

/* Asking for more time, and the request waiting for a decision. */
.fu-card:has(.fu-ext-form:not([hidden])), .fu-card:has(.fu-ext-pending) { flex-wrap: wrap; }
.fu-ext-form .fu-ext-reason { flex: 1 1 260px; }
.fu-ext-form textarea { padding: 6px 8px; font-size: 13px; border-radius: 8px; width: 100%; resize: vertical; font-family: inherit; }
.fu-ext-hint { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--text-muted); }
.fu-ext-pending {
    flex-basis: 100%;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; margin-top: 4px;
    border-radius: 10px; background: color-mix(in srgb, var(--amber) 10%, transparent);
    border-inline-start: 3px solid var(--amber);
}
.fu-ext-pending-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; }
.fu-ext-pending-text span { color: var(--text-muted); }
.fu-ext-pending-text q { color: var(--text-primary); overflow-wrap: anywhere; }
.fu-ext-decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fu-ext-decide input { padding: 6px 8px; font-size: 12.5px; border-radius: 8px; min-width: 0; width: 180px; max-width: 100%; }
.fu-ext-decide button { padding: 7px 13px; font-size: 12.5px; }
.fu-ext-wait { font-size: 12px; color: var(--text-muted); }

/* Needs review: section headings and transcripts waiting for extraction. */
.fu-section-h { margin: 18px 2px 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: .02em; }
.fu-section-h:first-child { margin-top: 0; }
.fu-section-sub { margin: -4px 2px 10px; font-size: 12.5px; color: var(--text-muted); }
.fu-pending { margin-bottom: 8px; }
.fu-pending-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 15px; margin-bottom: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    border-inline-start: 3px solid var(--accent);
}
.fu-pending-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.fu-pending-main strong { font-size: 14px; margin-inline-end: 4px; }
.fu-pending-row.busy { opacity: .6; pointer-events: none; }
.fu-card:target { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }

.fu-empty { text-align: center; padding: 64px 24px; color: var(--text-secondary); }
.fu-empty-icon { font-size: 40px; margin-bottom: 12px; }
.fu-empty h3 { margin: 0 0 8px; font-size: 16px; color: var(--text-primary); }
.fu-empty p { margin: 0 auto; max-width: 460px; font-size: 13.5px; line-height: 1.6; }

.fu-drawer { position: fixed; inset: 0; z-index: 1200; }
.fu-drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }

.fu-drawer-panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(560px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    border-inline-start: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
}

.fu-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
}
.fu-drawer-head h3 { margin: 0; font-size: 15px; color: var(--text-primary); }

.fu-drawer-quote {
    padding: 14px 18px;
    background: var(--accent-soft);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.fu-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 32px; }
.fu-drawer-loading { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 13px; }

.fu-seg { padding: 9px 11px; border-radius: var(--radius-md); margin-bottom: 3px; }

/* The quoted turn is tinted and ruled so the eye lands on the exact words
   the claim was built from, with the surrounding turns still readable. */
.fu-seg.quoted {
    background: var(--accent-soft);
    border-inline-start: 3px solid var(--accent);
}

.fu-seg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.fu-seg-who { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.fu-seg-time { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fu-seg-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; overflow-wrap: anywhere; }
.fu-seg.quoted .fu-seg-text { color: var(--text-primary); }

@media (max-width: 720px) {
    .fu-card { flex-direction: column; gap: 12px; }
    .fu-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
}

/* Deliberately quiet. It sits above the list rather than in a modal or a
   toast, because the whole premise is that it is worth reading — and
   something that interrupts you to say "nothing is wrong" stops being
   read within a week. Kind is carried by a small colour bar, not by a
   loud background: five urgent-looking rows communicate less than one. */
.fu-digest {
    margin: 18px 20px 0;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.fu-digest-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); }
.fu-digest-icon { font-size: 16px; }

.fu-digest-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }

.fu-digest-item > a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 8px 12px;
    border-inline-start: 3px solid var(--border-default);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition);
}
.fu-digest-item > a:hover { background: var(--bg-hover); }

.fu-digest-item.overdue         > a { border-inline-start-color: var(--red); }
.fu-digest-item.due-soon        > a { border-inline-start-color: var(--amber); }
.fu-digest-item.review          > a { border-inline-start-color: var(--accent); }
.fu-digest-item.decision-review > a { border-inline-start-color: var(--pink); }

.fu-digest-title  { font-size: 13.5px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.fu-digest-reason { font-size: 11.5px; color: var(--text-muted); }

/* The translation sits UNDER the original and is labelled, rather than
   replacing it. The stored wording is what every citation rests on, so a
   machine translation is offered as a second opinion, never as the
   record. Visually quieter than the original for the same reason. */
.fu-translate {
    margin-top: 8px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 0;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition);
}
.fu-translate:hover:not(:disabled) { background: var(--bg-active); }
.fu-translate:disabled { opacity: 0.6; cursor: default; }

.fu-translated {
    margin-top: 8px;
    padding: 9px 11px;
    border-inline-start: 2px dashed var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
}
.fu-translated-tag {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.fu-translated-title { font-size: 13.5px; color: var(--text-primary); line-height: 1.45; overflow-wrap: anywhere; }
.fu-translated-why   { margin-top: 4px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* The same treatment for a transcript line in the source drawer: under the
   line it translates, never in its place, because that line is the evidence. */
.fu-drawer-translate { margin: 4px 0 10px; }
.fu-seg-translated   { margin-top: 6px; padding: 7px 10px; }
.fu-drawer-note      { margin: 4px 0 10px; font-size: 12px; color: var(--text-muted); }

/* Framed as a question, not a verdict. The system has noticed something
   that MIGHT reverse an earlier decision; asserting it had would invite
   someone to unpick a decision that still stands. Amber, not red: this
   is "look at this", not "something is broken". */
.fu-conflict {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
    border-inline-start: 3px solid var(--amber);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--amber) 8%, transparent);
    transition: opacity 0.2s;
}
.fu-conflict-head  { font-size: 12.5px; font-weight: 700; color: var(--amber); }
.fu-conflict-prior { margin-top: 4px; font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.fu-conflict-why   { margin-top: 4px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.fu-conflict-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fu-conflict-actions > * { font-size: 12px; padding: 6px 11px; }

/* Grouped by who the promise was made to, because that is the unit
   someone acts on: you send one client what you owe them, not a flat
   list spanning every client. */
.fu-party { margin-bottom: 20px; }

.fu-party-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 2px 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.fu-party-name { margin: 0; font-size: 14.5px; color: var(--text-primary); }
.fu-party-sub  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.fu-party-copy { font-size: 12px; padding: 6px 12px; white-space: nowrap; }
.fu-party .fu-card { margin-bottom: 8px; }

.fu-import {
    max-width: 620px;
    padding: 18px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.fu-import-label { display: block; margin-top: 12px; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.fu-import-label:first-of-type { margin-top: 0; }
.fu-import-input { width: 100%; padding: 9px 11px; font-size: 13.5px; }
.fu-import-hint  { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.fu-import-note h3  { margin: 0 0 8px; font-size: 14px; color: var(--text-primary); }
.fu-import-note ul  { margin: 0; padding-inline-start: 18px; }
.fu-import-note li  { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 7px; }

/* Marks a stretch that was deliberately excluded. Stated plainly and
   near the top of the transcript: a gap the reader discovers for
   themselves looks like the record was tampered with, which is the
   opposite of what this feature is for. */
.fu-private {
    padding: 9px 11px;
    margin-bottom: 8px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* In-room banner while a private stretch is live, so nobody in the call
   is unaware that this part is not being recorded. */
/* Room-wide banners stack here (off the record, live translation). */
.mr-banners {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.mr-banners > .mr-offrecord { position: static; }
.mr-livetranslation {
    padding: 6px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #0e7490;
    box-shadow: var(--shadow-md);
}
.mr-offrecord {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 900;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #7A22C9;
    box-shadow: var(--shadow-md);
}

/* The answer is visually secondary to its sources, deliberately. The
   sources are the record; the answer is a summary of them, and a layout
   that made the summary dominant would encourage acting on it without
   checking what it was built from. */
.mem-ask { display: flex; gap: 8px; max-width: 720px; }
.mem-input { flex: 1; padding: 11px 13px; font-size: 14px; }
.mem-sub { margin: 6px 0 16px; font-size: 11.5px; color: var(--text-muted); }

.mem-note {
    max-width: 720px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--amber) 8%, transparent);
    font-size: 13px;
    color: var(--text-secondary);
}

.mem-answer {
    max-width: 720px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border-default);
    border-inline-start: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
}
.mem-answer-text { font-size: 14.5px; line-height: 1.6; color: var(--text-primary); overflow-wrap: anywhere; }
.mem-answer-tag  { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }

.mem-h { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); font-weight: 700; }

.mem-src {
    max-width: 720px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.mem-src-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.mem-cite { font-weight: 700; color: var(--accent); font-size: 12.5px; }
.mem-src-text { font-size: 13.5px; color: var(--text-primary); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.mem-src-link { display: inline-block; margin-top: 7px; font-size: 12px; color: var(--accent); text-decoration: none; }

/* Industry rule-pack flag. Distinct from the amber "needs review" chip so a
   sensitivity signal is never confused with a workflow state — one asks for
   judgement about content, the other about status. */
.fu-chip.flag {
    background: color-mix(in srgb, var(--red) 12%, transparent);
    color: var(--red);
    font-weight: 600;
}

/* Quieter than a contradiction warning. An old decision is not a
   problem, it is a question — dressing it as an alert would train people
   to dismiss the alerts that do matter. */
.fu-stale {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    transition: opacity 0.2s;
}
.fu-stale-head { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.fu-digest-item.stale > a { border-inline-start-color: var(--text-muted); }

/* Sits under the off-the-record banner's slot rather than over it: if a
   meeting is both private and on a bad link, "this is not being
   recorded" is the more important of the two messages. */
.mr-degraded {
    position: fixed;
    inset-inline: 0;
    top: 34px;
    z-index: 890;
    padding: 7px 16px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: var(--amber);
    box-shadow: var(--shadow-sm);
}
.mr-degraded[data-tone="ok"] { background: var(--green); }

/* Chat details → a meeting's own chat: the meeting and its attendees. */
.cd-meeting-info { display: grid; gap: 3px; padding: 10px 12px; margin-bottom: 10px;
    background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.cd-meeting-title { font-weight: 700; font-size: 15px; }
.cd-meeting-state { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    background: var(--bg-hover); color: var(--text-secondary); margin-inline-start: 6px; }
.cd-meeting-state.live { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.cd-live-tag { font-size: 10px; font-weight: 700; color: #16a34a; }
.cd-meeting .cd-member-list { max-height: 280px; overflow-y: auto; }

/* ---- Chat messages: day separators, grouping, meeting events, guests ---- */
.messages > .day-sep {
    display: flex; align-items: center; gap: 12px;
    margin: 14px 0 6px; color: var(--text-muted);
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
}
.messages > .day-sep::before, .messages > .day-sep::after {
    content: ""; flex: 1; height: 1px; background: var(--border-subtle);
}
.messages > .day-sep span { padding: 3px 10px; border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--bg-deep); }

/* Consecutive messages from one person within a few minutes read as one block. */
.message.grouped { padding-top: 1px; padding-bottom: 1px; }
.message.grouped > .avatar { visibility: hidden; height: 0; }
.message.grouped .message-meta > .sender-name,
.message.grouped .message-meta > .guest-tag { display: none; }
.message.grouped .message-meta { margin-bottom: 0; min-height: 0; }
.message.grouped .message-meta > time { display: none; }
.message.grouped:hover .message-meta > time { display: inline; }
.message.grouped .message-meta:not(:has(.pinned-tag, .edited-tag:not([style*="none"]))) { display: none; }
.message.grouped .msg-seen { display: none; }
.message.grouped:hover .msg-seen { display: inline-flex; }
.message.grouped:hover .message-meta { display: flex; }

/* Long words, links and code never push the conversation sideways. */
.message-content { overflow-wrap: anywhere; }
.message-content img { max-width: 100%; height: auto; }
.msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; max-width: 100%; }
.msg-att-image img { display: block; max-width: min(360px, 100%); max-height: 320px; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); }
.msg-att-file { max-width: min(360px, 100%); }
.msg-att-file .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-voice audio { max-width: min(320px, 100%); }
.reply-preview { max-width: 100%; }
.reply-preview .reply-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.guest-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 1px 6px; border-radius: 999px; background: var(--bg-hover); color: var(--text-secondary);
}

/* Meeting started / ended / summary — an event, not someone's message. */
.message.meeting-event { justify-content: center; }
.message.meeting-event:hover { background: transparent; }
.message.meeting-event .message-body { flex: 0 1 560px; }
.meeting-event-card {
    border: 1px solid var(--border-subtle); background: var(--bg-deep);
    border-radius: var(--radius-lg); padding: 10px 14px;
    border-inline-start: 3px solid var(--accent);
}
.meeting-event-card .message-content { font-size: 13.5px; }
.meeting-event-card .message-meta { margin: 4px 0 0; justify-content: flex-end; }

/* ---- Picking people or workspaces: a tick box, not the site-wide on/off switch ---- */
body input[type="checkbox"].pick-box.pick-box {
    width: 18px !important; min-width: 18px !important; height: 18px !important; margin: 0 !important; padding: 0 !important;
    border: 2px solid var(--text-muted) !important; border-radius: 4px !important; background: transparent !important; flex: none;
    vertical-align: middle !important; }
body input[type="checkbox"].pick-box.pick-box::before { content: none !important; display: none !important; }
body input[type="checkbox"].pick-box.pick-box::after { content: "" !important; display: none !important; }
body input[type="checkbox"].pick-box.pick-box:checked,
body input[type="checkbox"].pick-box.pick-box:indeterminate { background: var(--accent) !important; border-color: var(--accent) !important; }
body input[type="checkbox"].pick-box.pick-box:checked::after {
    content: "" !important; display: block !important; position: absolute !important; left: 4px !important; right: auto !important; top: 0 !important;
    width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) !important; }
body input[type="checkbox"].pick-box.pick-box:indeterminate::after {
    content: "" !important; display: block !important; position: absolute !important; left: 2px !important; right: auto !important; top: 50% !important;
    width: 10px; height: 2px; background: #fff; transform: translateY(-50%) !important; }
body input[type="checkbox"].pick-box.pick-box:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* A card on a chat message (follow-up reminders: Done! / Need 1 day). */
.msg-card {
    margin-top: 4px; padding: 12px 14px; max-width: 520px;
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-inline-start: 3px solid var(--ic-teal, #0d9488); border-radius: 10px;
}
.msg-card-text { margin: 0 0 6px; color: var(--text-primary); line-height: 1.45; white-space: pre-wrap; }
.msg-card-text.subtle { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.msg-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Follow-ups → GitHub / Jira (card 44). */
.fu-flash { margin: 8px 20px 0; padding: 10px 14px; border-radius: 10px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.fu-flash.ok { background: color-mix(in srgb, var(--ic-green) 12%, transparent); color: var(--text-primary); }
.fu-flash.err { background: color-mix(in srgb, var(--ic-red) 12%, transparent); color: var(--text-primary); }
.fu-exports { margin: 24px 20px 32px; padding: 14px 16px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-elevated); }
.fu-exports > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.fu-exports > summary small { font-weight: 400; color: var(--text-muted); margin-inline-start: auto; }
.fu-exports-intro { color: var(--text-secondary); font-size: 13px; margin: 10px 0 14px; }
.fu-exports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.fu-export-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.fu-export-form h4 { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 14px; }
.fu-export-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-secondary); }
.fu-export-form input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-main); color: var(--text-primary); font: inherit; }
.fu-export-actions { display: flex; gap: 8px; }
.fu-sent { text-decoration: none; }

/* Calendar popup: "Send my AI Proxy" (card 43) */
.cal-pop-proxy { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.cal-proxy-opt { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.cal-proxy-opt input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.cal-proxy-opt strong { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); }
.cal-proxy-opt strong svg { color: #7A22C9; }
.cal-proxy-opt small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.cal-proxy-msg { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }
.cal-proxy-msg:empty { display: none; }

/* Card 45 — Catch up */
.catchup-btn { display: flex; align-items: center; gap: 8px; width: calc(100% - 16px); margin: 4px 8px 8px; padding: 8px 12px;
    border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated, transparent); color: var(--text-primary);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.catchup-btn:hover { background: var(--bg-hover); }
.catchup-btn svg { color: var(--accent); }
.catchup-btn span { flex: 1; text-align: start; }
.catchup-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff;
    font-size: 11px; line-height: 20px; text-align: center; }
.catchup-badge[hidden] { display: none; }
.catchup-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(8, 6, 18, .5); display: flex; justify-content: center;
    align-items: flex-start; padding: 6vh 16px 16px; }
.catchup-backdrop[hidden] { display: none; }
.catchup-panel { width: min(680px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--bg-main);
    color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.catchup-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.catchup-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.catchup-head h2 svg { color: var(--accent); }
.catchup-x { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 6px; border-radius: 8px; }
.catchup-x:hover { background: var(--bg-hover); }
.catchup-ask { display: flex; gap: 8px; padding: 6px 18px; }
.catchup-ask input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-subtle);
    background: var(--bg-elevated, var(--bg-main)); color: var(--text-primary); font: inherit; font-size: 13px; }
.catchup-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 18px 10px; }
.catchup-quick button { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); border-radius: 999px;
    padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.catchup-quick button:hover { background: var(--bg-hover); color: var(--text-primary); }
.catchup-body { overflow-y: auto; padding: 4px 18px 18px; }
.catchup-busy { display: flex; align-items: center; gap: 8px; color: var(--text-muted); padding: 18px 0; }
.catchup-busy .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: catchupPulse 1s infinite alternate; }
@keyframes catchupPulse { from { opacity: .3; } to { opacity: 1; } }
.catchup-summary { font-size: 13px; color: var(--text-secondary); margin: 6px 0 10px; }
.catchup-note { font-size: 13px; color: var(--text-muted); background: var(--bg-hover); border-radius: 10px; padding: 10px 12px; }
.catchup-h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 6px;
    display: flex; align-items: center; gap: 6px; }
.catchup-urgent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.catchup-urgent a { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(239,68,68,.35);
    background: rgba(239,68,68,.06); color: inherit; text-decoration: none; }
.catchup-urgent a:hover { background: rgba(239,68,68,.12); }
.cu-meta { font-size: 12px; color: var(--text-muted); }
.cu-text { font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }
.cu-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.cu-tags span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
    background: rgba(239,68,68,.14); color: #dc2626; }
.catchup-sec { padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.catchup-sec:first-of-type { border-top: 0; }
.cu-ch { font-weight: 700; font-size: 14px; color: var(--text-primary); text-decoration: none; display: flex; gap: 8px; align-items: baseline; }
.cu-ch span { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.cu-ch:hover { color: var(--accent); }
.catchup-sec ul { margin: 6px 0 0; padding-inline-start: 20px; font-size: 13.5px; color: var(--text-secondary); }
.catchup-sec li { margin: 3px 0; }

/* Card 46 — Ghostwriter */
.ghostwrite-btn svg { color: #8b5cf6; }
.ghostwrite-btn.recording { background: #ef4444 !important; color: #fff; animation: catchupPulse 1s infinite alternate; }
.ghostwrite-btn.recording svg { color: #fff; }
.ghost-panel { margin: 0 0 8px; padding: 10px 12px; border: 1px solid rgba(139,92,246,.35); border-radius: 14px;
    background: rgba(139,92,246,.06); display: flex; flex-direction: column; gap: 8px; }
.ghost-panel[hidden] { display: none; }
.gw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gw-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-primary); }
.gw-title svg { color: #8b5cf6; }
.gw-tone-wrap { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.gw-tone { font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--border-subtle);
    background: var(--bg-main); color: var(--text-primary); }
.gw-status { margin: 0; font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.ghost-panel[data-state="error"] .gw-status { color: #dc2626; }
.ghost-panel[data-state="busy"] .gw-status::before, .ghost-panel[data-state="recording"] .gw-status::before {
    content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px;
    background: #8b5cf6; animation: catchupPulse 1s infinite alternate; }
.ghost-panel[data-state="recording"] .gw-status::before { background: #ef4444; }
.gw-draft { width: 100%; box-sizing: border-box; resize: vertical; padding: 9px 11px; border-radius: 10px;
    border: 1px solid var(--border-subtle); background: var(--bg-main); color: var(--text-primary); font: inherit; font-size: 14px; line-height: 1.45; }
.gw-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Card 47 — chat in my language */
.msg-translated { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11.5px; color: var(--text-muted); }
.msg-translated svg { width: 12px; height: 12px; }
.msg-translated button { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.msg-translated button:hover { text-decoration: underline; }
.message-content[dir="auto"] { unicode-bidi: plaintext; }

/* Card 48 — AI answers to Notes */
.ai-msg-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-act { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-subtle);
    background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; }
.ai-act:hover { background: var(--bg-hover); color: var(--text-primary); }
.ai-act-done { color: #059669; border-color: rgba(5,150,105,.4); }

/* Card 51 — Smart Guard bar above the message box. */
.guard-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px;
    border-radius: 12px; font-size: 13px; line-height: 1.4; }
.guard-bar[hidden] { display: none; }
.guard-bar .guard-text { flex: 1 1 220px; min-width: 0; }
.guard-bar.guard-secret { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.45); color: var(--text-primary); }
.guard-bar.guard-secret .ic { color: #ef4444; }
.guard-bar.guard-tone { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.45); color: var(--text-primary); }
.guard-bar.guard-tone .ic { color: #f59e0b; }

/* Card 49 — Smart Clips on the watch page. */
.clip-ai { display: grid; gap: 8px; margin-bottom: 12px; }
.clip-ai-summary { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(139,92,246,.35);
    background: linear-gradient(135deg, rgba(139,92,246,.10), rgba(59,130,246,.06)); }
.clip-ai-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text-primary); }
.clip-ai-summary ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; line-height: 1.45; }
.clip-ai-status { margin: 0; font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.clip-ai-status[hidden] { display: none; }
.clip-chapters { display: grid; gap: 8px; margin-top: 10px; }
.clip-track { position: relative; height: 6px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.clip-track-seg { position: absolute; top: 0; bottom: 0; background: rgba(139,92,246,.55); border-inline-end: 2px solid var(--bg-surface, #fff); }
.clip-chapter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.clip-chapter { display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border-default); background: var(--bg-deep); color: var(--text-primary); font-size: 13px; max-width: 100%; }
.clip-chapter:hover, .clip-chapter.active { border-color: #8b5cf6; background: rgba(139,92,246,.12); }
.clip-chapter-time { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 12px; flex: none; }
.clip-chapter-title { overflow-wrap: anywhere; text-align: start; }
.clip-skip { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.clip-skip[hidden] { display: none; }
.clip-transcript { margin-top: 12px; }
.clip-transcript summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.clip-lines { display: grid; gap: 2px; margin-top: 8px; max-height: 320px; overflow-y: auto; }
.clip-line { display: flex; gap: 10px; text-align: start; padding: 4px 6px; border: 0; border-radius: 8px; background: none;
    color: var(--text-primary); font-size: 13px; cursor: pointer; }
.clip-line:hover { background: var(--bg-deep); }

/* Right-to-left: icons that point a direction (reply, forward, send, arrows)
   mirror so they point the way Arabic reads. Symmetric icons are untouched. */
[dir="rtl"] svg.ic:has(> use[href$="#reply"]),
[dir="rtl"] svg.ic:has(> use[href$="#reply-all"]),
[dir="rtl"] svg.ic:has(> use[href$="#forward"]),
[dir="rtl"] svg.ic:has(> use[href$="#undo-2"]),
[dir="rtl"] svg.ic:has(> use[href$="#redo-2"]),
[dir="rtl"] svg.ic:has(> use[href$="#send"]),
[dir="rtl"] svg.ic:has(> use[href$="#arrow-up-right"]),
[dir="rtl"] svg.ic:has(> use[href$="#arrow-left"]),
[dir="rtl"] svg.ic:has(> use[href$="#arrow-right"]),
[dir="rtl"] svg.ic:has(> use[href$="#chevron-left"]),
[dir="rtl"] svg.ic:has(> use[href$="#chevron-right"]),
[dir="rtl"] .send-btn svg { transform: scaleX(-1); }
/* Prev/next arrow characters on sliders point the reading way too. */
[dir="rtl"] .ps-nav { transform: scaleX(-1); }

/* Text people write (messages, replies, mail, AI answers, meeting chat) takes its
   direction from its own words, so English reads correctly on an Arabic page and
   Arabic on an English one. */
.message-content, .message-content :is(p, li, div, blockquote, h1, h2, h3, h4),
.pp-content, .reply-snippet, .cr-snippet, .ts-snippet,
.mail-msg-body, .mail-msg-body :is(p, div, li),
.ai-msg-body, .ai-msg-body :is(p, li, div, blockquote, h1, h2, h3, h4),
.chat-text { unicode-bidi: plaintext; }

/* The Helio Meet icon (img/brand/heliomeet-mark-*.png) in the app and the sign-in pages. */
.auth-brand-logo > img, .workspace-logo > img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* "See all results" at the foot of the top-bar search (opens /Chat/Search). */
.top-search-results .ts-all { display: block; padding: 10px 14px; border-top: 1px solid var(--border-subtle); font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.top-search-results .ts-all:hover { background: var(--bg-hover); }

/* Compliance: audit reports and auto-purge rules */
.comp-reports .rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.comp-reports .rep-card { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 14px; min-width: 0; }
.comp-reports .rep-grid .rep-card { margin-bottom: 0; }
.comp-reports .rep-card h2, .comp-reports .rep-h h2, .comp-reports h2.rep-h { font-size: 15px; margin-bottom: 10px; }
.comp-reports h2.rep-h, .comp-reports .rep-h { margin-top: 22px; }
.comp-reports .rep-seal.ok { border-inline-start: 4px solid #10b981; }
.comp-reports .rep-seal.bad { border-inline-start: 4px solid #ef4444; }
.comp-reports .rep-status { font-size: 16px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.comp-reports .rep-seal.ok .rep-status { color: #047857; }
.comp-reports .rep-seal.bad .rep-status { color: #b91c1c; }
.comp-reports .rep-hash { font-size: 11px; word-break: break-all; }
.comp-reports .rep-cats { width: 100%; border-collapse: collapse; font-size: 13px; }
.comp-reports .rep-cats th { text-align: start; font-weight: 500; padding: 4px 0; white-space: nowrap; width: 1%; padding-inline-end: 12px; }
.comp-reports .rep-cats .rep-num { text-align: end; font-variant-numeric: tabular-nums; width: 1%; padding-inline-start: 12px; }
.comp-reports .rep-bar span { display: block; height: 8px; min-width: 2px; border-radius: 4px; background: var(--accent); }
.comp-reports .filter-bar { flex-wrap: wrap; align-items: center; }
.comp-reports .filter-bar .muted-text { margin-bottom: 0; }
.comp-reports .filter-bar select, .comp-reports .ret-form select, .comp-reports .ret-form input {
    padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-default);
    background: var(--bg-deep); color: var(--text-primary); font: inherit; }
.comp-reports .ret-form { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.comp-reports .ret-form label { font-size: 12.5px; color: var(--text-secondary); }
.comp-reports .ret-form button { align-self: flex-start; margin-top: 4px; }
.comp-reports .ret-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-reports .ret-head h2 { margin: 0; }
.comp-reports .ret-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* AI accuracy: confidence badge, document review, feedback bar */
.aiq-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.aiq-badge.high { background: rgba(16, 185, 129, 0.14); color: #047857; }
.aiq-badge.low { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }
.aiq-doc .aiq-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 10px; }
.aiq-doc .aiq-body { line-height: 1.6; }
.aiq-doc .aiq-body h2, .aiq-doc .aiq-body h3 { margin: 14px 0 6px; font-size: 15px; }
.aiq-doc .aiq-body ul, .aiq-doc .aiq-body ol, .aiq-doc .aiq-unsupported { padding-inline-start: 22px; margin: 6px 0; }
.aiq-doc .aiq-unsupported li { margin: 4px 0; }
.aiq-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-default); font-size: 12.5px; color: var(--text-secondary); }
.aiq-bar button { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; line-height: 1.4; }
.aiq-bar button:hover { border-color: var(--accent); color: var(--text-primary); }
.aiq-bar button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text-primary); }
.aiq-bar button:focus-visible, .aiq-bar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.aiq-bar .aiq-open { color: var(--accent); font-weight: 600; text-decoration: none; }
.aiq-bar .aiq-comment { flex: 1 1 100%; display: flex; gap: 6px; }
.aiq-bar .aiq-comment input { flex: 1; min-width: 0; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-deep); color: var(--text-primary); font: inherit; }

/* Focus Mode in the status menu */
.focus-menu { padding: 6px 10px 8px; display: grid; gap: 6px; }
.focus-menu-head { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.focus-menu-row { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-pick, .focus-end { background: transparent; border: 1px solid var(--border-default); color: var(--text-primary); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.focus-pick:hover, .focus-end:hover { border-color: var(--accent); }
.focus-end { justify-self: start; color: #b91c1c; border-color: rgba(239, 68, 68, .45); }
.focus-line { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.focus-line[hidden] { display: none; }
.focus-line-end { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.focus-pick:focus-visible, .focus-end:focus-visible, .focus-line-end:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chat folders */
.cf-section .cf-holder { display: grid; gap: 2px; }
.cf-folder { border-radius: 8px; }
.cf-head { display: flex; align-items: center; gap: 4px; padding-inline-end: 6px; }
.cf-toggle { flex: 1; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; cursor: pointer; text-align: start; border-radius: 6px; min-width: 0; }
.cf-toggle:hover { background: var(--bg-hover, rgba(127,127,127,.08)); }
.cf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-count { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.cf-caret { width: 10px; color: var(--text-muted); }
.cf-more, .cf-file { background: transparent; border: 0; cursor: pointer; color: var(--text-secondary); padding: 0 4px; font-size: 13px; }
.cf-file { opacity: 0; transition: opacity .1s; }
.channel-item:hover .cf-file, .cf-file:focus-visible { opacity: .6; }
.cf-file:hover { opacity: 1; }
.cf-more:focus-visible, .cf-file:focus-visible, .cf-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
.cf-list { padding-inline-start: 10px; }
.cf-empty { color: var(--text-muted); font-size: 12px; padding: 4px 12px; list-style: none; }
.cf-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.cf-dragging { opacity: .5; }
.cf-menu { position: fixed; z-index: 3000; min-width: 180px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.25); padding: 4px; display: grid; }
.cf-menu button { background: transparent; border: 0; text-align: start; padding: 8px 12px; border-radius: 6px; color: var(--text-primary); font: inherit; font-size: 13px; cursor: pointer; }
.cf-menu button:hover, .cf-menu button:focus-visible { background: var(--accent-soft); outline: none; }
.cf-menu button[aria-current="true"] { font-weight: 700; }
.cf-menu button.danger { color: #b91c1c; }

/* First-time tour */
.tour-shade { position: fixed; inset: 0; z-index: 4000; background: rgba(2, 6, 23, .45); }
.tour-ring { position: fixed; z-index: 4001; border: 2px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 4px rgba(124, 58, 237, .25); pointer-events: none; transition: all .2s ease; }
.tour-card { position: fixed; z-index: 4002; width: min(340px, calc(100vw - 24px)); background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); border-radius: 14px; padding: 16px 18px; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.tour-card h2 { font-size: 16px; margin: 4px 0 6px; }
.tour-card p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 14px; line-height: 1.5; }
.tour-count { font-size: 11.5px; color: var(--text-muted); }
.tour-actions { display: flex; gap: 8px; align-items: center; }
.tour-spacer { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* ---- Accessibility ---------------------------------------------------- */

/* Skip link: hidden until a keyboard user tabs to it. */
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 5000; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; outline: 3px solid #fde047; outline-offset: 2px; }

/* A visible focus ring for keyboard users everywhere (mouse clicks don't show it). */
:where(a, button, input, select, textarea, summary, [tabindex], [contenteditable="true"]):focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px !important;
}

/* High contrast: darker text, stronger borders, underlined links in content. */
:root.a11y-contrast {
    --text-primary: #000000;
    --text-secondary: #111827;
    --text-muted: #1f2937;
    --border-subtle: rgba(0, 0, 0, 0.45);
    --border-default: rgba(0, 0, 0, 0.75);
    --accent: #0a3f91;
    --accent-hover: #062b66;
    --bg-hover: #e2e8f0;
}
:root.a11y-contrast[data-theme="dark"] {
    --bg-deep: #000000;
    --bg-sidebar: #000000;
    --bg-main: #000000;
    --bg-elevated: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #f1f5f9;
    --text-muted: #e2e8f0;
    --border-subtle: rgba(255, 255, 255, 0.5);
    --border-default: rgba(255, 255, 255, 0.8);
    --accent: #8ab8ff;
    --accent-hover: #b8d4ff;
    --bg-hover: #1f2937;
}
@media (prefers-color-scheme: dark) {
    :root.a11y-contrast:not([data-theme="light"]) {
        --bg-deep: #000000;
        --bg-sidebar: #000000;
        --bg-main: #000000;
        --bg-elevated: #0a0a0a;
        --text-primary: #ffffff;
        --text-secondary: #f1f5f9;
        --text-muted: #e2e8f0;
        --border-subtle: rgba(255, 255, 255, 0.5);
        --border-default: rgba(255, 255, 255, 0.8);
        --accent: #8ab8ff;
        --accent-hover: #b8d4ff;
        --bg-hover: #1f2937;
    }
}
.a11y-contrast .message-content a, .a11y-contrast .muted-text a, .a11y-contrast .admin-page p a { text-decoration: underline; }
.a11y-contrast :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-width: 3px !important; }

/* Easier-to-read text: a dyslexia-friendly font when the device has one
   (OpenDyslexic, Atkinson Hyperlegible), else a wide, plain one; more space
   between letters, words and lines; no italics. */
:root.a11y-readable body,
:root.a11y-readable input,
:root.a11y-readable textarea,
:root.a11y-readable select,
:root.a11y-readable button {
    font-family: "OpenDyslexic", "Atkinson Hyperlegible", Verdana, Tahoma, "Segoe UI", sans-serif !important;
    letter-spacing: 0.035em;
    word-spacing: 0.12em;
}
:root.a11y-readable .message-content, :root.a11y-readable p, :root.a11y-readable li { line-height: 1.7; }
:root.a11y-readable em, :root.a11y-readable i { font-style: normal; font-weight: 600; }

/* Lobby network test */
.net-check { border: 1px solid var(--border-default); border-radius: 12px; padding: 12px 14px; margin: 12px 0; text-align: start; }
.net-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.net-head h2 { font-size: 14px; margin: 0; }
.net-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.net-grid div { background: var(--bg-hover); border-radius: 8px; padding: 6px 8px; }
.net-grid dt { font-size: 11px; color: var(--text-muted); }
.net-grid dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.net-verdict { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.net-verdict.good { color: #047857; }
.net-verdict.fair { color: #b45309; }
.net-verdict.poor { color: #b91c1c; }
[data-theme="dark"] .net-verdict.good { color: #6ee7b7; }
[data-theme="dark"] .net-verdict.fair { color: #fcd34d; }
[data-theme="dark"] .net-verdict.poor { color: #fca5a5; }

/* System health sparkline */
.hlth .hl-ok { fill: var(--accent); opacity: .7; }
.hlth .hl-bad { fill: #ef4444; }
.hlth td svg { display: block; }

/* Clip analytics (owner) */
.clip-analytics { border: 1px solid var(--border-default); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.clip-analytics h2 { font-size: 15px; margin: 0 0 8px; }
.clip-an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.clip-an-stats div { background: var(--bg-hover); border-radius: 8px; padding: 8px 10px; display: grid; }
.clip-an-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.clip-an-stats span { font-size: 11.5px; color: var(--text-muted); }
.clip-an-chart { margin-top: 10px; }
.clip-an-chart svg { width: 100%; height: auto; display: block; }
.clip-an-chart .grid { stroke: var(--border-default); stroke-width: 1; }
.clip-an-chart .area { fill: var(--accent); opacity: .18; }
.clip-an-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.clip-an-chart text { fill: var(--text-muted); font-size: 10px; }

/* Booking funnel */
.fun-card h2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.fun-card h2 .muted-text { margin: 0; font-weight: 400; font-size: 12.5px; }
.fun-steps { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 6px; }
.fun-steps li { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 50px 50px; gap: 10px; align-items: center; font-size: 13px; }
.fun-steps b { font-variant-numeric: tabular-nums; text-align: end; }
.fun-steps em { font-style: normal; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: end; }
.fun-bar { height: 10px; background: var(--bg-hover); border-radius: 999px; overflow: hidden; }
.fun-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.fun-daily { width: 100%; height: auto; display: block; margin-top: 6px; }
.fun-daily rect.v { fill: var(--accent); opacity: .25; }
.fun-daily rect.b { fill: var(--accent); }
.fun-daily text { fill: var(--text-muted); font-size: 10px; }
.fun-legend { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fun-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-start: 8px; }
.fun-legend .sw.v { background: var(--accent); opacity: .25; }
.fun-legend .sw.b { background: var(--accent); }
/* Team Health */
.th-rows { display: grid; gap: 10px; }
.th-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 14px; align-items: center; }
.th-row .th-nums { grid-column: 2; font-size: 12px; color: var(--text-muted); }
.th-name .muted-text { margin: 0; }
.th-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-hover); }
.th-m { background: #f59e0b; }
.th-f { background: #10b981; }
.fun-legend .sw.th-m { background: #f59e0b; }
.fun-legend .sw.th-f { background: #10b981; }
@media (max-width: 560px) { .th-row { grid-template-columns: 1fr; } .th-row .th-nums { grid-column: 1; } .fun-steps li { grid-template-columns: 1fr 50px 50px; } .fun-steps .fun-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Admin console help button */
.help-fab { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 2500; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.help-fab:hover { background: var(--accent-hover); }
.help-panel { position: fixed; inset-inline-end: 20px; bottom: 80px; z-index: 2501; width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); border-radius: 14px; padding: 14px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.help-panel[hidden] { display: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; }
.help-head h2 { font-size: 16px; margin: 0; }
.help-close { background: none; border: 0; font-size: 22px; color: var(--text-secondary); cursor: pointer; line-height: 1; }
.help-panel section { border-top: 1px solid var(--border-default); padding-top: 10px; margin-top: 10px; }
.help-panel h3 { font-size: 14px; margin: 0 0 4px; }
.help-panel p { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; line-height: 1.5; }
.help-panel a { font-size: 13px; color: var(--accent); }
.help-more { display: inline-block; margin-top: 12px; }

/* Admin > Import */
.table-scroll { overflow-x: auto; max-width: 100%; }

/* Chat box time-zone note */
.after-hours-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-secondary); font-size: 12.5px; }
.after-hours-bar[hidden] { display: none; }
.after-hours-bar span { flex: 1; min-width: 0; }
.after-hours-close { background: none; border: 0; color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer; }

/* Meeting cost */
.meeting-cost-line { margin: 6px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.meeting-cost-line[hidden] { display: none; }
.meeting-cost-link { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent); }
.roi-figures { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 10px; }
.roi-figures dt { color: var(--text-secondary); font-size: 13px; }
.roi-figures dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.roi-tips { margin: 0 0 10px; padding-inline-start: 18px; font-size: 13px; }
.roi-default { margin-top: 10px; max-width: 420px; }

/* An app opened from its sidebar button */
.app-card:target { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Admin > Import: one card per provider */
.imp-providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; align-items: start; }
.imp-provider h3 { margin: 0 0 4px; font-size: 16px; }
.imp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.imp-token { margin-top: 10px; }
.imp-token summary { cursor: pointer; color: var(--accent); font-size: 13px; }

/* Help panel opened from the sidebar button */
.help-panel.help-panel-rail { inset-inline-end: auto; inset-inline-start: 76px; bottom: 16px; }
.help-links { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 700px) { .help-panel.help-panel-rail { inset-inline-start: 12px; inset-inline-end: 12px; width: auto; bottom: 72px; } }
@media (max-width: 640px) { .help-fab { bottom: 92px; width: 40px; height: 40px; font-size: 18px; } }

/* User guide (/Guide) */
.guide-page { max-width: 860px; margin: 0 auto; }
.guide-toc { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 14px; padding: 16px 20px; margin: 16px 0 24px; }
.guide-toc h2 { font-size: 16px; margin: 0 0 8px; }
.guide-toc h3 { font-size: 13px; margin: 14px 0 6px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.guide-toc ol { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 28px; }
.guide-toc li { margin: 3px 0; break-inside: avoid; }
.guide-toc a { color: var(--accent); }
.guide-section { border-top: 1px solid var(--border-default); padding: 20px 0 8px; scroll-margin-top: 16px; }
.guide-section h2 { font-size: 20px; margin: 0 0 6px; }
.guide-intro { color: var(--text-secondary); margin: 0 0 10px; }
.guide-steps { margin: 0 0 12px; padding-inline-start: 22px; line-height: 1.6; }
.guide-steps li { margin: 6px 0; max-width: 70ch; }
.guide-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.guide-top { font-size: 13px; color: var(--text-secondary); }
.guide-section:target h2 { color: var(--accent); }
.guide-contact { margin-top: 24px; }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } }

label[for="thDays"], label[for="thWeek"] { white-space: nowrap; }

/* Meeting cost line: its own row under the times */
.schedule-field.time-field { flex-wrap: wrap; }
.schedule-field.time-field .meeting-cost-line, .schedule-field.time-field .meeting-cost-link { order: 10; }
.schedule-field.time-field .meeting-cost-line { flex-basis: 100%; margin: 4px 0 0; }
.schedule-field.time-field .meeting-cost-link { margin-top: 0; }
.hlth .hl-track { fill: var(--border-default); }
[dir="rtl"] .schedule-field .time-arrow { display: inline-block; transform: scaleX(-1); }
.comp-reports .filter-bar select, .comp-reports .ret-form select { padding-inline-end: 36px; }
.comp-reports .rep-grid { align-items: start; }

/* Desktop app sign-up: the plans and prices sit next to the sign-up details
   (form on one side, plans on the other) instead of below them. Only inside the
   Windows app (body.helio-desktop) and only on the sign-up page (#rgPlans). */
body.helio-desktop .auth-form-pane:has(#rgPlans:not([style*="display: none"])) {
    grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
    align-items: start;
    place-items: start stretch;
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
body.helio-desktop .auth-form-pane:has(#rgPlans) .auth-card { margin: 0; }
body.helio-desktop .auth-form-pane #rgPlans {
    max-width: none !important;
    margin: 0 !important;
    padding: 24px !important;
    position: sticky;
    top: 24px;
    background: rgba(30, 23, 48, 0.78);
    border: 1px solid rgba(var(--brand-wash-1-rgb), 0.22);
    border-radius: var(--radius-lg);
}
body.helio-desktop .auth-form-pane #rgPlans h3 { text-align: start !important; }
body.helio-desktop .auth-form-pane #rgPlansGrid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }
@media (max-width: 900px) {
    body.helio-desktop .auth-form-pane:has(#rgPlans) { grid-template-columns: 1fr; }
    body.helio-desktop .auth-form-pane #rgPlans { position: static; }
}
