/* ================================================================
 * RevuFlex Management Console — design system
 * Professional light SaaS dashboard. Inter sans + JetBrains Mono for
 * identifiers/keys only. Indigo accent. No decorative canvas.
 * ================================================================ */

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

:root {
    --bg:            #f5f6f8;
    --surface:       #ffffff;
    --surface-2:     #fafbfc;
    --surface-3:     #f1f3f5;
    --border:        #e5e7eb;
    --border-strong: #d1d5db;
    --text:          #0f172a;
    --text-2:        #475569;
    --text-muted:    #94a3b8;
    --accent:        #4f46e5;
    --accent-hover:  #4338ca;
    --accent-bg:     #eef2ff;
    --success:       #059669;
    --success-bg:    #ecfdf5;
    --danger:        #dc2626;
    --danger-bg:     #fef2f2;
    --warning:       #d97706;
    --radius:        10px;
    --radius-sm:     6px;
    --shadow-xs:     0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm:     0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-lg:     0 10px 30px -10px rgba(15,23,42,0.18);
    --ring:          0 0 0 3px var(--accent-bg);
}

html, body { min-height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    line-height: 1.45;
    /* Default = auth pages (login / setup / activate): single centered card. */
    display: grid;
    place-items: safe center;
    padding: 24px 16px;
}

/* Logged-in pages opt into the sidebar + topbar shell. */
body.app {
    display: grid;
    grid-template-columns: 252px 1fr;
    grid-template-rows: 1fr;
    padding: 0;
    place-items: stretch;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px;
    border-bottom: 1px solid var(--border);
}
.sidebar__brand-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}
.sidebar__brand-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}
.sidebar__nav {
    padding: 8px 10px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sidebar__nav-heading {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 12px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.1s, color 0.1s;
}
.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nav-item.is-active {
    background: var(--accent-bg);
    color: var(--accent);
}
.nav-item__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar__footer {
    border-top: 1px solid var(--border);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    margin: 0 4px 4px;
    border-radius: var(--radius-sm);
}
.sidebar__footer:hover { background: var(--surface-2); }
.sidebar__footer-main {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
}
.sidebar__footer-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__footer-email {
    color: var(--text-2);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Main column ── */
.app__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar within main ── */
.app__topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 60px;
}
.app__topbar-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.app__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
    min-width: 0;
}
.app__breadcrumb a {
    color: var(--text-2);
    font-weight: 500;
    white-space: nowrap;
}
.app__breadcrumb a:hover { color: var(--text); }
.app__breadcrumb__sep { color: var(--text-muted); }
.app__breadcrumb__current {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app__topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Page body (content area inside main) ── */
.page {
    padding: 24px 28px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1400px;
    width: 100%;
}

/* Small-screen collapse: sidebar becomes a top strip */
@media (max-width: 820px) {
    body.app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .sidebar {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar__nav { flex-direction: row; padding: 8px; overflow-x: auto; }
    .sidebar__nav-heading { display: none; }
    .sidebar__footer { display: none; }
    .app__topbar, .page { padding-left: 16px; padding-right: 16px; }
}

/* Decorative elements from the old dark theme — hide if any remain. */
#grid-canvas, .vignette { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Shell ── */
.shell {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.shell--wide { width: min(520px, 100%); }
.shell--dash { width: min(1000px, 100%); }
.shell--page { width: min(1000px, 100%); }

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-xs);
}
.card--dash { padding: 20px 24px 24px; }

.card__header { margin-bottom: 20px; }
.card__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.card__subtitle {
    font-size: 14px;
    color: var(--text-2);
    font-weight: 400;
}

/* ── Brand (login pages) ── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 18px;
}
.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: #fff;
    border-radius: 7px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}
.brand__divider { display: none; }
.brand__label {
    font-weight: 500;
    color: var(--text);
}

/* ── Section title ── */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ── Form ── */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.field__hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}
.field__input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field__input:hover:not(:focus) { border-color: var(--border-strong); }
.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.field__input::placeholder { color: var(--text-muted); }
.field__input--mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    letter-spacing: 0;
    text-align: left;
}

/* The activation code needs its own look — centered, spaced letters. */
#code, #totp {
    text-align: center;
    letter-spacing: 0.35em;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase;
}

select.field__input {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2394a3b8' d='M6 8L2 4h8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    appearance: none;
    -webkit-appearance: none;
}

/* Checklist */
.checklist {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    padding: 2px 2px;
    font-size: 12px;
    color: var(--text-muted);
}
.checklist li {
    position: relative;
    padding-left: 20px;
    transition: color 0.15s;
}
.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    transition: all 0.15s;
}
.checklist li.ok { color: var(--success); }
.checklist li.ok::before {
    background: var(--success);
    border-color: var(--success);
    box-shadow: inset 0 0 0 2px var(--surface);
}

