/* ==========================================================================
   TLE AI — Main Stylesheet
   ========================================================================== */

/* --- LexStrata Brand Tokens --- */
:root {
    /* The only 4 official LexStrata brand colors */
    --lx-black: #0B0D10;
    /* Charcoal Black */
    --lx-graphite: #2B2F36;
    /* Graphite Gray  */
    --lx-silver: #C5C9CE;
    /* Steel Silver   */
    --lx-red: #8B1E2D;
    /* Deep Judicial Red */
    --lx-gold: #C49A2A;
    /* Attorney Assist Gold */

    /* Translucent silver for borders / hover surfaces */
    --lx-b0: rgba(197, 201, 206, 0.08);
    --lx-b1: rgba(197, 201, 206, 0.15);
    --lx-b2: rgba(197, 201, 206, 0.25);

    /* Typography */
    --lx-font-serif: 'Cinzel', 'Liberation Serif', Georgia, serif;
    --lx-font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Layout */
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 64px;
    --transition-speed: 0.2s;
}

/* --- Global brand baseline --- */
html,
body {
    background: var(--lx-black);
    color: var(--lx-silver);
    font-family: var(--lx-font-sans);
    font-size: 16px;
    margin: 0;
}

/* Bump small Tailwind text utilities for readability */
.text-xs {
    font-size: 0.8125rem !important;
    line-height: 1.25rem !important;
}

.text-sm {
    font-size: 0.95rem !important;
    line-height: 1.4rem !important;
}

.text-base {
    font-size: 1.05rem !important;
    line-height: 1.55rem !important;
}

.text-lg {
    font-size: 1.2rem !important;
}

.text-xl {
    font-size: 1.35rem !important;
}

.text-2xl {
    font-size: 1.6rem !important;
}

/* ===== Global spacing — single source of truth ===== */
.card,
.panel-box,
.lx-card {
    background: var(--lx-b0);
    border-radius: 6px;
    color: var(--lx-silver);
    padding: 0.9rem;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 0 var(--lx-b1) inset;
    margin-bottom: 1.25rem;
}

.card>table,
.card>.table-wrapper>table {
    min-width: max-content;
}

/* Form inputs — see generic block in "Form controls" section below */
.main-content input[readonly] {
    background: var(--lx-graphite);
    cursor: default;
}

.main-content input::placeholder,
.main-content textarea::placeholder {
    color: var(--lx-silver);
    opacity: 0.5;
}

.sidebar-nav-item {
    padding: 0.7rem 0.9rem;
}

/* Admin page wrapper — all admin pages get the same right-content padding */
/* ── Shared page padding token ─────────────────────────────────────────── */
.admin-page,
.acct-page,
.case-content,
.sub-page {
    padding: 2rem;
}

@media (max-width: 768px) {
    .admin-page,
    .acct-page,
    .case-content,
    .sub-page {
        padding: 1rem;
    }
}


/* Sidebar logo images — visibility toggled by JS via the [hidden] attribute */
.sidebar-logo-full {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

.sidebar-logo-badge {
    width: 42px;
    height: 42px;
    object-fit: contain;
    margin: 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-logo-text,
.lx-serif,
.sub-title,
.acct-title,
.case-form-title,
.case-section-title,
.plans-page-title,
.account-section-title,
.acct-sec-title,
.phase-prompt-card-title,
.rc-card-title,
.case-upload-title {
    font-family: var(--lx-font-serif);
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    color: var(--lx-silver);
    margin: 0;
}


::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--lx-graphite);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--lx-b2);
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #14171c 0%, var(--lx-black) 60%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.55), 1px 0 0 var(--lx-b1);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: width var(--transition-speed) ease;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar header (logo + toggle) */
.sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--lx-b0);
    background: var(--lx-black);
    flex-shrink: 0;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--lx-silver);
    width: 100%;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--lx-red);
    transition: opacity var(--transition-speed) ease;
}

.sidebar-logo-text {
    font-family: var(--lx-font-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--lx-silver);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-logo-subtitle {
    font-size: 0.5rem;
    color: var(--lx-red);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
}

body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .sidebar-logo-subtitle {
    display: none;
}

/* When collapsed, shrink logo to just the icon */
body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    position: relative;
}

body.sidebar-collapsed .sidebar-logo {
    justify-content: center;
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    background: var(--lx-black);
}

.sidebar-nav-item,
.sidebar-section-title,
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--lx-silver);
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    background: transparent;
    transition: background var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav-item:hover,
.sidebar-group-toggle:hover {
    background: rgba(197, 201, 206, 0.035);
    color: var(--lx-silver);
}

.sidebar-nav-item.active {
    background: rgba(139, 30, 45, 0.09);
    border-left-color: var(--lx-red);
    font-weight: 500;
}

.sidebar-nav-item.active .sidebar-icon {
    opacity: 1;
}

/* Sidebar conversation item with delete icon */
.sidebar-conv-item {
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    transition: background-color var(--transition-speed);
    overflow: hidden;
}

.sidebar-conv-item:hover {
    background: rgba(197, 201, 206, 0.035);
}

.sidebar-conv-item.active {
    background: rgba(139, 30, 45, 0.09) !important;
    border-left: 3px solid var(--lx-red) !important;
}

.sidebar-conv-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    flex: 1;
    min-width: 0;
    color: var(--lx-silver);
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-conv-item.active .sidebar-conv-link {
    color: var(--lx-silver);
    font-weight: 500;
}

/* Sidebar 3-dot menu */
.sidebar-conv-menu {
    position: relative;
    flex-shrink: 0;
    padding-right: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-conv-item:hover .sidebar-conv-menu {
    opacity: 1;
}

.sidebar-menu-dropdown {
    display: none;
    position: fixed;
    background: var(--lx-black);
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    z-index: 200;
    min-width: 130px;
    padding: 0.25rem 0;
}

.sidebar-menu-dropdown.show {
    display: block;
}

.sidebar-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--lx-silver);
    white-space: nowrap;
    transition: background-color var(--transition-speed);
}

.sidebar-menu-dropdown button:hover {
    background-color: var(--lx-graphite);
    color: var(--lx-silver);
}

.sidebar-menu-dropdown button.text-danger:hover {
    color: #ef4444;
    background-color: #fef2f2;
}

.sidebar-rename-input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    margin: 0.15rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--lx-red);
    border-radius: 0.375rem;
    outline: none;
    background: #fff;
}

body.sidebar-collapsed .sidebar-conv-menu {
    display: none;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.7;
}

.sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity var(--transition-speed) ease;
}

body.sidebar-collapsed .sidebar-label {
    display: none;
}

.sidebar-section-title {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--lx-silver);
    padding: 0.75rem 0.75rem 0.25rem;
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-divider {
    height: 1px;
    background: var(--lx-b0);
    margin: 0.5rem 0;
}

/* New conversation button in sidebar */
.sidebar-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #8b1e2d85;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--lx-silver);
    text-decoration: none;
    background: #8b1e2d9e;
    transition: background-color var(--transition-speed);
}

.sidebar-new-chat:hover {
    background-color: var(--lx-red);
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--lx-b0);
    background: var(--lx-black);
    padding: 1rem;
    flex-shrink: 0;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--lx-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-email {
    font-size: 0.9em;
    color: var(--lx-silver);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* 3-dot menu button & dropdown */
.sidebar-user-menu {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    color: var(--lx-silver);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: color var(--transition-speed), background-color var(--transition-speed);
}

.sidebar-menu-btn:hover {
    color: var(--lx-silver);
    background-color: rgba(0, 0, 0, 0.06);
}

.sidebar-dropdown {
    display: none;
    position: fixed;
    min-width: 160px;
    background: var(--lx-black);
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.25rem;
    z-index: 200;
}

.sidebar-dropdown.open {
    display: block;
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--lx-silver);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
}

.sidebar-dropdown-item:hover {
    background-color: rgba(197, 201, 206, 0.04);
    color: var(--lx-silver);
}

.sidebar-dropdown-item .sidebar-icon {
    width: 16px;
    height: 16px;
}

