@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-elevated-soft: #1e293b;
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.18);
    --accent-strong: #06b6d4;
    --danger: #fb7185;
    --text: #e5e7eb;
    --text-soft: #9ca3af;
    --border-subtle: rgba(148, 163, 184, 0.35);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.7);
    --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.6);
}

/* Cloud Provider Grouping */
.folder-provider-header {
    background: rgba(15, 23, 42, 0.4);
    padding: 8px 12px;
    margin-top: 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 3px solid #0ea5e9;
}

.cloud-section-header {
    grid-column: 1 / -1;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cloud-section-header::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #0ea5e9;
    border-radius: 2px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #334155 0, #0f172a 55%, #020617 100%);
    color: var(--text);
}

.app-root {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    backdrop-filter: blur(30px);
    overflow: hidden;
}

.app-sidebar {
    width: 280px;
    min-width: 200px;
    flex-shrink: 0;
    /* border-right moved to inline border or separate */
    border-right: none;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
    padding: 20px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    padding: 0;
    background: radial-gradient(circle at top, rgba(30, 41, 59, 0.9), #0f172a);
    min-width: 0;
    /* Fix flex nesting */
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 10px;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top left, #22d3ee1c, transparent 55%);
}

.app-logo {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    background: radial-gradient(circle at top left, #22d3ee, #0ea5e9);
    color: #020617;
    box-shadow: 0 16px 35px rgba(34, 211, 238, 0.5);
}

.app-title-main {
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-title-sub {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.sidebar-section {
    padding: 14px;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top left, #22d3ee0d, transparent 55%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.04), transparent 60%),
        #1e293b80;
    box-shadow: var(--shadow-subtle);
}

.section-title {
    margin: 0 0 10px;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
}

.user-switcher {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-switcher label {
    font-size: 0.8rem;
    color: var(--text-soft);
}

select {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 8px 10px;
    font-size: 0.88rem;
    outline: none;
    appearance: none;
    position: relative;
}

.user-hint {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.folder-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.btn {
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--text);
    transition: background 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease,
        border-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    color: #020617;
    box-shadow: 0 16px 35px rgba(34, 211, 238, 0.4);
}

.btn-outline {
    border-color: rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.7);
}

.btn-ghost {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.7);
}

.btn-text {
    border-color: transparent;
    background: transparent;
    padding-inline: 2px;
    color: var(--accent);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary:hover {
    box-shadow: 0 20px 45px rgba(56, 189, 248, 0.4);
}

.btn-outline:hover,
.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 1);
}

.btn-text:hover {
    color: var(--accent-strong);
}

.folder-tree {
    max-height: calc(100vh - 260px);
    overflow: auto;
    padding-right: 4px;
    font-size: 0.86rem;
}

.folder-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-soft);
}

.folder-node:hover {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text);
}

.folder-node.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(59, 130, 246, 0.18));
    border: 1px solid rgba(34, 211, 238, 0.7);
    color: var(--accent);
}

.folder-node.hidden {
    opacity: 0.4;
}

.folder-node .folder-icon {
    width: 18px;
}

.folder-children {
    margin-left: 16px;
    border-left: 1px dashed rgba(148, 163, 184, 0.4);
    padding-left: 8px;
}



.middle-column {
    display: flex;
    flex-direction: column;
    flex: 1.15;
    min-width: 360px;
    background: transparent;
    overflow: hidden;
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.viewer-column {
    width: 320px;
    min-width: 50px;
    /* collapsible */
    background: #0f172a;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
    position: relative;
}

.viewer-header-bar {
    height: 40px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.viewer-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.viewer-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 0.85rem;
    opacity: 0.6;
    pointer-events: none;
}

/* --- Resizers --- */

.resizer-vertical {
    width: 6px;
    cursor: col-resize;
    background: rgba(15, 23, 42, 0.4);
    transition: background 0.2s;
    flex-shrink: 0;
    z-index: 10;
}

.resizer-vertical:hover,
.resizer-vertical.resizing {
    background: var(--accent);
}

.resizer-horizontal {
    height: 6px;
    cursor: row-resize;
    background: rgba(15, 23, 42, 0.4);
    transition: background 0.2s;
    flex-shrink: 0;
    z-index: 10;
}

.resizer-horizontal:hover,
.resizer-horizontal.resizing {
    background: var(--accent);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.main-header h1 {
    margin: 0;
    font-size: 1.2rem;
}

.main-subtitle {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.main-header-actions {
    display: flex;
    gap: 8px;
}

.upload-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-dropzone {
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.8);
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.18), transparent 65%),
        rgba(15, 23, 42, 0.92);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-soft);
}

.upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(34, 211, 238, 0.5);
    color: var(--accent);
    font-size: 1.2rem;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.upload-text span {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.upload-note {
    margin-left: auto;
    max-width: 260px;
    font-size: 0.76rem;
    color: var(--text-soft);
}

.upload-meta {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.meta-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
}

.content-panel {
    border-radius: 18px;
    background: radial-gradient(circle at top left, #334155, #0f172a);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.inspector-panel {
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding: 14px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 300px;
    /* initial height */
    min-height: 150px;
    overflow-y: auto;
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.inspector-header h2 {
    margin: 0;
    font-size: 0.9rem;
}

.inspector-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.inspector-section-title {
    margin: 6px 0 4px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
}

.inspector-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;
}

.pill {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-weight: 500;
}

.inspector-label {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.inspector-input,
.inspector-input-inline {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text);
    padding: 5px 8px;
    font-size: 0.8rem;
    outline: none;
}

.inspector-input-inline {
    width: 100%;
}

.inspector-input:focus,
.inspector-input-inline:focus {
    border-color: rgba(34, 211, 238, 0.9);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4);
}

.inspector-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inspector-empty {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.inspector-note {
    margin: 2px 0 0;
    font-size: 0.74rem;
    color: var(--text-soft);
}

.inspector-info {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
    font-size: 0.76rem;
    color: var(--text-soft);
}

.inspector-info-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.inspector-info-label {
    opacity: 0.8;
}

.inspector-info-value {
    text-align: right;
}

.inspector-thumb-dropzone {
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.8);
    padding: 6px 8px;
    font-size: 0.78rem;
    color: var(--text-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.8);
}

.inspector-thumb-dropzone span {
    flex: 1;
}

.inspector-thumb-dropzone button {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.inspector-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.inspector-visibility-toggle input[type="checkbox"] {
    width: 13px;
    height: 13px;
}

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

.content-header h2 {
    margin: 0;
    font-size: 0.98rem;
}

.pill {
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: var(--text-soft);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.file-card {
    border-radius: 14px;
    padding: 10px;
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.2), transparent 55%),
        rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.7);
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    border-color: rgba(56, 189, 248, 0.9);
}

