:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(24, 33, 52, 0.72);
    --bg-card-hover: rgba(31, 43, 68, 0.88);
    --bg-input: #080c14;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(56, 189, 248, 0.16);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.35);

    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 12% 35%, rgba(56, 189, 248, 0.06), transparent 28%),
        radial-gradient(circle at 88% 20%, rgba(129, 140, 248, 0.06), transparent 28%);
}

.hidden {
    display: none !important;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 20;
    overflow-y: auto;
}

.brand {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    padding: 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.brand-text {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-version {
    font-size: 0.72rem;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

/* RBAC Role Card */
.role-card {
    margin: 0.85rem 1rem 0.5rem;
    padding: 0.75rem;
    background: rgba(8, 12, 20, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.role-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.role-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.role-badge {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
}

.role-admin {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.role-editor {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.role-viewer {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.role-select {
    width: 100%;
    padding: 0.42rem 0.55rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
}

.db-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

/* Nav Menu */
.nav-menu {
    padding: 0.6rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.3rem 0.5rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--accent-primary);
    background-color: var(--accent-glow);
    border-color: rgba(56, 189, 248, 0.25);
    font-weight: 600;
}

.nav-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    color: var(--text-secondary);
}

/* Tag Cloud */
.sidebar-tags-panel {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    flex: 1;
}

.sidebar-tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.55rem;
}

.clear-tag-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.72rem;
    cursor: pointer;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-pill {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-pill:hover,
.tag-pill.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
    border-color: var(--border-hover);
}

.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-secondary-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
}

.data-actions {
    display: flex;
    gap: 0.5rem;
}

.data-actions button {
    flex: 1;
    font-size: 0.76rem;
    padding: 0.45rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 15;
}

.search-container {
    position: relative;
    width: 460px;
    max-width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted);
}

#searchInput {
    width: 100%;
    padding: 0.6rem 3rem 0.6rem 2.6rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
}

#searchInput:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.shortcut-badge {
    position: absolute;
    right: 0.65rem;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    border: none;
    padding: 0.58rem 1.05rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(56, 189, 248, 0.25);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.84rem;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.84rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.84rem;
    cursor: pointer;
}

/* Split Layout */
.workspace-split {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.section-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.active-filter-pill {
    background: var(--accent-glow);
    color: var(--accent-primary);
    border: 1px solid var(--border-hover);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.35rem;
    backdrop-filter: blur(10px);
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.55);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
    font-weight: 600;
}

.card-section-pill {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-family: var(--font-mono);
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.14);
    color: #a5b4fc;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.55rem;
    cursor: pointer;
}

.card-title:hover {
    color: var(--accent-primary);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex: 1;
}

/* Rich Markdown Formatting inside Cards & Reader */
.card-desc h3,
.card-desc h4 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    margin: 0.85rem 0 0.4rem;
    font-size: 1rem;
}

.card-desc p {
    margin-bottom: 0.6rem;
}

.card-desc ul,
.card-desc ol {
    margin: 0.4rem 0 0.75rem 1.25rem;
}

.card-desc blockquote {
    border-left: 3px solid var(--accent-primary);
    background: rgba(56, 189, 248, 0.07);
    padding: 0.55rem 0.85rem;
    border-radius: 0 6px 6px 0;
    margin: 0.65rem 0;
    color: #cbd5e1;
    font-size: 0.86rem;
}

.card-desc code {
    display: inline-block;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.28);
    padding: 0.04rem 0.3rem;
    margin: 0.1rem 0.14rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.83em;
    line-height: 1.25;
    vertical-align: baseline;
    color: #bae6fd;
}

.card-desc pre {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    overflow-x: auto;
    margin: 0.65rem 0;
}

.card-desc pre code {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #38bdf8;
}

.md-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.md-table th,
.md-table td {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.md-table th {
    background: rgba(56, 189, 248, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.wiki-image {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
}

.internal-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed rgba(56, 189, 248, 0.55);
    cursor: pointer;
    padding: 0 2px;
}

.internal-link:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.18);
    border-radius: 3px;
}

.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #cbd5e1;
    overflow-x: auto;
    margin-bottom: 0.85rem;
}

.code-block pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.76rem;
    color: var(--text-muted);
    gap: 0.5rem;
}

.card-footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.backlink-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
}

.asset-3d-badge {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.12rem 0.52rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
}

.card-actions {
    display: flex;
    gap: 0.35rem;
}

.edit-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.28rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.edit-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Interactive 3D Studio Preview Dock (Movable Overlay in v2.1) */
.studio-3d-dock {
    width: 460px;
    background: var(--bg-secondary);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 1.15rem;
    position: fixed;
    top: 86px;
    right: 28px;
    z-index: 120;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(56, 189, 248, 0.15);
}