/* Toggle button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: none;
    background: none;
    color: var(--lx-silver);
    cursor: pointer;
    transition: color var(--transition-speed), background-color var(--transition-speed), opacity var(--transition-speed);
    border-radius: 0.375rem;
    flex-shrink: 0;
    opacity: 1;
}

body.sidebar-collapsed .sidebar-toggle {
    display: none;
}

body.sidebar-collapsed .sidebar:hover .sidebar-toggle {
    display: flex;
}

body.sidebar-collapsed .sidebar:hover .sidebar-logo-icon {
    display: none;
}

.sidebar-toggle:hover {
    color: var(--lx-silver);
    background-color: rgba(0, 0, 0, 0.06);
}

.sidebar-toggle .toggle-icon {
    width: 25px;
    height: 25px;
    transition: transform var(--transition-speed) ease;
}

body.sidebar-collapsed .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* Masquerade banner */
.sidebar-masquerade {
    background-color: rgba(139, 30, 45, 0.15);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--lx-silver);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-masquerade a {
    color: var(--lx-silver);
    text-decoration: underline;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    color: var(--lx-silver);
    background:
        radial-gradient(900px 600px at 85% 0%, rgba(139, 30, 45, 0.22), transparent 55%),
        radial-gradient(700px 500px at 0% 100%, rgba(197, 201, 206, 0.10), transparent 60%),
        linear-gradient(135deg, #1a1d23 0%, #15181d 35%, var(--lx-black) 100%);
    transition: margin-left var(--transition-speed) ease;
    overflow-x: hidden;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* --- Toast Messages --- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.toast-success {
    background-color: rgba(197, 201, 206, 0.10);
    color: var(--lx-silver);
}

.toast-error {
    background-color: rgba(139, 30, 45, 0.18);
    color: var(--lx-silver);
}

.toast-warning {
    background-color: rgba(139, 30, 45, 0.15);
    color: var(--lx-silver);
}

.toast-info {
    background-color: rgba(197, 201, 206, 0.10);
    color: var(--lx-silver);
}

/* Buttons consolidated below — see canonical block */

/* .form-input — now uses generic form controls */

/* --- Badges --- */
.badge-assistant {
    background-color: var(--lx-black);
    color: var(--lx-red);
}

.badge-status-success {
    background: rgba(197, 201, 206, 0.10);
    color: var(--lx-silver);
    border: 1px solid rgba(197, 201, 206, 0.15);
}

.badge-status-warning {
    background: rgba(139, 30, 45, 0.15);
    color: var(--lx-red);
    border: 1px solid rgba(139, 30, 45, 0.25);
}

.badge-status-danger {
    background: rgba(139, 30, 45, 0.18);
    color: var(--lx-red);
    border: 1px solid rgba(139, 30, 45, 0.3);
}

.badge-status-default {
    background: rgba(197, 201, 206, 0.04);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
}

/* --- Chat --- */
.chat-layout {
    display: flex;
    height: calc(100vh - 61px);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Chat surfaces — single canonical block
   ========================================================================== */
.chat-header,
.chat-messages,
.chat-input-area,
.chat-main {
    background: var(--lx-black);
    color: var(--lx-silver);
    border-color: var(--lx-b0);
}

.chat-header {
    border-bottom: 1px solid var(--lx-b1);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-input-area {
    border-top: 1px solid var(--lx-b0);
    padding: 1.25rem 1.5rem;
}

.chat-input {
    flex: 1;
    background: var(--lx-graphite);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 0.75rem;
    padding: 0.85rem 1.1rem;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    font-size: 1.05rem;
    font-family: var(--lx-font-sans);
}

.chat-input:focus {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.35);
}

.send-btn,
/* .chat-send-btn — uses .btn .btn-primary, only override border-radius */
.chat-send-btn {
    border-radius: 0.75rem;
}

.chat-bubble-user,
.chat-bubble-assistant {
    max-width: 42rem;
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 1rem;
    padding: 0.7rem 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.chat-bubble-user {
    border-top-right-radius: 0.25rem;
}

.chat-bubble-assistant {
    border-top-left-radius: 0.25rem;
    background-color: rgba(139, 30, 45, 0.12);
    font-family: 'Times New Roman', Times, serif;
}

.chat-bubble-assistant * {
    font-family: 'Times New Roman', Times, serif;
}

.chat-bubble-assistant code,
.chat-bubble-assistant pre,
.chat-bubble-assistant pre * {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

/* Citations bar inside assistant bubbles */
.citations-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.citations-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--lx-silver);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.citation-tag {
    display: inline-block;
    font-size: 0.6875rem;
    background-color: #8b1e2d57;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
}

.data-table thead {
    background-color: var(--lx-graphite);
}

.data-table th {
    padding: 0.5rem 0.625rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lx-silver);
    white-space: nowrap;
}

.data-table tbody tr {
    border-top: 1px solid var(--lx-b1);
}

.data-table tbody tr:hover {
    background-color: var(--lx-graphite);
}

.data-table td {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Prose (markdown content inside assistant bubbles) --- */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: inherit;
}

.prose h1 {
    font-size: 1.25rem;
}

.prose h2 {
    font-size: 1.125rem;
}

.prose h3 {
    font-size: 1rem;
}

.prose h4 {
    font-size: 0.9375rem;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child {
    margin-top: 0;
}

.prose p {
    margin: 0.5rem 0;
}

.prose p:first-child {
    margin-top: 0;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin: 0.25rem 0;
}

.prose li>ul,
.prose li>ol {
    margin: 0.125rem 0;
}

.prose em {
    font-style: italic;
}

.prose blockquote {
    border-left: 3px solid var(--lx-red);
    padding-left: 0.75rem;
    margin: 0.5rem 0;
    color: var(--lx-silver);
    font-style: italic;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--lx-b1);
    margin: 0.75rem 0;
}

.prose pre {
    background: rgba(197, 201, 206, 0.04);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.prose code {
    background: rgba(197, 201, 206, 0.04);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.8125rem;
}

.prose th,
.prose td {
    border: 1px solid var(--lx-b1);
    padding: 0.375rem 0.625rem;
    text-align: left;
}

.prose th {
    background: var(--lx-graphite);
    font-weight: 600;
}

.prose a {
    color: var(--lx-red);
    text-decoration: underline;
}

/* --- Typing indicator (three bouncing dots) --- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--lx-silver);
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Links --- */
.link-primary {
    color: var(--lx-red);
    text-decoration: none;
}

.link-primary:hover {
    text-decoration: underline;
}

.link-danger {
    color: var(--lx-red);
    font-size: 0.75rem;
}

.link-danger:hover {
    text-decoration: underline;
}

/* --- Chat error toast --- */
.chat-error-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(139, 30, 45, 0.18);
    color: var(--lx-silver);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.chat-error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Delete Confirmation Popup --- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: confirmFadeIn 0.15s ease;
}

@keyframes confirmFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.confirm-popup {
    background: var(--lx-graphite);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: confirmSlideUp 0.15s ease;
}

@keyframes confirmSlideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-popup h3 {
    margin: 0 0 0.8rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--lx-silver);
}

.confirm-popup p {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--lx-silver);
    line-height: 1.5;
}

.confirm-popup-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Attorney-assist confirm popup — wider, left-aligned text */
.attorney-confirm-popup {
    max-width: 520px;
    text-align: left;
}

.attorney-confirm-popup h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.attorney-confirm-list {
    margin: 0.5rem 0 1.25rem 1.25rem;
    padding: 0;
    list-style: decimal;
    color: var(--lx-silver);
    font-size: 0.875rem;
    line-height: 1.6;
}

.attorney-confirm-list li {
    margin-bottom: 0.5rem;
}

/* --- Utility --- */
.text-primary {
    color: var(--lx-red);
}

.text-primary-dark {
    color: var(--lx-red);
}

.bg-primary {
    background-color: var(--lx-red);
}

/* --- Mobile hamburger button --- */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--lx-silver);
    cursor: pointer;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background-color: rgba(197, 201, 206, 0.04);
}

/* --- Mobile overlay (behind sidebar) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

.sidebar-overlay.open {
    display: block;
}

/* --- Subscription / Manage Plan --- */
.sub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lx-red);
    text-decoration: none;
    margin-bottom: 1rem;
}

.sub-back-link:hover {
    text-decoration: underline;
}

.sub-page {
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sub-card {
    background: var(--lx-black);
    border: 1px solid var(--lx-b1);
    border-radius: 0.75rem;
    padding: 2.5rem;
}

.sub-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}


.sub-info-container {
    margin-bottom: 2rem;

}

.sub-info-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--lx-b1);
    gap: 1rem;
}

.sub-info-row:last-child {
    border-bottom: none;
}

.sub-info-label {
    width: 220px;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--lx-silver);
    font-weight: 500;
}

.sub-info-value {
    font-size: 0.875rem;
    color: var(--lx-silver);
    font-weight: 500;
}

.sub-status-active {
    color: var(--lx-silver);
}

.sub-status-canceled {
    color: var(--lx-red);
}

.plan-col {
    border: 2px solid var(--lx-b1);
    border-radius: 0.625rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.plan-col.is-highlighted {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 2px rgba(139, 30, 45, 0.12), 0 4px 20px rgba(74, 144, 164, 0.18);
    background: linear-gradient(160deg, rgba(139, 30, 45, 0.12) 0%, var(--lx-black) 60%);
}

.pricing-col {
    padding: 1.375rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.plan-head {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lx-red);
    margin-bottom: 0.4rem;
    min-height: 1.1rem;
}

.plan-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--lx-silver);
    margin: 0 0 0.2rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin: 0.5rem 0 0.25rem;
}

.price-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--lx-silver);
}

.price-interval {
    font-size: 0.875rem;
    color: var(--lx-silver);
}

.plan-subtitle {
    font-size: 0.8125rem;
    color: var(--lx-silver);
    margin: 0 0 1rem;
}

.price-list {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--lx-silver);
    margin: 0 0 0.45rem;
    line-height: 1.4;
}

.price-list svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.plan-btn-wrapper {
    padding: 0 1.25rem 1.375rem;
}