.file-card.selected {
    border-color: rgba(34, 211, 238, 0.95);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.7), 0 18px 40px rgba(15, 23, 42, 0.9);
}

.cloud-file-card.selected {
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.26), transparent 55%),
        rgba(15, 23, 42, 0.98);
    border-color: rgba(34, 211, 238, 0.95);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.65), 0 18px 40px rgba(15, 23, 42, 0.9);
}

.cloud-file-card:active {
    transform: translateY(-1px) scale(0.99);
}

.file-card.hidden {
    opacity: 0.4;
    filter: grayscale(0.8);
}

/* --- Unsupported Cloud File (non-GLB) --- */
.cloud-file-unsupported {
    opacity: 0.4;
    filter: grayscale(0.65);
    cursor: not-allowed;
    position: relative;
}

.cloud-file-unsupported:hover {
    opacity: 0.55;
    filter: grayscale(0.5);
    transform: none;
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.7);
}

.cloud-file-unsupported .file-badge {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.file-unsupported-hint {
    font-size: 0.68rem;
    color: #f59e0b;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Toggle button active state */
#btnToggleShowAll.active {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.7);
    color: var(--accent);
}

body.theme-light .cloud-file-unsupported .file-badge {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

body.theme-light .file-unsupported-hint {
    color: #d97706;
}

body.theme-light #btnToggleShowAll.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.7);
    color: #2563eb;
}

body.theme-kio #btnToggleShowAll.active {
    background: rgba(51, 255, 51, 0.12);
    border-color: rgba(51, 255, 51, 0.7);
    color: #1A1A1A;
}

.file-thumbnail {
    border-radius: 10px;
    height: 90px;
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.36), transparent 60%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.35), transparent 60%),
        #0f172a;
    position: relative;
    overflow: hidden;
}

.file-visibility-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-soft);
    cursor: pointer;
    padding: 0;
}

.file-visibility-toggle.visible {
    border-color: rgba(34, 211, 238, 0.9);
    color: var(--accent);
}

.file-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.file-thumbnail::before,
.file-thumbnail::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.file-thumbnail::before {
    width: 120%;
    height: 120%;
    top: 8%;
    left: -28%;
}

.file-thumbnail::after {
    width: 80%;
    height: 80%;
    top: -10%;
    right: -20%;
}

.file-badge {
    position: absolute;
    bottom: 7px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.7rem;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.file-name {
    font-size: 0.84rem;
}

.file-info {
    font-size: 0.74rem;
    color: var(--text-soft);
}

.file-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.file-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.7rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px 28px;
    color: var(--text-soft);
}

.empty-state h3 {
    margin: 0 0 6px;
    font-size: 0.98rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.82rem;
}

.concept-notes {
    border-radius: 16px;
    padding: 12px 14px 10px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px dashed rgba(148, 163, 184, 0.7);
    font-size: 0.8rem;
    color: var(--text-soft);
}