/* ── Status ── */
.status {
    min-height: 18px;
    font-size: 13px;
    color: var(--text-2);
    padding: 0 2px;
    transition: color 0.12s;
}
.status--error { color: var(--danger); }
.status--ok    { color: var(--success); }
.status--info  { color: var(--text-2); }

/* ── Buttons ── */
.submit {
    position: relative;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.08s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
.submit:hover  { background: var(--accent-hover); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: 0.6; cursor: not-allowed; }

.submit--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.submit--ghost:hover {
    background: var(--surface-2);
    color: var(--text);
}

.submit__spinner {
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: rf-spin 0.7s linear infinite;
}
.submit--ghost .submit__spinner {
    border: 1.5px solid rgba(15,23,42,0.15);
    border-top-color: var(--text);
}
.submit.is-loading .submit__spinner { display: inline-block; }
.submit.is-loading .submit__label   { opacity: 0.85; }

@keyframes rf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .submit__spinner { animation: none; }
    .submit:active { transform: none; }
}

/* Icon button */
.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    white-space: nowrap;
}
.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

/* ── Topbar ── */
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.dash-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    margin: -4px;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
}
.dash-topbar__left:hover { background: var(--surface-2); }

.dash-identity { display: flex; flex-direction: column; line-height: 1.25; }
.dash-identity__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}
.dash-identity__email {
    color: var(--text-2);
    font-size: 12px;
    font-weight: 400;
}

/* ── Avatar ── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar--small { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg    { width: 80px; height: 80px; font-size: 24px; }

.avatar-uploader {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.avatar-uploader__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    border-radius: 50%;
}
.avatar-uploader__overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(15,23,42,0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}
.avatar-uploader:hover .avatar-uploader__overlay { opacity: 1; }

.logo-uploader {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.logo-uploader__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.logo-uploader__preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
}
.logo-uploader__preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Projects grid ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.project-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    min-height: 110px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
}
.project-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.project-card:active { transform: translateY(0); }
.project-card__logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    flex-shrink: 0;
}
.project-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.project-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-card__url {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-card--add {
    border-style: dashed;
    background: transparent;
    color: var(--text-muted);
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 110px;
}
.project-card--add:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-bg);
}
.project-card--add__plus {
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}
.project-card--add__label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ── User / service list rows ── */
.user-list {
    display: flex;
    flex-direction: column;
    margin: 0 -24px -24px;
}
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    transition: background 0.08s;
}
.user-row:first-child { border-top: none; }
.user-row:hover { background: var(--surface-2); }
.user-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-row__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-row__email {
    color: var(--text-2);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-row__meta {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
    flex-shrink: 0;
}
.user-row__delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
}
.user-row__delete:hover { color: var(--danger); background: var(--danger-bg); }

.loading-row {
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px;
    text-align: center;
}

/* ── Services ── */
.service-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
}
.service-row:first-child { border-top: none; }
.service-row:hover { background: var(--surface-2); }
.service-row__badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.service-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}
.service-row__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}
.service-row__creds {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.service-row__delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}
.service-row__delete:hover { color: var(--danger); background: var(--danger-bg); }

/* ── Modal ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15,23,42,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}
.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}
.modal__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.modal__subtitle {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 18px;
    line-height: 1.5;
}
.modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── Invite result — KV ── */
.invite-result { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}
.kv__value {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    cursor: pointer;
    transition: background 0.1s;
}
.kv__value:hover { background: var(--surface-3); }
.kv__value--static { cursor: default; }
.kv__value--static:hover { background: var(--surface-2); }

/* ── Revealed secret values ── */
.kv__value.is-revealed,
.stat__value.is-revealed {
    background: var(--accent-bg);
    border-color: transparent;
    color: var(--text);
    transition: background 0.12s;
}
.kv__value.is-revealed:hover,
.stat__value.is-revealed:hover {
    background: #e0e7ff;
}

/* Stat cards on the service detail page get a Reveal button aligned
   with the label. */
.stat__label.stat__label--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.stat-reveal-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-2);
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.stat-reveal-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}
.kv__hint {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Form grid (two-column on wide) ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* ── Stats ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.stat__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: 0;
    text-transform: none;
}
.stat__value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    font-feature-settings: 'tnum';
    letter-spacing: -0.01em;
}
.stat__value--mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ── Page header (dashboard sub-pages) ── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.back-link:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}
.project-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.project-title__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* ── Credential pairs ── */
.cred-pairs { display: flex; flex-direction: column; gap: 8px; }
.cred-pair {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    gap: 6px;
}
.cred-pair__remove {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 12px;
    font-size: 16px;
    line-height: 1;
}
.cred-pair__remove:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-bg);
}
.cred-add {
    align-self: flex-start;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.cred-add:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-bg);
}