.portal-btn {
    padding: 0.5rem 1.125rem;
    background: var(--lx-red);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.portal-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }

    .sub-info-label {
        width: 140px;
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 50;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    body.sidebar-collapsed.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: flex !important;
    }

    .chat-header {
        display: flex !important;
        padding: 0.5rem 0.75rem;
    }

    .chat-messages {
        padding: 0.75rem;
    }

    .chat-input-area {
        padding: 0.75rem;
    }

    .chat-bubble-user,
    .chat-bubble-assistant {
        max-width: 95% !important;
    }

    .chat-input {
        font-size: 16px;
    }

    .citation-tag {
        max-width: 150px;
    }
}

/* ==========================================================================
   LexStrata Brand Overrides — applied last so they win against legacy rules
   ========================================================================== */

/* ==========================================================================
   Buttons — single canonical block
   ========================================================================== */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.375rem;
    font-family: var(--lx-font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary,
.btn-danger {
    background: var(--lx-red);
    color: #f5d5d9;
    border-color: var(--lx-red);
}

.btn-primary:hover,
.btn-danger:hover {
    color: #fff;
    opacity: 0.92;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: transparent;
    color: var(--lx-silver);
    border-color: var(--lx-b1);
}

.btn-secondary:hover {
    background: var(--lx-graphite);
}

.btn-ghost,
.btn-action {
    background: var(--lx-graphite);
    color: var(--lx-silver);
    border-color: var(--lx-b1);
}

.btn-ghost:hover,
.btn-action:hover {
    border-color: var(--lx-b2);
    opacity: 0.9;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* --- Form controls (single canonical block) --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
select,
textarea,
.form-input,
.account-input {
    background: var(--lx-black);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    font-family: var(--lx-font-sans);
    font-size: 0.95rem;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

input::placeholder,
textarea::placeholder {
    color: var(--lx-silver);
    opacity: 0.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.15);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23C5C9CE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select option {
    background: var(--lx-graphite);
    color: var(--lx-silver);
}

select option:hover,
select option:focus {
    background: var(--lx-b2) !important;
    color: #fff !important;
}

select option:checked {
    background: var(--lx-b2) !important;
    color: #fff !important;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--lx-silver);
}

thead tr {
    border-bottom: 1px solid var(--lx-b1);
}

th {
    text-align: left;
    padding: 8px 10px;
    font-size: 9.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--lx-silver);
    font-weight: 500;
    font-family: var(--lx-font-sans);
}

td {
    padding: 8px 10px;
    color: var(--lx-silver);
    font-size: 12px;
    border-bottom: 1px solid var(--lx-b0);
}

tbody tr:hover {
    background: rgba(197, 201, 206, 0.025);
}

tbody tr.lx-row-active,
tbody tr.lx-row-active:hover {
    background: rgba(95, 196, 154, 0.12) !important;
    border-left: 2px solid #5fc49a;
}

tbody tr.lx-row-active td {
    color: #c8efd9;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-family: var(--lx-font-sans);
}

.b-active,
.b-indexed {
    background: rgba(25, 80, 55, 0.28);
    color: #5fc49a;
    border: 1px solid rgba(30, 140, 80, 0.22);
}

.b-inactive {
    background: rgba(60, 60, 60, 0.4);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
}

.b-user {
    background: rgba(197, 201, 206, 0.07);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
}

.b-admin {
    background: rgba(139, 30, 45, 0.18);
    color: #d88;
    border: 1px solid rgba(139, 30, 45, 0.3);
}

.b-root {
    background: rgba(168, 85, 247, 0.18);
    color: #c4a0f0;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.b-customized {
    background: rgba(196, 154, 42, 0.15);
    color: #d4a939;
    border: 1px solid rgba(196, 154, 42, 0.3);
}

.b-default {
    background: rgba(197, 201, 206, 0.06);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    opacity: 0.7;
}

/* ── Phase prompt cards grid ──────────────────────────────────────────────── */
.phase-prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.phase-prompt-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.phase-prompt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}


.phase-prompt-card-desc {
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.6;
    margin: 0;
}

.phase-prompt-card-output {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.4;
    font-family: monospace;
    margin: 0;
}

/* ── Prompt tabs ──────────────────────────────────────────────────────────── */
.prompt-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--lx-b1);
    margin-bottom: 1.5rem;
}

.prompt-tab {
    background: transparent;
    border: none;
    color: var(--lx-silver);
    opacity: 0.5;
    padding: 0.65rem 1.25rem;
    font-family: var(--lx-font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: opacity var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.prompt-tab:hover {
    opacity: 0.85;
}

.prompt-tab-active {
    opacity: 1;
    color: #fff;
    border-bottom-color: var(--lx-red);
}

.prompt-tab-panel {
    display: none;
}

.prompt-tab-panel-active {
    display: block;
}

/* ── Phase group row in prompts table ─────────────────────────────────────── */
tr.phase-group-header td {
    background: var(--lx-black) !important;
    padding: 0.75rem 1.1rem !important;
    border-bottom: 1px solid var(--lx-b1) !important;
}

/* ── Prompt editor textarea ───────────────────────────────────────────────── */
.prompt-editor {
    width: 100%;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    background: var(--lx-black);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    padding: 1rem;
    resize: vertical;
    min-height: 300px;
}

.prompt-editor:focus {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.15);
    outline: none;
}

.prompt-default-preview {
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.7;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

/* ============================================================
   Admin panel — dark theme overrides for Tailwind utilities
   Scoped to .main-content so non-admin pages are unaffected.
   Uses !important to win over Tailwind CDN utilities and any
   inline style attributes used in templates.
   ============================================================ */

/* Plain `.border` (Tailwind defaults to gray-200) — keep themed */
.main-content .border:not([class*="border-green"]):not([class*="border-red"]):not([class*="border-amber"]) {
    border-color: var(--lx-b1) !important;
}

.main-content .divide-y> :not([hidden])~ :not([hidden]) {
    border-top-color: var(--lx-b1) !important;
}

/* Tinted alert / badge backgrounds */
.main-content .bg-green-50 {
    background-color: rgba(16, 185, 129, 0.10) !important;
}

.main-content .bg-red-50,
.main-content .bg-blue-50,
.main-content .bg-indigo-50 {
    background-color: rgba(139, 30, 45, 0.08) !important;
}

.main-content .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.12) !important;
}

.main-content .bg-green-100 {
    background-color: rgba(16, 185, 129, 0.18) !important;
}

.main-content .bg-red-100,
.main-content .bg-blue-100,
.main-content .bg-indigo-100 {
    background-color: rgba(139, 30, 45, 0.15) !important;
}

.main-content .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.18) !important;
}

/* Text colors */
.main-content .text-green-800,
.main-content .text-green-700 {
    color: #34d399 !important;
}

.main-content .text-red-800,
.main-content .text-red-700,
.main-content .text-red-600,
.main-content .text-red-500,
.main-content .text-blue-800,
.main-content .text-blue-700,
.main-content .text-blue-600,
.main-content .text-indigo-800,
.main-content .text-indigo-700,
.main-content .text-indigo-600 {
    color: var(--lx-red) !important;
}

.main-content .text-amber-800,
.main-content .text-amber-700,
.main-content .text-amber-600 {
    color: #fbbf24 !important;
}

/* Border colors */
.main-content .border-green-100,
.main-content .border-green-200 {
    border-color: rgba(16, 185, 129, 0.30) !important;
}

.main-content .border-red-100,
.main-content .border-red-200,
.main-content .border-blue-100,
.main-content .border-blue-200,
.main-content .border-indigo-100,
.main-content .border-indigo-200 {
    border-color: rgba(139, 30, 45, 0.30) !important;
}

.main-content .border-amber-100,
.main-content .border-amber-200 {
    border-color: rgba(245, 158, 11, 0.30) !important;
}

/* Code / pre blocks */
.main-content pre.bg-gray-50,
.main-content pre.bg-gray-100,
.main-content code.bg-gray-50,
.main-content code.bg-gray-100 {
    background-color: var(--lx-graphite) !important;
    color: var(--lx-silver) !important;
    border-color: var(--lx-b1) !important;
}

/* DataTables (used on adminpanel/documents.html) */
.main-content #vs-table_wrapper .dt-search input,
.main-content #vs-table_wrapper .dt-length select,
.main-content #users-table_wrapper .dt-search input,
.main-content #users-table_wrapper .dt-length select {
    background-color: var(--lx-black) !important;
    color: var(--lx-silver) !important;
    border-color: var(--lx-b1) !important;
}

.main-content #vs-table_wrapper .dt-info,
.main-content #vs-table_wrapper .dt-paging .dt-paging-button,
.main-content #users-table_wrapper .dt-info,
.main-content #users-table_wrapper .dt-paging .dt-paging-button {
    color: var(--lx-silver) !important;
}

.main-content #vs-table_wrapper .dt-paging .dt-paging-button:not(.current):hover,
.main-content #users-table_wrapper .dt-paging .dt-paging-button:not(.current):hover {
    background-color: rgba(197, 201, 206, 0.04) !important;
}