.dock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.dock-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.dock-header p {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
}

.dock-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dock-select {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.6rem;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    font-size: 0.78rem;
}

.btn-upload-3d {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.7rem;
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.canvas-3d-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: radial-gradient(circle at center, #131c31 0%, #070b12 100%);
}

#wiki3DCanvas {
    width: 100%;
    height: 320px;
    display: block;
    cursor: grab;
}

#wiki3DCanvas:active {
    cursor: grabbing;
}

.canvas-overlay-hud {
    position: absolute;
    bottom: 0.55rem;
    left: 0.65rem;
    right: 0.65rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.hud-badge {
    background: rgba(8, 12, 20, 0.82);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.hud-metrics {
    background: rgba(8, 12, 20, 0.78);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.dock-scrubber {
    margin-top: 0.75rem;
}

.scrubber-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

#moveScrubber {
    width: 100%;
    accent-color: var(--accent-primary);
}

.viewer-toolbar {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.btn-mini {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.btn-mini.active,
.btn-mini:hover {
    color: var(--accent-primary);
    border-color: rgba(56, 189, 248, 0.35);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

.modal-reader {
    max-width: 860px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.reader-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.reader-timestamp {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.reader-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reader-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.reader-body {
    font-size: 0.95rem;
    line-height: 1.7;
}

.reader-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.links-box h4 {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.links-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.38rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.editor-toolbar {
    display: flex;
    gap: 0.3rem;
}

.toolbar-btn {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.2rem 0.5rem;
    font-size: 0.74rem;
    cursor: pointer;
}

.toolbar-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    outline: none;
}

.form-group textarea.code-input {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

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

@media (max-width: 1200px) {
    .workspace-split {
        flex-direction: column;
    }
    .studio-3d-dock {
        width: 100%;
        position: static;
    }
}

/* ==========================================================================
   Mathematical Environments (KaTeX & Mathematical Fallback Typography)
   ========================================================================== */

.math-inline {
    display: inline-block;
    vertical-align: baseline;
    font-family: 'KaTeX_Math', 'Latin Modern Math', 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif;
    font-size: 1.05em;
    padding: 0 0.18rem;
    color: #e0f2fe;
}

.math-block {
    margin: 1.25rem 0;
    padding: 1.15rem 1.6rem;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    text-align: center;
    position: relative;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.math-block:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.15);
}

.math-block-inner {
    display: inline-block;
    min-width: 100%;
    text-align: center;
}

/* KaTeX theme overrides for Enzian dark studio aesthetics */
.katex {
    font-size: 1.1em;
    color: #f0f9ff;
    text-rendering: auto;
}

.katex-display {
    margin: 0.2rem 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

.katex-display > .katex {
    text-align: center;
    white-space: nowrap;
}

/* Fallback Math Typography */
.math-fallback {
    font-family: 'KaTeX_Math', 'Latin Modern Math', 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif;
    font-size: 1.08em;
    color: #e0f2fe;
    letter-spacing: 0.02em;
}

.math-block-fallback {
    font-size: 1.18em;
    padding: 0.45rem 0;
    display: inline-block;
}

.math-bold {
    font-weight: 700;
    font-family: var(--font-sans);
    color: #38bdf8;
    padding: 0 0.1rem;
}

.math-text {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.9em;
    color: #94a3b8;
}

.math-func {
    font-family: var(--font-sans);
    font-style: normal;
    font-weight: 600;
    color: #818cf8;
}

.math-sqrt {
    display: inline-flex;
    align-items: baseline;
    margin: 0 0.15rem;
}

.math-rad {
    font-size: 1.15em;
    margin-right: 1px;
    color: #38bdf8;
}

.math-radicand {
    border-top: 1.5px solid #38bdf8;
    padding: 0 0.18rem;
    display: inline-block;
}

.math-frac {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    padding: 0 0.3rem;
    font-size: 0.9em;
    line-height: 1.15;
}

.math-num {
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
}

.math-den {
    padding-top: 1px;
}

.math-cases {
    display: inline-flex;
    align-items: center;
    margin: 0.5rem 0;
    text-align: left;
}

.math-cases-brace {
    font-size: 2.2em;
    font-weight: 300;
    line-height: 1;
    color: #38bdf8;
    margin-right: 0.45rem;
}

.math-cases-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.math-cases-row {
    display: flex;
    gap: 1.25rem;
    align-items: baseline;
}

.math-case-cond {
    color: #94a3b8;
    font-size: 0.9em;
}

#wiki3DCanvas {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

#wiki3DCanvas:active {
    cursor: grabbing;
}



/* ==========================================================================
   Enzian Wiki v2.1 Enhancements:
   - Collapsible Sidepanel & Per-Category Article Tree
   - Dynamic Domain / Category Quick-Creator
   - Inline Code (`backticks`) in Titles, Headers & Body
   - Streamlined 4-Part Preview Cards
   - Dedicated Full-Page Article View with Back Stack Navigation
   - Hover Link Tooltips & Movable Floating Overlays (Article & 3D Viewport)
   ========================================================================== */

.sidebar {
    width: 300px;
    transition: transform 0.24s ease, width 0.24s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    border-right: none;
    overflow: hidden;
}

.main-content {
    margin-left: 300px;
    transition: margin-left 0.24s ease;
}

.app-container.sidebar-collapsed .main-content {
    margin-left: 0;
}

.brand-titles {
    flex: 1;
    min-width: 0;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.16s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--accent-primary);
    border-color: var(--border-hover);
    background: var(--accent-glow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sidebar-expand-trigger {
    white-space: nowrap;
}

/* Nav Section Header & Dynamic Category Creator */
.nav-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.35rem 0.4rem;
}

.add-domain-btn {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 6px;
    padding: 0.16rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-domain-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    color: #fff;
}

.new-domain-panel {
    background: rgba(8, 12, 20, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 9px;
    padding: 0.65rem;
    margin-bottom: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.new-domain-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.new-domain-panel input,
.custom-domain-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.76rem;
    outline: none;
}

.custom-domain-input {
    margin-top: 0.45rem;
}

.new-domain-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    margin-top: 0.15rem;
}

/* Collapsible Domain -> Category -> Article Tree */
.sidebar-category-tree {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.tree-domain-block {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    background: rgba(8, 12, 20, 0.38);
    overflow: hidden;
}

.tree-domain-header {
    display: flex;
    align-items: center;
    padding: 0.42rem 0.55rem;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.15s ease;
}

.tree-domain-header.active {
    background: var(--accent-glow);
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.tree-chevron-btn,
.tree-cat-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.tree-chevron-btn:hover,
.tree-cat-toggle-btn:hover {
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
}

.tree-chevron {
    display: inline-block;
    font-size: 1.05rem;
    line-height: 1;
    font-weight: 700;
    transition: transform 0.16s ease;
}

.tree-chevron.collapsed {
    transform: rotate(-90deg);
}

.tree-domain-select-btn {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    text-align: left;
}

.tree-domain-header.active .tree-domain-select-btn {
    color: var(--accent-primary);
}

.tree-domain-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-categories-container {
    padding: 0.3rem 0.45rem 0.45rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tree-category-group {
    display: flex;
    flex-direction: column;
}

.tree-category-header {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
}

.tree-category-header.active {
    background: rgba(56, 189, 248, 0.14);
}

.tree-cat-filter-btn {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    cursor: pointer;
    text-align: left;
}

.tree-cat-filter-btn:hover,
.tree-category-header.active .tree-cat-filter-btn {
    color: var(--accent-primary);
}

.tree-cat-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.tree-article-list {
    list-style: none;
    margin: 0.15rem 0 0.25rem 0.85rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tree-article-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    padding: 0.26rem 0.45rem;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1.35;
    transition: all 0.14s ease;
}

.tree-article-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tree-article-item.active {
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.15);
    font-weight: 600;
}

.tree-article-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.15rem 0.4rem;
}

/* Inline Code (`backticks`) in Titles, Headers, Sidebar & Body */
code,
.inline-code-pill,
.card-title code,
.article-page-title code,
.overlay-article-title code,
.tree-article-item code,
.tooltip-title code {
    display: inline-block;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.28);
    padding: 0.04rem 0.3rem;
    margin: 0.1rem 0.14rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.84em;
    line-height: 1.25;
    vertical-align: baseline;
    color: #bae6fd;
    font-weight: 500;
}

/* Streamlined 4-Part Preview Card */
.preview-card-v21 .card-short-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Full-Page Article Reader View */
.article-page-view {
    flex: 1;
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.85rem 2.25rem;
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6);
}

.article-page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.32);
    padding: 0.48rem 0.95rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.16s ease;
}

.btn-back-nav:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #fff;
    transform: translateX(-2px);
}

.article-page-header {
    margin-bottom: 1.35rem;
}

.article-page-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.35rem 0 0.75rem;
    line-height: 1.3;
}

.code-block-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    margin-bottom: 0.45rem;
    font-weight: 600;
}

/* Movable Floating Overlays (Linked Article & 3D Viewport) */
.floating-overlay-window {
    backdrop-filter: blur(14px);
    transition: box-shadow 0.18s ease;
}

.floating-overlay-window.dragging-window {
    user-select: none;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9), 0 0 0 2px var(--accent-primary);
}