.concept-notes h2 {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.concept-notes ul {
    margin: 0;
    padding-left: 20px;
}

.concept-notes li+li {
    margin-top: 4px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(140%);
    background: rgba(15, 23, 42, 0.96);
    border-radius: 999px;
    padding: 8px 16px;
    border: 1px solid rgba(34, 211, 238, 0.9);
    color: var(--accent);
    font-size: 0.82rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.18s ease-out;
    pointer-events: none;
}

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



/* --- Light Theme Overrides ------------------------------------------------- */

body.theme-light {
    background: radial-gradient(circle at top left, #e5e7eb 0, #f9fafb 55%, #e5e7eb 100%);
    color: #0f172a;
}

body.theme-light .folder-provider-header {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-left-color: #0ea5e9;
}

body.theme-light .cloud-section-header {
    color: #1e293b;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

body.theme-light .cloud-section-header::before {
    background: #0ea5e9;
}

body.theme-light .user-switcher label {
    color: #475569;
}

body.theme-light .app-sidebar {
    background: linear-gradient(145deg, #f9fafb, #e5e7eb);
    border-right-color: rgba(148, 163, 184, 0.5);
}

body.theme-light .sidebar-section {
    background: radial-gradient(circle at top left, #e0f2fe, transparent 55%),
        radial-gradient(circle at bottom right, #e5e7eb, transparent 60%),
        #ffffffd0;
}

body.theme-light .section-title {
    color: #94a3b8;
}

body.theme-light select {
    background: #f3f4f6;
    color: #0f172a;
    border-color: #cbd5f3;
}

body.theme-light .app-main {
    background: radial-gradient(circle at top, #e5e7eb, #f9fafb);
}

body.theme-light .upload-dropzone {
    background: radial-gradient(circle at top left, #e0f2fe, transparent 55%),
        radial-gradient(circle at bottom right, #e5e7eb, transparent 65%),
        #ffffff;
}

body.theme-light .upload-note,
body.theme-light .upload-meta,
body.theme-light .user-hint,
body.theme-light .main-subtitle,
body.theme-light .concept-notes {
    color: #6b7280;
}

body.theme-light .content-panel {
    background: radial-gradient(circle at top left, #ffffff, #e5e7eb);
    border-color: rgba(148, 163, 184, 0.6);
}

body.theme-light .file-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.6);
}

body.theme-light .file-card.selected {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.8), 0 18px 40px rgba(148, 163, 184, 0.8);
}

body.theme-light .file-thumbnail {
    background: radial-gradient(circle at top left, #e0f2fe, transparent 60%),
        radial-gradient(circle at bottom right, #e5e7eb, transparent 60%),
        #f9fafb;
}

body.theme-light .file-badge,
body.theme-light .file-tag,
body.theme-light .pill {
    background: #f9fafb;
    border-color: rgba(148, 163, 184, 0.7);
    color: #4b5563;
}

body.theme-light .folder-node {
    color: #64748b;
}

body.theme-light .folder-node:hover {
    background: #e5e7eb;
    color: #0f172a;
}

body.theme-light .folder-node.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(56, 189, 248, 0.08));
    border-color: rgba(59, 130, 246, 0.7);
    color: #1d4ed8;
}

.folder-node.drag-target {
    border-color: rgba(34, 211, 238, 0.9);
    background: radial-gradient(circle at left, rgba(34, 211, 238, 0.18), transparent 65%);
}

body.theme-light .folder-node.drag-target {
    border-color: rgba(59, 130, 246, 0.9);
    background: radial-gradient(circle at left, rgba(59, 130, 246, 0.16), transparent 65%);
}

body.theme-light .concept-notes {
    background: #ffffff;
    border-style: solid;
}

body.theme-light .toast {
    background: #0f172a;
    color: #22c55e;
    border-color: #22c55e;
}

body.theme-light .inspector-panel {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border-top-color: rgba(148, 163, 184, 0.4);
}

body.theme-light .inspector-header h2 {
    color: #1e293b;
}

body.theme-light .inspector-subtitle,
body.theme-light .inspector-label,
body.theme-light .inspector-note,
body.theme-light .inspector-empty {
    color: #64748b;
}

body.theme-light .inspector-section-title {
    color: #94a3b8;
}

body.theme-light .inspector-input,
body.theme-light .inspector-input-inline {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.5);
    color: #1e293b;
}

body.theme-light .inspector-input:focus,
body.theme-light .inspector-input-inline:focus {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

body.theme-light .inspector-info {
    color: #64748b;
    border-top-color: rgba(148, 163, 184, 0.4);
}

body.theme-light .inspector-thumb-dropzone {
    background: #f9fafb;
    border-color: rgba(148, 163, 184, 0.5);
    color: #64748b;
}

body.theme-light .viewer-column {
    background: #e8ecf0;
    border-left-color: rgba(148, 163, 184, 0.5);
}

body.theme-light .viewer-header-bar {
    background: linear-gradient(90deg, #f9fafb, #f1f5f9);
    border-bottom-color: rgba(148, 163, 184, 0.4);
}

body.theme-light .viewer-label {
    color: #64748b;
}

body.theme-light .viewer-container {
    background: radial-gradient(circle at center, #e8ecf0 0%, #d8dde4 100%);
}

body.theme-light .viewer-placeholder {
    color: #94a3b8;
}

body.theme-light .resizer-vertical {
    background: rgba(148, 163, 184, 0.2);
}

body.theme-light .resizer-vertical:hover,
body.theme-light .resizer-vertical.resizing {
    background: rgba(59, 130, 246, 0.6);
}

body.theme-light .resizer-horizontal {
    background: rgba(148, 163, 184, 0.2);
}

body.theme-light .resizer-horizontal:hover,
body.theme-light .resizer-horizontal.resizing {
    background: rgba(59, 130, 246, 0.6);
}

/* --- Light Theme: Buttons -------------------------------------------------- */
body.theme-light .btn {
    color: #1e293b;
}

body.theme-light .btn-outline {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.6);
    color: #334155;
}

body.theme-light .btn-ghost {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(148, 163, 184, 0.4);
    color: #334155;
}

body.theme-light .btn-outline:hover,
body.theme-light .btn-ghost:hover {
    background: #f1f5f9;
    border-color: rgba(100, 116, 139, 0.8);
    color: #0f172a;
}

body.theme-light .btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 8px 25px rgba(3, 105, 161, 0.3);
}

body.theme-light .btn-primary:hover {
    box-shadow: 0 12px 35px rgba(3, 105, 161, 0.4);
}

body.theme-light .btn-text {
    color: #0284c7;
}

body.theme-light .btn-text:hover {
    color: #0369a1;
}

/* --- Light Theme: Modal ---------------------------------------------------- */
body.theme-light .modal-overlay {
    background: rgba(148, 163, 184, 0.6);
    backdrop-filter: blur(8px);
}

body.theme-light .modal-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
}

body.theme-light .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.3);
}

body.theme-light .modal-header h2 {
    color: #0f172a;
}

body.theme-light .modal-close {
    color: #64748b;
}

body.theme-light .modal-close:hover {
    color: #0f172a;
}

/* --- Light Theme: Cloud Provider Options (in Modal) ------------------------ */
body.theme-light .cloud-provider-option {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .cloud-provider-option:hover {
    background: #f1f5f9;
    border-color: rgba(100, 116, 139, 0.5);
}

body.theme-light .cloud-provider-option.selected {
    border-color: rgba(14, 165, 233, 0.6);
    background: rgba(14, 165, 233, 0.06);
}

body.theme-light .provider-info strong {
    color: #1e293b;
}

body.theme-light .provider-info span {
    color: #64748b;
}

body.theme-light .provider-check {
    color: #0284c7;
}

body.theme-light .provider-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* --- Light Theme: Cloud Credentials Form ----------------------------------- */
body.theme-light .cloud-credentials-form h3 {
    color: #1e293b;
}

body.theme-light .form-hint {
    color: #64748b;
}

body.theme-light .form-group label {
    color: #475569;
}

body.theme-light .form-input {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.45);
    color: #1e293b;
}

body.theme-light .form-input:focus {
    border-color: rgba(14, 165, 233, 0.7);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

body.theme-light .form-input::placeholder {
    color: #94a3b8;
}

body.theme-light .form-status.loading {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

body.theme-light .form-status.success {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.3);
    color: #16a34a;
}

body.theme-light .form-status.error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* --- Light Theme: Cloud Panel (main page) ---------------------------------- */
body.theme-light .cloud-providers-header h2 {
    color: #0f172a;
}

body.theme-light .cloud-provider-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .cloud-provider-card.connected {
    border-color: rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), #ffffff);
}

body.theme-light .cloud-provider-card.connected .provider-card-status {
    color: #0284c7;
}

body.theme-light .provider-card-body strong {
    color: #1e293b;
}

body.theme-light .provider-card-status {
    color: #64748b;
}

body.theme-light .provider-card-info {
    color: #94a3b8;
}

body.theme-light .provider-badge-inline {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

body.theme-light .cloud-no-files {
    color: #64748b;
}

body.theme-light .cloud-empty-state {
    color: #94a3b8;
}

body.theme-light .cloud-file-card {
    border-left-color: rgba(14, 165, 233, 0.5);
}

/* --- Light Theme: User Info Bar -------------------------------------------- */
body.theme-light .user-info-details strong {
    color: #1e293b;
}

body.theme-light .user-info-details span {
    color: #64748b;
}

body.theme-light .user-info-bar {
    border-color: rgba(148, 163, 184, 0.3);
}

/* --- Light Theme: Mode Switcher -------------------------------------------- */
body.theme-light .mode-btn {
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.3);
    background: #f8fafc;
}

body.theme-light .mode-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

body.theme-light .mode-btn.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(59, 130, 246, 0.08));
    border-color: rgba(14, 165, 233, 0.5);
    color: #0284c7;
}

/* --- Light Theme: Scrollable content & various fixes ----------------------- */
body.theme-light .scrollable-content {
    color: #1e293b;
}

body.theme-light .sidebar-header {
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent 55%);
}

body.theme-light .file-visibility-toggle {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.5);
    color: #64748b;
}