/* Inline-style escape hatches used in prompt_view.html compare button */
.main-content #compare-toggle {
    background: var(--lx-graphite) !important;
    border-color: var(--lx-b1) !important;
    color: var(--lx-silver) !important;
}

/* Chat input area disclaimer */
.chat-disclaimer {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.6;
    text-align: center;
    margin: 0.6rem 0 0;
    padding: 0;
}

/* Hide chat header on desktop — only used as mobile hamburger bar */
@media (min-width: 769px) {
    .chat-header {
        display: none !important;
    }
}

/* ==========================================================================
   Chat detail page — extracted from inline styles
   ========================================================================== */
.chat-title {
    flex: 1;
}

.chat-row {
    display: flex;
}

.chat-row-user {
    justify-content: flex-end;
}

.chat-row-assistant {
    justify-content: flex-start;
}

.chat-row-streaming {
    margin-bottom: 1rem;
    padding: 0 1.5rem;
}

.chat-message-text {
    color: var(--lx-silver);
    white-space: pre-wrap;
    margin: 0;
}

.chat-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--lx-silver);
    padding: 3rem 0;
}

.thinking-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thinking-status {
    font-size: 0.8rem;
    color: var(--lx-silver);
}

.attachment-list,
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--lx-silver);
}

.upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(197, 201, 206, 0.06);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--lx-silver);
}

.upload-chip.failed {
    color: var(--lx-red);
}

.upload-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.1rem;
    font-size: 0.875rem;
    line-height: 1;
    color: var(--lx-silver);
}

.chat-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-attach-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--lx-silver);
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Sign-out trigger button + modal — extracted from inline styles
   ========================================================================== */
.signout-trigger-btn {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.signout-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.signout-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.signout-modal-center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.signout-modal-card {
    background: var(--lx-graphite);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    position: relative;
    z-index: 1;
}

.signout-modal-icon {
    margin: 0 auto 1rem;
    color: var(--lx-red);
    display: block;
}

.signout-modal-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lx-silver);
    margin: 0 0 0.5rem;
}

.signout-modal-card p {
    color: var(--lx-silver);
    opacity: 0.7;
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.signout-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.signout-modal-actions form {
    margin: 0;
}

/* Chat sidebar partials */
.sidebar-pin-icon {
    color: var(--lx-red);
    flex-shrink: 0;
}

.sidebar-empty-text {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 1rem;
    color: var(--lx-silver);
    opacity: 0.6;
}

.conv-rename-form {
    flex: 1;
    display: flex;
}

.conv-action-form {
    display: contents;
}

/* ==========================================================================
   Admin panel — small utility classes extracted from inline styles
   ========================================================================== */
.text-muted-soft {
    color: var(--lx-silver);
    opacity: 0.6;
}

.text-muted-italic {
    color: var(--lx-silver);
    opacity: 0.6;
    font-style: italic;
}

.font-mono-bold {
    font-family: monospace;
    font-weight: 600;
}

.form-input-narrow {
    max-width: 140px;
}

.max-w-220 {
    max-width: 220px;
}

.min-h-400 {
    min-height: 400px;
}

.block {
    display: block;
}

/* Prompt-view compare row */
.prompt-compare-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-compare-label {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.6;
}

.prompt-compare-select {
    background: var(--lx-graphite);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: var(--lx-font-sans);
}

/* DataTables — moved out of adminpanel/documents.html */
#vs-table_wrapper .dt-search input,
#vs-table_wrapper .dt-length select,
#users-table_wrapper .dt-search input,
#users-table_wrapper .dt-length select {
    background: var(--lx-black);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    outline: none;
}

#users-table_wrapper .dt-length select,
#vs-table_wrapper .dt-length select {
    width: auto;
    min-width: 70px;
}

#users-table_wrapper .dt-search input,
#vs-table_wrapper .dt-search input {
    width: 240px;
    max-width: 100%;
}

#users-table_wrapper .dt-layout-row:first-child,
#vs-table_wrapper .dt-layout-row:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

#users-table_wrapper .dt-layout-row:first-child .dt-layout-cell,
#vs-table_wrapper .dt-layout-row:first-child .dt-layout-cell {
    flex: 0 0 auto;
    width: auto;
}

#vs-table_wrapper .dt-search input:focus,
#vs-table_wrapper .dt-length select:focus,
#users-table_wrapper .dt-search input:focus,
#users-table_wrapper .dt-length select:focus {
    border-color: var(--lx-red);
}

#vs-table_wrapper .dt-paging .dt-paging-button,
#users-table_wrapper .dt-paging .dt-paging-button {
    padding: 0.25rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--lx-silver);
}

#vs-table_wrapper .dt-paging .dt-paging-button.current,
#users-table_wrapper .dt-paging .dt-paging-button.current {
    background: var(--lx-red);
    color: #fff;
}

#vs-table_wrapper .dt-paging .dt-paging-button:not(.current):hover,
#users-table_wrapper .dt-paging .dt-paging-button:not(.current):hover {
    background: rgba(197, 201, 206, 0.04);
}

#vs-table_wrapper .dt-info {
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.7;
}

#vs-table {
    width: 100%;
}

#vs-table thead th {
    text-align: left;
    padding-right: 30px;
}

#vs-table thead th.dt-orderable-asc,
#vs-table thead th.dt-orderable-desc,
#vs-table thead th.dt-ordering-asc,
#vs-table thead th.dt-ordering-desc,
#vs-table thead th.dt-ordering-none {
    position: relative;
    text-align: left;
    padding-right: 30px;
}

#vs-table thead th .dt-column-order {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    width: 12px;
}

/* ==========================================================================
   Subscription plans page (required.html + _plan_card.html)
   ========================================================================== */
.plans-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--lx-graphite);
}

.plans-page-inner {
    width: 100%;
    max-width: 900px;
}

.plans-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.plans-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(139, 30, 45, 0.12);
    border-radius: 50%;
    margin-bottom: 1.25rem;
}


.plans-page-subtitle {
    color: var(--lx-silver);
    opacity: 0.8;
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.plan-card {
    background: var(--lx-black);
    border: 1px solid var(--lx-b1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.plan-card-featured {
    border: 2px solid var(--lx-red);
    box-shadow: 0 4px 24px rgba(139, 30, 45, 0.13);
}

.plan-card-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lx-red);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.875rem;
    border-radius: 999px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.plan-card-current {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 30, 45, 0.12);
    color: var(--lx-red);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.plan-card-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--lx-silver);
    margin: 0 0 0.25rem;
}

.plan-card-subtitle {
    color: var(--lx-silver);
    opacity: 0.7;
    font-size: 0.8125rem;
    margin: 0;
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plan-card-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--lx-silver);
    line-height: 1.4;
}

.plan-card-feature-top {
    align-items: flex-start;
}

.plan-card-feature-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.plan-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.plan-btn {
    display: block;
    text-align: center;
    padding: 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.plan-btn-primary,
.plan-btn-cancel {
    background: var(--lx-red);
    color: #fff;
    border: 1px solid var(--lx-red);
}

.plan-btn-primary:hover,
.plan-btn-cancel:hover {
    opacity: 0.9;
}

.plan-btn-secondary {
    background: rgba(197, 201, 206, 0.04);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    font-weight: 500;
}

.plan-btn-active {
    background: rgba(197, 201, 206, 0.10);
    color: var(--lx-silver);
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.plan-btn-disabled {
    background: rgba(197, 201, 206, 0.04);
    color: var(--lx-silver);
    border: 1px solid var(--lx-b1);
    font-weight: 500;
    cursor: not-allowed;
}

.plans-page-footer {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--lx-silver);
    opacity: 0.7;
}

.plans-page-footer-link {
    color: var(--lx-red);
    text-decoration: none;
    font-weight: 500;
}

/* ==========================================================================
   Auth (login / signup) — extracted from inline <style> blocks
   ========================================================================== */
.lx-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lx-black);
    padding: 1.5rem;
    font-family: var(--lx-font-sans);
}

.lx-auth-wrap *,
.lx-auth-wrap *::before,
.lx-auth-wrap *::after {
    box-sizing: border-box;
}

.lx-auth-wrap .lx-card {
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.55);
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
}

.lx-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.lx-brand-logo {
    height: 56px;
    width: auto;
    display: block;
    margin: 0 auto 0.875rem;
    object-fit: contain;
}

.lx-brand-name {
    font-family: var(--lx-font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lx-silver);
    line-height: 1.2;
    margin-bottom: 0.35rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.lx-brand-sub {
    font-size: 0.7rem;
    color: var(--lx-red);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.lx-alert {
    padding: 0.625rem 0.875rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
    border: 1px solid var(--lx-b1);
    background: var(--lx-graphite);
    color: var(--lx-silver);
}

.lx-alert-error,
.lx-alert-danger {
    border-color: rgba(139, 30, 45, 0.4);
    color: var(--lx-silver);
    background: rgba(139, 30, 45, 0.18);
}

.lx-alert-success,
.lx-alert-warning,
.lx-alert-info {
    border-color: var(--lx-b1);
    background: rgba(197, 201, 206, 0.06);
    color: var(--lx-silver);
}

.lx-field {
    margin-bottom: 1.125rem;
}

.lx-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--lx-silver);
    opacity: 0.7;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lx-input {
    display: block;
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1px solid var(--lx-b1);
    border-radius: 3px;
    font-size: 0.9rem;
    color: var(--lx-silver);
    background: var(--lx-graphite);
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    font-family: var(--lx-font-sans);
}

.lx-input::placeholder {
    color: var(--lx-silver);
    opacity: 0.5;
}

.lx-input:focus {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.18);
}

