:root {
    --app-font-scale: 1.0;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border-color: #e2e8f0;
    --surface-muted: #f1f5f9;
    --surface-soft: #f8fafc;
    --accent-green: #22c55e;
    --accent-orange: var(--brand);
    --accent-blue: #3b82f6;
    --font-sans: 'Inter', sans-serif;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg-color: #0b1120;
    --card-bg: #111827;
    --text-main: #e5e7eb;
    --text-sub: #94a3b8;
    --border-color: #293548;
    --surface-muted: #1e293b;
    --surface-soft: #172033;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: calc(14px * var(--app-font-scale)) !important;
    min-height: 100vh;
}

.app-shell {
    display: grid;
    grid-template-columns: 64px auto minmax(0, 1fr);
    min-height: 100vh;
}

.knowledge-hub-column {
    grid-column: 2;
    max-width: 250px;
    min-width: 250px;
    overflow: hidden;
    padding-top: 20px;
    transition: max-width 0.28s ease, min-width 0.28s ease, opacity 0.2s ease;
}
.app-shell.knowledge-hub-collapsed .knowledge-hub-column { max-width: 0; min-width: 0; opacity: 0; }
.knowledge-hub-inner { padding: 0 0 20px 20px; width: 250px; }
.sidebar-restore-tab {
    align-items: center; background: #eaeef2; border: 1px solid #d7dee7; border-left: 0;
    border-radius: 0 8px 8px 0; color: #475569; cursor: pointer; display: none;
    height: 34px; justify-content: center; left: 0; position: fixed; top: 92px; width: 30px; z-index: 15;
}
.app-shell.knowledge-hub-collapsed .sidebar-restore-tab { display: inline-flex; left: 64px; }

.icon-rail, .primary-nav-rail {
    --app-font-scale: 1;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 64px;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 10px;
    box-sizing: border-box;
    grid-column: 1;
    z-index: 30;
}
.nav-rail-top-group { align-items: center; display: flex; flex-direction: column; gap: 16px; }
.nav-rail-bottom-group { bottom: 0; display: flex; justify-content: center; left: 0; margin-top: auto; padding-bottom: 24px; position: absolute; width: 100%; }

.rail-logo, .rail-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.rail-logo {
    display: block;
    object-fit: cover;
    width: 44px;
    height: 44px;
    margin: 0 0 8px;
    padding: 0;
    border-radius: 12px;
}

.rail-button {
    background: #1e293b;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.rail-button:hover {
    background: var(--accent-orange);
    color: white;
    transform: translateY(-1px);
}
.rail-button.active-view { background: var(--accent-orange); color: white; }
.rail-spacer { display: none; }

.app-main {
    grid-column: 3;
    min-width: 0;
    padding: 20px;
}