body.theme-light .file-badge {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.5);
    color: #475569;
}

@media (max-width: 960px) {
    .app-root {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        display: none;
    }

    .app-main {
        padding-inline: 14px;
    }

    .upload-panel {
        margin-top: 8px;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .inspector-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .upload-dropzone {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-note {
        margin-left: 0;
        max-width: none;
    }

    .upload-meta {
        flex-direction: column;
    }
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #020617 100%);
    overflow: hidden;
}

.login-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 12s ease-in-out infinite;
}

.login-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #22d3ee, transparent 70%);
    top: -100px;
    left: -100px;
    animation-duration: 14s;
}

.login-orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    bottom: -80px;
    right: -80px;
    animation-duration: 18s;
    animation-delay: -4s;
}

.login-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #f472b6, transparent 70%);
    top: 50%;
    left: 60%;
    animation-duration: 16s;
    animation-delay: -8s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(40px, 30px) scale(1.05);
    }
}

.login-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
}

.login-logo-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    box-shadow: 0 20px 60px rgba(34, 211, 238, 0.3),
        0 0 0 1px rgba(34, 211, 238, 0.2);
    animation: logoPulse 3s ease-in-out infinite;
}

.login-logo-icon {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 20px 60px rgba(34, 211, 238, 0.3), 0 0 0 1px rgba(34, 211, 238, 0.2);
    }

    50% {
        box-shadow: 0 20px 80px rgba(34, 211, 238, 0.5), 0 0 0 2px rgba(34, 211, 238, 0.3);
    }
}

.login-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #e5e7eb 30%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
}

.login-card {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.login-card-title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e5e7eb;
}

.login-card-desc {
    margin: 0 0 20px;
    font-size: 0.88rem;
    color: #64748b;
}

/* Login Tabs (Anmelden / Registrieren) */
.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.login-tab:hover {
    color: #e5e7eb;
}

.login-tab.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.12));
    color: #22d3ee;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.15);
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form .form-group {
    margin-bottom: 12px;
}

.btn-block {
    width: 100%;
    padding: 12px 20px !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    border-radius: 14px !important;
    margin-top: 8px;
}

.login-profiles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.login-profile-card:hover {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateX(4px);
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.15);
}

.login-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.login-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-profile-info strong {
    font-size: 0.95rem;
    color: #e5e7eb;
}

.login-profile-info span {
    font-size: 0.8rem;
    color: #64748b;
}

.login-arrow {
    font-size: 1.1rem;
    color: #475569;
    transition: color 0.2s, transform 0.2s;
}

.login-profile-card:hover .login-arrow {
    color: #22d3ee;
    transform: translateX(4px);
}

.login-footer {
    font-size: 0.76rem;
    color: #475569;
    text-align: center;
}

/* Login exit animation */
.login-exit {
    animation: loginFadeOut 0.6s ease forwards;
}

@keyframes loginFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(8px);
    }
}

/* App enter animation */
.app-enter {
    animation: appFadeIn 0.6s ease forwards;
}

@keyframes appFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.97);
    }

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

/* ============================================================
   USER INFO BAR (Sidebar)
   ============================================================ */

.user-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.user-info-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-info-details strong {
    font-size: 0.85rem;
    color: #e5e7eb;
}

.user-info-details span {
    font-size: 0.72rem;
    color: #64748b;
}

.btn-logout {
    margin-left: auto;
    font-size: 1rem !important;
    padding: 4px 8px !important;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 1;
    color: var(--danger) !important;
}

/* ============================================================
   CLOUD PANEL
   ============================================================ */

.cloud-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.cloud-providers-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-add-cloud {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.cloud-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.cloud-provider-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.cloud-provider-card.connected {
    border-color: rgba(34, 211, 238, 0.3);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.05), rgba(15, 23, 42, 0.7));
}

.cloud-provider-card.disabled {
    opacity: 0.5;
}

.provider-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.provider-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.provider-card-body strong {
    font-size: 0.95rem;
}

.provider-card-status {
    font-size: 0.78rem;
    color: #64748b;
}

.cloud-provider-card.connected .provider-card-status {
    color: #22d3ee;
}

.provider-card-info {
    font-size: 0.72rem;
    color: #475569;
}

.provider-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-sm {
    font-size: 0.75rem !important;
    padding: 5px 10px !important;
}

.provider-badge-inline {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.cloud-files-section {
    margin-top: 8px;
}

.cloud-load-more {
    text-align: center;
    padding: 12px;
}

.cloud-no-files {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-size: 0.85rem;
}

.cloud-empty-state {
    text-align: center;
    padding: 20px;
    color: #475569;
    font-size: 0.82rem;
}

.cloud-file-card {
    border-left: 3px solid rgba(34, 211, 238, 0.4);
}

/* Folder cards inside Cloud Files grid */
.cloud-folder-card .file-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.22), transparent 60%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.18), transparent 60%),
        #0f172a;
}

.cloud-folder-thumb {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.cloud-folder-card.loading {
    pointer-events: none;
}

.cloud-folder-card.loading .cloud-folder-thumb {
    opacity: 0.25;
}

.cloud-card-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cloud-folder-card.loading .cloud-card-spinner {
    display: flex;
}

.cloud-card-spinner::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: rgba(34, 211, 238, 0.95);
    animation: cloudSpin 0.85s linear infinite;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

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

body.theme-light .cloud-folder-card .file-thumbnail {
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 60%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.12), transparent 60%),
        #f9fafb;
}