.lx-btn {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    background: var(--lx-red);
    color: #f5d5d9;
    border: 1px solid var(--lx-red);
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-speed);
    text-align: center;
    font-family: var(--lx-font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lx-btn:hover {
    color: #fff;
    opacity: 0.92;
}

.lx-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--lx-silver);
    opacity: 0.7;
}

.lx-footer a {
    color: var(--lx-silver);
    opacity: 1;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--lx-b2);
}

.lx-footer a:hover {
    color: #fff;
    border-bottom-color: var(--lx-silver);
}

/* ==========================================================================
   Attorney Assist / Cases
   ========================================================================== */

/* ── Mode Toggle Header ───────────────────────────────────────────────────── */
.mode-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--lx-b1);
    background: var(--lx-black);
}

.mode-toggle {
    display: flex;
    background: var(--lx-graphite);
    border-radius: 0.375rem;
    padding: 3px;
}

.mode-toggle-btn {
    padding: 0.4rem 1.2rem;
    border-radius: 0.25rem;
    color: var(--lx-silver);
    text-decoration: none;
    font-size: 0.875rem;
    font-family: var(--lx-font-sans);
    font-weight: 500;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.mode-toggle-btn:hover {
    background: var(--lx-b1);
}

body.mode-public .mode-toggle-btn {
    color: #6B7280;
}

.mode-toggle-active {
    background: var(--lx-red);
    color: #fff !important;
}

.mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-family: var(--lx-font-sans);
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--lx-b1);
    position: absolute;
    right: 1.5rem;
}

.mode-indicator-public {
    color: var(--lx-red);
    border-color: var(--lx-red);
}

.mode-indicator-attorney {
    color: var(--lx-red);
    border-color: var(--lx-red);
    background: rgba(139, 30, 45, 0.06);
}

/* ── Case Layout ──────────────────────────────────────────────────────────── */
.case-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.case-content {
    flex: 1;
    overflow-y: auto;
}

/* ── Case Tabs ────────────────────────────────────────────────────────────── */
.case-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--lx-b1);
    margin-bottom: 1.5rem;
}

.case-tabs {
    display: flex;
    gap: 2rem;
}

.case-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0;
    color: var(--lx-silver);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--lx-font-sans);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-speed);
}

.case-tab-active {
    color: #fff;
    border-bottom-color: var(--lx-red);
}

.case-tab-locked {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Step Indicators ──────────────────────────────────────────────────────── */
.case-step-indicators {
    display: flex;
    gap: 0.5rem;
}

.case-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--lx-b2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-family: var(--lx-font-sans);
    font-weight: 600;
    color: var(--lx-silver);
    opacity: 0.5;
}

.case-step-active {
    border-color: var(--lx-red);
    color: var(--lx-red);
    opacity: 1;
}

/* ── Section Header ───────────────────────────────────────────────────────── */
.case-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.case-section-title {
    font-family: var(--lx-font-serif);
}

.case-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-family: var(--lx-font-sans);
    font-weight: 600;
    margin-bottom: 1.25rem !important;
}
.case-badge-awaiting {
    background: rgba(139, 30, 45, 0.18);
    color: var(--lx-red);
}

/* ── Case Info Card ───────────────────────────────────────────────────────── */
.case-info-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
    background: var(--lx-b0);
    border-radius: 6px;
    padding: 0.9rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 0 var(--lx-b1) inset;
}

.case-info-field {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.case-info-label {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-family: var(--lx-font-sans);
    font-weight: 600;
    color: var(--lx-silver);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.25rem;
}

.case-info-value {
    font-size: 0.875rem;
    font-family: var(--lx-font-sans);
    color: var(--lx-silver);
    min-width: 0;
    overflow-wrap: break-word;
}

/* ── Upload Section ───────────────────────────────────────────────────────── */

.case-upload-subtitle {
    font-size: 0.85rem;
    color: var(--lx-silver);
    opacity: 0.6;
    margin-bottom: 1rem;
}

.case-dropzone {
    border: 2px dashed var(--lx-b2);
    border-radius: 0.5rem;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-speed), background var(--transition-speed);
    margin-bottom: 1rem;
}

.case-dropzone:hover,
.case-dropzone-active {
    border-color: var(--lx-red);
    background: rgba(139, 30, 45, 0.06);
}

.case-dropzone-icon {
    color: var(--lx-silver);
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.case-dropzone-text {
    font-size: 0.9rem;
    color: var(--lx-silver);
    opacity: 0.6;
    margin-bottom: 0.75rem;
}

.case-dropzone-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--lx-b2);
    border-radius: 0.375rem;
    color: var(--lx-silver);
    font-size: 0.875rem;
    font-family: var(--lx-font-sans);
    cursor: pointer;
    transition: background var(--transition-speed);
    margin-bottom: 0.5rem;
}

.case-dropzone-btn:hover {
    background: var(--lx-b1);
}

.case-dropzone-hint {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.4;
}

/* ── Files List ───────────────────────────────────────────────────────────── */
.case-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.case-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    color: var(--lx-silver);
}

.case-file-item.case-file-uploading {
    opacity: 0.5;
}

.case-file-item.case-file-error {
    border-color: var(--lx-red);
}

.case-file-icon {
    flex-shrink: 0;
    color: var(--lx-silver);
    opacity: 0.5;
}

.case-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-file-status {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.5;
}

.case-file-remove {
    background: none;
    border: none;
    color: var(--lx-silver);
    opacity: 0.4;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: opacity var(--transition-speed), color var(--transition-speed);
}

.case-file-remove:hover {
    opacity: 1;
    color: var(--lx-red);
}

/* ── Case Footer ──────────────────────────────────────────────────────────── */
.case-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--lx-b0);
}

.case-file-count {
    font-size: 0.85rem;
    color: var(--lx-silver);
    opacity: 0.5;
}

/* ── Case Buttons (use .btn .btn-primary / .btn .btn-secondary) ───────────── */

/* ── New Case Form ────────────────────────────────────────────────────────── */
.case-form-container {
    max-width: 560px;
}

.case-form-container .card {
    overflow: visible;
    padding: 1.5rem;
}

.case-form-title {
    font-family: var(--lx-font-serif);
}

.case-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.case-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.case-form-group[hidden] {
    display: none !important;
}

.case-form-label {
    font-size: 0.7rem;
    font-family: var(--lx-font-sans);
    font-weight: 600;
    color: var(--lx-silver);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* .case-form-input — now uses generic form controls */
.case-form-error {
    font-size: 0.8rem;
    color: var(--lx-red);
}

.case-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* ── Case Type Breadcrumb ─────────────────────────────────────────────────── */
.case-type-breadcrumb[hidden] { display: none !important; }
.case-type-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.6rem 0.9rem;
    background: #8b1e2d57;
    border: 1px solid var(--lx-b3);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-family: var(--lx-font-sans);
    color: var(--lx-silver);
    margin-bottom: 0.25rem;
}
.case-type-breadcrumb .crumb {
    color: var(--lx-white);
    font-weight: 500;
}
.case-type-breadcrumb .crumb-sep {
    color: var(--lx-b3);
    font-size: 0.75rem;
}

/* ── Chained Case Type Selector ───────────────────────────────────────────── */
.chain-row {
    margin-top: 0.5rem;
}

.chain-select:disabled,
.chain-search:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.chain-hidden {
    display: none;
}

.chain-searchable {
    position: relative;
}

.chain-search {
    width: 100%;
}

.chain-breadcrumb {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 30, 45, 0.08);
    border: 1px solid rgba(139, 30, 45, 0.20);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.85;
    letter-spacing: 0.01em;
}

/* ── Combobox (searchable select) ────────────────────────────────────────── */
.combo-wrap {
    position: relative;
}

/* Trigger — looks like a <select> */
.combo-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.combo-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.combo-trigger-text.placeholder {
    opacity: 0.45;
}

.combo-trigger-arrow {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform var(--transition-speed);
}

.combo-wrap.open .combo-trigger-arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.combo-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: var(--lx-black);
    border: 1px solid var(--lx-graphite);
    border-radius: 6px;
    z-index: 99;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.combo-dropdown[hidden] {
    display: none !important;
}

/* Search input inside dropdown */
.combo-search {
    padding: 0.5rem 0.6rem;
    border: none;
    border-bottom: 1px solid var(--lx-graphite);
    background: transparent;
    color: var(--lx-silver);
    font-size: 0.85rem;
    outline: none;
    border-radius: 6px 6px 0 0;
}

.combo-search::placeholder {
    opacity: 0.4;
}