/* Top Navigation Header Bar */
.navbar {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}
.top-navbar-container {
    align-items: center; background: var(--card-bg); border-bottom: 1px solid var(--surface-muted);
    box-sizing: border-box; display: flex !important; flex-direction: row !important;
    justify-content: space-between; padding: 14px 24px; width: 100%;
}
.navbar-left-cluster { align-items: center; display: flex; flex-direction: row; gap: 16px; min-width: 0; }
.search-field-block { min-width: 240px; width: 320px; }
.nav-search-input {
    width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-main);
    font-size: 14px;
}
.navbar-actions-row { align-items: center; display: flex; flex-direction: row; gap: 12px; }
.btn-nav-action {
    align-items: center; border: 0; border-radius: 8px; cursor: pointer; display: flex;
    font-size: 13px; font-weight: 600; gap: 6px; padding: 6px 14px; transition: all .15s ease;
}
.btn-chat, .btn-random { background: var(--surface-soft); border: 1px solid var(--border-color); color: var(--text-sub); }
.btn-chat:hover, .btn-chat:focus-visible,
.btn-random:hover, .btn-random:focus-visible {
    background: #e2e8f0; border-color: #94a3b8; color: #0f172a;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .16); transform: translateY(-2px);
}
:root[data-theme="dark"] .btn-chat:hover,
:root[data-theme="dark"] .btn-chat:focus-visible,
:root[data-theme="dark"] .btn-random:hover,
:root[data-theme="dark"] .btn-random:focus-visible {
    background: #243b5a; border-color: #60a5fa; color: #f8fafc;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, .2), 0 7px 18px rgba(0, 0, 0, .38);
}
.btn-nav-action.btn-add { background: var(--brand); color: #fff; }
.btn-nav-action.btn-add:hover { background: var(--brand-hover); }
.status-pill { align-items: center; border-radius: 20px; display: flex; flex-shrink: 0; font-size: 13px; font-weight: 600; gap: 6px; padding: 6px 12px; }
.status-online { background: #e6f4ea; color: #137333; }
.dot-indicator { font-size: 10px; }
.quote-center-container {
    box-sizing: border-box; margin: 0 auto; padding: 12px 24px;
    text-align: center; width: 100%;
}
.quote-text-main {
    color: #334155; font-family: Georgia, serif; font-size: 16px; font-style: italic;
    line-height: 1.6; margin: 0 0 4px 0; text-shadow: 0 1px 1px rgba(0,0,0,0.01);
}
.quote-author-sub { color: #64748b; font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em; margin: 0; }

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #166534;
    background: #dcfce7;
    padding: 6px 12px;
    border-radius: 20px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
}

.btn-ask {
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-add {
    background: var(--accent-orange);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

/* Base Application Layout Workspace Split Panels */
.workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.knowledge-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 20px;
    position: relative;
}

.knowledge-panel h2 {
    font-size: 15px;
    margin-bottom: 6px;
}

.knowledge-panel p {
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.tag-explorer { display: flex; flex-direction: column; gap: 6px; }
.tag-filter {
    border: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px 10px;
    text-align: left;
}
.tag-filter:hover, .tag-filter.active { background: var(--brand-soft); color: var(--brand-text); }

/* Left Side Quick Workspace Sidebar Elements */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    font-weight: 700;
    margin-bottom: 4px;
}

.action-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.action-card:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.action-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.action-card p {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
}

/* Main Workspace Canvas Grid Panel View */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.content-header h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    font-weight: 700;
}

.collections-workspace-panel { padding: 24px; width: 100%; }
.collections-workspace-header { align-items: center; border-bottom: 1px solid var(--border-color); display: flex; gap: 20px; justify-content: space-between; padding-bottom: 16px; }
.collections-workspace-header h2 { color: var(--text-main); font-size: 24px; margin: 0; }
.collections-workspace-header p { color: var(--text-sub); font-size: 14px; margin: 4px 0 0; }
.collections-workspace-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; }
.collections-auto-sort-button, .collections-reclassify-button, .collections-new-folder-button { background: #e0f2fe; color: #0369a1; padding: 8px 14px; }
.collections-auto-sort-button:hover, .collections-auto-sort-button:focus-visible,
.collections-reclassify-button:hover, .collections-reclassify-button:focus-visible,
.collections-new-folder-button:hover, .collections-new-folder-button:focus-visible { background: #bae6fd; color: #075985; box-shadow: 0 5px 14px rgba(2, 132, 199, .24); transform: translateY(-2px); }
:root[data-theme="dark"] .collections-auto-sort-button:hover,
:root[data-theme="dark"] .collections-auto-sort-button:focus-visible,
:root[data-theme="dark"] .collections-reclassify-button:hover,
:root[data-theme="dark"] .collections-reclassify-button:focus-visible,
:root[data-theme="dark"] .collections-new-folder-button:hover,
:root[data-theme="dark"] .collections-new-folder-button:focus-visible { background: #38bdf8; color: #082f49; box-shadow: 0 0 0 2px rgba(125, 211, 252, .24), 0 7px 18px rgba(0, 0, 0, .38); }
.collection-navigation-bar { align-items: center; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 12px; }
.collection-navigation-bar[hidden] { display: none !important; }
.collection-back-button { align-items: center; background: #0f172a; border: 0; border-radius: 7px; color: #fff; cursor: pointer; display: inline-flex; font-size: 12px; font-weight: 700; gap: 7px; padding: 8px 12px; }
.collection-back-arrow { font-size: 17px; line-height: 1; }
.collection-navigation-title { align-items: center; color: var(--text-main); display: flex; flex-wrap: wrap; font-size: 14px; font-weight: 700; gap: 6px; overflow-wrap: anywhere; }
.collection-breadcrumb-button { background: transparent; border: 0; color: #2563eb; cursor: pointer; font: inherit; padding: 3px 2px; }
.collection-breadcrumb-button:hover, .collection-breadcrumb-button:focus-visible { color: #166534; text-decoration: underline; }
.collection-breadcrumb-button.current { color: var(--text-main); cursor: default; text-decoration: none; }
.collection-breadcrumb-separator { color: var(--text-sub); font-weight: 500; }
.collection-navigation-actions { display: flex; margin-left: auto; }
.collection-subfolder-section { border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.collection-subfolder-section[hidden] { display: none !important; }
.collection-subfolder-heading { color: var(--text-sub); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.collection-subfolder-section .collections-folder-grid { margin-top: 12px; }
.collections-folder-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.collection-folder-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; min-width: 0; padding: 20px; text-align: center; }
.collection-folder-icon { align-items: center; color: #475569; display: flex; height: 46px; justify-content: center; margin-bottom: 8px; }
.collection-folder-icon svg { fill: none; height: 38px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 38px; }
.collection-icon-variant { align-items: center; display: inline-flex; justify-content: center; }
.collection-dark-workspace-icon { display: none; }
:root[data-theme="dark"] .collection-default-workspace-icon { display: none; }
:root[data-theme="dark"] .collection-dark-workspace-icon { display: inline-flex; }
:root[data-theme="dark"] .collection-dark-workspace-icon svg { color: #f8fafc; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .28)); }
:root[data-theme="dark"] .collection-dark-workspace-icon .dark-workspace-icon-background { fill: #202a36; stroke: none; }
:root[data-theme="dark"] .collection-folder-icon .collection-dark-workspace-icon svg { height: 46px; width: 46px; }
.folder-menu-item-text { align-items: center; display: flex; gap: 8px; }
.folder-menu-item-text svg { fill: none; flex-shrink: 0; height: 17px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 17px; }
.collection-folder-name { color: var(--text-main); font-size: 16px; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.collection-folder-count { color: var(--text-sub); display: block; font-size: 12px; }
.collection-folder-open { background: var(--surface-muted); border: 1px solid transparent; border-radius: 6px; color: var(--text-main); cursor: pointer; font-size: 12px; margin-top: 8px; padding: 4px 8px; }
.collection-folder-open:hover, .collection-folder-open:focus-visible { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.collection-folder-actions { align-items: center; display: flex; gap: 7px; justify-content: center; margin-top: 8px; }
.collection-folder-actions .collection-folder-open { margin-top: 0; }
.collection-folder-rename { background: transparent; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-sub); cursor: pointer; font-size: 12px; padding: 4px 8px; }
.collection-folder-rename:hover { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.collections-empty-state { color: #94a3b8; font-style: italic; grid-column: 1 / -1; }

.btn-manage {
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-main);
}

.sidebar-controls-rail {
    align-items: center; background: #eaeef2; border: 1px solid #d7dee7; border-radius: 9px;
    display: flex; justify-content: space-between; margin: -8px -8px 14px; padding: 4px;
}
.sidebar-sub-bar {
    background: #eaeef2; border: 1px solid #d7dee7; border-radius: 8px; display: grid;
    grid-template-rows: 0fr; margin: -8px -8px 10px; opacity: 0; overflow: hidden;
    padding: 0 6px; transition: grid-template-rows 0.2s ease, opacity 0.18s ease, padding 0.2s ease;
}
.sidebar-sub-bar.open { grid-template-rows: 1fr; opacity: 1; padding: 6px; }
.sidebar-sub-bar-inner { align-items: center; display: flex; gap: 5px; min-height: 0; overflow: hidden; }
.sidebar-sub-input { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 11px; min-width: 0; outline: 0; padding: 7px 8px; width: 100%; }
.sidebar-sub-input:focus { border-color: #94a3b8; box-shadow: 0 0 0 2px rgba(148,163,184,.16); }
.sidebar-mini-button { background: white; border: 1px solid #cbd5e1; border-radius: 7px; color: #475569; cursor: pointer; font-size: 11px; font-weight: 700; padding: 7px 8px; }
.sidebar-mini-button:hover { border-color: var(--brand-line); color: var(--brand-text); }
.toolbar-button {
    align-items: center; background: transparent; border: 1px solid transparent;
    border-radius: 6px; color: #64748b; cursor: pointer; display: inline-flex;
    height: 28px; justify-content: center; padding: 0; transition: 0.18s ease; width: 31px;
}
.toolbar-button:hover, .toolbar-button.active { border-color: var(--brand-line); color: var(--brand-text); background: var(--brand-soft); }
.toolbar-button svg { fill: none; height: 15px; pointer-events: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.toolbar-button.sidebar-slide { background: #f8fafc; border-color: #d7dee7; }
.canvas-config {
    background: white; border: 1px solid var(--border-color); border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18); display: none; padding: 16px;
    left: 0; position: absolute; right: auto; top: 40px; width: 270px; z-index: 12;
}
.canvas-config.open { display: block; }
.config-section + .config-section { border-top: 1px solid var(--border-color); margin-top: 12px; padding-top: 12px; }
.config-title { color: var(--text-sub); display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; margin-bottom: 8px; }
.config-option { align-items: center; cursor: pointer; display: flex; font-size: 12px; gap: 8px; margin: 7px 0; }
.view-switcher { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); }
.view-switcher label { cursor: pointer; }
.view-switcher input { position: absolute; opacity: 0; }
.view-switcher span { border: 1px solid var(--border-color); border-radius: 7px; display: block; font-size: 11px; padding: 8px 4px; text-align: center; }
.view-switcher input:checked + span { background: #0f172a; border-color: #0f172a; color: white; }

.canvas-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}
.canvas-grid.view-list .dashboard-cards-grid { display: grid !important; grid-template-columns: 1fr; }
.canvas-grid.view-list .dashboard-card-item { max-width: none; min-height: 0; width: 100%; }
.canvas-grid.view-list .card-source-link { display: grid; grid-template-columns: 150px 1fr; }
.canvas-grid.view-list .card-visual-accent { height: 100%; min-height: 130px; }
.canvas-grid.view-table .dashboard-cards-grid { display: table !important; padding: 0; width: 100%; }
.canvas-grid.view-table .dashboard-card-item { border-radius: 0; display: table-row; max-width: none; min-height: 0; width: 100%; }
.canvas-grid.view-table .card-source-link { display: table-cell; padding: 12px; }
.canvas-grid.view-table .card-visual-accent, .canvas-grid.view-table .card-tag-list { display: none; }
.canvas-grid.view-table .card-body { padding: 0; }
.canvas-grid.view-table .card-footer { display: table-cell; min-width: 130px; vertical-align: middle; }

.date-cluster { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.date-banner {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 10px;
    font-family: var(--font-sans);
}
.dashboard-cards-grid {
    box-sizing: border-box;
    display: grid !important;
    gap: 20px !important;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 360px)) !important;
    justify-content: start;
    min-width: 0;
    padding: 24px 0;
    width: 100% !important;
}
.dashboard-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    padding: 16px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100% !important;
}
.dashboard-card-item[draggable="true"] { cursor: grab; }
.dashboard-card-item[draggable="true"]:active { cursor: grabbing; }
.folder-drop-zone-node { transition: background-color .2s ease, border-color .2s ease, transform .2s ease !important; }
.folder-drop-zone-node.drag-target-active { background: #f0fdf4 !important; border: 1px dashed #22c55e !important; transform: scale(1.02); }
.card-footer-actions { align-items: center; display: flex; gap: 6px; margin-left: auto; position: relative; z-index: 3; }
.manual-folder-action-anchor { display: inline-block; position: relative; }
.btn-card-folder-trigger { align-items: center; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px; color: #334155; cursor: pointer; display: flex; font-size: 12px; font-weight: 600; gap: 4px; padding: 3px 7px; }
.btn-card-folder-trigger:hover, .btn-card-folder-trigger:focus-visible { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.card-folder-floating-menu { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 22px rgba(15,23,42,.16); inset: auto; margin: 0; max-height: min(420px, calc(100vh - 24px)); min-width: 230px; overflow-y: auto; padding: 8px 0; position: fixed; z-index: 999; }
.card-folder-floating-menu:popover-open { display: block; }
.dashboard-card-item.folder-menu-open { overflow: visible; z-index: 25; }
.card-folder-floating-menu.hidden { display: none; }
.folder-menu-label { color: var(--text-sub); font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 4px 12px; text-transform: uppercase; }
.folder-menu-item { align-items: center; background: transparent; border: 0; color: var(--text-main); cursor: pointer; display: flex; font-size: 13px; gap: 8px; justify-content: space-between; padding: 7px 12px; text-align: left; width: 100%; }
.folder-menu-item:hover, .dropdown-item-hover-node:hover { background: #f0fdf4; color: #166534; }
.folder-menu-item.unassigned { color: #dc2626; font-weight: 600; }
.folder-menu-item.back-level { background: #eff6ff; border-bottom: 1px solid #f1f5f9; color: #2563eb; font-size: 12px; font-weight: 700; }
.folder-menu-item-text { min-width: 0; overflow-wrap: anywhere; }
.folder-menu-expand { background: #f1f5f9; border: 0; border-radius: 4px; color: #64748b; cursor: pointer; flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 6px; }
.folder-menu-empty { color: #94a3b8; font-size: 12px; font-style: italic; padding: 8px 12px; }
.folder-menu-divider { border: 0; border-top: 1px solid #f1f5f9; margin: 4px 0; }

/* Dynamic Collection Card Components */
.collection-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 360px;
}
.collection-card.dashboard-card-anchor {
    background-color: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transform: translateY(0) scale(1);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), background-color 250ms ease;
}
.collection-card.dashboard-card-anchor:hover {
    background-color: #f4f6f8 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-8px) scale(1.015);
}
.dashboard-card-anchor .card-body, .dashboard-card-anchor .card-tag-list, .dashboard-card-anchor .card-footer { background: transparent !important; }
.dynamic-creation-stub-card { min-height: 360px; }
.creation-stub-row {
    align-items: center; background: white; border: 0; border-bottom: 1px solid var(--border-color);
    color: var(--text-main); cursor: pointer; display: flex; flex: 1; gap: 12px;
    padding: 14px 16px; text-align: left; transition: background-color .16s ease;
}
.creation-stub-row:last-child { border-bottom: 0; }
.creation-stub-row:hover { background: #f8fafc; }
.creation-stub-icon { align-items: center; background: #f1f5f9; border-radius: 9px; display: inline-flex; font-size: 17px; height: 34px; justify-content: center; width: 34px; }
.creation-stub-copy { display: flex; flex-direction: column; gap: 3px; }
.creation-stub-copy strong { font-size: 13px; font-weight: 650; }
.creation-stub-copy small { color: var(--text-sub); font-size: 10px; line-height: 1.35; }
.card-source-link { color: inherit; display: flex; flex: 1; flex-direction: column; min-width: 0; text-decoration: none; }
.dashboard-card .card-source-link::after { content: ''; inset: 0; position: absolute; z-index: 1; }
.dashboard-card .card-tag-list, .dashboard-card .btn-delete { position: relative; z-index: 2; }
.truncated-card-title {
    color: var(--text-main); font-size: 16px; font-weight: 700; margin: 0 0 4px;
    overflow-wrap: anywhere; white-space: normal; width: 100%;
}
.truncated-card-link {
    color: #3b82f6; display: block; font-size: 12px; margin-bottom: 12px;
    overflow: hidden !important; text-decoration: none; text-overflow: ellipsis !important;
    white-space: nowrap !important; width: 100%;
}
.card-source-link:hover .truncated-card-link { text-decoration: underline; }

/* Visual Accent top container block matching screenshot */
.card-visual-accent {
    height: 120px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

/* Document Icon Mock inside Visual Accent */
.icon-document-graphic {
    width: 28px;
    height: 36px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #94a3b8;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.icon-document-graphic::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-bottom-left-radius: 3px;
}

/* Dynamic Header Card Label (Matches Screenshot Top Circles) */
.dynamic-header-label {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.78);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: absolute;
    right: 10px;
    top: 10px;
}
.recalled-badge-overlay {
    align-items: center; background: rgba(254, 240, 138, .95); border: 1px solid #e2e8f0;
    border-radius: 6px; color: #1e293b; display: flex; font-size: 11px; font-weight: 700;
    gap: 4px; left: 12px; padding: 4px 8px; position: absolute; top: 12px; z-index: 10;
}
.fallback-asset-badge {
    background: rgba(15,23,42,.82); border: 1px solid rgba(255,255,255,.38); border-radius: 9px;
    color: white; font-size: 12px; font-weight: 800; letter-spacing: .04em; padding: 8px 11px;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    font-family: var(--font-sans);
}

.card-status {
    font-size: 12px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.card-status-dot {
    width: 4px;
    height: 4px;
    background-color: var(--accent-orange);
    border-radius: 50%;
}

/* Lower Card Area holding Footer tag label boundary fields */
.card-footer {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dynamic Footer Tag Label (Matches Screenshot Bottom Circles) */
.dynamic-footer-tag {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.btn-delete {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.collection-card:hover .btn-delete {
    opacity: 1;
}

.system-modal-overlay, .delete-modal-overlay {
    align-items: center;
    backdrop-filter: blur(8px) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 0;
    display: flex;
    height: 100vh;
    inset: 0;
    justify-content: center;
    left: 0;
    margin: 0;
    max-height: none;
    max-width: none;
    overflow: visible;
    padding: 0;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 99999 !important;
}
.system-modal-overlay.hidden, .delete-modal-overlay.hidden { display: none; opacity: 0; }
.auth-lock-overlay { z-index: 100000 !important; }
.auth-lock-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .28); max-width: 430px;
    padding: 34px; text-align: center; width: min(92vw, 430px);
}
.auth-lock-card h2, .auth-lock-card h3 { color: var(--text-main); margin-bottom: 8px; }
.auth-subtitle { color: var(--text-sub); font-size: 13px; line-height: 1.5; margin-bottom: 20px; }
.auth-input-row { display: flex; flex-direction: column; gap: 11px; }
.auth-input {
    background: var(--surface-soft); border: 1px solid var(--border-color); border-radius: 9px;
    color: var(--text-main); font-size: 14px; outline: 0; padding: 11px 13px; width: 100%;
}
.auth-input:focus { border-color: var(--brand-text); box-shadow: 0 0 0 3px rgba(194, 65, 12, .14); }
.auth-submit { justify-content: center; min-height: 40px; }
.auth-error { color: #dc2626; font-size: 12px; line-height: 1.45; margin-top: 12px; }
.auth-recovery-button { background: transparent; border: 0; color: #64748b; cursor: pointer; font-size: 11px; margin-top: 15px; text-decoration: underline; }
.auth-recovery-button:hover { color: var(--brand-text); }
.auth-recovery-button:disabled { cursor: wait; opacity: .55; }
.auth-recovery-result {
    background: var(--surface-soft); border: 1px solid var(--border-color); border-radius: 10px;
    margin-top: 14px; padding: 13px; text-align: left;
}
.auth-recovery-result.hidden { display: none; }
.auth-recovery-label { color: var(--text-sub); display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; text-transform: uppercase; }
.auth-recovery-value-row { align-items: center; display: flex; gap: 8px; }
.auth-recovery-password {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 7px;
    color: var(--text-main); flex: 1; font-family: monospace; font-size: 14px; min-width: 0;
    padding: 9px 10px; user-select: all;
}
.auth-recovery-copy { background: #2563eb; border: 0; border-radius: 7px; color: white; cursor: pointer; font-size: 12px; font-weight: 700; padding: 10px 12px; }
.auth-recovery-help { color: var(--text-sub); font-size: 11px; line-height: 1.45; margin-top: 8px; }
.account-action-row { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.account-action-row .nav-search-input { min-width: 180px; width: auto; }
.account-status { color: var(--text-sub); font-size: 12px; margin-top: 10px; min-height: 18px; }
.logout-button { background: #f1f5f9; border: 1px solid var(--border-color); color: #475569; }
.logout-button:hover, .logout-button:focus-visible {
    background: #e2e8f0; border-color: #94a3b8; color: #0f172a;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .16); transform: translateY(-1px);
}
:root[data-theme="dark"] .logout-button:hover,
:root[data-theme="dark"] .logout-button:focus-visible {
    background: #475569; border-color: #94a3b8; color: #ffffff;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, .2), 0 7px 18px rgba(0, 0, 0, .38);
}
.password-reveal-wrapper { align-items: center; display: flex; position: relative; width: 100%; }
.password-input-field { padding-right: 42px !important; }
.password-toggle-eye-btn {
    background: transparent; border: 0; cursor: pointer; font-size: 14px; margin-left: -46px;
    outline: none; padding: 4px 8px; user-select: none; z-index: 10;
}
.password-toggle-eye-btn:focus-visible { border-radius: 5px; box-shadow: 0 0 0 2px var(--brand-text); }
.settings-alert-banner { background: #e0f2fe; border-radius: 6px; color: #0369a1; font-size: 13px; font-weight: 600; margin-top: 12px; padding: 10px; }
.settings-alert-banner.hidden { display: none; }
.admin-tenant-table-container { overflow-x: auto; }
.admin-user-table { border-collapse: collapse; margin-top: 12px; width: 100%; }
.admin-user-table th { border-bottom: 2px solid var(--border-color); color: var(--text-sub); font-size: 12px; padding: 8px; text-align: left; }
.admin-user-table td { border-bottom: 1px solid var(--surface-muted); color: var(--text-main); font-size: 13px; padding: 10px 8px; }
.admin-user-table th:last-child, .admin-user-table td:last-child { text-align: right; }
.admin-user-action { border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; margin: 2px; padding: 5px 8px; }
.admin-user-action.neutral { background: var(--surface-muted); color: var(--text-main); }
.admin-user-action.danger { background: #000; color: #fff; }
.admin-user-action.suspend { background: #fee2e2; color: #991b1b; }
.admin-user-action.activate { background: #e0f2fe; color: #0369a1; }
.account-state-pill { border-radius: 4px; font-size: 11px; font-weight: 600; padding: 2px 6px; }
.account-state-pill.active { background: #bbf7d0; color: #166534; }
.account-state-pill.suspended { background: #fecaca; color: #991b1b; }
.account-settings-scope { border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.account-download-button { align-self: flex-start; display: inline-flex; text-decoration: none; }
.account-danger-zone { background: #fff5f5; border: 1px solid #fecaca; border-radius: 9px; padding: 16px; }
.account-danger-zone h4 { color: #991b1b; font-size: 15px; margin-bottom: 4px; }
.account-danger-zone p { color: #7f1d1d; font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.self-delete-button { background: #dc2626; border: 0; border-radius: 7px; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; padding: 8px 14px; }
.self-delete-button:hover, .self-delete-button:focus-visible { background: #b91c1c; box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }
:root[data-theme="dark"] .account-danger-zone { background: #32191d; border-color: #7f1d1d; }
:root[data-theme="dark"] .account-danger-zone h4 { color: #fca5a5; }
:root[data-theme="dark"] .account-danger-zone p { color: #fecaca; }
#adminUserManagementBlock.hidden, #regularUserDangerZoneBlock.hidden, #backupHubButton.hidden { display: none !important; }
.system-modal-box {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.05);
    max-width: 440px;
    padding: 32px 40px;
    position: relative;
    text-align: center;
    width: 90%;
}
.system-modal-text { color: #1e293b; font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1.5; margin-bottom: 24px; }
.system-modal-actions { display: flex; gap: 12px; justify-content: center; }
.tripartite-layout { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-primary-action, .btn-secondary-action { border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; padding: 10px 20px; transition: all 150ms ease; }
.btn-primary-action { background-color: #ef4444; color: #ffffff; }
.btn-primary-action:hover { background-color: #dc2626; }
.btn-danger-action { background-color: #ef4444 !important; color: #ffffff; }
.btn-warn-action { background-color: var(--brand) !important; color: #ffffff; }
.btn-danger-action:hover { background-color: #dc2626 !important; }
.btn-warn-action:hover { background-color: var(--brand-hover) !important; }
.btn-secondary-action { background-color: #f1f5f9; color: #475569; }
.btn-secondary-action:hover { background-color: #e2e8f0; color: #1e293b; }
.btn-primary-action-blue { background: #2563eb; border: 0; border-radius: 8px; color: white; cursor: pointer; font-size: 14px; font-weight: 600; padding: 10px 20px; transition: background-color 150ms ease; }
.btn-primary-action-blue:hover { background: #1d4ed8; }

.add-content-dialog {
    width: min(720px, calc(100vw - 32px));
    border: 0;
    border-radius: 22px;
    padding: 0;
    color: var(--text-main);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}
.add-content-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
}
.modal-shell { padding: 26px; }
.modal-header, .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.modal-header { margin-bottom: 22px; }
.modal-header h2 { font-size: 22px; letter-spacing: -0.03em; }
.modal-header-actions { display: flex; align-items: center; gap: 10px; }
.keyboard-badge {
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 6px;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
}
.modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 20px;
}
.modal-view { display: none; }
.modal-view.active { display: block; }
.modal-field-label {
    display: block;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.modal-input, .modal-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font: inherit;
    outline: none;
    padding: 14px 16px;
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent-orange); }
.modal-textarea { min-height: 112px; resize: vertical; }
.field-stack { display: grid; gap: 14px; }
.drop-zone {
    border: 1.5px dashed #94a3b8;
    border-radius: 16px;
    cursor: pointer;
    margin-top: 16px;
    padding: 28px 20px;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-zone.dragging { border-color: var(--accent-orange); background: var(--brand-soft); }
.upload-icon { font-size: 34px; margin-bottom: 8px; }
.drop-zone strong { font-size: 14px; }
.selected-file { color: var(--text-sub); font-size: 12px; margin-top: 8px; min-height: 18px; }
.format-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.format-pill { background: #f1f5f9; border-radius: 999px; color: #475569; font-size: 10px; font-weight: 700; padding: 4px 8px; }
.modal-message { min-height: 20px; color: #b45309; font-size: 12px; margin-top: 12px; }
.modal-footer { border-top: 1px solid var(--border-color); margin-top: 18px; padding-top: 18px; }
.modal-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tab {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-sub);
    cursor: pointer;
    font-weight: 600;
    padding: 9px 11px;
}
.modal-tab.active { background: #f1f5f9; color: var(--text-main); }
.create-button {
    border: 0;
    border-radius: 10px;
    background: #0f172a;
    color: white;
    cursor: pointer;
    font-weight: 700;
    min-width: 100px;
    padding: 11px 18px;
}
.create-button:disabled { cursor: wait; opacity: 0.65; }
.card-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }
.card-tag-button {
    background: var(--brand-soft);
    border: 1px solid var(--brand-soft);
    border-radius: 6px;
    color: var(--accent-orange);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 7px;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.card-tag-button:hover {
    background: var(--brand-soft);
    border-color: var(--brand-line);
    transform: translateY(-1px);
}
.wikipedia-dialog { width: min(520px, calc(100vw - 32px)); }
.wikipedia-header { justify-content: flex-start; }
.wikipedia-back {
    border: 0;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 2px 8px 4px 0;
}
.wikipedia-copy { color: var(--text-sub); font-size: 14px; line-height: 1.6; margin: -8px 0 20px; }
.wikipedia-search-box {
    align-items: center;
    border: 1.5px solid var(--brand-line);
    border-radius: 14px;
    display: flex;
    gap: 12px;
    padding: 5px 14px;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.10);
}
.wikipedia-mark { font-family: Georgia, serif; font-size: 25px; font-weight: 700; }
.wikipedia-search-box input { border: 0; flex: 1; font: inherit; font-size: 16px; outline: 0; padding: 13px 0; }
.example-section { margin-top: 20px; }
.example-label { color: var(--text-sub); display: block; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.example-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.example-pill { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 999px; cursor: pointer; padding: 8px 11px; }
.example-pill:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.wikipedia-footer { justify-content: flex-end; }
.backup-dialog { width: min(900px, calc(100vw - 32px)); }
.backup-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.backup-section { border: 1px solid var(--border-color); border-radius: 14px; padding: 16px; }
.backup-section h3 { font-size: 14px; margin-bottom: 12px; }
.backup-option { align-items: flex-start; display: flex; gap: 9px; margin: 10px 0; }
.backup-path { width: 100%; }
.schedule-fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 10px; }
.backup-history { grid-column: 1 / -1; overflow-x: auto; }
.backup-history table { border-collapse: collapse; font-size: 12px; width: 100%; }
.backup-history th, .backup-history td { border-bottom: 1px solid var(--border-color); padding: 10px 8px; text-align: left; }
.native-explorer-link { background: transparent; border: 0; color: #2563eb; cursor: pointer; font-family: monospace; font-size: 13px; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.native-explorer-link:hover, .native-explorer-link:focus-visible { color: #1d4ed8; }
.settings-modal-card {
    background: #ffffff; border-radius: 16px; width: min(1080px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px)); max-height: calc(100vh - 48px);
    display: flex; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.settings-sidebar-panel {
    width: 240px; min-width: 240px; background: #fdfdfd; padding: 24px 12px;
    display: flex; flex-direction: column; justify-content: flex-start;
    border-right: 1px solid #f1f5f9; box-sizing: border-box;
}
.settings-nav-group { display: flex; flex-direction: column; gap: 4px; }
.settings-sidebar-btn, .settings-sidebar-footer-btn {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: 10px; border: none; font-size: 14px; background: transparent;
    font-weight: 500; color: #475569; text-align: left; cursor: pointer; transition: all 0.2s;
}
.settings-sidebar-btn.active-tab { background: #fef08a !important; color: #1e293b !important; font-weight: 600; }
.settings-sidebar-btn:hover, .settings-sidebar-footer-btn:hover { background: #f1f5f9; }
.settings-viewport {
    flex: 1; padding: 40px; position: relative; background: #ffffff; min-width: 0;
    box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
}
.settings-modal-dismiss-x {
    position: absolute; top: 24px; right: 28px; background: none; border: none;
    font-size: 24px; color: #94a3b8; cursor: pointer;
}
.settings-modal-dismiss-x:hover, .settings-modal-dismiss-x:focus-visible { color: #0f172a; }
.settings-tab-content { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 18px 0; }
.settings-tab-content.hidden { display: none; }
.settings-apply-footer { align-items: center; border-top: 1px solid var(--border-color); display: flex; flex: 0 0 auto; justify-content: flex-end; margin-top: 8px; padding-top: 16px; }
.settings-apply-button { background: var(--brand); border: 0; border-radius: 9px; color: #ffffff; cursor: pointer; font-size: 13px; font-weight: 700; min-width: 88px; padding: 10px 22px; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.settings-apply-button:hover, .settings-apply-button:focus-visible { background: var(--brand-hover); box-shadow: 0 5px 14px rgba(194, 65, 12, .28); transform: translateY(-1px); }
.settings-apply-button:disabled { cursor: wait; opacity: .65; }
.preference-select { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-main); cursor: pointer; max-width: 240px; padding: 8px 12px; }
.preference-select:hover, .preference-select:focus-visible { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); outline: none; }
.tts-preference-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tts-preference-field { display: flex; flex-direction: column; gap: 6px; }
.tts-preference-label { color: var(--text-main); font-size: 12px; font-weight: 600; }
.tts-availability-status { color: var(--text-sub); font-size: 12px; line-height: 1.45; min-height: 18px; }
.tts-preview-button { align-items: center; align-self: flex-start; background: #2563eb; border: 0; border-radius: 7px; color: #fff; cursor: pointer; display: inline-flex; font-size: 12px; font-weight: 700; gap: 6px; padding: 8px 12px; }
.tts-preview-button:hover, .tts-preview-button:focus-visible { background: #1d4ed8; box-shadow: 0 0 0 3px rgba(96, 165, 250, .22); outline: none; }
.tts-preview-button[data-playing="true"] { background: #dc2626; }
.tts-preview-button[data-playing="true"]:hover { background: #b91c1c; }
.tts-preview-button:disabled { cursor: not-allowed; opacity: .5; }
.quiz-coming-soon { align-items: center; color: var(--text-main); display: flex; flex-direction: column; justify-content: center; min-height: 330px; text-align: center; }
.quiz-coming-soon-emoji { font-size: 64px; line-height: 1; margin-bottom: 18px; transform: rotate(-8deg); }
.quiz-coming-soon strong { font-size: 24px; }
.quiz-coming-soon p { color: var(--text-sub); font-size: 13px; margin-top: 8px; }
.settings-section-block { margin-top: 16px; }
.help-section-heading { border-bottom: 2px solid var(--border-color); color: var(--text-main); font-size: 11px; font-weight: 700; letter-spacing: .05em; padding-bottom: 5px; text-transform: uppercase; }
.help-feedback-row { border-bottom: 1px solid var(--border-color); padding: 14px 0; }
.help-feedback-row:last-child { border-bottom: 0; }
.faq-content-placeholder-box { background: var(--surface-soft); border: 1px dashed var(--border-color); border-radius: 7px; color: var(--text-sub); font-size: 13px; font-style: italic; line-height: 1.5; margin-top: 10px; padding: 12px; }
.help-action-layout { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.help-disabled-action { background: var(--surface-muted); border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-sub); cursor: not-allowed; font-size: 13px; font-weight: 600; padding: 7px 12px; }
.app-version-control { align-items: center; color: var(--text-sub); display: flex; flex-wrap: wrap; font-size: 12px; gap: 7px; }
.version-copy-button { background: var(--surface-muted); border: 1px solid var(--border-color); border-radius: 5px; color: var(--text-main); cursor: pointer; font-size: 11px; font-weight: 700; padding: 4px 8px; }
.version-copy-button:hover, .version-copy-button:focus-visible { background: #dbeafe; border-color: #60a5fa; color: #1e3a8a; outline: none; }
:root[data-theme="dark"] .version-copy-button:hover,
:root[data-theme="dark"] .version-copy-button:focus-visible { background: #1e3a5f; border-color: #60a5fa; color: #eff6ff; }
.version-copy-feedback { color: #16a34a; font-size: 11px; font-weight: 700; }
.version-copy-feedback[hidden] { display: none !important; }
:root[data-theme="dark"] .version-copy-feedback { color: #86efac; }
.feedback-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.feedback-textarea-wrap { position: relative; }
.feedback-textarea { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-main); font: inherit; line-height: 1.5; min-height: 112px; padding: 10px 12px 28px; resize: vertical; width: 100%; }
.feedback-textarea:hover, .feedback-textarea:focus-visible { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); outline: none; }
.feedback-character-counter { bottom: 8px; color: var(--text-sub); font-size: 11px; position: absolute; right: 10px; }
.feedback-character-counter.near-limit { color: #dc2626; font-weight: 700; }
.feedback-submit-button { align-self: flex-start; background: #2563eb; border: 0; border-radius: 7px; color: #fff; cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 13px; }
.feedback-submit-button:hover, .feedback-submit-button:focus-visible { background: #1d4ed8; box-shadow: 0 0 0 3px rgba(96, 165, 250, .22); }
.feedback-submit-button:disabled { cursor: wait; opacity: .6; }
.feedback-upload-row { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.feedback-upload-button { background: var(--surface-muted); border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-main); cursor: pointer; font-size: 12px; font-weight: 600; padding: 7px 11px; }
.feedback-upload-button:hover, .feedback-upload-button:focus-within { border-color: #60a5fa; }
.feedback-upload-button input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.feedback-file-status, .feedback-submit-status { color: var(--text-sub); font-size: 12px; min-height: 18px; }
.feedback-screenshot-preview { border: 1px solid var(--border-color); border-radius: 8px; max-height: 180px; max-width: 100%; object-fit: contain; }
.feedback-screenshot-preview[hidden], #adminFeedbackReviewBlock.hidden { display: none !important; }
.admin-feedback-list { display: grid; gap: 10px; margin-top: 10px; }
.admin-feedback-card { background: var(--surface-soft); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; }
.admin-feedback-card strong { color: var(--text-main); }
.admin-feedback-meta { color: var(--text-sub); font-size: 11px; margin-bottom: 7px; }
.admin-feedback-message { color: var(--text-main); font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.settings-section-heading { font-size: 20px; font-weight: 600; color: #0f172a; }
.settings-row-item { display: flex; flex-direction: column; width: 100%; }
.settings-item-title { font-size: 14px; font-weight: 600; color: #1e293b; }
.settings-item-desc { font-size: 13px; color: #64748b; margin-top: 2px; }
.settings-sub-header-label { font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: 0.05em; }
.capsule-segmented-control {
    display: flex; background: #f1f5f9; padding: 4px; border-radius: 10px;
    border: 1px solid #e2e8f0; flex-shrink: 0;
}
.capsule-segment {
    display: flex; align-items: center; gap: 6px; padding: 8px 18px; font-size: 13px;
    font-weight: 500; border-radius: 7px; border: none; background: transparent;
    color: #64748b; cursor: pointer;
}
.capsule-segment.segment-selected {
    background: #ffffff; color: #1e293b; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.font-scaler-control-box { display: flex; align-items: center; background: #f1f5f9; border-radius: 8px; padding: 2px; flex-shrink: 0; }
.font-scale-adjuster-btn {
    width: 32px; height: 32px; border: none; background: transparent; font-size: 16px;
    color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.font-scale-adjuster-btn:hover { color: #0f172a; }
.font-scale-adjuster-btn:disabled { cursor: not-allowed; opacity: .35; }
.font-scale-value-display { font-size: 13px; font-weight: 600; color: #1e293b; min-width: 54px; text-align: center; }
.flex-row-layout { display: flex !important; flex-direction: row !important; justify-content: space-between; align-items: center; width: 100%; }
.text-block-wrap { flex: 1; min-width: 0; padding-right: 16px; }
.justify-between { display: flex; justify-content: space-between; gap: 24px; }
.align-center { align-items: center; }
.border-bottom { border-bottom: 1px solid #f1f5f9; }
.pb-6 { padding-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

:root[data-theme="dark"] .nav-search-input,
:root[data-theme="dark"] .tag-filter,
:root[data-theme="dark"] .sidebar-controls-rail,
:root[data-theme="dark"] .sidebar-sub-bar,
:root[data-theme="dark"] .sidebar-sub-input,
:root[data-theme="dark"] .toolbar-button.sidebar-slide,
:root[data-theme="dark"] .sidebar-mini-button,
:root[data-theme="dark"] .btn-manage,
:root[data-theme="dark"] .btn-ask,
:root[data-theme="dark"] .creation-stub-row,
:root[data-theme="dark"] .chat-history-panel,
:root[data-theme="dark"] .chat-message.assistant,
:root[data-theme="dark"] .chat-console,
:root[data-theme="dark"] .chat-utility,
:root[data-theme="dark"] .suggested-question,
:root[data-theme="dark"] .modal-close,
:root[data-theme="dark"] .btn-secondary-action,
:root[data-theme="dark"] .dynamic-footer-tag { background: var(--surface-muted); color: var(--text-main); }
:root[data-theme="dark"] .tag-filter:hover,
:root[data-theme="dark"] .tag-filter:focus-visible,
:root[data-theme="dark"] .tag-filter.active {
    background: var(--brand-hover); color: var(--on-brand);
    box-shadow: inset 0 0 0 1px var(--brand-text), 0 5px 14px rgba(194, 65, 12, .26);
    outline: none; transform: translateY(-1px);
}
:root[data-theme="dark"] .collection-card.dashboard-card-anchor,
:root[data-theme="dark"] .add-content-dialog,
:root[data-theme="dark"] .system-modal-box,
:root[data-theme="dark"] .chat-workspace,
:root[data-theme="dark"] .chat-console,
:root[data-theme="dark"] .wikipedia-search-box { background: var(--card-bg) !important; color: var(--text-main); }
:root[data-theme="dark"] .collection-card.dashboard-card-anchor:hover,
:root[data-theme="dark"] .creation-stub-row:hover { background: var(--surface-soft) !important; }
:root[data-theme="dark"] .modal-input,
:root[data-theme="dark"] .modal-textarea,
:root[data-theme="dark"] .wikipedia-search-box input,
:root[data-theme="dark"] .chat-console textarea { background: var(--card-bg); color: var(--text-main); }
:root[data-theme="dark"] .system-modal-text,
:root[data-theme="dark"] .system-modal-title { color: var(--text-main); }
:root[data-theme="dark"] .settings-modal-card,
:root[data-theme="dark"] .settings-viewport { background: var(--card-bg); }
:root[data-theme="dark"] .settings-sidebar-panel { background: var(--surface-soft); border-color: var(--border-color); }
:root[data-theme="dark"] .settings-sidebar-btn,
:root[data-theme="dark"] .settings-sidebar-footer-btn { color: var(--text-sub); }
:root[data-theme="dark"] .settings-sidebar-btn:hover,
:root[data-theme="dark"] .settings-sidebar-footer-btn:hover { background: var(--surface-muted); }
:root[data-theme="dark"] .settings-section-heading,
:root[data-theme="dark"] .settings-tab-content h2,
:root[data-theme="dark"] .settings-item-title { color: var(--text-main); }
:root[data-theme="dark"] .capsule-segmented-control,
:root[data-theme="dark"] .font-scaler-control-box { background: var(--surface-muted); border-color: var(--border-color); }
:root[data-theme="dark"] .capsule-segment.segment-selected { background: #334155; color: #f8fafc; }
:root[data-theme="dark"] .font-scale-value-display { color: var(--text-main); }
:root[data-theme="dark"] .border-bottom { border-color: var(--border-color); }
:root[data-theme="dark"] .quote-text-main { color: #cbd5e1; }
:root[data-theme="dark"] .status-online { background: #153524; color: #86efac; }
:root[data-theme="dark"] .graph-view-layer { background: radial-gradient(circle at 50% 44%, #172033 0, #0f172a 58%, #0b1120 100%); }
:root[data-theme="dark"] .graph-toolbar { background: rgba(17, 24, 39, .92); border-color: var(--border-color); }
.backup-status-success { color: #15803d; font-weight: 700; }
.backup-status-failed { color: #dc2626; font-weight: 700; }
.note-reader { white-space: pre-wrap; color: var(--text-sub); line-height: 1.65; }
.backup-toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; background: #0f172a; color: white; border-radius: 10px; opacity: 0; padding: 12px 16px; pointer-events: none; transform: translateY(8px); transition: 0.2s ease; }
.backup-toast.visible { opacity: 1; transform: translateY(0); }
.dashboard-view[hidden] { display: none !important; }
.chat-workspace { background: #fff; border: 1px solid var(--border-color); border-radius: 16px; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 112px); overflow: hidden; }
.chat-history-panel { background: #f8fafc; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 16px; }
.chat-history-tools { display: flex; gap: 8px; }
.new-chat-button { background: #0f172a; border: 0; border-radius: 9px; color: white; cursor: pointer; flex: 1; font-size: 12px; font-weight: 700; padding: 10px; }
.chat-toggle-button { background: white; border: 1px solid var(--border-color); border-radius: 9px; cursor: pointer; width: 38px; }
.chat-empty-history { color: var(--text-sub); display: grid; flex: 1; font-size: 12px; place-items: center; text-align: center; }
.chat-stage { display: flex; flex-direction: column; min-width: 0; padding: 34px clamp(20px, 6vw, 90px) 20px; }
.chat-stage h1 { font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; text-align: center; }
.chat-thread { display: flex; flex: 1; flex-direction: column; gap: 12px; margin: 28px auto 18px; max-height: max(330px, calc(100dvh - 330px)); overflow: auto; width: min(760px, 100%); }
.chat-message { border-radius: 14px; font-size: 13px; line-height: 1.6; padding: 12px 15px; white-space: pre-wrap; }
.chat-message.user { align-self: flex-end; background: #0f172a; color: white; max-width: 78%; }
.chat-message.assistant { align-self: flex-start; background: #f1f5f9; max-width: 86%; }
.chat-console { border: 1px solid #cbd5e1; border-radius: 18px; box-shadow: 0 18px 45px rgba(15,23,42,.09); margin: 0 auto; padding: 14px; width: min(760px, 100%); }
.chat-console textarea { border: 0; font: inherit; min-height: 76px; outline: 0; resize: none; width: 100%; }
.chat-console-footer { align-items: center; display: flex; gap: 7px; }
.chat-utility { background: #f1f5f9; border: 0; border-radius: 999px; color: #475569; font-size: 10px; padding: 7px 9px; }
.chat-send { background: var(--accent-orange); border: 0; border-radius: 9px; color: white; cursor: pointer; font-weight: 800; margin-left: auto; padding: 8px 13px; }
.chat-guide { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 14px; margin: 18px auto; padding: 16px 42px 16px 18px; position: relative; width: min(760px, 100%); }
.chat-guide strong { display: block; font-size: 13px; margin-bottom: 6px; }
.chat-guide p, .chat-guide li { color: #64748b; font-size: 11px; line-height: 1.55; }
.chat-guide ul { margin: 7px 0 0 18px; }
.chat-guide-close { background: transparent; border: 0; cursor: pointer; font-size: 18px; position: absolute; right: 12px; top: 9px; }
.suggested-questions { display: flex; gap: 9px; margin-top: auto; overflow-x: auto; padding-top: 14px; }
.suggested-question { background: #f1f5f9; border: 1px solid var(--border-color); border-radius: 999px; color: #475569; cursor: pointer; flex: 0 0 auto; font-size: 11px; padding: 9px 12px; }
.modal-close-trigger { background: #f1f5f9; border: 0; border-radius: 999px; color: #64748b; cursor: pointer; font-size: 20px; height: 34px; line-height: 1; position: absolute; right: 16px; top: 16px; width: 34px; }
.modal-close-trigger:hover { background: #e2e8f0; color: #1e293b; }
.modal-brand-icon-wrap { align-items: center; background: white; border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 12px 30px rgba(59,130,246,.15); color: #2563eb; display: inline-flex; height: 76px; justify-content: center; margin: 8px 0 22px; width: 76px; }
.brand-svg-node { fill: none; height: 42px; stroke: currentColor; stroke-width: 1.8; width: 42px; }
.system-modal-title { font-size: 25px; letter-spacing: -.035em; margin-bottom: 12px; }
.system-modal-desc { color: #64748b; font-size: 14px; line-height: 1.65; margin: 0 auto 24px; max-width: 370px; }
.graph-view-layer { background: radial-gradient(circle at 50% 44%, #f8fbff 0, #eef4fb 55%, #e7eef8 100%); inset: 0; position: fixed; z-index: 40; }
.graph-view-layer[hidden] { display: none; }
.graph-toolbar { align-items: center; background: rgba(255,255,255,.9); border: 1px solid #dbe4f0; border-radius: 14px; box-shadow: 0 12px 35px rgba(15,23,42,.1); display: flex; gap: 12px; left: 20px; padding: 10px 14px; position: absolute; right: 20px; top: 20px; z-index: 2; }
.graph-home-button { background: #0f172a; border: 0; border-radius: 9px; color: white; cursor: pointer; font-size: 18px; height: 38px; width: 38px; }
.graph-toolbar-copy strong { display: block; font-size: 14px; }
.graph-toolbar-copy span { color: #64748b; font-size: 11px; }
.graph-legend { color: #64748b; font-size: 11px; margin-left: auto; }
#graphViewCanvas { cursor: grab; display: block; height: 100%; width: 100%; }
#graphViewCanvas.dragging { cursor: grabbing; }

@media (max-width: 1100px) {
    .knowledge-hub-column { max-width: 210px; min-width: 210px; }
    .knowledge-hub-inner { width: 210px; }
    .knowledge-panel { position: relative; }
}

@media (max-width: 760px) {
    .app-shell { display: block; padding-left: 64px; }
    .knowledge-hub-column { max-width: none; min-width: 0; width: 100%; }
    .app-shell.knowledge-hub-collapsed .knowledge-hub-column { display: none; }
    .workspace-layout { grid-template-columns: 1fr; }
    .knowledge-panel, .content-area { grid-column: 1; grid-row: auto; }
    .top-navbar-container { align-items: stretch; flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
    .navbar-left-cluster { align-items: stretch; flex-basis: 100%; flex-direction: column; gap: 10px; }
    .search-field-block { min-width: 0; width: 100%; }
    .navbar-actions-row { flex-wrap: wrap; }
    .collections-workspace-header { align-items: flex-start; flex-direction: column; }
    .collections-folder-grid { grid-template-columns: 1fr; }
    .status-pill { margin-left: auto; }
    .canvas-config { right: 0; }
    .settings-modal-card { flex-direction: column; height: calc(100vh - 24px); max-height: calc(100vh - 24px); width: calc(100% - 24px); }
    .settings-sidebar-panel { border-bottom: 1px solid var(--border-color); border-right: 0; min-width: 0; padding: 12px; width: 100%; }
    .settings-nav-group { flex-direction: row; overflow-x: auto; }
    .settings-sidebar-btn { flex: 0 0 auto; width: auto; }
    .settings-sidebar-footer-btn { display: none; }
    .settings-viewport { padding: 32px 20px; }
    .justify-between:not(.flex-row-layout) { align-items: stretch; flex-direction: column; }
    .capsule-segmented-control { align-self: stretch; }
    .capsule-segment { flex: 1; justify-content: center; padding-inline: 8px; }
}
.backup-note { color: var(--text-muted, #64748b); font-size: 13px; margin: 6px 0 0; }


/* BP76: summary pending */
.ai-paused-notice { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; font-size: 0.9rem; }
.ai-paused-notice[hidden] { display: none; }
.pending-chip { display: inline-block; margin: 0 20px 8px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 0.75rem; font-weight: 600; }
:root[data-theme="dark"] .ai-paused-notice { background: #422006; color: #fde68a; border-color: #b45309; }

/* BP74: edit conflict bar, Trash view, "already in your library" */
.note-conflict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; font-size: 0.9rem; }
.note-conflict[hidden] { display: none; }
.note-conflict span { flex: 1 1 auto; font-weight: 600; }
.note-conflict button, .already-saved-open { border: 1px solid var(--brand); background: #fff; color: var(--brand-text); border-radius: 8px; padding: 4px 12px; cursor: pointer; font: inherit; }
.note-conflict button:hover, .already-saved-open:hover { background: var(--brand-soft); }
.card-trashed { opacity: 0.8; }
.card-trashed .card-source-link { cursor: default; }
.btn-restore { font-weight: 600; }
.trash-empty { padding: 24px; color: #6b7280; }
:root[data-theme="dark"] .note-conflict { background: #422006; color: #fde68a; border-color: #b45309; }
:root[data-theme="dark"] .note-conflict button, :root[data-theme="dark"] .already-saved-open { background: transparent; color: var(--brand-line); border-color: var(--brand-line); }

/* BP78: Settings sections */
.devices-list { list-style: none; margin: 0; padding: 0; }
.device-row { align-items: center; border-bottom: 1px solid var(--border-color, rgba(128,128,128,.25)); display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; }
#aiUsageFill { background: var(--brand); display: block; height: 100%; width: 0; }
.settings-item-title input[type="checkbox"] { margin-right: 8px; }
:root[data-reduce-motion] *, :root[data-reduce-motion] *::before, :root[data-reduce-motion] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