body.theme-light .cloud-file-card.selected {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(59, 130, 246, 0.06));
    border-color: rgba(14, 165, 233, 0.85);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.35), 0 18px 40px rgba(148, 163, 184, 0.55);
}

body.theme-light .cloud-card-spinner::before {
    border-color: rgba(148, 163, 184, 0.55);
    border-top-color: rgba(14, 165, 233, 0.95);
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.45);
}

body.theme-kio .cloud-folder-card .file-thumbnail {
    background: radial-gradient(circle at top left, rgba(51, 255, 51, 0.10), transparent 60%),
        radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.06), transparent 60%),
        #F5F5F5;
}

body.theme-kio .cloud-file-card.selected {
    background: linear-gradient(135deg, rgba(51, 255, 51, 0.14), rgba(0, 0, 0, 0.03));
    border-color: rgba(34, 204, 34, 0.75);
    box-shadow: 0 0 0 1px rgba(34, 204, 34, 0.35), 0 12px 30px rgba(0, 0, 0, 0.08);
}

body.theme-kio .cloud-card-spinner::before {
    border-color: rgba(0, 0, 0, 0.18);
    border-top-color: rgba(34, 204, 34, 0.95);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

/* --- Cloud Breadcrumb & Folder Bar ---------------------------------------- */

.cloud-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.cloud-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-soft);
    font-size: 0.78rem;
    user-select: none;
    max-width: 100%;
}

.cloud-breadcrumb-item.is-link {
    cursor: pointer;
    color: var(--accent);
    border-color: rgba(34, 211, 238, 0.35);
}

.cloud-breadcrumb-item.is-link:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(34, 211, 238, 0.75);
    color: var(--accent-strong);
}

.cloud-breadcrumb-item.is-current {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.55);
}

.cloud-breadcrumb-item.selected {
    border-color: rgba(34, 211, 238, 0.85);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.cloud-breadcrumb-item.loading {
    pointer-events: none;
    opacity: 0.92;
    position: relative;
    padding-right: 28px;
}

.cloud-breadcrumb-item.loading::after {
    content: "";
    position: absolute;
    right: 8px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: rgba(34, 211, 238, 0.95);
    animation: cloudSpin 0.85s linear infinite;
}

.cloud-breadcrumb-sep {
    opacity: 0.65;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.cloud-folder-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.cloud-folder-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-soft);
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.cloud-folder-pill:hover {
    transform: translateY(-1px);
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
    color: var(--text);
}

.cloud-folder-pill.selected {
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25);
    color: var(--text);
}

.cloud-folder-pill.loading {
    pointer-events: none;
    position: relative;
    padding-right: 30px;
}

.cloud-folder-pill.loading::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: rgba(34, 211, 238, 0.95);
    animation: cloudSpin 0.85s linear infinite;
}

/* Optional: tree expand toggles (cloud sidebar) */
.cloud-folder-tree .folder-node {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cloud-folder-tree .folder-node.loading {
    opacity: 0.92;
}

.cloud-inline-spinner {
    margin-left: auto;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: rgba(34, 211, 238, 0.95);
    animation: cloudSpin 0.85s linear infinite;
}

.cloud-tree-toggle {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-soft);
    cursor: pointer;
    flex-shrink: 0;
}

.cloud-tree-toggle:hover {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
}

.cloud-tree-toggle.is-hidden {
    visibility: hidden;
}

.cloud-tree-children {
    margin-left: 18px;
    border-left: 1px dashed rgba(148, 163, 184, 0.4);
    padding-left: 8px;
}

body.theme-light .cloud-breadcrumb-item {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.55);
    color: #64748b;
}

body.theme-light .cloud-breadcrumb-item.is-link {
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.35);
}

body.theme-light .cloud-breadcrumb-item.is-current {
    color: #0f172a;
}

body.theme-light .cloud-breadcrumb-item.selected {
    border-color: rgba(14, 165, 233, 0.85);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
}

body.theme-light .cloud-breadcrumb-item.loading::after {
    border-color: rgba(148, 163, 184, 0.55);
    border-top-color: rgba(14, 165, 233, 0.95);
}

body.theme-light .cloud-folder-pill {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.55);
    color: #64748b;
}

body.theme-light .cloud-folder-pill.selected {
    border-color: rgba(14, 165, 233, 0.65);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.18);
    color: #0f172a;
}

body.theme-light .cloud-folder-pill.loading::after,
body.theme-light .cloud-inline-spinner {
    border-color: rgba(148, 163, 184, 0.55);
    border-top-color: rgba(14, 165, 233, 0.95);
}

body.theme-light .cloud-folder-pill:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.theme-light .cloud-tree-toggle {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.5);
    color: #64748b;
}

body.theme-kio .cloud-breadcrumb-item,
body.theme-kio .cloud-folder-pill {
    background: #F5F5F5;
    border-color: rgba(0, 0, 0, 0.12);
    color: #4B5563;
}

body.theme-kio .cloud-folder-pill.selected {
    border-color: rgba(34, 204, 34, 0.55);
    box-shadow: 0 0 0 1px rgba(34, 204, 34, 0.18);
    color: #1A1A1A;
}

body.theme-kio .cloud-folder-pill.loading::after,
body.theme-kio .cloud-inline-spinner {
    border-color: rgba(0, 0, 0, 0.18);
    border-top-color: rgba(34, 204, 34, 0.95);
}

body.theme-kio .cloud-breadcrumb-item.is-link {
    color: #22CC22;
    border-color: rgba(34, 204, 34, 0.35);
}

body.theme-kio .cloud-breadcrumb-item.is-current {
    color: #1A1A1A;
}

body.theme-kio .cloud-breadcrumb-item.selected {
    border-color: rgba(34, 204, 34, 0.75);
    box-shadow: 0 0 0 1px rgba(34, 204, 34, 0.25);
}

body.theme-kio .cloud-breadcrumb-item.loading::after {
    border-color: rgba(0, 0, 0, 0.18);
    border-top-color: rgba(34, 204, 34, 0.95);
}

body.theme-kio .cloud-folder-pill:hover {
    background: #EEEEEE;
    border-color: rgba(0, 0, 0, 0.2);
    color: #1A1A1A;
}