/* ── Legal footer (subtle helper text) ── */
.legal {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0 0;
}
.legal__sep { color: var(--border-strong); }

/* ── Service status dots ── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    cursor: help;
    transition: background 0.2s, box-shadow 0.2s;
}
.status-dot--pending {
    background: var(--text-muted);
    animation: rf-pulse 1.2s ease-in-out infinite;
}
.status-dot--ok {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.15);
}
.status-dot--bad {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.status-dot--warn {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
}
.status-dot--muted {
    background: var(--border-strong);
}
.status-dot--error {
    background: var(--danger);
}
@keyframes rf-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
    .status-dot--pending { animation: none; }
}

/* Smaller icon-btn inside service rows */
.service-row .icon-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* ── Custom select (icon-aware dropdown) ── */
.cselect {
    position: relative;
    width: 100%;
}
.cselect__trigger {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px 8px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.cselect__trigger:hover { border-color: var(--border-strong); }
.cselect__trigger:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.cselect[aria-expanded='true'] .cselect__trigger,
.cselect__trigger[aria-expanded='true'] {
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.cselect__text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cselect__caret {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.cselect__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
/* `display: flex` above overrides the HTML `hidden` attribute, so restore
   the UA default when the panel is closed. */
.cselect__panel[hidden] { display: none; }
.cselect__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    transition: background 0.08s;
}
.cselect__option:hover { background: var(--surface-2); }
.cselect__option.is-selected {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
}

/* ── Service brand icon (Simple Icons CDN) ── */
.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-2);
    overflow: hidden;
}
.service-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}
.service-icon--row {
    width: 28px;
    height: 28px;
    font-size: 10px;
}
.service-icon--md {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border-radius: 5px;
}
.service-icon--md img { width: 70%; height: 70%; }

/* Service row as a link (clickable to service.html) */
.service-row--link {
    text-decoration: none;
    color: inherit;
}
.service-row--link:hover {
    background: var(--surface-2);
    cursor: pointer;
}

/* ── Data table (service detail page) ── */
.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-2);
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table td.mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-2);
}

/* ── Notes list (service detail page) ── */
.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.notes-list li {
    position: relative;
    padding: 10px 12px 10px 28px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}
.notes-list li::before {
    content: '•';
    position: absolute;
    left: 12px;
    top: 8px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Delete-project icon button accent */
.icon-btn.icon-btn--danger {
    color: var(--danger);
    border-color: var(--border);
}
.icon-btn.icon-btn--danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Autofill fix */
.field__input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    caret-color: var(--text);
}

/* ── Vault ───────────────────────────────────────────────── */
.vault-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    gap: 8px;
}
.vault-lock__icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    margin-bottom: 4px;
}
.vault-lock__title { font-size: 18px; font-weight: 600; }
.vault-lock__sub {
    color: var(--text-2);
    font-size: 14px;
    max-width: 440px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.vault-list { display: grid; gap: 14px; }

.vault-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 16px 18px;
}
.vault-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.vault-item__badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.vault-item__title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vault-item__delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    line-height: 0;
}
.vault-item__delete:hover { color: var(--danger); background: var(--danger-bg); }
.vault-item__notes {
    font-size: 13px;
    color: var(--text-2);
    margin: 2px 0 12px;
}
.vault-item__empty {
    font-size: 13px;
    color: var(--text-muted);
}

/* Add-secret modal: dynamic key/value rows. */
.vault-fields { display: grid; gap: 8px; }
.vault-field-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 8px;
    align-items: center;
}
.vault-field-row__remove {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    flex: none;
}
.vault-field-row__remove:hover { color: var(--danger); border-color: var(--danger); }

/* The HTML `hidden` attribute must always win. Several component classes
   set an explicit `display` (e.g. `.submit` → inline-flex, `.card` → block)
   which would otherwise override `[hidden]` and leak hidden controls
   (e.g. the Vault "+ New secret" button while the vault is locked). */
[hidden] { display: none !important; }

/* ── Vault: category icons ───────────────────────────────── */
.vault-cat-icon {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    /* `color` is set inline per category; tint the box from it. */
    background: color-mix(in srgb, currentColor 14%, transparent);
}
.vault-cat-icon svg { width: 22px; height: 22px; }