.overlay-drag-handle {
    cursor: move;
    user-select: none;
}

.overlay-badge-row {
    margin-bottom: 0.25rem;
}

.movable-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.article-overlay-window {
    position: fixed;
    top: 110px;
    left: calc(50% - 260px);
    width: 540px;
    max-width: calc(100vw - 32px);
    max-height: 85vh;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.42);
    border-radius: 14px;
    padding: 1.15rem 1.3rem;
    z-index: 130;
    display: flex;
    flex-direction: column;
    box-shadow: 0 26px 55px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.overlay-window-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.overlay-article-title {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text-primary);
}

.overlay-window-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.36rem 0.75rem;
    font-size: 0.78rem;
}

.overlay-window-body {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    padding: 0.85rem 0.15rem;
    max-height: 62vh;
    font-size: 0.88rem;
}

.overlay-window-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Floating Link Hover Tooltip */
.wiki-link-tooltip {
    position: fixed;
    z-index: 200;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: rgba(11, 15, 25, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.tooltip-meta {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.tooltip-title {
    font-family: var(--font-heading);
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.tooltip-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 0.45rem;
}

.tooltip-hint {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 0.35rem;
}

/* ==========================================================================
   Kora Wiki v2.2 Enhancements:
   - Clickable Brand Home Link (`#wikiBrandHomeLink`)
   - Resizable Floating Overlays (`#studio3DDock` & `#articleOverlayWindow`)
   - Live Wikilink Autocomplete & Draft Link Status Preview in Edit Mode
   - Broken vs Resolved Link Visual Indicators
   - User Profile Settings & Auth Modals
   ========================================================================== */

.brand-home-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
    transition: background 0.16s ease, transform 0.16s ease;
    cursor: pointer;
}

.brand-home-link:hover {
    background: rgba(56, 189, 248, 0.1);
}

.brand-home-link:hover .logo-title {
    color: var(--accent-primary);
}

/* Resizable Floating Overlays */
.resizable-overlay {
    min-width: 320px;
    min-height: 280px;
}

.studio-3d-dock.resizable-overlay {
    display: flex;
    flex-direction: column;
}

.studio-3d-dock.resizable-overlay .canvas-3d-wrapper {
    flex: 1;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.studio-3d-dock.resizable-overlay #wiki3DCanvas {
    width: 100%;
    height: 100%;
    flex: 1;
}

.overlay-resize-handle {
    position: absolute;
    z-index: 15;
}

.overlay-resize-handle.resize-e {
    top: 12px;
    right: 0;
    width: 8px;
    bottom: 14px;
    cursor: ew-resize;
}

.overlay-resize-handle.resize-w {
    top: 12px;
    left: 0;
    width: 8px;
    bottom: 14px;
    cursor: ew-resize;
}

.overlay-resize-handle.resize-s {
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
}

.overlay-resize-handle.resize-se {
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(56, 189, 248, 0.55) 50%);
    border-bottom-right-radius: 10px;
}

.overlay-resize-handle.resize-sw {
    left: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
    background: linear-gradient(225deg, transparent 50%, rgba(56, 189, 248, 0.45) 50%);
    border-bottom-left-radius: 10px;
}

.floating-overlay-window.resizing-window {
    user-select: none;
    transition: none !important;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9), 0 0 0 2px var(--accent-primary);
}