body.theme-kio .cloud-tree-toggle {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
    color: #6B7280;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.modal-card {
    width: 100%;
    max-width: 540px;
    background: linear-gradient(145deg, #0f172a, #020617);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modalSlideIn 0.35s ease;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    font-size: 1.2rem;
    padding: 4px 8px !important;
    border: none !important;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cloud-provider-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cloud-provider-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.cloud-provider-option.selected {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.06);
}

.cloud-provider-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.provider-icon {
    font-size: 1.5rem;
}

.provider-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.provider-info strong {
    font-size: 0.9rem;
}

.provider-info span {
    font-size: 0.76rem;
    color: #64748b;
}

.provider-check {
    color: #22d3ee;
    font-weight: 700;
    font-size: 1.1rem;
}

.provider-badge {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.cloud-credentials-form h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
}

.form-hint {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
}

.form-input {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.form-input::placeholder {
    color: #475569;
}

.form-status {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.form-status.loading {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.form-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.form-status.error {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: #fb7185;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-actions .btn {
    min-width: 100px;
}

.cloud-folder-tree .folder-node {
    padding-left: 10px;
}

/* ============================================================
   KIO MODE THEME – Kreativ.Institute Branding
   Grey / White / Neon Green · Monospace Typography
   ============================================================ */


body.theme-kio {
    background: #E5E5E5;
    color: #1A1A1A;
    font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
}

body.theme-kio * {
    font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
}

/* --- KIO: Sidebar --------------------------------------------------------- */
body.theme-kio .app-sidebar {
    background: linear-gradient(145deg, #FFFFFF, #F0F0F0);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-kio .sidebar-header {
    background: transparent;
}

body.theme-kio .sidebar-section {
    background: transparent;
}

body.theme-kio .section-title {
    color: #6B7280;
    letter-spacing: 0.18em;
}

body.theme-kio .app-logo {
    background: linear-gradient(135deg, #33FF33, #22CC22);
    color: #000000;
    box-shadow: 0 12px 30px rgba(51, 255, 51, 0.35);
}

body.theme-kio .app-title-main {
    color: #1A1A1A;
}

body.theme-kio .app-title-sub {
    color: #6B7280;
}

/* --- KIO: Main Area ------------------------------------------------------- */
body.theme-kio .app-main {
    background: #E5E5E5;
}

body.theme-kio .scrollable-content {
    color: #1A1A1A;
}

body.theme-kio .main-header h1 {
    color: #1A1A1A;
}

/* --- KIO: Buttons --------------------------------------------------------- */
body.theme-kio .btn {
    color: #1A1A1A;
    font-family: 'JetBrains Mono', monospace;
}

body.theme-kio .btn-primary {
    background: linear-gradient(135deg, #33FF33, #22CC22);
    color: #000000;
    box-shadow: 0 0 0 3px #FFFFFF, 0 8px 24px rgba(51, 255, 51, 0.3);
    border: 1px solid rgba(0,0,0,0.1);
    font-weight: 700;
}

body.theme-kio .btn-primary:hover {
    box-shadow: 0 0 0 4px #FFFFFF, 0 12px 32px rgba(51, 255, 51, 0.45);
}

body.theme-kio .btn-outline {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.15);
    color: #1A1A1A;
    box-shadow: 0 0 0 2px #FFFFFF;
}

body.theme-kio .btn-ghost {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1A1A1A;
    box-shadow: 0 0 0 2px #FFFFFF;
}

body.theme-kio .btn-outline:hover,
body.theme-kio .btn-ghost:hover {
    background: #F5F5F5;
    border-color: rgba(51, 255, 51, 0.5);
    color: #000000;
}

body.theme-kio .btn-text {
    color: #22CC22;
}

body.theme-kio .btn-text:hover {
    color: #1AAE1A;
}

/* --- KIO: Folder Tree ----------------------------------------------------- */
body.theme-kio .folder-node {
    color: #4B5563;
}

body.theme-kio .folder-node:hover {
    background: #E8E8E8;
    color: #1A1A1A;
}

body.theme-kio .folder-node.active {
    background: #D8D8D8;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #1A1A1A;
    font-weight: 600;
}

body.theme-kio .folder-node.drag-target {
    border-color: #1A1A1A;
    background: radial-gradient(circle at left, rgba(0, 0, 0, 0.08), transparent 65%);
}

body.theme-kio .folder-children {
    border-left-color: rgba(0, 0, 0, 0.12);
}

body.theme-kio .folder-provider-header {
    background: rgba(0, 0, 0, 0.04);
    color: #4B5563;
    border-left-color: #1A1A1A;
}

/* --- KIO: File Cards ------------------------------------------------------ */
body.theme-kio .file-card {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-kio .file-card:hover {
    border-color: rgba(51, 255, 51, 0.6);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

body.theme-kio .file-card.selected {
    border-color: rgba(51, 255, 51, 0.9);
    box-shadow: 0 0 0 1px rgba(51, 255, 51, 0.6), 0 12px 30px rgba(0, 0, 0, 0.08);
}

body.theme-kio .file-thumbnail {
    background: radial-gradient(circle at top left, rgba(51, 255, 51, 0.08), transparent 60%),
        radial-gradient(circle at bottom right, #E8E8E8, transparent 60%),
        #F5F5F5;
}

body.theme-kio .file-badge,
body.theme-kio .file-tag,
body.theme-kio .pill {
    background: #F5F5F5;
    border-color: rgba(0, 0, 0, 0.12);
    color: #4B5563;
}

body.theme-kio .file-name {
    color: #1A1A1A;
}

body.theme-kio .file-info {
    color: #6B7280;
}

body.theme-kio .file-visibility-toggle {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
    color: #6B7280;
}

body.theme-kio .file-visibility-toggle.visible {
    border-color: rgba(51, 255, 51, 0.7);
    color: #22CC22;
}

/* --- KIO: Content Panel --------------------------------------------------- */
body.theme-kio .content-panel {
    background: radial-gradient(circle at top left, #FFFFFF, #EFEFEF);
    border-color: rgba(0, 0, 0, 0.1);
}

/* --- KIO: Cloud Section Headers ------------------------------------------- */
body.theme-kio .cloud-section-header {
    color: #1A1A1A;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

body.theme-kio .cloud-section-header::before {
    background: #33FF33;
}

/* --- KIO: Viewer ---------------------------------------------------------- */
body.theme-kio .viewer-column {
    background: #E0E0E0;
    border-left-color: rgba(0, 0, 0, 0.1);
}

body.theme-kio .viewer-header-bar {
    background: linear-gradient(90deg, #F5F5F5, #EEEEEE);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .viewer-label {
    color: #4B5563;
}

body.theme-kio .viewer-container {
    background: radial-gradient(circle at center, #E8E8E8 0%, #D8D8D8 100%);
}

body.theme-kio .viewer-placeholder {
    color: #9CA3AF;
}

/* --- KIO: Resizers -------------------------------------------------------- */
body.theme-kio .resizer-vertical {
    background: rgba(0, 0, 0, 0.08);
}

body.theme-kio .resizer-vertical:hover,
body.theme-kio .resizer-vertical:active {
    background: #33FF33;
}

body.theme-kio .resizer-horizontal {
    background: rgba(0, 0, 0, 0.08);
}

body.theme-kio .resizer-horizontal:hover,
body.theme-kio .resizer-horizontal:active {
    background: #33FF33;
}

/* --- KIO: Inspector ------------------------------------------------------- */
body.theme-kio .inspector-panel {
    background: linear-gradient(180deg, #FFFFFF, #F8F8F8);
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .inspector-header h2 {
    color: #1A1A1A;
}

body.theme-kio .inspector-subtitle,
body.theme-kio .inspector-label,
body.theme-kio .inspector-note,
body.theme-kio .inspector-empty {
    color: #6B7280;
}

body.theme-kio .inspector-section-title {
    color: #9CA3AF;
}

body.theme-kio .inspector-input,
body.theme-kio .inspector-input-inline {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
}

body.theme-kio .inspector-input:focus,
body.theme-kio .inspector-input-inline:focus {
    border-color: rgba(51, 255, 51, 0.6);
    box-shadow: 0 0 0 2px rgba(51, 255, 51, 0.15);
}

body.theme-kio .inspector-info {
    color: #6B7280;
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .inspector-thumb-dropzone {
    background: #F5F5F5;
    border-color: rgba(0, 0, 0, 0.12);
    color: #6B7280;
}

/* --- KIO: Select ---------------------------------------------------------- */
body.theme-kio select {
    background: #FFFFFF;
    color: #1A1A1A;
    border-color: rgba(0, 0, 0, 0.15);
}

/* --- KIO: User Info ------------------------------------------------------- */
body.theme-kio .user-info-bar {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
}

body.theme-kio .user-info-avatar {
    background: #33FF33;
    color: #000000;
    font-weight: 800;
}

body.theme-kio .user-info-details strong {
    color: #1A1A1A;
}

body.theme-kio .user-info-details span {
    color: #6B7280;
}

body.theme-kio .user-switcher label {
    color: #4B5563;
}

body.theme-kio .upload-note,
body.theme-kio .upload-meta,
body.theme-kio .user-hint,
body.theme-kio .main-subtitle,
body.theme-kio .concept-notes {
    color: #6B7280;
}

/* --- KIO: Mode Switcher --------------------------------------------------- */
body.theme-kio .mode-switcher {
    border-color: rgba(0, 0, 0, 0.15);
    background: #EEEEEE;
}

body.theme-kio .mode-btn {
    color: #6B7280;
    border-color: transparent;
    background: transparent;
}

body.theme-kio .mode-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1A1A1A;
}

body.theme-kio .mode-btn.active {
    background: #33FF33;
    border-color: #22CC22;
    color: #000000;
    font-weight: 800;
}

/* --- KIO: Upload ---------------------------------------------------------- */
body.theme-kio .upload-dropzone {
    background: radial-gradient(circle at top left, rgba(51, 255, 51, 0.06), transparent 55%),
        radial-gradient(circle at bottom right, #E8E8E8, transparent 65%),
        #FFFFFF;
    border-color: rgba(0, 0, 0, 0.15);
}

/* --- KIO: Toast ----------------------------------------------------------- */
body.theme-kio .toast {
    background: #1A1A1A;
    color: #33FF33;
    border-color: #33FF33;
}

/* --- KIO: Concept Notes --------------------------------------------------- */
body.theme-kio .concept-notes {
    background: #FFFFFF;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.1);
}

/* --- KIO: Modal ----------------------------------------------------------- */
body.theme-kio .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

body.theme-kio .modal-card {
    background: linear-gradient(145deg, #FFFFFF, #F5F5F5);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
}

body.theme-kio .modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .modal-header h2 {
    color: #1A1A1A;
}

body.theme-kio .modal-close {
    color: #6B7280;
}

body.theme-kio .modal-close:hover {
    color: #1A1A1A;
}

/* --- KIO: Cloud Provider Options (Modal) ---------------------------------- */
body.theme-kio .cloud-provider-option {
    background: #F5F5F5;
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .cloud-provider-option:hover {
    background: #EEEEEE;
    border-color: rgba(0, 0, 0, 0.15);
}

body.theme-kio .cloud-provider-option.selected {
    border-color: rgba(51, 255, 51, 0.5);
    background: rgba(51, 255, 51, 0.06);
}

body.theme-kio .provider-info strong {
    color: #1A1A1A;
}

body.theme-kio .provider-info span {
    color: #6B7280;
}

body.theme-kio .provider-check {
    color: #22CC22;
}

body.theme-kio .provider-badge {
    background: rgba(51, 255, 51, 0.1);
    color: #22CC22;
}

/* --- KIO: Cloud Credentials Form ------------------------------------------ */
body.theme-kio .cloud-credentials-form h3 {
    color: #1A1A1A;
}

body.theme-kio .form-hint {
    color: #6B7280;
}

body.theme-kio .form-group label {
    color: #4B5563;
}

body.theme-kio .form-input {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
}

body.theme-kio .form-input:focus {
    border-color: rgba(51, 255, 51, 0.6);
    box-shadow: 0 0 0 3px rgba(51, 255, 51, 0.1);
}

body.theme-kio .form-input::placeholder {
    color: #9CA3AF;
}

body.theme-kio .form-status.loading {
    background: rgba(51, 255, 51, 0.06);
    border-color: rgba(51, 255, 51, 0.25);
    color: #1A8A1A;
}

body.theme-kio .form-status.success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

body.theme-kio .form-status.error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* --- KIO: Cloud Panel (main page) ----------------------------------------- */
body.theme-kio .cloud-providers-header h2 {
    color: #1A1A1A;
}

body.theme-kio .cloud-provider-card {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .cloud-provider-card.connected {
    border-color: rgba(0, 0, 0, 0.15);
    background: #F8F8F8;
}

body.theme-kio .cloud-provider-card.connected .provider-card-status {
    color: #1A1A1A;
}

body.theme-kio .connected-checkmark {
    color: #22CC22;
}

body.theme-kio .provider-card-body strong {
    color: #1A1A1A;
}

body.theme-kio .provider-card-status {
    color: #6B7280;
}

body.theme-kio .provider-card-info {
    color: #9CA3AF;
}

body.theme-kio .provider-badge-inline {
    background: rgba(51, 255, 51, 0.1);
    color: #22CC22;
}

body.theme-kio .cloud-no-files {
    color: #6B7280;
}

body.theme-kio .cloud-empty-state {
    color: #9CA3AF;
}

body.theme-kio .cloud-file-card {
    border-left-color: rgba(51, 255, 51, 0.4);
}

/* --- KIO: Login Screen ---------------------------------------------------- */
body.theme-kio .login-screen {
    background: linear-gradient(135deg, #D0D0D0 0%, #E5E5E5 40%, #D0D0D0 100%);
}

body.theme-kio .login-orb-1 {
    background: radial-gradient(circle, #33FF33, transparent 70%);
}

body.theme-kio .login-orb-2 {
    background: radial-gradient(circle, #22CC22, transparent 70%);
}

body.theme-kio .login-orb-3 {
    background: radial-gradient(circle, #66FF66, transparent 70%);
}

body.theme-kio .login-logo {
    background: linear-gradient(135deg, #33FF33, #1AAE1A);
    box-shadow: 0 20px 60px rgba(51, 255, 51, 0.3),
        0 0 0 1px rgba(51, 255, 51, 0.2);
}

body.theme-kio .login-logo-icon {
    color: #000000;
}

body.theme-kio .login-title {
    background: linear-gradient(135deg, #1A1A1A 30%, #33FF33 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.theme-kio .login-subtitle {
    color: #6B7280;
}

body.theme-kio .login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
}

body.theme-kio .login-card-title {
    color: #1A1A1A;
}

body.theme-kio .login-card-desc {
    color: #6B7280;
}

body.theme-kio .login-tabs {
    background: rgba(0, 0, 0, 0.04);
}

body.theme-kio .login-tab {
    color: #6B7280;
    font-family: 'JetBrains Mono', monospace;
}

body.theme-kio .login-tab:hover {
    color: #1A1A1A;
}

body.theme-kio .login-tab.active {
    background: linear-gradient(135deg, rgba(51, 255, 51, 0.12), rgba(34, 204, 34, 0.08));
    color: #1A8A1A;
    box-shadow: 0 2px 8px rgba(51, 255, 51, 0.12);
}

body.theme-kio .login-profile-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .login-profile-card:hover {
    background: rgba(51, 255, 51, 0.06);
    border-color: rgba(51, 255, 51, 0.35);
    box-shadow: 0 8px 30px rgba(51, 255, 51, 0.1);
}

body.theme-kio .login-profile-info strong {
    color: #1A1A1A;
}

body.theme-kio .login-profile-info span {
    color: #6B7280;
}

body.theme-kio .login-arrow {
    color: #9CA3AF;
}

body.theme-kio .login-profile-card:hover .login-arrow {
    color: #33FF33;
}

body.theme-kio .login-footer {
    color: #9CA3AF;
}

/* --- KIO: Shortcuts Overlay ----------------------------------------------- */
body.theme-kio .shortcuts-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

body.theme-kio .shortcuts-card {
    background: #FFFFFF;
    color: #1A1A1A;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

body.theme-kio .shortcuts-card kbd {
    background: #F0F0F0;
    border-color: rgba(0, 0, 0, 0.12);
    color: #1A1A1A;
}

/* --- KIO: Scene Editor Panels --------------------------------------------- */
body.theme-kio .scene-editor-column {
    background: #E0E0E0;
}

body.theme-kio .scene-editor-header {
    background: linear-gradient(90deg, #F5F5F5, #EEEEEE);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-kio .scene-sidebar-panel {
    background: #FFFFFF;
    border-top-color: rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

body.theme-kio .scene-sidebar-tabs {
    background: rgba(0, 0, 0, 0.03);
}

body.theme-kio .scene-tab {
    color: #6B7280;
    font-weight: 600;
}

body.theme-kio .scene-tab:hover {
    color: #1A1A1A;
}

body.theme-kio .scene-tab.active {
    color: #1A1A1A;
    border-color: #33FF33;
    background: #E8E8E8;
}

body.theme-kio .scene-list-item.active {
    background: #33FF33;
    border-color: #22CC22;
}

body.theme-kio .scene-list-name {
    color: #1A1A1A;
    font-weight: 600;
}

body.theme-kio .scene-list-item.active .scene-list-name,
body.theme-kio .scene-name-label {
    color: #000000;
    font-weight: 800;
}

body.theme-kio .scene-object-list {
    color: #1A1A1A;
    font-weight: 600;
}

body.theme-kio .scene-object-inspector {
    color: #1A1A1A;
    font-weight: 600;
}

body.theme-kio .scene-inspector-title {
    color: #000000;
    font-weight: 800;
}

body.theme-kio .mode-indicator {
    color: #1A1A1A;
    background: #D8D8D8;
    border-color: rgba(0, 0, 0, 0.2);
}

body.theme-kio .scene-save-btn {
    background: #D8D8D8;
    color: #1A1A1A;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: none;
    font-weight: 600;
}

body.theme-kio .scene-save-btn:hover {
    background: #C8C8C8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.theme-kio .scene-tool-btn {
    background: #FFFFFF;
    color: #1A1A1A;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-weight: 600;
    box-shadow: none;
}

body.theme-kio .scene-tool-btn:hover {
    background: #F5F5F5;
}

body.theme-kio .scene-tool-btn.active {
    background: #33FF33 !important;
    border-color: #22CC22 !important;
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(51, 255, 51, 0.3) !important;
}

body.theme-kio .scene-tool-btn kbd {
    background: rgba(0, 0, 0, 0.1);
    color: #1A1A1A;
}

body.theme-kio .scene-tool-btn.active kbd {
    background: rgba(0, 0, 0, 0.15);
    color: #000000;
}