/* Scrollable list */
.combo-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.combo-item {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--lx-silver);
    cursor: pointer;
    transition: background var(--transition-speed);
}

.combo-item:hover,
.combo-item.combo-active {
    background: var(--lx-b2);
    color: #fff;
}

.combo-item.combo-other {
    border-top: 1px solid var(--lx-graphite);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    opacity: 0.7;
}

.combo-empty {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.4;
    font-style: italic;
}

/* ── Case Status Badges (sidebar) ─────────────────────────────────────────── */
.case-status-badge {
    font-size: 0.6rem;
    font-family: var(--lx-font-sans);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.case-status-intake {
    background: rgba(139, 30, 45, 0.2);
    color: var(--lx-red);
}

.case-status-build {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.case-status-analyze {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.case-status-audit {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.case-status-output {
    background: rgba(139, 30, 45, 0.2);
    color: var(--lx-red);
}

/* ── Sidebar: Attorney Assist New Case Button ─────────────────────────────── */
.sidebar-new-case {
    background: rgba(139, 30, 45, 0.3);
    border-color: rgba(139, 30, 45, 0.5);
}

.sidebar-new-case:hover {
    background: var(--lx-red);
}

/* ── Locked Warning Banner ─────────────────────────────────────────────────── */
.case-locked-banner[hidden] {
    display: none;
}

.case-locked-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(139, 30, 45, 0.12);
    border: 1px solid rgba(139, 30, 45, 0.25);
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    animation: caseBannerSlide 0.25s ease;
}

@keyframes caseBannerSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-locked-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--lx-silver);
}

.case-locked-banner-icon {
    flex-shrink: 0;
    color: var(--lx-red);
}

/* .case-locked-banner-btn — use .btn .btn-primary .btn-sm */

/* ── Completed Intake Badge ────────────────────────────────────────────────── */
.case-badge-complete {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    margin-bottom: 1.25rem;
}

/* ── Exhibit List (read-only) ─────────────────────────────────────────────── */
.case-exhibit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.case-exhibit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--lx-silver);
}

.case-exhibit-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

.case-exhibit-pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.case-exhibit-docx {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.case-exhibit-doc {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.case-exhibit-txt {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.case-exhibit-xlsx,
.case-exhibit-xls,
.case-exhibit-csv {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.case-exhibit-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-exhibit-size {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.4;
    flex-shrink: 0;
}

/* ── Run Command Page ─────────────────────────────────────────────────────── */

/* Step circle done state */
.case-step-done {
    border-color: #22c55e;
    color: #22c55e;
    opacity: 1;
}

/* Intake complete banner */
.rc-intake-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--lx-silver);
}

.rc-intake-banner-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rc-intake-check {
    color: #22c55e;
    flex-shrink: 0;
}

.rc-intake-banner-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.rc-view-intake {
    color: var(--lx-silver);
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--lx-b2);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    transition: background var(--transition-speed);
}

.rc-view-intake:hover {
    background: var(--lx-b1);
}

/* Section container — uses .card base, just add spacing */
.rc-section {
    margin-bottom: 1.25rem;
}

/* Section header */
.rc-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--lx-b0);
}

.rc-section-desc {
    flex: 1;
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.5;
}

.rc-section-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid;
    white-space: nowrap;
}

.rc-status-complete {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.rc-status-in-progress {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.rc-status-pending {
    color: var(--lx-silver);
    opacity: 0.5;
    border-color: var(--lx-b2);
}

.rc-status-locked {
    color: var(--lx-silver);
    opacity: 0.35;
    border-color: var(--lx-b1);
}

/* Phase badges */
.rc-phase-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.rc-phase-build,
.rc-phase-analyze,
.rc-phase-audit {
    background: rgba(234, 179, 8, 0.12);
    color: #eab308;
}

/* Cards grid */
.rc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

/* Individual card */
.rc-card {
    background: var(--lx-black);
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rc-card-locked {
    opacity: 0.45;
}

.rc-card-header {
    display: flex;
    justify-content: space-between;
}


.rc-card-desc {
    font-size: 0.8rem;
    color: var(--lx-silver);
    opacity: 0.6;
    margin: 0;
}

.rc-card-files {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.4;
    margin: 0;
}

.rc-card-lock-msg {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.4;
    font-style: italic;
    margin: 0;
}

/* Status dots */
.rc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rc-dot-complete {
    background: #22c55e;
}

.rc-dot-in-progress {
    background: #3b82f6;
    animation: rc-dot-pulse 1.5s infinite;
}

.rc-dot-pending {
    background: var(--lx-silver);
    opacity: 0.3;
}

.rc-dot-locked {
    background: var(--lx-silver);
    opacity: 0.15;
}

.rc-dot-failed {
    background: var(--lx-red);
}

@keyframes rc-dot-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.rc-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Layout for inline status holder (used in phase cards) */
.rc-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Analyze Packet card ─────────────────────────────────────────────────── */
.rc-packet-card {
    border-color: rgba(196, 154, 42, 0.35);
    background: rgba(196, 154, 42, 0.04);
    margin-bottom: 0.75rem;
}

.rc-packet-card .rc-card-title {
    color: var(--lx-gold);
}

.rc-packet-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 2px;
    background: rgba(196, 154, 42, 0.15);
    color: var(--lx-gold);
    border: 1px solid rgba(196, 154, 42, 0.3);
    flex-shrink: 0;
}

.rc-packet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.rc-packet-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.rc-packet-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rc-packet-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.rc-packet-phases {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
        margin-top: 5px;
}

.rc-packet-phase-tag {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.55;
    background: rgba(197, 201, 206, 0.06);
    border: 1px solid var(--lx-b1);
    border-radius: 2px;
    padding: 1px 6px;
}

/* ── Outputs Tab ──────────────────────────────────────────────────────────── */
.outputs-group {
    margin-bottom: 1.5rem;
}

.outputs-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--lx-b1);
}

.outputs-group-count {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.outputs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.output-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--lx-graphite);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 0 var(--lx-b1) inset;
    border-radius: 0.5rem;
}

.output-item-pending {
    opacity: 0.6;
}

.output-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--lx-font-sans);
}