.vault-item__heading { flex: 1; min-width: 0; }
.vault-item__cat {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Category picker row in the Add dialog: icon + select. */
.vault-cat-row { display: flex; align-items: center; gap: 10px; }
.vault-cat-row .field__input { flex: 1; }

/* ── RevuMeet: list ──────────────────────────────────────── */
.submit--small { padding: 6px 12px; font-size: 13px; }
.meeting-actions { display: flex; gap: 8px; align-items: center; flex: none; }

/* ── RevuMeet: call room ─────────────────────────────────── */
body.meet {
    margin: 0;
    height: 100vh;
    background: #0b0f14;
    color: #e8edf2;
    display: block;
    overflow: hidden;
}
.mirror { transform: scaleX(-1); }

.meet-prejoin {
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}
.meet-prejoin__card {
    width: min(520px, 100%);
    background: #121821;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}
.meet-prejoin__preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.meet-prejoin__preview video { width: 100%; height: 100%; object-fit: cover; }
.meet-prejoin__title { font-size: 18px; margin: 4px 0 12px; }
.meet-prejoin__controls { display: flex; gap: 12px; justify-content: center; margin: 12px 0 16px; }
.meet-prejoin__join { width: 100%; justify-content: center; }

.meet-room {
    position: relative;
    height: 100vh;
    height: 100dvh; /* avoids mobile browser chrome clipping the controls */
    display: flex;
    flex-direction: column;
}
.meet-topbar { flex: 0 0 auto; }
.meet-controls { flex: 0 0 auto; }
.meet-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #1f2937;
}
.meet-topbar__info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.meet-topbar__title { font-weight: 600; font-size: 15px; }
.meet-topbar__copy {
    background: #1c2734; color: #c7d2dd; border: 1px solid #2b3a4d;
    border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.meet-topbar__copy:hover { background: #243244; }
.meet-topbar__clock { font-size: 13px; color: #8a98a8; }

.meet-tiles {
    padding: 16px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-content: center;
    overflow: auto;
}
.meet-tile {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0d141d;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
}
.meet-tile video { width: 100%; height: 100%; object-fit: cover; background: #0d141d; }
.meet-tile__name {
    position: absolute; left: 10px; bottom: 8px;
    background: rgba(0,0,0,0.55); color: #fff;
    padding: 3px 10px; border-radius: 999px; font-size: 12px;
    display: flex; align-items: center; gap: 6px;
}
.meet-tile__mic { font-size: 12px; }
.meet-tile__camoff {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: #6b7a8c; font-size: 14px; background: #0d141d;
}

.meet-lobby {
    position: absolute;
    left: 50%; bottom: 90px; transform: translateX(-50%);
    z-index: 6; width: min(420px, 92%);
    background: #15202c; border: 1px solid #29384a; border-radius: 12px;
    padding: 12px 16px; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
}
.meet-lobby__title { font-size: 13px; color: #aebccb; margin-bottom: 8px; }
.meet-lobby__row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.meet-lobby__row span { flex: 1; color: #e8edf2; }
/* Ghost buttons sit on a dark card here — make their text readable. */
.meet-lobby .submit--ghost {
    color: #e8edf2; border-color: #3a4a5e; background: transparent;
}
.meet-lobby .submit--ghost:hover { background: #243244; color: #fff; }

.meet-controls {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 16px 16px 34px;
    padding-bottom: calc(34px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
}
.meet-ctrl {
    width: 48px; height: 48px; border-radius: 50%;
    background: #1c2734; color: #e8edf2; border: 1px solid #2b3a4d;
    cursor: pointer; display: grid; place-items: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.meet-ctrl__ico { display: inline-flex; }
.meet-ctrl__ico svg { width: 22px; height: 22px; display: block; }
/* Button children must never become click targets: a re-rendered icon svg
   detaches mid-click and breaks the popovers' outside-click "was this inside
   the button?" checks (clicks only landed on the button's padding). */
.meet-ctrl__ico, .meet-ctrl__ico * { pointer-events: none; }
/* Active-speaker ring (follows the tile's rounded corners). */
.meet-tile--speaking { outline: 2px solid #34d399; outline-offset: -2px; }
.meet-ctrl:hover { background: #243244; }
.meet-ctrl--off { background: #c0392b; border-color: #c0392b; color: #fff; }
.meet-ctrl--off:hover { background: #a93226; }
.meet-ctrl--leave {
    width: auto; padding: 0 22px; border-radius: 999px;
    background: #c0392b; border-color: #c0392b; color: #fff; font-size: 14px; font-weight: 600;
}
.meet-ctrl--leave:hover { background: #a93226; }

.meet-error { height: 100vh; display: grid; place-items: center; }
.meet-error__card {
    background: #121821; border: 1px solid #1f2937; border-radius: 16px;
    padding: 28px; text-align: center; width: min(420px, 100%);
}
.meet-error__msg { margin-bottom: 18px; color: #c7d2dd; }

/* RevuMeet pre-join / guest entry: dark-card text fixes. */
.meet-guest__sub { color: #aebccb; font-size: 14px; margin: 4px 0 16px; }
.meet-prejoin .field__label { color: #c7d2dd; }
.meet-prejoin .field { margin-bottom: 12px; }

/* ── RevuMeet: stage (tiles + chat), screen share, controls ── */
.meet-stage { position: relative; flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }
.meet-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.meet-main .meet-tiles { flex: 1 1 auto; min-height: 0; }
.meet-tile { cursor: pointer; }
.meet-tile--screen { grid-column: 1 / -1; }
.meet-tile--screen video { object-fit: contain; background: #000; }

/* Spotlight (speaker view): one big tile, others in a bottom filmstrip. */
.meet-spotlight {
    flex: 1 1 auto; min-height: 0; padding: 10px 12px 4px; display: flex;
}
.meet-spotlight .meet-tile {
    width: 100%; height: 100%; aspect-ratio: auto; cursor: pointer;
}
.meet-spotlight .meet-tile video { object-fit: contain; background: #000; }
.meet-tiles--strip {
    flex: 0 0 auto; display: flex; flex-direction: row;
    grid-template-columns: none; align-content: normal;
    justify-content: center; align-items: center;
    overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 10px 16px 14px;
}
.meet-tiles--strip .meet-tile {
    flex: 0 0 auto; width: 128px; height: 128px; aspect-ratio: 1 / 1;
    border-radius: 12px;
}
.meet-tiles--strip .meet-tile video { object-fit: cover; }
.meet-tiles--strip .meet-tile__name { font-size: 11px; padding: 2px 8px; }

.meet-ctrl { position: relative; }
.meet-ctrl--on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.meet-ctrl--on:hover { background: #1e40af; }
.meet-ctrl__badge {
    position: absolute; top: -3px; right: -3px;
    background: #dc2626; color: #fff; font-size: 11px; font-weight: 600;
    min-width: 18px; height: 18px; border-radius: 999px;
    display: grid; place-items: center; padding: 0 4px;
}

/* Chat panel */
.meet-chat {
    width: 320px; max-width: 80vw; flex: none;
    border-left: 1px solid #1f2937; background: #0e141c;
    display: flex; flex-direction: column;
}
.meet-chat__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #1f2937; font-weight: 600; font-size: 14px;
}
.meet-chat__close { background: none; border: none; color: #8a98a8; font-size: 16px; cursor: pointer; }
.meet-chat__messages { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 90%; }
.chat-msg--mine { align-self: flex-end; text-align: right; }
.chat-msg__who { font-size: 11px; color: #8a98a8; margin-bottom: 2px; }
.chat-msg__body {
    display: inline-block; background: #1c2734; color: #e8edf2;
    padding: 7px 11px; border-radius: 12px; font-size: 13px; line-height: 1.4;
    word-break: break-word; text-align: left;
}
.chat-msg--mine .chat-msg__body { background: #1d4ed8; color: #fff; }
.meet-chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #1f2937; }
.meet-chat__input {
    flex: 1; background: #121821; border: 1px solid #2b3a4d; color: #e8edf2;
    border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 13px;
}
.meet-chat__input:focus { outline: none; border-color: #3b82f6; }

@media (max-width: 640px) {
    .meet-chat { position: absolute; inset: 0; width: 100%; max-width: 100%; }
}

/* ── RevuMeet: list grouping + live notification banner ── */
.meet-group-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); margin: 18px 0 8px;
}
.meet-group-title:first-child { margin-top: 0; }

.revu-banner {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); border-radius: 999px; padding: 8px 10px 8px 18px;
    max-width: calc(100vw - 32px);
}
.revu-banner__dot { width: 9px; height: 9px; border-radius: 50%; background: #dc2626; flex: none;
    box-shadow: 0 0 0 0 rgba(220,38,38,0.5); animation: revu-pulse 1.6s infinite; }
@keyframes revu-pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5);} 70%{ box-shadow: 0 0 0 8px rgba(220,38,38,0);} 100%{ box-shadow:0 0 0 0 rgba(220,38,38,0);} }
.revu-banner__text { font-size: 14px; color: var(--text); }
.revu-banner__text b { font-weight: 600; }
.revu-banner__dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 8px; }

/* ── RevuMeet: chat DM context + participants panel ── */
.meet-chat__context {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 8px 14px; font-size: 12px; color: #aebccb;
    background: #15202c; border-bottom: 1px solid #1f2937;
}
.meet-chat__context b { color: #e8edf2; }
.meet-chat__context button {
    background: #1c2734; color: #c7d2dd; border: 1px solid #2b3a4d;
    border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11px; cursor: pointer;
}
.meet-chat__context button:hover { background: #243244; }

.people-list { flex: 1; overflow: auto; }
.person-row { padding: 10px 14px; border-bottom: 1px solid #1f2937; }
.person-row__top { display: flex; align-items: center; gap: 10px; }
.person-row__name { flex: 1; min-width: 0; font-size: 14px; color: #e8edf2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 8px; }
.person-row__host {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    color: #93c5fd; background: rgba(59,130,246,0.15); padding: 2px 6px; border-radius: 999px; flex: none;
}
.person-row__status { display: flex; gap: 6px; flex: none; }
.person-ico { display: inline-flex; color: #8fa0b2; }
.person-ico svg { width: 17px; height: 17px; display: block; }
.person-ico--off { color: #ef4444; }
.person-row__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.person-btn {
    background: #1c2734; color: #c7d2dd; border: 1px solid #2b3a4d;
    border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.person-btn:hover { background: #243244; }
.person-btn--danger { color: #fca5a5; border-color: #5a2f33; }
.person-btn--danger:hover { background: #3a2226; color: #fff; }

/* ── RevuMeet: chat tabs ── */
.meet-chat { position: relative; }
.chat-tabs-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #1f2937; }
.chat-tabs { flex: 1; display: flex; gap: 6px; overflow-x: auto; }
.chat-tab { position: relative; flex: 0 0 auto; background: #1c2734; color: #c7d2dd;
    border: 1px solid #2b3a4d; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.chat-tab.is-active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.chat-tab__lock { font-size: 10px; }
.chat-tab__dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
.chat-tabs__menu-btn { flex: none; background: #1c2734; color: #c7d2dd; border: 1px solid #2b3a4d;
    border-radius: 6px; width: 28px; height: 26px; cursor: pointer; }
.chat-tabs__menu { position: absolute; top: 78px; right: 8px; z-index: 10; min-width: 170px;
    max-height: 260px; overflow: auto; background: #15202c; border: 1px solid #2b3a4d;
    border-radius: 8px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); }
.chat-tabs__menu-item { display: flex; justify-content: space-between; align-items: center; gap: 8px;
    width: 100%; text-align: left; background: none; border: none; color: #e8edf2;
    padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chat-tabs__menu-item:hover { background: #1c2734; }
.chat-tabs__menu-count { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; }

/* ── RevuMeet: participants — clickable icons + kick ── */
.person-ico.is-clickable { cursor: pointer; }
.person-ico.is-clickable:hover { color: #fff; }
.person-row__name.is-clickable { cursor: pointer; }
.person-row__name.is-clickable:hover { text-decoration: underline; }
.person-kick { width: 22px; height: 22px; border-radius: 50%; background: #dc2626; border: none;
    cursor: pointer; flex: none; position: relative; }
.person-kick::before { content: ''; position: absolute; left: 5px; right: 5px; top: 10px; height: 2px;
    background: #fff; border-radius: 1px; }
.person-kick:hover { background: #b91c1c; }

/* ── RevuMeet: assign-host modal ── */
.meet-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6);
    display: grid; place-items: center; padding: 20px; }
.meet-modal__card { background: #121821; border: 1px solid #1f2937; border-radius: 16px;
    padding: 24px; width: min(420px, 100%); color: #e8edf2; }
.meet-modal__title { font-size: 18px; margin-bottom: 6px; }
.meet-modal__sub { color: #aebccb; font-size: 14px; margin-bottom: 16px; }
.host-choice-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; margin-bottom: 16px; }
.host-choice { text-align: left; background: #1c2734; color: #e8edf2; border: 1px solid #2b3a4d;
    border-radius: 8px; padding: 10px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.host-choice:hover { background: #243244; }
.meet-modal__actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── RevuMeet: fullscreen button + fullscreen filmstrip ── */
.meet-spotlight { position: relative; }
.meet-fs-btn { position: absolute; right: 14px; bottom: 14px; z-index: 4;
    width: 40px; height: 40px; border-radius: 8px; background: rgba(0,0,0,.5);
    border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer; display: grid; place-items: center; }
.meet-fs-btn svg { width: 20px; height: 20px; }
.meet-fs-btn:hover { background: rgba(0,0,0,.75); }

.meet-main:fullscreen { background: #0b0f14; }
.meet-main:fullscreen .meet-spotlight { padding: 0; }
.meet-main:fullscreen .meet-fs-btn { right: auto; left: 14px; }
.meet-main:fullscreen .meet-tiles--strip {
    position: absolute; top: 12px; right: 12px; bottom: 12px; left: auto;
    flex-direction: column; width: 210px; height: auto; justify-content: flex-start;
    overflow-y: auto; overflow-x: hidden; gap: 8px; padding: 8px;
    background: rgba(0,0,0,.4); border-radius: 12px;
}
.meet-main:fullscreen .meet-tiles--strip .meet-tile { flex: 0 0 auto; width: 194px; height: 110px; aspect-ratio: 16 / 9; }
.meet-main:-webkit-full-screen .meet-tiles--strip {
    position: absolute; top: 12px; right: 12px; bottom: 12px; left: auto;
    flex-direction: column; width: 210px; height: auto; justify-content: flex-start;
    overflow-y: auto; overflow-x: hidden; gap: 8px; padding: 8px;
    background: rgba(0,0,0,.4); border-radius: 12px;
}
.meet-main:-webkit-full-screen .meet-fs-btn { right: auto; left: 14px; }

/* Grid mode: tiles share the available height so the grid always fits the
   stage (no scrollbar), like Meet/Teams. Strip/spotlight modes are unaffected. */
.meet-main .meet-tiles:not(.meet-tiles--strip) {
    grid-auto-rows: 1fr;
    align-content: stretch;
    overflow: hidden;
}
.meet-main .meet-tiles:not(.meet-tiles--strip) > .meet-tile {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
}

/* ── RevuMeet: hardening — reconnect banner, toasts, devices, a11y ── */
.meet-reconnect {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 60; display: flex; align-items: center; gap: 10px;
    background: #15202c; border: 1px solid #2b3a4d; color: #e8edf2;
    border-radius: 999px; padding: 8px 18px; font-size: 13px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
}
.meet-reconnect__spinner {
    width: 12px; height: 12px; border-radius: 50%; flex: none;
    border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
    animation: rf-spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .meet-reconnect__spinner { animation: none; }
}

.meet-toasts {
    position: fixed; bottom: 104px; left: 50%; transform: translateX(-50%);
    z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.meet-toast {
    background: #15202c; border: 1px solid #2b3a4d; color: #e8edf2;
    border-radius: 10px; padding: 10px 16px; font-size: 13px; line-height: 1.45;
    max-width: min(440px, 90vw); pointer-events: auto; user-select: text;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
    transition: opacity 0.25s;
}
.meet-toast--error { border-color: #5a2f33; }
.meet-toast.is-hiding { opacity: 0; }

.meet-devices { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; text-align: left; }
.meet-devices__row { display: flex; align-items: center; gap: 10px; }
.meet-devices__label { flex: 0 0 88px; font-size: 12px; color: #aebccb; }
.meet-devices__select {
    flex: 1; min-width: 0; background: #121821; border: 1px solid #2b3a4d;
    color: #e8edf2; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px;
}
.meet-devices__select:focus { outline: none; border-color: #4f46e5; }
.meet-devices__select:disabled { opacity: 0.55; }
.meet-meter { height: 6px; border-radius: 999px; background: #1c2734; overflow: hidden; margin-left: 98px; }
.meet-meter__bar { height: 100%; width: 0%; background: #059669; border-radius: 999px; transition: width 90ms linear; }

/* In-call device settings popover (anchored above the control bar) */
.meet-settings {
    position: fixed;
    left: 50%;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 24px));
    background: #121821;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    z-index: 60;
}
.meet-settings__title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 10px;
}
.meet-settings .meet-devices { margin: 0; }
.meet-settings .meet-meter { margin: 2px 0 12px 98px; }

.meet-topbar__meta { display: flex; align-items: center; gap: 12px; flex: none; }
.meet-topbar__count { font-size: 12px; color: #8a98a8; }

.meet-tile:focus-visible,
.meet-ctrl:focus-visible,
.meet-fs-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* Ghost buttons inside dark modals (host chooser / confirm) need light text. */
.meet-modal .submit--ghost { color: #e8edf2; border-color: #3a4a5e; background: transparent; }
.meet-modal .submit--ghost:hover { background: #243244; color: #fff; }

/* Status text sits on the dark pre-join card — keep it readable there. */
.meet-prejoin .status { color: #aebccb; }
.meet-prejoin .status--error { color: #f87171; }
.meet-prejoin .status--ok { color: #34d399; }
.meet-prejoin .submit--ghost { color: #e8edf2; border-color: #3a4a5e; background: transparent; }

/* ── RevuMeet: in-call recording ── */
/* Topbar chip: shown for EVERYONE while any host records. */
.meet-rec {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.45);
    color: #fca5a5; border-radius: 999px; padding: 3px 11px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    white-space: nowrap;
}
.meet-rec__dot {
    width: 8px; height: 8px; border-radius: 50%; background: #dc2626; flex: none;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); animation: revu-pulse 1.6s infinite;
}
.meet-rec__time {
    font-weight: 600; letter-spacing: 0; color: #fecaca;
    font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
    .meet-rec__dot { animation: none; }
}

/* Record control: circle → red pill with elapsed time while recording. */
.meet-ctrl--rec {
    width: auto; padding: 0 18px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: #c0392b; border-color: #c0392b; color: #fff;
}
.meet-ctrl--rec:hover { background: #a93226; border-color: #a93226; }
.meet-ctrl__rectime {
    font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Record popover (same shell as the device-settings popover). */
.meet-record__opt {
    display: flex; align-items: center; gap: 10px; width: 100%;
    background: #1c2734; color: #e8edf2; border: 1px solid #2b3a4d;
    border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
    font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.meet-record__opt:hover { background: #243244; }
.meet-record__opt:disabled { opacity: 0.6; cursor: default; }
.meet-record__opt:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.meet-record__opt-ico { display: inline-flex; color: #8fa0b2; flex: none; }
.meet-record__opt-ico svg { width: 18px; height: 18px; display: block; }
.meet-record__hint { margin: 4px 0 0; font-size: 12px; color: #8a98a8; }
.meet-prejoin .submit--ghost:hover { background: #243244; color: #fff; }

/* ── RevuMeet: raise hand ── */
/* Tile badge (top-right) for every raised hand, including your own. */
.meet-tile__hand {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px; padding: 4px 9px; font-size: 14px; line-height: 1;
    pointer-events: none;
}
/* Participants panel: raise-order chip next to the name. */
.person-row__hand {
    flex: none; display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 600; color: #fbbf24;
    background: rgba(251, 191, 36, 0.12); border-radius: 999px; padding: 2px 8px;
}

/* ── RevuMeet: chat file attachments ── */
.chat-attach {
    flex: none; width: 38px; height: 38px; border-radius: 8px;
    background: #1c2734; color: #c7d2dd; border: 1px solid #2b3a4d;
    cursor: pointer; display: grid; place-items: center;
}
.chat-attach:hover { background: #243244; color: #fff; }
.chat-attach:disabled { opacity: 0.55; cursor: default; }
.chat-attach .meet-ctrl__ico svg { width: 18px; height: 18px; display: block; }
.chat-upload {
    padding: 6px 16px; font-size: 12px; color: #8a98a8;
    border-top: 1px solid #1f2937;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-file {
    display: flex; align-items: center; gap: 10px;
    width: fit-content; max-width: 100%;
    background: #1c2734; border: 1px solid #2b3a4d; border-radius: 12px;
    padding: 9px 11px; text-align: left;
}
.chat-msg__body + .chat-file { margin-top: 6px; }
.chat-msg--mine .chat-file { margin-left: auto; background: #172554; border-color: #1d4ed8; }
.chat-file__ico { flex: none; color: #8fa0b2; display: inline-flex; }
.chat-file__ico svg { width: 20px; height: 20px; display: block; }
.chat-file__meta { flex: 1; min-width: 0; }
.chat-file__name {
    font-size: 13px; color: #e8edf2; max-width: 150px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-file__size { font-size: 11px; color: #8a98a8; }
.chat-file__dl {
    flex: none; background: #121821; color: #c7d2dd; border: 1px solid #2b3a4d;
    border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.chat-file__dl:hover { background: #243244; color: #fff; }
.chat-file__dl:disabled { opacity: 0.55; cursor: default; }
.chat-attach:focus-visible,
.chat-file__dl:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* ── RevuMeet: view menu + sidebar layout ── */
/* Selected option in the view popover (menuitemradio). */
.meet-view__opt[aria-checked="true"] { background: #16233a; border-color: #1d4ed8; }
.meet-view__opt[aria-checked="true"]:hover { background: #1b2a45; }

/* Grid mode: the screen share behaves like a regular tile (no full-row span). */
.meet-tiles--flat .meet-tile--screen { grid-column: auto; }

/* Temporary click-to-focus escape hatch while in Grid mode. */
.meet-backgrid {
    position: absolute; left: 14px; top: 14px; z-index: 4;
    background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; border-radius: 999px; padding: 6px 14px;
    font: inherit; font-size: 12px; cursor: pointer;
}
.meet-backgrid:hover { background: rgba(0, 0, 0, 0.75); }
.meet-backgrid:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* Sidebar view: spotlight + right-hand vertical rail (adapted from the
   fullscreen vertical-rail styles above). */
.meet-main--sidebar { flex-direction: row; }
.meet-main--sidebar .meet-spotlight { flex: 1 1 auto; min-width: 0; }
.meet-main--sidebar .meet-tiles--strip {
    flex: 0 0 auto; flex-direction: column; width: 210px; height: auto;
    justify-content: flex-start; align-items: stretch;
    overflow-y: auto; overflow-x: hidden; gap: 8px; padding: 10px 10px 10px 2px;
}
.meet-main--sidebar .meet-tiles--strip .meet-tile {
    flex: 0 0 auto; width: auto; height: auto; aspect-ratio: 16 / 9;
}
@media (max-width: 640px) {
    /* No room for a side rail on phones — fall back to the bottom strip. */
    .meet-main--sidebar { flex-direction: column; }
    .meet-main--sidebar .meet-tiles--strip {
        flex-direction: row; width: auto; align-items: center;
        overflow-x: auto; overflow-y: hidden; padding: 10px 16px 14px;
    }
    .meet-main--sidebar .meet-tiles--strip .meet-tile {
        width: 128px; height: 128px; aspect-ratio: 1 / 1;
    }
}
