/* LexStudy complete update v1.0 — categories, theme and responsive layer */
:root {
    --lex-safe-top: env(safe-area-inset-top, 0px);
    --lex-safe-right: env(safe-area-inset-right, 0px);
    --lex-safe-bottom: env(safe-area-inset-bottom, 0px);
    --lex-safe-left: env(safe-area-inset-left, 0px);
}
html { min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
button, a, input, select, textarea, summary { touch-action: manipulation; }

/* The left sidebar must show each study category and let it collapse. */
.study-library-enhanced #addCategoryButton { display: inline-grid !important; }
.study-library-enhanced #categoryTree .category-header { display: flex !important; }
.study-library-enhanced #categoryTree .category-archive-section,
.study-library-enhanced #categoryTree .uncategorized-label { display: block !important; }
.study-library-enhanced #categoryTree .category-group { display: block !important; }
.study-library-enhanced #categoryTree .category-items { display: flex !important; }
.study-library-enhanced #categoryTree .category-group.collapsed .category-items { display: none !important; }
.study-library-enhanced #categoryTree .category-group .empty-small { display: block !important; }
.category-header[aria-expanded="false"] .category-chevron { transform: rotate(-90deg); }

.bookmark-category-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.bookmark-quick-category { margin-top: -5px; padding: 11px; display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 9px; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.bookmark-quick-category[hidden] { display: none !important; }
.bookmark-quick-category > div { display: flex; gap: 7px; }

/* Shared theme control; no global observer or dynamic code injection. */
.lex-theme-control { position: relative; flex: 0 0 auto; color: var(--text, #182033); }
.lex-theme-control details { position: relative; }
.lex-theme-control summary { list-style: none; }
.lex-theme-control summary::-webkit-details-marker { display: none; }
.lex-theme-trigger { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line, #dfe3ed); border-radius: 9px; background: var(--surface, #fff); color: var(--text, #182033); cursor: pointer; font: inherit; font-weight: 750; white-space: nowrap; }
.lex-theme-panel { position: absolute; z-index: 2147483600; top: calc(100% + 7px); right: 0; width: min(280px, calc(100vw - 20px)); display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line, #dfe3ed); border-radius: 12px; background: var(--surface, #fff); color: var(--text, #182033); box-shadow: 0 20px 58px rgba(7, 14, 30, .24); }
.lex-theme-panel label { display: grid; gap: 5px; font-size: .76rem; font-weight: 700; }
.lex-theme-panel select { min-height: 39px; width: 100%; border: 1px solid var(--line, #dfe3ed); border-radius: 8px; background: var(--surface, #fff); color: var(--text, #182033); padding: 7px; }
.lex-theme-panel button { min-height: 39px; border: 0; border-radius: 8px; background: var(--accent, #315cff); color: #fff; font-weight: 800; cursor: pointer; }
.lex-theme-panel small { min-height: 1em; color: var(--muted, #687086); }

/* Wetsedities uses its own palette. Route all formerly hard-coded light
   surfaces through variables so page-only and global themes are complete. */
body.lh2-page {
    --lh2-soft:#f8f9fc;
    --lh2-subtle:#fafbfc;
    --lh2-blue-soft:#f3f6ff;
    --lh2-blue-line:#cdd8f2;
    --lh2-blue-text:#52648f;
    --lh2-neutral:#eef1f5;
    --lh2-line-soft:#e8ecf2;
    --lh2-state-bg:rgba(255,255,255,.55);
    --lh2-diff-text:#283346;
}
html[data-theme="dark"] body.lh2-page {
    --lh2-bg:#0d111b;
    --lh2-panel:#151b28;
    --lh2-border:#2b3446;
    --lh2-text:#f2f4fa;
    --lh2-muted:#a8b0c2;
    --lh2-green:#5de2b6;
    --lh2-green-bg:#12382d;
    --lh2-red:#ff8a99;
    --lh2-red-bg:#3b2028;
    --lh2-orange:#ffc16a;
    --lh2-orange-bg:#3a2a18;
    --lh2-soft:#1b2231;
    --lh2-subtle:#111722;
    --lh2-blue-soft:#17233f;
    --lh2-blue-line:#344567;
    --lh2-blue-text:#b8c6ec;
    --lh2-neutral:#242c3d;
    --lh2-line-soft:#2b3446;
    --lh2-state-bg:rgba(21,27,40,.72);
    --lh2-diff-text:#e4e8f1;
    color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body.lh2-page {
        --lh2-bg:#0d111b;
        --lh2-panel:#151b28;
        --lh2-border:#2b3446;
        --lh2-text:#f2f4fa;
        --lh2-muted:#a8b0c2;
        --lh2-green:#5de2b6;
        --lh2-green-bg:#12382d;
        --lh2-red:#ff8a99;
        --lh2-red-bg:#3b2028;
        --lh2-orange:#ffc16a;
        --lh2-orange-bg:#3a2a18;
        --lh2-soft:#1b2231;
        --lh2-subtle:#111722;
        --lh2-blue-soft:#17233f;
        --lh2-blue-line:#344567;
        --lh2-blue-text:#b8c6ec;
        --lh2-neutral:#242c3d;
        --lh2-line-soft:#2b3446;
        --lh2-state-bg:rgba(21,27,40,.72);
        --lh2-diff-text:#e4e8f1;
        color-scheme:dark;
    }
}
.lh2-header,
.lh2-composer,
.lh2-button.secondary,
.lh2-search-row input,
.lh2-edition-select select,
.lh2-article-controls input,
.lh2-search-results,
.lh2-search-result,
.lh2-selected-law button,
.lh2-scope-tabs button.is-active,
.lh2-results,
.lh2-history,
.lh2-diff-pane,
.lh2-timeline-item { background:var(--lh2-panel) !important; color:var(--lh2-text); border-color:var(--lh2-border) !important; }
.lh2-button.secondary:hover:not(:disabled),
.lh2-search-result:hover,
.lh2-article-item:hover,
.lh2-article-item.is-active { background:var(--lh2-soft) !important; }
.lh2-selected-law,
.lh2-locked-law,
.lh2-history-verdict { background:var(--lh2-blue-soft) !important; border-color:var(--lh2-blue-line) !important; }
.lh2-selected-law span,
.lh2-locked-law span { color:var(--lh2-blue-text); }
.lh2-edition-meta,
.lh2-link-lock,
.lh2-result-summary,
.lh2-diff-pane > header { background:var(--lh2-soft) !important; }
.lh2-scope,
.lh2-article-list { background:var(--lh2-subtle) !important; }
.lh2-scope-tabs,
.lh2-status,
.lh2-summary-chip,
.lh2-history-progress > div { background:var(--lh2-neutral); }
.lh2-state { background:var(--lh2-state-bg) !important; border-color:var(--lh2-border) !important; }
.lh2-action-row,
.lh2-search-result,
.lh2-article-item { border-color:var(--lh2-line-soft) !important; }
.lh2-diff-text { color:var(--lh2-diff-text); }
.lh2-history-timeline::before { background:var(--lh2-line-soft); }
.lh2-timeline-item::before { border-color:var(--lh2-panel); }
.lh2-official-badge { background:var(--lh2-blue-soft); color:var(--lh2-blue-text); }

/* Legal analysis theme is scoped to its overlay when page-only is chosen. */
.lsb-root[data-lex-theme="light"] {
    --lsb-bg:#f3f5f9; --lsb-panel:#fff; --lsb-border:#dbe1eb; --lsb-text:#172033; --lsb-muted:#667085; --lsb-danger:#b42318; --lsb-shadow:0 24px 80px rgba(20,33,58,.18);
    --surface:#fff; --surface-2:#f8f9fc; --text:#172033; --muted:#667085; --line:#dbe1eb;
    color-scheme:light;
}
.lsb-root[data-lex-theme="dark"] {
    --lsb-bg:#0d111b; --lsb-panel:#151b28; --lsb-border:#2b3446; --lsb-text:#f2f4fa; --lsb-muted:#a8b0c2; --lsb-danger:#ff8a99; --lsb-shadow:0 24px 80px rgba(0,0,0,.48);
    --surface:#151b28; --surface-2:#1b2231; --text:#f2f4fa; --muted:#a8b0c2; --line:#2b3446;
    color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
    .lsb-root[data-lex-theme="system"] {
        --lsb-bg:#0d111b; --lsb-panel:#151b28; --lsb-border:#2b3446; --lsb-text:#f2f4fa; --lsb-muted:#a8b0c2; --lsb-danger:#ff8a99; --lsb-shadow:0 24px 80px rgba(0,0,0,.48);
        --surface:#151b28; --surface-2:#1b2231; --text:#f2f4fa; --muted:#a8b0c2; --line:#2b3446;
        color-scheme:dark;
    }
}

.app-shell, .editor-page, .editor-shell, .lh2-app,
.login-page, .billing-page, .support-page { min-height:100vh; min-height:100dvh; }
.login-page, .billing-page, .support-page {
    padding-left:var(--lex-safe-left);
    padding-right:var(--lex-safe-right);
}
.login-shell { min-height:100vh; min-height:100dvh; }
.billing-shell, .legal-shell, .support-app { padding-bottom:calc(60px + var(--lex-safe-bottom)); }
.toast-region { right: max(14px, var(--lex-safe-right)); bottom: max(14px, var(--lex-safe-bottom)); }

@media (hover: none), (pointer: coarse) {
    button, .button, .sidebar-action, .article-action, .lh2-button, .lsb-button, .lsb-icon-button, .lsb-view-button, .lex-theme-trigger { min-height: 44px; }
    .mini-button { min-width: 38px; min-height: 38px; }
}

/* Tablets and phones. */
@media (max-width: 900px) {
    input, textarea, select { font-size: 16px !important; }
    .sidebar { height: 100vh; height: 100dvh; padding-top: var(--lex-safe-top); padding-bottom: var(--lex-safe-bottom); overscroll-behavior: contain; }
    .notes-panel { height: 100vh; height: 100dvh; padding-top: var(--lex-safe-top); padding-bottom: var(--lex-safe-bottom); }
    .topbar { padding-top: calc(11px + var(--lex-safe-top)); padding-left: max(13px, var(--lex-safe-left)); padding-right: max(13px, var(--lex-safe-right)); }
    .topbar-actions { min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .topbar-actions::-webkit-scrollbar { display:none; }
    .article-list { padding-bottom: calc(82px + var(--lex-safe-bottom)); }
    dialog.modal { width: calc(100vw - 16px); max-height: calc(100dvh - var(--lex-safe-top) - var(--lex-safe-bottom) - 16px); margin: auto; }
    dialog.modal form { max-height: inherit; overflow-y: auto; padding-bottom: calc(16px + var(--lex-safe-bottom)); }
    .study-library-drawer { height: 100vh; height: 100dvh; padding-bottom: var(--lex-safe-bottom); }
    .study-library-body { min-height: 0; }

    .editor-topbar { padding-top: calc(10px + var(--lex-safe-top)); padding-left: max(12px, var(--lex-safe-left)); padding-right: max(12px, var(--lex-safe-right)); }
    .editor-actions { width: 100%; flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 3px; scrollbar-width:none; }
    .editor-actions::-webkit-scrollbar, .editor-toolbar::-webkit-scrollbar { display:none; }
    .editor-actions > *, .editor-toolbar > * { flex: 0 0 auto; }
    .editor-toolbar { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width:none; }
    .editor-workspace { min-height: calc(100dvh - 175px); }
    .rich-text-editor { min-height: calc(100dvh - 205px); font-size:16px; }
    .article-tooltip { position:fixed !important; inset:auto 8px calc(8px + var(--lex-safe-bottom)) 8px !important; width:auto !important; max-width:none !important; max-height:min(62dvh,560px); overflow-y:auto; border-radius:16px; }
    .editor-modal-panel, .lex-citation-dialog, .document-check-dialog { width:calc(100vw - 16px) !important; max-width:none !important; max-height:calc(100dvh - var(--lex-safe-top) - var(--lex-safe-bottom) - 16px) !important; overflow-y:auto !important; }

    .lh2-header { padding-top: calc(10px + var(--lex-safe-top)); padding-left:max(12px,var(--lex-safe-left)); padding-right:max(12px,var(--lex-safe-right)); align-items:stretch; flex-direction:column; gap:9px; }
    .lh2-header-actions { width:100%; overflow-x:auto; scrollbar-width:none; }
    .lh2-header-actions::-webkit-scrollbar { display:none; }
    .lh2-header-actions > * { flex:0 0 auto; }
    .lh2-intro, .lh2-composer, .lh2-results, .lh2-history { padding-left:max(12px,var(--lex-safe-left)); padding-right:max(12px,var(--lex-safe-right)); }
    .lh2-columns { grid-template-columns:minmax(0,1fr) !important; }
    .lh2-action-row, .lh2-search-row { align-items:stretch; flex-direction:column; }
    .lh2-diff-table-wrap, .lh2-comparison-table { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

    .lsb-shell { inset:var(--lex-safe-top) var(--lex-safe-right) var(--lex-safe-bottom) var(--lex-safe-left); width:auto; height:auto; max-height:none; border:0; border-radius:0; }
    .lsb-topbar { min-height:0; align-items:stretch; flex-direction:column; gap:8px; padding:9px 10px; }
    .lsb-top-actions, .lsb-document-actions, .lsb-view-switch { width:100%; overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; }
    .lsb-top-actions::-webkit-scrollbar, .lsb-document-actions::-webkit-scrollbar, .lsb-view-switch::-webkit-scrollbar { display:none; }
    .lsb-top-actions > *, .lsb-document-actions > *, .lsb-view-switch > * { flex:0 0 auto; }
    .lsb-document-toolbar { position:sticky; top:0; z-index:15; grid-template-columns:minmax(0,1fr); align-items:stretch; padding:8px; }
    .lsb-module-palette { max-height:190px; overflow-x:auto; overflow-y:hidden; }
    .lsb-module-list { width:max-content; min-width:100%; display:flex !important; flex-wrap:nowrap; }
    .lsb-module-palette-item { width:min(250px,76vw); flex:0 0 auto; }
    .lsb-canvas { padding:10px; overflow:auto; -webkit-overflow-scrolling:touch; }
    .lsb-modal-panel { width:calc(100vw - 16px) !important; max-width:none !important; max-height:calc(100dvh - var(--lex-safe-top) - var(--lex-safe-bottom) - 16px); overflow-y:auto; }

    .lex-theme-panel { position:fixed; top:auto; left:max(8px,var(--lex-safe-left)); right:max(8px,var(--lex-safe-right)); bottom:calc(8px + var(--lex-safe-bottom)); width:auto; }
    .bookmark-quick-category { grid-template-columns:minmax(0,1fr) 86px; }
    .bookmark-quick-category > div { grid-column:1 / -1; justify-content:flex-end; }
}

@media (max-width: 600px) {
    .bookmark-category-picker { grid-template-columns:1fr; }
    .bookmark-category-picker .button { width:100%; }
    .study-library-content-header { align-items:stretch; }
    .study-library-folder-actions { overflow-x:auto; flex-wrap:nowrap; }
    .study-library-folder-actions > * { flex:0 0 auto; }
    .editor-topbar { align-items:flex-start; flex-direction:column; gap:9px; }
    .editor-info { grid-template-columns:1fr !important; }
    .editor-help { display:none; }
    .rich-text-editor { width:calc(100% - 12px); margin-inline:auto; padding:28px clamp(16px,6vw,34px); box-shadow:none; }
    .law-heading h1 { font-size:clamp(1.25rem,7vw,1.8rem); }
}

@supports (-webkit-touch-callout: none) {
    body, .sidebar, .notes-panel { min-height:-webkit-fill-available; }
}


/* LexStudy theme + Book 7A repair v1.0.1 */

/* The legal-analysis overlay still contains legacy hard-coded light surfaces.
   These tokens map the complete workspace to the selected scoped theme. */
.lsb-root {
    --lsb-surface: #ffffff;
    --lsb-surface-2: #f8f9fc;
    --lsb-surface-3: #eef2f8;
    --lsb-hover: #eef2f8;
    --lsb-dropzone: rgba(255, 255, 255, .58);
    --lsb-neutral-text: #344054;
    --lsb-preview: #ffffff;
    --lsb-preview-text: #1d2939;
    --lsb-depth-line: #d9e0ea;
    --lsb-scroll-track: #edf1f7;
    --lsb-scroll-thumb: #a8b6cb;
    --lsb-scroll-thumb-hover: #7f91ad;
    --lsb-scroll-thumb-active: #647895;
}

.lsb-root[data-lex-theme="dark"],
html[data-theme="dark"] .lsb-root:not([data-lex-theme]) {
    --lsb-surface: #151b28;
    --lsb-surface-2: #111722;
    --lsb-surface-3: #20293a;
    --lsb-hover: #20293a;
    --lsb-dropzone: rgba(21, 27, 40, .76);
    --lsb-neutral-text: #c7cfdd;
    --lsb-preview: #151b28;
    --lsb-preview-text: #f2f4fa;
    --lsb-depth-line: #3a465b;
    --lsb-scroll-track: #111722;
    --lsb-scroll-thumb: #55627a;
    --lsb-scroll-thumb-hover: #6c7a94;
    --lsb-scroll-thumb-active: #8290aa;
}

@media (prefers-color-scheme: dark) {
    .lsb-root[data-lex-theme="system"],
    html[data-theme="system"] .lsb-root:not([data-lex-theme]) {
        --lsb-bg: #0d111b;
        --lsb-panel: #151b28;
        --lsb-border: #2b3446;
        --lsb-text: #f2f4fa;
        --lsb-muted: #a8b0c2;
        --lsb-danger: #ff8a99;
        --lsb-shadow: 0 24px 80px rgba(0, 0, 0, .48);
        --surface: #151b28;
        --surface-2: #1b2231;
        --text: #f2f4fa;
        --muted: #a8b0c2;
        --line: #2b3446;
        --lsb-surface: #151b28;
        --lsb-surface-2: #111722;
        --lsb-surface-3: #20293a;
        --lsb-hover: #20293a;
        --lsb-dropzone: rgba(21, 27, 40, .76);
        --lsb-neutral-text: #c7cfdd;
        --lsb-preview: #151b28;
        --lsb-preview-text: #f2f4fa;
        --lsb-depth-line: #3a465b;
        --lsb-scroll-track: #111722;
        --lsb-scroll-thumb: #55627a;
        --lsb-scroll-thumb-hover: #6c7a94;
        --lsb-scroll-thumb-active: #8290aa;
        color-scheme: dark;
    }
}

.lsb-root .lsb-button-subtle,
.lsb-root .lsb-view-button.is-active,
.lsb-root .lsb-module-palette-item,
.lsb-root .lsb-node-card,
.lsb-root .lsb-node-type-select,
.lsb-root .lsb-node-title-input,
.lsb-root .lsb-node-body,
.lsb-root .lsb-modal input,
.lsb-root .lsb-modal select,
.lsb-root .lsb-modal textarea,
.lsb-root .lsb-mindmap-central,
.lsb-root .lsb-mindmap-card,
.lsb-root .lsb-template-option,
.lsb-root .lsb-preview-content,
.lsb-root .lsb-insert-prompt {
    background: var(--lsb-surface) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-sidebar,
.lsb-root .lsb-module-palette,
.lsb-root .lsb-source-chip,
.lsb-root .lsb-preview-content .legal-structure-sources {
    background: var(--lsb-surface-2) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-title-input:hover,
.lsb-root .lsb-title-input:focus,
.lsb-root .lsb-view-switch,
.lsb-root .lsb-node-action,
.lsb-root .lsb-source-kind,
.lsb-root .lsb-mindmap-source-count,
.lsb-root .lsb-icon-button:hover,
.lsb-root .lsb-workspace-item:hover {
    background: var(--lsb-surface-3) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-button-subtle:hover,
.lsb-root .lsb-node-action:hover {
    background: var(--lsb-hover) !important;
    color: var(--lsb-text) !important;
}

.lsb-root .lsb-root-dropzone {
    background: var(--lsb-dropzone) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-source-kind,
.lsb-root .lsb-mindmap-source-count {
    color: var(--lsb-neutral-text) !important;
}

.lsb-root .lsb-preview-content {
    background: var(--lsb-preview) !important;
    color: var(--lsb-preview-text) !important;
}

.lsb-root .lsb-module-icon,
.lsb-root .lsb-node-type-icon,
.lsb-root .lsb-mindmap-icon {
    background: color-mix(in srgb, var(--module-color, #7a869a) 18%, var(--lsb-surface)) !important;
}

.lsb-root .lsb-tree-node-wrap::before,
.lsb-root .lsb-tree-node-wrap::after,
.lsb-root .lsb-mindmap-node-wrap::before,
.lsb-root .lsb-mindmap-children::before {
    background: var(--lsb-depth-line) !important;
}

.lsb-root .lsb-drag-grip {
    color: var(--lsb-muted) !important;
}

.lsb-root .lsb-workspace-list,
.lsb-root .lsb-module-palette,
.lsb-root .lsb-canvas,
.lsb-root .lsb-modal {
    scrollbar-color: var(--lsb-scroll-thumb) var(--lsb-scroll-track);
}

.lsb-root .lsb-workspace-list::-webkit-scrollbar-track,
.lsb-root .lsb-module-palette::-webkit-scrollbar-track,
.lsb-root .lsb-canvas::-webkit-scrollbar-track,
.lsb-root .lsb-modal::-webkit-scrollbar-track,
.lsb-root .lsb-workspace-list::-webkit-scrollbar-corner,
.lsb-root .lsb-module-palette::-webkit-scrollbar-corner,
.lsb-root .lsb-canvas::-webkit-scrollbar-corner,
.lsb-root .lsb-modal::-webkit-scrollbar-corner {
    background: var(--lsb-scroll-track) !important;
}

.lsb-root .lsb-workspace-list::-webkit-scrollbar-thumb,
.lsb-root .lsb-module-palette::-webkit-scrollbar-thumb,
.lsb-root .lsb-canvas::-webkit-scrollbar-thumb,
.lsb-root .lsb-modal::-webkit-scrollbar-thumb {
    background: var(--lsb-scroll-thumb) !important;
}

.lsb-root .lsb-workspace-list::-webkit-scrollbar-thumb:hover,
.lsb-root .lsb-module-palette::-webkit-scrollbar-thumb:hover,
.lsb-root .lsb-canvas::-webkit-scrollbar-thumb:hover,
.lsb-root .lsb-modal::-webkit-scrollbar-thumb:hover {
    background: var(--lsb-scroll-thumb-hover) !important;
}

.lsb-root .lsb-workspace-list::-webkit-scrollbar-thumb:active,
.lsb-root .lsb-module-palette::-webkit-scrollbar-thumb:active,
.lsb-root .lsb-canvas::-webkit-scrollbar-thumb:active,
.lsb-root .lsb-modal::-webkit-scrollbar-thumb:active {
    background: var(--lsb-scroll-thumb-active) !important;
}

/* The comparison article filter was added after the original theme mapping. */
.lh2-result-filters {
    background: var(--lh2-subtle) !important;
    color: var(--lh2-text) !important;
    border-color: var(--lh2-border) !important;
}

.lh2-filter-search input,
.lh2-filter-status {
    background: var(--lh2-panel) !important;
    color: var(--lh2-text) !important;
    border-color: var(--lh2-border) !important;
}

.lh2-filter-count,
.lh2-filter-status.unchanged[aria-pressed="true"] {
    background: var(--lh2-neutral) !important;
    color: var(--lh2-text) !important;
}

.lh2-filter-status:hover {
    border-color: var(--lh2-muted) !important;
    color: var(--lh2-text) !important;
}

/* LEXSTUDY_ANALYSIS_THEME_HOTFIX_V102
   Complete the legal-analysis page theme after workspace-polish-v1.css. */
.lsb-root {
    --lsb-workspace-bg: #f4f6fa;
    --lsb-workspace-dot: rgba(108, 122, 146, .10);
    --lsb-toolbar-bg: #ffffff;
    --lsb-toolbar-shadow: 0 4px 13px rgba(14, 24, 44, .04);
    --lsb-control-bg: #f8f9fc;
    --lsb-control-hover: #ffffff;
}

.lsb-root[data-lex-theme="light"] {
    --lsb-workspace-bg: #f4f6fa;
    --lsb-workspace-dot: rgba(108, 122, 146, .10);
    --lsb-toolbar-bg: #ffffff;
    --lsb-toolbar-shadow: 0 4px 13px rgba(14, 24, 44, .04);
    --lsb-control-bg: #f8f9fc;
    --lsb-control-hover: #ffffff;
}

.lsb-root[data-lex-theme="dark"] {
    --lsb-workspace-bg: #0f1520;
    --lsb-workspace-dot: rgba(148, 163, 184, .13);
    --lsb-toolbar-bg: #151b28;
    --lsb-toolbar-shadow: 0 4px 13px rgba(0, 0, 0, .22);
    --lsb-control-bg: #1b2231;
    --lsb-control-hover: #242d3e;
}

@media (prefers-color-scheme: dark) {
    .lsb-root[data-lex-theme="system"] {
        --lsb-workspace-bg: #0f1520;
        --lsb-workspace-dot: rgba(148, 163, 184, .13);
        --lsb-toolbar-bg: #151b28;
        --lsb-toolbar-shadow: 0 4px 13px rgba(0, 0, 0, .22);
        --lsb-control-bg: #1b2231;
        --lsb-control-hover: #242d3e;
    }
}

.lsb-root .lsb-shell,
.lsb-root .lsb-layout,
.lsb-root .lsb-main,
.lsb-root .lsb-content {
    background-color: var(--lsb-bg) !important;
    color: var(--lsb-text) !important;
}

.lsb-root .lsb-document-toolbar {
    background: var(--lsb-toolbar-bg) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
    box-shadow: var(--lsb-toolbar-shadow) !important;
}

.lsb-root .lsb-canvas {
    background:
        radial-gradient(
            circle at 1px 1px,
            var(--lsb-workspace-dot) 1px,
            transparent 1.2px
        )
        0 0 / 18px 18px,
        var(--lsb-workspace-bg) !important;
    color: var(--lsb-text) !important;
}

.lsb-root .lsb-title-input {
    color: var(--lsb-text) !important;
}

.lsb-root .lsb-title-input:hover,
.lsb-root .lsb-title-input:focus {
    background: var(--lsb-control-bg) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-view-switch,
.lsb-root .lsb-document-actions,
.lsb-root .lsb-save-status,
.lsb-root .lexcloud-legal-controls {
    background: var(--lsb-control-bg) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-document-actions .lsb-button-subtle:hover,
.lsb-root .lsb-view-button.is-active,
.lsb-root .lexcloud-legal-controls select,
.lsb-root .lexcloud-legal-controls button {
    background: var(--lsb-control-hover) !important;
    color: var(--lsb-text) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-root-dropzone {
    background: color-mix(in srgb, var(--lsb-toolbar-bg) 82%, transparent) !important;
    color: var(--lsb-muted) !important;
    border-color: var(--lsb-border) !important;
}

.lsb-root .lsb-empty-state,
.lsb-root .lsb-empty-state strong,
.lsb-root .lsb-empty-state span {
    color: var(--lsb-muted) !important;
}