.output-badge-docx,
.output-badge-doc {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

.output-badge-xlsx,
.output-badge-xls {
    background: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

.output-badge-pdf {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.output-badge-txt {
    background: rgba(168, 85, 247, 0.25);
    color: #a855f7;
}

.output-badge-generic {
    background: var(--lx-b1);
    color: var(--lx-silver);
}

.output-info {
    flex: 1;
    min-width: 0;
}

.output-filename {
    font-family: var(--lx-font-sans);
    font-size: 0.875rem;
    color: var(--lx-silver);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-meta {
    font-size: 0.7rem;
    color: var(--lx-silver);
    opacity: 0.5;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Generic status pill (used by phase cards + outputs list) ────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1.4;
}

.status-pill-ready {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.status-pill-running {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.status-pill-failed {
    color: #fb8d9c;
    background: rgba(139, 30, 45, 0.15);
    border-color: rgba(139, 30, 45, 0.4);
}

.status-pill-none {
    color: var(--lx-silver);
    background: transparent;
    border-color: var(--lx-b1);
    opacity: 0.5;
}

a.status-pill:hover { opacity: 0.85; }

/* Animated three-dot loader (sits inside .status-pill-running) */
.status-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 2px;
}
.status-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: status-dot-bounce 1.2s infinite ease-in-out both;
}
.status-dots span:nth-child(1) { animation-delay: -0.32s; }
.status-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes status-dot-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Output preview page */
.output-preview {
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-top: 1rem;
    color: var(--lx-silver);
    font-family: var(--lx-font-sans);
    line-height: 1.7;
    max-width: 900px;
}

.output-preview h1,
.output-preview h2,
.output-preview h3,
.output-preview h4 {
    color: var(--lx-silver);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.output-preview h1 {
    font-size: 1.5rem;
}

.output-preview h2 {
    font-size: 1.25rem;
}

.output-preview h3 {
    font-size: 1.1rem;
}

.output-preview p {
    margin: 0.5rem 0;
}

.output-preview ul,
.output-preview ol {
    padding-left: 1.5rem;
}

.output-preview li {
    margin: 0.25rem 0;
}

.output-preview strong {
    color: #fff;
}

.output-preview table {
    border-collapse: collapse;
    margin: 1rem 0;
    width: 100%;
}

.output-preview th,
.output-preview td {
    border: 1px solid var(--lx-b1);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.output-preview th {
    background: var(--lx-b0);
    font-weight: 600;
}

/* Full system execute bar */
.rc-execute-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.rc-execute-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rc-execute-icon {
    font-size: 1.5rem;
}

.rc-execute-title {
    font-family: var(--lx-font-serif);
    color: var(--lx-silver);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rc-execute-desc {
    font-size: 0.75rem;
    color: var(--lx-silver);
    opacity: 0.5;
    margin: 0.2rem 0 0;
}

/* .rc-execute-btn — use .btn .btn-primary */

/* ── Case Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .case-content {
        padding: 1.25rem;
    }

    .case-info-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .case-tabs-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .case-form-container {
        margin: 1rem auto;
    }
}

/* ==========================================================================
   PUBLIC MODE — Light Theme Override
   ========================================================================== */
body.mode-public .sidebar {
    background: #fff;
    box-shadow: 1px 0 0 #E2E5E9, 4px 0 16px rgba(0, 0, 0, 0.06);
}

body.mode-public .sidebar-header {
    background: #fff;
    border-bottom-color: #E2E5E9;
}

body.mode-public .sidebar-logo-text {
    color: #1A1D23;
}

body.mode-public .sidebar-toggle .toggle-icon {
    color: #6B7280;
}

body.mode-public .sidebar-nav {
    background: #fff;
}

body.mode-public .sidebar-new-chat {
    background: var(--lx-red);
    border-color: var(--lx-red);
    color: #fff;
}

body.mode-public .sidebar-new-chat:hover {
    background: #6E1724;
}

body.mode-public .sidebar-divider {
    border-color: #E2E5E9;
}

body.mode-public .sidebar-section-title {
    color: #9CA3AF;
}

body.mode-public .sidebar-conv-link {
    color: #374151;
}

body.mode-public .sidebar-conv-item:hover {
    background: #F5F6F8;
}

body.mode-public .sidebar-conv-item.active {
    background: rgba(139, 30, 45, 0.08) !important;
    border-left-color: var(--lx-red) !important;
}

body.mode-public .sidebar-conv-item.active .sidebar-conv-link {
    color: var(--lx-red);
}

body.mode-public .sidebar-footer {
    background: #fff;
    border-top-color: #E2E5E9;
}

body.mode-public .sidebar-masquerade,
body.mode-public .sidebar-masquerade a {
    color: #000;
}

body.mode-public .sidebar-user-email {
    color: #374151;
}

body.mode-public .sidebar-avatar {
    background: var(--lx-red);
    color: #fff;
}

body.mode-public .sidebar-menu-btn {
    color: #9CA3AF;
}

body.mode-public .sidebar-nav-item {
    color: #374151;
}

body.mode-public .sidebar-nav-item .sidebar-icon {
    color: #6B7280;
}

body.mode-public .sidebar-nav-item:hover {
    background: #F5F6F8;
}

body.mode-public .sidebar-rename-input {
    background: #F5F6F8;
    color: #1A1D23;
    border-color: #E2E5E9;
}

body.mode-public .sidebar-empty-text {
    color: #9CA3AF;
}

body.mode-public .main-content {
    background: #F5F6F8;
    color: #1A1D23;
}

body.mode-public .mode-header {
    background: #fff;
    border-bottom: 1px solid #E2E5E9;
}

body.mode-public .mode-toggle {
    background: #ECEEF1;
}

body.mode-public .mode-toggle-btn:hover {
    background: #D8DBE0;
}

/* Chat area */
body.mode-public .chat-layout {
    background: #F5F6F8;
}

body.mode-public .chat-messages {
    background: #F5F6F8;
}

body.mode-public .chat-empty-state {
    color: #6B7280;
}

/* User bubble */
body.mode-public .chat-bubble-user {
    background: var(--lx-red);
    color: #fff;
    border: none;
}

body.mode-public .chat-bubble-user .chat-message-text {
    color: #fff;
}

body.mode-public .chat-bubble-user .attachment-chip {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Assistant bubble */
body.mode-public .chat-bubble-assistant {
    background: #fff;
    border: 1px solid #E2E5E9;
    color: #1A1D23;
}

body.mode-public .chat-bubble-assistant .prose {
    color: #1A1D23;
}

body.mode-public .citations-bar {
    border-top-color: #E2E5E9;
}

body.mode-public .citations-label {
    color: #6B7280;
}

body.mode-public .citation-tag {
    background: rgba(139, 30, 45, 0.1);
    color: var(--lx-red);
}

/* Input area */
body.mode-public .chat-input-area {
    background: #fff;
    border-top: 1px solid #E2E5E9;
}

body.mode-public .chat-input {
    background: #F5F6F8;
    color: #1A1D23;
    border: 1px solid #E2E5E9;
}

body.mode-public .chat-input::placeholder {
    color: #9CA3AF;
}

body.mode-public .chat-input:focus {
    border-color: var(--lx-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.15);
}

body.mode-public .chat-attach-btn {
    color: #6B7280;
}

body.mode-public .chat-attach-btn:hover {
    color: var(--lx-red);
}

body.mode-public .chat-disclaimer {
    color: #9CA3AF;
}

/* File chips */
body.mode-public .upload-chip {
    background: #F0F1F3;
    border-color: #E2E5E9;
    color: #374151;
}

body.mode-public .upload-chip.failed {
    color: var(--lx-red);
}

/* Typing indicator */
body.mode-public .typing-dot {
    background-color: #9CA3AF;
}

body.mode-public .thinking-status {
    color: #6B7280;
}

/* Chat header (mobile) */
body.mode-public .chat-header {
    background: #fff;
    border-bottom-color: #E2E5E9;
    color: #1A1D23;
}

body.mode-public .chat-title {
    color: #1A1D23;
}

body.mode-public .mobile-menu-btn {
    color: #6B7280;
}

/* Streaming */
body.mode-public #streaming-response .chat-bubble-assistant {
    background: #fff;
    border: 1px solid #E2E5E9;
    color: #1A1D23;
}

body.mode-public #streaming-response .prose {
    color: #1A1D23;
}
/* ══════════════════════════════════════════════════
/* ══════════════════════════════════════════════════
   ACCOUNT / PROFILE PAGE
══════════════════════════════════════════════════ */
.acct-flash {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.acct-flash-ok  { background: rgba(197,201,206,0.08); color: var(--lx-silver); }
.acct-flash-err { background: rgba(139,30,45,0.18); color: #e05070; }

.acct-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


.acct-mode-badge {
    padding: 0.2rem 0.625rem;
    border-radius: 2rem;
    border: 1px solid var(--lx-b2);
    font-size: 0.73rem;
    font-weight: 500;
    color: rgba(197,201,206,0.6);
    margin-bottom: 1.25rem;
}

/* ── Tab Switcher ─────────────────────────────── */
.acct-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--lx-b1);
    margin-bottom: 1.5rem;
}

.acct-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: rgba(197,201,206,0.5);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-speed);
}

.acct-tab:hover { color: var(--lx-silver); }

.acct-tab.active {
    color: var(--lx-silver);
    border-bottom-color: var(--lx-red);
}

/* ── Two-column layout ────────────────────────────── */
.acct-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
    align-items: start;
}

.acct-col {
    display: flex;
    flex-direction: column;
}

@media (max-width: 860px) {
    .acct-sections-grid {
        grid-template-columns: 1fr;
    }
}

.acct-tab svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Sections ─────────────────────────────────── */
.acct-section {
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.acct-sec-head {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.acct-sec-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: rgba(139,30,45,0.15);
    border: 1px solid rgba(139,30,45,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--lx-red);
}
.acct-sec-icon svg { width: 24px; height: 24px; }


.acct-sec-desc {
    font-size: 0.78rem;
    color: rgba(197,201,206,0.45);
    margin: 0;
}

.acct-sec-badge {
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(139,30,45,0.18);
    border: 1px solid rgba(139,30,45,0.4);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e05070;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Fields Grid ──────────────────────────────── */
.acct-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.acct-field { display: flex; flex-direction: column; gap: 0.375rem; }
.acct-field-full { grid-column: 1 / -1; }

.acct-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(197,201,206,0.5);
}

.acct-req { color: var(--lx-red); }
.acct-textarea { min-height: 96px; resize: vertical; font-family: var(--lx-font-sans); }

/* ── Signature Drop Zone ──────────────────────── */
.acct-sig-drop {
    border: 1px dashed var(--lx-b2);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: var(--lx-b0);
    transition: border-color var(--transition-speed), background var(--transition-speed);
}
.acct-sig-drop:hover,
.acct-sig-drop-active { border-color: rgba(197,201,206,0.4); background: rgba(197,201,206,0.04); }
.acct-sig-drop svg { width: 24px; height: 24px; color: rgba(197,201,206,0.35); }
.acct-sig-drop-text { font-size: 0.84rem; color: rgba(197,201,206,0.5); }
.acct-sig-browse { color: var(--lx-red); text-decoration: underline; }
.acct-sig-hint { font-size: 0.73rem; color: rgba(197,201,206,0.3); }

.acct-sig-preview {
    border: 1px solid var(--lx-b1);
    border-radius: 0.5rem;
    padding: 1.25rem;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lx-b0);
    position: relative;
}
.acct-sig-empty { font-size: 0.8rem; color: rgba(197,201,206,0.28); font-style: italic; }

.acct-sig-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(139,30,45,0.2);
    border: 1px solid rgba(139,30,45,0.4);
    color: #e05070;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
}
.acct-sig-preview.has-image .acct-sig-remove { display: block; }

/* ── Toggle Switch ────────────────────────────── */
.acct-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--lx-b1);
    background: rgba(197,201,206,0.04);
}
.acct-toggle-text .acct-toggle-lbl {
    font-size: 0.875rem; font-weight: 500; color: var(--lx-silver); display: block;
}
.acct-toggle-text .acct-toggle-sub {
    font-size: 0.75rem; color: rgba(197,201,206,0.45); display: block; margin-top: 0.125rem;
}
.acct-toggle {
    position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.acct-toggle input { opacity: 0; width: 0; height: 0; }
.acct-track {
    position: absolute; cursor: pointer; inset: 0; border-radius: 24px;
    background: rgba(197,201,206,0.18); transition: background 0.2s;
}
.acct-track::before {
    content: ''; position: absolute; height: 18px; width: 18px;
    left: 3px; bottom: 3px; border-radius: 50%; background: #fff; transition: transform 0.2s;
}
.acct-toggle input:checked + .acct-track { background: var(--lx-red); }
.acct-toggle input:checked + .acct-track::before { transform: translateX(20px); }

/* ── Verification ─────────────────────────────── */
.acct-verify-list { display: flex; flex-direction: column; gap: 0.75rem; }
.acct-verify-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.875rem 1rem; border-radius: 0.5rem;
    border: 1px solid var(--lx-b1); background: rgba(197,201,206,0.04);
}
.acct-verify-name { font-size: 0.875rem; font-weight: 500; color: var(--lx-silver); display: block; }
.acct-verify-desc { font-size: 0.75rem; color: rgba(197,201,206,0.45); display: block; margin-top: 0.125rem; }
.acct-pending-badge {
    padding: 0.2rem 0.5rem; border-radius: 0.25rem;
    background: rgba(196,154,42,0.12); border: 1px solid rgba(196,154,42,0.35);
    font-size: 0.63rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--lx-gold); flex-shrink: 0;
}
.acct-terms-row { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.acct-terms-txt { font-size: 0.78rem; color: rgba(197,201,206,0.55); white-space: nowrap; }

/* ── Plan / Usage ─────────────────────────────── */
.acct-plan-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.875rem 1rem; border-radius: 0.5rem;
    border: 1px solid var(--lx-b1); background: rgba(197,201,206,0.04);
}
.acct-plan-left { display: flex; align-items: center; gap: 0.75rem; }
.acct-plan-label { font-size: 0.78rem; color: rgba(197,201,206,0.5); }
.acct-plan-chip {
    padding: 0.2rem 0.625rem; border-radius: 2rem;
    background: rgba(139,30,45,0.15); border: 1px solid rgba(139,30,45,0.3);
    font-size: 0.73rem; font-weight: 600; color: #e05070;
}
.acct-usage-card {
    padding: 0.875rem 1rem; border-radius: 0.5rem;
    border: 1px solid var(--lx-b1); background: rgba(197,201,206,0.04);
}
.acct-usage-top { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.acct-usage-lbl { font-size: 0.78rem; font-weight: 500; color: var(--lx-silver); }
.acct-usage-val { font-size: 0.75rem; color: rgba(197,201,206,0.55); }
.acct-usage-bar {
    height: 4px; background: rgba(197,201,206,0.12);
    border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem;
}
.acct-usage-fill { height: 100%; background: var(--lx-red); border-radius: 4px; max-width: 100%; }
.acct-usage-note { font-size: 0.73rem; color: rgba(197,201,206,0.4); }

/* ── Footer ───────────────────────────────────── */
.acct-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--lx-b1); margin-bottom: 1.5rem;
}