/* Resolved vs Broken (Future Article) Internal Links */
.internal-link.is-broken {
    color: #fbbf24;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.65);
}

.internal-link.is-broken:hover {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
}

/* Editor Wikilink Live Autocomplete & Draft Link Status Preview */
.editor-desc-group {
    position: relative;
}

.editor-textarea-wrapper {
    position: relative;
}

.wikilink-autocomplete-popover {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    max-height: 250px;
    background: rgba(11, 15, 25, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
    z-index: 250;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wikilink-ac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.42rem 0.75rem;
    background: rgba(56, 189, 248, 0.12);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.wikilink-ac-hint {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-muted);
    font-weight: 400;
}

.wikilink-ac-list {
    overflow-y: auto;
    max-height: 205px;
    display: flex;
    flex-direction: column;
}

.wikilink-ac-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.48rem 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.wikilink-ac-item:hover,
.wikilink-ac-item.active {
    background: rgba(56, 189, 248, 0.16);
}

.wikilink-ac-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.wikilink-ac-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.wikilink-ac-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.06rem 0.36rem;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-primary);
}

.wikilink-ac-badge.future-badge {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.wikilink-ac-excerpt {
    font-size: 0.73rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-draft-links-preview {
    margin-top: 0.45rem;
    padding: 0.45rem 0.65rem;
    background: rgba(8, 12, 20, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
}

.draft-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.12rem 0.45rem;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.draft-link-pill.resolved {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.draft-link-pill.unresolved {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

/* Profile & Login Modals */
.profile-modal-content {
    max-width: 540px;
}

.login-modal-content {
    max-width: 420px;
}

.profile-status-msg {
    font-size: 0.78rem;
    color: var(--accent-primary);
}