/* ── Public mode overrides ────────────────────── */
body.mode-public .acct-section { background: #f9fafb; border-color: #e5e7eb; }
body.mode-public .acct-tabs { border-bottom-color: #e5e7eb; }
body.mode-public .acct-toggle-row,
body.mode-public .acct-verify-item,
body.mode-public .acct-plan-card,
body.mode-public .acct-usage-card { background: #fff; border-color: #e5e7eb; }
body.mode-public .acct-sig-drop,
body.mode-public .acct-sig-preview { background: #f3f4f6; border-color: #d1d5db; }
body.mode-public .acct-footer { border-top-color: #e5e7eb; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .acct-fields { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════
   SHARED TITLE TOKENS — single source of truth
   Override any prior per-class font values here
══════════════════════════════════════════════════ */

/* Page-level titles (h1/h2 — top of a page or major section) */
.sub-title,
.acct-title,
.case-form-title,
.case-section-title,
.plans-page-title {
    font-size: 1.5rem    !important;
    font-weight: 700      !important;
    margin-bottom: 1.25rem !important;
}

/* Card / section titles (inside cards, panels, rows) */
.account-section-title,
.acct-sec-title,
.phase-prompt-card-title,
.rc-card-title,
.case-upload-title {
    font-size: 0.9375rem !important;
    margin-bottom: 0 !important;
}

.acct-sec-title, .rc-card-title{
    margin-bottom: 0 !important;
}

/* Heading scale — !important beats Tailwind CDN runtime injection */
h1 { font-size: 1.25rem   !important; font-weight: 700 !important; margin-bottom: 1rem    !important; }
h2 { font-size: 1.0625rem !important; font-weight: 700 !important; margin-bottom: 0.875rem !important; }
h3 { font-size: 0.9375rem !important; font-weight: 600 !important; margin-bottom: 0.75rem  !important; }
h4 { font-size: 0.875rem  !important; font-weight: 600 !important; margin-bottom: 0.5rem   !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ── Manage Subscription — plan cards ─────────────────────────────────────── */
.mp-sprites { display: none; }

.mp-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 1.5rem;
}
@media (max-width: 720px) { .mp-plans-grid { grid-template-columns: 1fr; } }

.mp-card {
    background: var(--lx-graphite);
    border: 1px solid var(--lx-b1);
    border-radius: 14px;
    padding: 2rem 1.6rem 1.6rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.18s, box-shadow 0.18s;
}
.mp-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.mp-card.mp-current {
    border: 2px solid var(--lx-red);
    box-shadow: 0 8px 32px rgba(139,30,45,0.25);
}
.mp-card.mp-current:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(139,30,45,0.35); }

.mp-curr-pill {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lx-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 100px;
    white-space: nowrap;
}

.mp-ctier { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lx-red); margin-bottom: 10px; }
.mp-cname { font-size: 22px; font-weight: 700; color: var(--lx-silver); letter-spacing: -0.01em; margin-bottom: 3px; }
.mp-cdesc { font-size: 12px; color: var(--lx-silver); opacity: 0.7; margin-bottom: 1.4rem; }

.mp-price {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--lx-b1);
}
.mp-psym { font-size: 17px; font-weight: 600; color: var(--lx-silver); padding-top: 7px; }
.mp-pnum { font-size: 48px; font-weight: 700; color: var(--lx-silver); line-height: 1; letter-spacing: -0.03em; }
.mp-pright { padding-top: 14px; margin-left: 4px; }
.mp-pper  { font-size: 11px; color: var(--lx-silver); opacity: 0.6; line-height: 1.35; }

.mp-flist { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 10px; margin: 0 0 1.6rem; padding: 0; }
.mp-fi { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--lx-silver); }
.mp-fi.mp-no { opacity: 0.4; }
.mp-ic { width: 18px; height: 18px; flex-shrink: 0; }

.mp-cta {
    display: block;
    padding: 13px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--lx-red);
    transition: all 0.18s;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.mp-cta-primary   { background: var(--lx-red); color: #f5d5d9; }
.mp-cta-primary:hover { color: #fff; opacity: 0.92; }
.mp-cta-active    { background: transparent; color: var(--lx-silver); border-color: var(--lx-b1); cursor: default; opacity: 0.8; }
.mp-cta-cancel    { background: transparent; color: #f87171; border-color: rgba(248,113,113,0.4); }
.mp-cta-cancel:hover { background: rgba(248,113,113,0.08); }
.mp-cta-secondary { background: transparent; color: var(--lx-silver); border-color: var(--lx-b1); }
.mp-cta-secondary:hover { border-color: var(--lx-red); color: var(--lx-silver); }
.mp-cta-disabled  { background: transparent; color: var(--lx-silver); border-color: var(--lx-b1); opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* --- Sidebar Usage Bar --- */
.sidebar-usage {
    padding: 10px 14px 8px;
    border-top: 1px solid var(--lx-b1);
    margin-bottom: 2px;
}
.sidebar-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.sidebar-usage-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lx-silver);
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-usage-value {
    font-size: 10px;
    color: var(--lx-silver);
    opacity: 0.65;
    white-space: nowrap;
    margin-left: 6px;
    flex-shrink: 0;
}
.sidebar-usage-track {
    height: 4px;
    background: var(--lx-b1);
    border-radius: 2px;
    overflow: hidden;
}
.sidebar-usage-fill {
    height: 100%;
    background: var(--lx-red);
    border-radius: 2px;
    transition: width 0.3s ease;
    min-width: 2px;
}
.sidebar-usage-warn  { background: #C49A2A; }
.sidebar-usage-danger { background: #dc2626; }

/* Collapsed sidebar: hide usage text, keep bar */
.sidebar-collapsed .sidebar-usage-header { display: none; }
.sidebar-collapsed .sidebar-usage { padding: 8px 10px 6px; }
