
/* ============================================================
   APPLE LIQUID-GLASS THEME — Project Bubble Planner
============================================================ */

/* --- Animated gradient background --- */
.background-gradient {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 35% 20%, #1f8fb8 0%, #0b6290 40%, #06334d 80%, #021622 100%);
    background-size: 220% 220%;
    animation: gradientShift 26s ease-in-out infinite;
    z-index: -3;
}

/* --- Apple-style Liquid Glass Fog Effect --- */
.background-fog {
    position: fixed;
    inset: -15%;
    pointer-events: none;
    z-index: -2;
    opacity: var(--fog-opacity, 0.85);
    filter: blur(var(--fog-blur, 12px));
    transform: translate3d(var(--fog-x, 0px), var(--fog-y, 0px), 0);
    will-change: transform, opacity;
}

/* Primary fog layer - large soft blobs */
.background-fog::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at var(--fog-x1, 25%) var(--fog-y1, 30%), rgba(255,255,255,var(--fog-a1, 0.35)), transparent var(--fog-r1, 55%)),
        radial-gradient(ellipse 60% 70% at var(--fog-x2, 75%) var(--fog-y2, 60%), rgba(180,220,255,var(--fog-a2, 0.30)), transparent var(--fog-r2, 50%)),
        radial-gradient(ellipse 80% 60% at var(--fog-x3, 40%) var(--fog-y3, 75%), rgba(220,240,255,var(--fog-a3, 0.28)), transparent var(--fog-r3, 52%)),
        radial-gradient(ellipse 55% 65% at var(--fog-x4, 15%) var(--fog-y4, 65%), rgba(200,230,255,var(--fog-a4, 0.25)), transparent var(--fog-r4, 48%));
    mix-blend-mode: screen;
    transform: translate3d(0, 0, 0);
    animation: fogDrift 20s ease-in-out infinite;
}

/* Secondary fog layer - smaller, brighter highlights */
.background-fog::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(255,255,255,0.4), transparent 35%),
        radial-gradient(circle at 80% 35%, rgba(200,235,255,0.35), transparent 40%),
        radial-gradient(circle at 55% 80%, rgba(180,220,255,0.3), transparent 38%),
        radial-gradient(circle at 10% 60%, rgba(220,245,255,0.28), transparent 32%),
        radial-gradient(circle at 90% 70%, rgba(200,230,255,0.25), transparent 36%);
    mix-blend-mode: screen;
    opacity: 0.7;
    filter: blur(var(--fog-blur2, 18px));
    animation: fogPulse 8s ease-in-out infinite, fogFloat 15s ease-in-out infinite;
    transform: translate3d(0, 0, 0);
}

/* Tertiary fog overlay - adds depth and movement */
.background-fog-overlay {
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
    filter: blur(25px);
    background:
        radial-gradient(ellipse 100% 80% at 30% 20%, rgba(255,255,255,0.15), transparent 50%),
        radial-gradient(ellipse 90% 100% at 70% 80%, rgba(180,215,255,0.12), transparent 45%);
    mix-blend-mode: overlay;
    animation: fogOverlayDrift 25s ease-in-out infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes fogDrift {
    0% { transform: translate3d(-2%, -1.5%, 0) scale(1.02); }
    33% { transform: translate3d(1.5%, 2%, 0) scale(1.04); }
    66% { transform: translate3d(2%, -1%, 0) scale(1.03); }
    100% { transform: translate3d(-2%, -1.5%, 0) scale(1.02); }
}

@keyframes fogFloat {
    0% { transform: translate3d(0, 0, 0); }
    25% { transform: translate3d(2%, 1.5%, 0); }
    50% { transform: translate3d(-1%, 2%, 0); }
    75% { transform: translate3d(-2%, -1%, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

@keyframes fogPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 0.9; }
}

@keyframes fogOverlayDrift {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(3%, 2%, 0) rotate(2deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}


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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    color: #f5f7ff;
}

body {
    overflow: auto;
}

:root {
    --btn-bg: linear-gradient(145deg, rgba(35,160,255,0.95), rgba(15,120,210,0.9));
    --btn-bg-muted: rgba(9,41,73,0.9);
    --btn-border: 1px solid rgba(255,255,255,0.35);
    --btn-radius: 11px;
    --btn-color: #e8f3ff;
    --btn-font-size: 12px;
    --btn-font-weight: 600;
    --btn-padding: 6px 10px;
    --btn-shadow: 0 8px 18px rgba(0,0,0,0.35);
    --btn-hover-brightness: 1.08;
    --layout-padding-x: 80;
    --layout-padding-y: 70;
    --layout-gap-x: 70;
    --layout-gap-y: 26;
    --grid-size: 40px;
    --grid-line-color: rgba(255,255,255,0.08);
}

button {
    border-radius: var(--btn-radius);
    border: var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: var(--btn-font-size);
    font-weight: var(--btn-font-weight);
    padding: var(--btn-padding);
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: filter 140ms ease, transform 140ms ease;
}

button:hover {
    filter: brightness(var(--btn-hover-brightness));
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: none;
}

button.primary {
    background: linear-gradient(135deg, #23d4ff, #0f9eff);
    color: #021019;
}

button.danger {
    background: linear-gradient(135deg, #ff5f6d, #c0392b);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 8px;
    z-index: 30;
}
.mobile-icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.35);
    background: linear-gradient(145deg, rgba(20,120,200,0.95), rgba(12,80,160,0.9));
    color: #eaf4ff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    padding: 0;
}
.mobile-icon-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.mobile-segmented {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.3);
    background: linear-gradient(160deg, rgba(6,24,44,0.9), rgba(6,18,34,0.95));
    box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.25);
}
.mobile-segmented-btn {
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(6,22,40,0.6);
    color: #cfe3ff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.mobile-segmented-btn.is-active {
    background: linear-gradient(135deg, rgba(70,200,255,0.45), rgba(40,140,210,0.55));
    color: #f8fcff;
    border-color: rgba(255,255,255,0.35);
}
.mobile-only {
    display: none;
}
.desktop-only {
    display: inline-flex;
}
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 10, 20, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 45;
}

.app-container {
    position: relative;
    display: flex;
    height: 100vh;
    padding: 12px;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.panel-toggle,
.edge-toggle {
    padding: 0;
    width: 18px;
    height: 40px;
    border-radius: 0;
    border: 1px solid rgba(255,255,255,0.4);
    background: linear-gradient(145deg, rgba(22,140,230,0.95), rgba(10,90,170,0.92));
    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
    cursor: pointer;
    transition: filter 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.panel-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.panel-toggle-sidebar {
    right: -8px;
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.panel-toggle-detail {
    left: -8px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.edge-toggle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
}

.edge-toggle-left {
    left: 0;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.edge-toggle-right {
    right: 0;
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

body.is-sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    border-width: 0;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
}

body.is-sidebar-collapsed .app-container {
    gap: 0;
}

body.is-sidebar-collapsed .edge-toggle-left {
    opacity: 1;
    pointer-events: auto;
}

body.is-detail-collapsed .detail-panel {
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    padding: 0;
    border-width: 0;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
}

body.is-detail-collapsed .content-row {
    gap: 0;
}

body.is-detail-collapsed .edge-toggle-right {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 820px) {
    body {
        overflow: hidden;
    }
    body.is-mobile {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }
    body.is-mobile .mobile-header {
        display: flex;
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    body.is-mobile .app-container {
        flex: 1;
        flex-direction: column;
        height: auto;
        padding: 0 8px calc(8px + env(safe-area-inset-bottom));
        gap: 12px;
    }
    body.is-mobile .content-row {
        flex-direction: column;
        gap: 12px;
    }
    body.is-mobile .main {
        min-height: 0;
    }
    body.is-mobile .panel-toggle,
    body.is-mobile .edge-toggle {
        display: none;
    }
    body.is-mobile .mobile-only {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    body.is-mobile .desktop-only {
        display: none;
    }
    body.is-mobile .graph-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
        border-radius: 0 0 18px 18px;
    }
    body.is-mobile .graph-wrapper {
        border-radius: 24px;
    }
    body.is-mobile .graph-toolbar input {
        flex: 1 1 100%;
    }
    body.is-mobile .graph-toolbar button {
        min-width: 0;
    }
    body.is-mobile .graph-toolbar .mobile-only {
        padding: 6px;
        width: 36px;
        height: 36px;
    }
    body.is-mobile .graph-toolbar .mobile-only svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }
    body.is-mobile .sidebar {
        position: fixed;
        top: calc(8px + env(safe-area-inset-top));
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 8px;
        width: min(86vw, 360px);
        max-width: none;
        min-width: 0;
        transform: translateX(-120%);
        transition: transform 200ms ease;
        z-index: 50;
        border-radius: 22px;
    }
    body.is-mobile .detail-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        top: auto;
        width: min(92vw, 520px);
        margin: 0 auto;
        height: min(75vh, 620px);
        transform: translateY(120%);
        transition: transform 220ms ease;
        z-index: 55;
        border-radius: 24px;
    }
    body.is-mobile.mobile-drawer-open .sidebar {
        transform: translateX(0);
    }
    body.is-mobile.mobile-detail-open .detail-panel {
        transform: translateY(0);
    }
    body.is-mobile.mobile-drawer-open #mobileDrawerOverlay,
    body.is-mobile.mobile-detail-open #mobileDetailOverlay {
        opacity: 1;
        pointer-events: auto;
    }
    body.is-mobile.mobile-detail-open #mobileDetailOverlay {
        z-index: 54;
    }
}

/* ============================================================
   SIDEBAR — Frosted Glass
============================================================ */

.sidebar {
    width: 330px;
    min-width: 290px;
    max-width: 390px;
    padding: 14px;
    border-radius: 18px;
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    background: linear-gradient(145deg, rgba(10,18,30,0.92), rgba(10,18,30,0.80));
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.35),
        inset 0 0 0 0.5px rgba(255,255,255,0.6);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    overflow-x: hidden;
    position: relative;
}

.sidebar-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Add project form */
#projectForm {
    display: flex;
    gap: 6px;
}

#newProjectName {
    flex: 1;
    padding: 6px 8px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(9, 19, 40, 0.25);
    color: #f9fbff;
    font-size: 13px;
}

#projectForm button {
    padding: var(--btn-padding);
    min-width: 78px;
}

/* Search input */
.project-search-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(6,23,39,0.38);
    color: #f9fbff;
    font-size: 13px;
}

/* Search mode toggle */
.search-mode-toggle {
    display: flex;
    gap: 8px;
    font-size: 11px;
    opacity: 0.9;
}
.search-mode-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
}
.search-mode-toggle input[type="radio"] {
    accent-color: #22d1ff;
}

/* Toolbar */
.sidebar-toolbar {
    display: flex;
    gap: 8px;
}
.sidebar-toolbar button {
    flex: 1;
    padding: var(--btn-padding);
    background: var(--btn-bg);
}

/* Project list */
#projectList {
    list-style: none;
    margin: 2px 0 0 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}
#projectList::-webkit-scrollbar { width: 6px; }
#projectList::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 8px;
}
.settings-btn {
    width: 100%;
    padding: var(--btn-padding);
    background: linear-gradient(145deg, rgba(20, 120, 210, 0.85), rgba(10, 70, 150, 0.85));
    border: 1px solid rgba(255,255,255,0.35);
}
.detail-panel::-webkit-scrollbar { width: 6px; }
.detail-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 10, 20, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 999;
}
.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.settings-modal {
    width: min(90vw, 420px);
    border-radius: 16px;
    padding: 18px 20px;
    background: linear-gradient(145deg, rgba(10, 24, 40, 0.96), rgba(6, 18, 32, 0.92));
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
    max-height: min(90vh, 720px);
    overflow-y: auto;
}
.subproject-modal {
    width: min(92vw, 520px);
    border-radius: 16px;
    padding: 18px 20px;
    background: linear-gradient(145deg, rgba(10, 24, 40, 0.96), rgba(6, 18, 32, 0.92));
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
    max-height: min(90vh, 720px);
    overflow-y: auto;
}
.subproject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.subproject-header h3 {
    margin: 0;
    font-size: 16px;
}
.subproject-close {
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(6, 20, 38, 0.7);
    color: #e5efff;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}
.subproject-step[data-hidden="true"] {
    display: none;
}
.subproject-help {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #c9d8f5;
}
.subproject-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.subproject-choice {
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(6, 20, 38, 0.7);
    color: #e5efff;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}
.subproject-choice:hover {
    background: rgba(28,84,138,0.8);
    border-color: rgba(120,200,255,0.7);
    transform: translateY(-1px);
}
.subproject-choice.is-selected {
    background: rgba(32, 96, 156, 0.95);
    border-color: rgba(160,220,255,0.9);
}
.subproject-selected {
    margin-bottom: 10px;
    font-size: 12px;
    color: #a9c7ff;
}
.subproject-empty {
    font-size: 12px;
    color: #9fb2d8;
    padding: 6px 2px;
}
.subproject-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
.subproject-actions button {
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(6, 20, 38, 0.7);
    color: #e5efff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
}
.subproject-actions button:disabled {
    opacity: 0.5;
    cursor: default;
}
.settings-modal::-webkit-scrollbar { width: 6px; }
.settings-modal::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
}
#settingsOverlay {
    align-items: flex-start;
    padding: 24px 12px;
    overflow-y: auto;
}
.settings-modal h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}
.settings-drop {
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(8, 20, 34, 0.6);
}
.settings-drop + .settings-drop {
    margin-top: 10px;
}
.settings-drop summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}
.settings-drop summary::-webkit-details-marker {
    display: none;
}
.settings-drop summary::after {
    content: "▾";
    transition: transform 160ms ease;
}
.settings-drop[open] summary::after {
    transform: rotate(180deg);
}
.settings-drop .settings-group {
    margin-top: 8px;
}
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}
.settings-help {
    font-size: 11px;
    color: #c9d8f5;
    opacity: 0.85;
    line-height: 1.4;
}
.settings-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.settings-option input[type="radio"] {
    accent-color: #22d1ff;
}
.settings-range {
    width: 100%;
    accent-color: #22d1ff;
}
.settings-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-range-row .settings-range {
    flex: 1;
    width: auto;
}
.settings-number {
    width: 72px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(6, 22, 40, 0.85);
    color: #e8f3ff;
    font-size: 12px;
    text-align: right;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}
.settings-number.is-invalid {
    border-color: rgba(255,120,120,0.8);
    box-shadow: 0 0 0 1px rgba(255,120,120,0.6);
}
.notes-width-grid {
    display: grid;
    gap: 6px;
}
.notes-width-row {
    display: grid;
    grid-template-columns: 18px repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
}
.notes-width-row .settings-number {
    width: 100%;
}
.notes-width-head {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}
.notes-width-label {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}
.notes-width-title {
    font-size: 11px;
    opacity: 0.7;
}
.settings-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(6, 22, 40, 0.85);
    color: #e8f3ff;
    font-size: 13px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}

/* Project rows */
.project-item {
    margin-bottom: 4px;
}
.project-row {
    padding: 6px 36px 6px 8px;
    border-radius: 12px;
    background: rgba(10,35,63,0.82);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
    position: relative;
}
.project-row:hover {
    background: rgba(28,84,138,0.95);
    transform: translateY(-1px);
}
.project-item.active > .project-row {
    border-color: rgba(64,205,255,0.95);
    box-shadow: 0 0 0 1px rgba(64,205,255,0.6);
}

.project-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.project-left.no-icon {
    gap: 4px;
}

.project-toggle {
    width: 14px;
    font-size: 11px;
    text-align: center;
    opacity: 0.9;
}
.project-toggle.empty {
    opacity: 0.4;
}

.project-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
    display: block;
}

.project-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    border-radius: 4px;
    background: linear-gradient(145deg, rgba(80,160,255,0.9), rgba(20,100,210,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.project-icon.folder {
    border-radius: 3px;
    background: linear-gradient(145deg, #f0d7aa, #cda16d);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}

.project-icon.project {
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(90,220,255,0.95), rgba(30,150,230,0.9));
}

.project-item.folder > .project-row {
    background: linear-gradient(145deg, rgba(228, 200, 156, 0.65), rgba(190, 154, 108, 0.55));
    border-color: rgba(240, 212, 172, 0.65);
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.24);
}

.project-item.folder > .project-row:hover {
    background: linear-gradient(145deg, rgba(237, 214, 176, 0.78), rgba(201, 166, 120, 0.68));
    border-color: rgba(255, 228, 192, 0.75);
}

/* Connector lines from folder to children */
.project-children::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5px;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(240, 212, 172, 0.75), rgba(200, 160, 110, 0.5));
}
.project-children > .project-item {
    position: relative;
}
.project-children > .project-item::before {
    content: "";
    position: absolute;
    top: 18px;
    left: -14px;
    width: 14px;
    height: 1px;
    background: linear-gradient(to right, rgba(240, 212, 172, 0.75), rgba(200, 160, 110, 0.5));
}
.project-children > .project-item:last-child::after {
    content: "";
    position: absolute;
    left: -9px;
    bottom: -4px;
    width: 1px;
    height: 6px;
    background: linear-gradient(to bottom, rgba(240, 212, 172, 0.55), transparent);
}

/* Project right side */
.project-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(1,15,30,0.7);
    color: #a9c7ff;
}

.project-right {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-left: 20px;
    flex-wrap: wrap;
}

.project-menu-trigger {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(6, 20, 38, 0.7);
    color: #e5efff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: background 140ms ease, border-color 140ms ease, transform 120ms ease, opacity 140ms ease;
}
.project-row:hover .project-menu-trigger,
.project-row:focus-within .project-menu-trigger {
    opacity: 1;
    pointer-events: auto;
}
.project-menu-trigger:hover {
    background: rgba(28,84,138,0.95);
    border-color: rgba(120,200,255,0.7);
    transform: translateY(-1px);
}

.project-menu {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 160px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(8, 20, 35, 0.96);
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 18px 40px rgba(0,0,0,0.4);
    display: none;
    z-index: 9999;
}
.project-menu.open {
    display: block;
}
.project-menu button {
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e7f1ff;
    font-size: 12px;
    cursor: pointer;
}
.project-menu button:hover {
    background: rgba(40, 110, 170, 0.5);
}
.project-menu button.danger {
    color: #ffd4d4;
}

.project-folder-label {
    font-size: 10px;
    color: #a5b7d8;
}


/* Nested rows: keep titles wide by moving actions to a new line */
/* Indented children */
.project-children {
    list-style: none;
    margin: 2px 0 0 16px;
    padding: 0 0 0 14px;
    position: relative;
}

/* Drag target highlight */
.drop-target > .project-row {
    outline: 1px dashed rgba(81,207,255,0.95);
}

/* Inline rename field */
.project-rename-input {
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(3,27,49,0.95);
    color: #f5f7ff;
    font-size: 13px;
    padding: 2px 4px;
    width: 100%;
}

.project-row .project-right {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* ============================================================
   MAIN / GRAPH / DETAIL PANEL
============================================================ */

.main {
    flex: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
}

.content-row {
    display: flex;
    flex: 1;
    gap: 10px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

/* Graph wrapper */
.graph-wrapper {
    flex: 3;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    background: linear-gradient(145deg, rgba(8,34,60,0.82), rgba(3,19,40,0.96));
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.55),
        inset 0 0 0 0.5px rgba(255,255,255,0.25);
    overflow: hidden;
}

#graph-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}
#graph {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: block;
}

.graph-wrapper.grid-enabled #graph-container,
.graph-wrapper.grid-enabled .gantt-container,
.graph-wrapper.grid-enabled .calendar-container {
    background-image:
        linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
    background-size: var(--grid-size-scaled, var(--grid-size)) var(--grid-size-scaled, var(--grid-size));
    background-position: var(--grid-offset-x, 0px) var(--grid-offset-y, 0px);
}

/* Graph toolbar */
.graph-toolbar {
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.22);
    background: linear-gradient(to top, rgba(2,16,32,0.95), rgba(6,26,48,0.9));
}

.graph-toolbar input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(5,28,51,0.8);
    color: #f3f7ff;
    font-size: 13px;
}

.graph-toolbar button {
    padding: var(--btn-padding);
    background: var(--btn-bg);
}

/* Detail panel */
.detail-panel {
    flex: 0 0 290px;
    flex-shrink: 0;
    min-width: 260px;
    padding: 12px;
    border-radius: 18px;
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    background: linear-gradient(165deg, rgba(10,20,34,0.95), rgba(6,14,26,0.88));
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow:
        0 18px 45px rgba(0,0,0,0.4),
        inset 0 0 0 0.6px rgba(255,255,255,0.6);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
    position: relative;
    height: 100%;
    max-height: none;
    min-height: 0;
    position: sticky;
    top: 12px;
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
}

.detail-panel h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-group label {
    font-size: 11px;
    opacity: 0.9;
}

.detail-group input,
.detail-group textarea {
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(10,26,56,0.75);
    color: #f7fbff;
    font-size: 12px;
    padding: 5px 7px;
    resize: none;
    overflow: hidden;
}

.date-time-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.date-time-row input {
    flex: 1 1 auto;
    min-width: 0;
}
.detail-time-input {
    min-width: 96px;
}

.notes-input-wrap {
    position: relative;
}
.notes-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}
.notes-preview {
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(10,26,56,0.75);
    color: #f7fbff;
    font-size: 12px;
    padding: 6px 8px;
    padding-right: 36px;
    padding-bottom: 18px;
    min-height: 50px;
    max-height: none;
    overflow: hidden;
    cursor: pointer;
}
.notes-preview:focus {
    outline: 2px solid rgba(120,170,255,0.45);
    outline-offset: 2px;
}
.notes-preview p {
    margin: 0 0 6px;
}
.notes-preview p:last-child {
    margin-bottom: 0;
}
.notes-preview ul,
.notes-preview ol {
    margin: 0 0 6px 16px;
    padding: 0;
}
.notes-preview li {
    margin: 0 0 2px;
}

.attachments-hint {
    font-size: 10px;
    opacity: 0.7;
}
.attachments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(10, 26, 56, 0.6);
    font-size: 11px;
}
.attachment-name {
    flex: 1 1 auto;
    color: #e8f3ff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-name.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}
.attachment-meta {
    font-size: 10px;
    opacity: 0.75;
}
.attachment-remove,
.attachment-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 24px;
    padding: 0;
    border-radius: 10px;
    border: var(--btn-border);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}
.attachment-remove {
    background: var(--btn-bg-muted);
    color: var(--btn-color);
}
.attachment-download {
    background: rgba(35, 80, 140, 0.45);
    color: #e8f3ff;
    width: 220px;
}
.attachment-download:hover {
    filter: brightness(var(--btn-hover-brightness));
}
.attachment-remove:hover {
    filter: brightness(var(--btn-hover-brightness));
}
.attachment-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    width: 100%;
    justify-content: flex-end;
}
.attachment-empty {
    font-size: 11px;
    opacity: 0.7;
}
.attachment-audio {
    width: 100%;
    height: 28px;
}
.attachment-waveform {
    width: 100%;
    max-width: 260px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(7, 18, 38, 0.65);
}
.attachment-rename {
    flex: 1 1 auto;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(10, 26, 56, 0.6);
    color: #e8f3ff;
    font-size: 11px;
}
.attachment-rename-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}
.attachment-rename-ext {
    font-size: 11px;
    opacity: 0.7;
}
.attachment-warning {
    width: 100%;
    font-size: 10px;
    color: #ffd2d2;
    opacity: 0.85;
}

.voice-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.voice-split {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.voice-split button {
    flex: 1 1 0;
}
.voice-controls button {
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    border: var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: 11px;
    cursor: pointer;
}
.voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.voice-btn-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
}
.voice-btn-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.voice-stop,
.voice-pause {
    min-width: 64px;
}
.voice-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.voice-status {
    font-size: 11px;
    opacity: 0.75;
}
.voice-timer {
    font-size: 11px;
    letter-spacing: 0.5px;
    opacity: 0.85;
}
.voice-meter {
    width: 100%;
    max-width: 260px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(7, 18, 38, 0.65);
}
.voice-status[data-tone="recording"] {
    color: #ffb7b7;
    opacity: 0.95;
}
.voice-status[data-tone="ok"] {
    color: #b6ffd7;
    opacity: 0.95;
}
.voice-status[data-tone="error"] {
    color: #ffb0b0;
    opacity: 0.95;
}

.detail-row {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}
.detail-row .detail-group {
    flex: 1 0 auto;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Subproject row */
.subproject-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.subproject-row button {
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: var(--btn-font-size);
}
.subproject-row button:hover {
    filter: brightness(var(--btn-hover-brightness));
}

/* Completion row */
.completion-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
}
.completion-label {
    opacity: 0.9;
}
.status-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 260px;
    margin: 0 auto;
    transform: translateX(-10px);
}
.status-actions button {
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.status-complete,
.status-pending,
.status-incomplete,
.status-clear {
    padding: 4px 8px;
    border-radius: var(--btn-radius);
    border: var(--btn-border);
    font-size: 11px;
    color: var(--btn-color);
    cursor: pointer;
    box-shadow: var(--btn-shadow);
}
.status-complete {
    background: linear-gradient(135deg, #1fcd8f, #0aa06e);
}
.status-pending {
    background: linear-gradient(135deg, #ffd44d, #d6a500);
    color: #1f1a00;
}
.status-incomplete {
    background: linear-gradient(135deg, #ff5f6d, #c0392b);
}
.status-clear {
    background: var(--btn-bg);
}

/* Detail actions */
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}
.detail-actions button {
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: var(--btn-font-size);
    flex: 1 1 120px;
}
.detail-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 12px;
    background: rgba(8,32,64,0.95);
    overflow: hidden;
}
.detail-dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: var(--btn-border);
    border-radius: var(--btn-radius);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-weight: var(--btn-font-weight);
}
.detail-dropdown .dropdown-caret {
    font-size: 11px;
    opacity: 0.8;
}
.detail-dropdown .dropdown-menu {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.22);
    background: rgba(6,27,53,0.7);
    backdrop-filter: blur(6px);
}
.detail-dropdown.open .dropdown-menu {
    display: flex;
}
.detail-dropdown .dropdown-menu button {
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    background: var(--btn-bg-muted);
    border-radius: var(--btn-radius);
    border: var(--btn-border);
    color: var(--btn-color);
}
.detail-dropdown .dropdown-menu .completion-row {
    justify-content: flex-start;
}
.detail-dropdown .dropdown-menu .detail-group input,
.detail-dropdown .dropdown-menu .detail-group textarea {
    width: 100%;
}
.bubble-color-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.color-selector {
    display: grid;
    grid-template-columns: repeat(5, minmax(36px, 1fr));
    gap: 10px;
    padding: 10px;
    max-width: 320px;
}
.color-selector .color-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.color-selector .color-swatch:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
.color-selector .color-swatch.is-selected {
    outline: 3px solid rgba(0, 0, 0, 0.35);
    outline-offset: 2px;
}
.color-selector .color-swatch:nth-child(1)  { background: #4f6d7a; }
.color-selector .color-swatch:nth-child(2)  { background: #5a7d6c; }
.color-selector .color-swatch:nth-child(3)  { background: rgba(0, 110, 190, 0.85); }
.color-selector .color-swatch:nth-child(4)  { background: #8b5e3c; }
.color-selector .color-swatch:nth-child(5)  { background: #4b6f44; }
.color-selector .color-swatch:nth-child(6)  { background: #7a4f50; }
.color-selector .color-swatch:nth-child(7)  { background: #3f6c7c; }
.color-selector .color-swatch:nth-child(8)  { background: #6a6f4c; }
.color-selector .color-swatch:nth-child(9)  { background: #5c4b7d; }
.color-selector .color-swatch:nth-child(10) { background: #444b5a; }

body[data-theme] .color-selector .color-swatch {
    background: transparent;
}
body[data-theme] .color-selector .color-swatch:nth-child(1)  { background: #4f6d7a; }
body[data-theme] .color-selector .color-swatch:nth-child(2)  { background: #5a7d6c; }
body[data-theme] .color-selector .color-swatch:nth-child(3)  { background: rgba(0, 110, 190, 0.85); }
body[data-theme] .color-selector .color-swatch:nth-child(4)  { background: #8b5e3c; }
body[data-theme] .color-selector .color-swatch:nth-child(5)  { background: #4b6f44; }
body[data-theme] .color-selector .color-swatch:nth-child(6)  { background: #7a4f50; }
body[data-theme] .color-selector .color-swatch:nth-child(7)  { background: #3f6c7c; }
body[data-theme] .color-selector .color-swatch:nth-child(8)  { background: #6a6f4c; }
body[data-theme] .color-selector .color-swatch:nth-child(9)  { background: #5c4b7d; }
body[data-theme] .color-selector .color-swatch:nth-child(10) { background: #444b5a; }

/* ============================================================
   GRAPH ELEMENTS
============================================================ */

.link {
    stroke: rgba(162, 206, 255, 0.7);
    stroke-width: 1.8px;
    stroke-linecap: round;
}
.link-insert-node {
    fill: rgba(255, 220, 100, 0.95);
    stroke: rgba(255, 180, 50, 0.9);
    stroke-width: 2px;
    cursor: grab;
    filter:
        drop-shadow(0 0 8px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 12px rgba(255, 200, 100, 0.5));
    transition: fill 150ms ease, stroke 150ms ease, r 150ms ease;
}
.link-insert-node:hover {
    fill: rgba(255, 240, 150, 1);
    stroke: rgba(255, 200, 80, 1);
    filter:
        drop-shadow(0 0 10px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 16px rgba(255, 220, 120, 0.6));
}
.link-insert-node:active {
    cursor: grabbing;
    fill: rgba(255, 255, 180, 1);
}

/* liquid-glass nodes (rect used for circle & rounded rect) */
.bubble-circle {
    fill: rgba(8, 24, 46, 0.80);
    fill-opacity: 0.95;
    stroke: rgba(255,255,255,0.65);
    stroke-width: 2px;
    filter:
        drop-shadow(0 0 8px rgba(0,0,0,0.5))
        drop-shadow(0 0 10px var(--theme-glow, rgba(0,180,255,0.25)));
}

.bubble-label {
    font-size: 13px;
    fill: #ffffff;
    text-anchor: middle;
    pointer-events: none;
}
.bubble-html {
    pointer-events: none;
    overflow: visible;
}
.bubble-html.allow-voice-controls {
    pointer-events: auto;
}
.bubble-html-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.25;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
    word-break: break-word;
    pointer-events: none;
}
.bubble-measure {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    left: -10000px;
    top: 0;
    height: auto;
    width: auto;
}
.bubble-html-content.with-notes {
    justify-content: flex-start;
}
.bubble-html-content.has-voice-playback {
    pointer-events: auto;
}
.bubble-html-content.has-voice-playback .bubble-html-line,
.bubble-html-content.has-voice-playback .bubble-html-notes,
.bubble-html-content.has-voice-playback .bubble-html-notes * {
    pointer-events: none;
}
.bubble-html-content.has-voice-playback .bubble-html-voice,
.bubble-html-content.has-voice-playback .bubble-html-voice * {
    pointer-events: auto;
}
.bubble-html-content a {
    color: #7fb3ff;
    text-decoration: underline;
}
.bubble-html-line {
    margin: 2px 0;
}
.bubble-html-title {
    font-weight: 600;
}
.bubble-html-notes {
    width: 100%;
    margin-top: 4px;
    text-align: left;
}
.bubble-html-notes-label {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 2px;
}
.bubble-html-notes-body {
    font-size: 12px;
    line-height: 1.3;
}
.bubble-html-notes-body p {
    margin: 0 0 4px;
}
.bubble-html-notes-body p:last-child {
    margin-bottom: 0;
}
.bubble-html-notes-body ul,
.bubble-html-notes-body ol {
    margin: 0 0 4px 16px;
    padding: 0;
}
.bubble-html-notes-body li {
    margin: 0 0 2px;
}
.bubble-html-voice {
    width: 100%;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.bubble-html-voice-label {
    font-size: 11px;
    opacity: 0.85;
}
.bubble-html-voice-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bubble-html-voice-title {
    font-size: 11px;
    opacity: 0.9;
}
.bubble-html-voice-unsupported {
    font-size: 11px;
    opacity: 0.7;
}
.bubble-html-voice-audio {
    width: 100%;
    height: 32px;
    min-height: 32px;
    display: block;
}
.bubble-audio-player {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: center;
    width: 100%;
}
.bubble-audio-play {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(14, 60, 120, 0.75);
    color: #e8f3ff;
    font-size: 10px;
    padding: 3px 8px;
    cursor: pointer;
}
.bubble-audio-progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    overflow: hidden;
    cursor: pointer;
}
.bubble-audio-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: rgba(120, 200, 255, 0.9);
}
.bubble-audio-time {
    font-size: 10px;
    opacity: 0.85;
    white-space: nowrap;
}
.voice-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
.voice-overlay-item {
    position: absolute;
    transform-origin: top left;
    pointer-events: none;
}
.voice-overlay-content {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #ffffff;
    font-size: 11px;
    pointer-events: auto;
}
.bubble-image {
    pointer-events: none;
    opacity: 0.95;
}
.bubble-image-nav {
    fill: #f4f8ff;
    font-size: 16px;
    text-anchor: middle;
    dominant-baseline: middle;
    cursor: pointer;
    pointer-events: all;
    user-select: none;
}
.bubble-image-nav:hover {
    filter: brightness(1.15);
}

.node.collapsed .bubble-circle {
    stroke-dasharray: 3 3;
    opacity: 0.75;
    fill-opacity: 0.75;
}

.node.collapsed .bubble-label {
    opacity: 0;
}

/* Selection is handled via thicker stroke in JS */

/* Responsive tweak */
@media (max-width: 1100px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
    }
    .content-row {
        flex-direction: column;
    }
    .graph-wrapper,
    .detail-panel {
        width: 100%;
        flex: 1 1 auto;
    }
}

/* ============================================================
   GANTT VIEW
   ============================================================ */

.gantt-container {
    flex: 1;
    display: none; /* toggled via JS */
    flex-direction: column;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 0;
}

#gantt-container > * {
    min-height: 0;
}

.gantt-chart-wrap {
    overflow: auto;
}

#ganttChart {
    width: 100%;
    display: block;
}

.gantt-editor {
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.22);
    background: rgba(2,16,32,0.95);
    overflow: auto;
    font-size: 12px;
}

.gantt-editor table {
    width: 100%;
    border-collapse: collapse;
}

.gantt-editor th,
.gantt-editor td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.gantt-editor th {
    text-align: left;
    font-size: 11px;
    opacity: 0.9;
}

.gantt-editor input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(4,22,42,0.9);
    color: #f3f7ff;
    font-size: 11px;
    padding: 3px 5px;
}

.gantt-datetime {
    display: flex;
    gap: 6px;
    align-items: center;
}
.gantt-datetime input {
    flex: 1 1 auto;
    min-width: 0;
}

.gantt-label {
    pointer-events: none;
}

.gantt-bar {
    stroke: rgba(255,255,255,0.7);
    stroke-width: 1px;
}

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.calendar-container {
    flex: 1;
    display: none;
    flex-direction: column;
    background: linear-gradient(145deg, rgba(8,34,60,0.82), rgba(3,19,40,0.96));
    border-top: 1px solid rgba(255,255,255,0.22);
    min-height: 0; /* allow internal scroll without pushing toolbar */
    height: 100%;
    overflow: hidden;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.22);
    background: rgba(2,16,32,0.9);
}
.calendar-controls button {
    padding: 6px 10px;
    background: var(--btn-bg-muted);
    border-radius: var(--btn-radius);
    border: var(--btn-border);
    color: var(--btn-color);
    box-shadow: none;
}
.calendar-title {
    font-weight: 600;
    font-size: 14px;
    margin-left: 8px;
}
.calendar-mode select {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(4,22,42,0.8);
    color: #f3f7ff;
    padding: 4px 6px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(110px, auto);
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 100%;
}

.calendar-day {
    position: relative;
    padding: 8px;
    border-radius: 12px;
    background: rgba(5, 28, 51, 0.7);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 110px;
    max-height: 240px;
    overflow: hidden;
}

.calendar-day.today {
    border-color: rgba(64,205,255,0.85);
    box-shadow: 0 0 0 1px rgba(64,205,255,0.35);
}

.calendar-day.muted {
    opacity: 0.6;
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
}

.calendar-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.calendar-entries::-webkit-scrollbar {
    width: 6px;
}
.calendar-entries::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
}

.calendar-entry {
    padding: 4px 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(64,205,255,0.15), rgba(40,140,200,0.2));
    border: 1px solid rgba(255,255,255,0.18);
    color: #e8f3ff;
    font-size: 11px;
    line-height: 1.3;
}

.calendar-empty {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
}

/* === NEW APPROACH: Dedicated scroll container inside Bubble Details ===
   This guarantees scrolling even when parent heights resolve oddly in flex layouts.
*/
html, body { height: 100%; }
.app-container { height: 100vh; }
.main { min-height: 0; height: 100%; }
.content-row { min-height: 0; height: 100%; }

.detail-panel {
  overflow: hidden;          /* prevent the panel itself from expanding/scrolling */
  min-height: 0;
}

.detail-scroll {
  flex: 1 1 auto;            /* take remaining space under the header */
  min-height: 0;             /* critical for scroll in flex children */
  overflow-y: auto;          /* the one and only scrollbar */
  overflow-x: hidden;
  padding: 6px 2px 12px;     /* breathing room around dropdown blocks */
}
.detail-scroll > * + * {
  margin-top: 12px;          /* consistent spacing between groups */
}

/* Keep dropdowns in normal flow (no internal scrollbars) */
.detail-dropdown .dropdown-menu {
  overflow: visible !important;
  max-height: none !important;
}

/* Notes still auto-grows and never scrolls */
#detailNotes {
  overflow: hidden !important;
  resize: none;
  height: 50px;
  min-height: 50px;
  max-height: none !important;
  padding-right: 36px;
  padding-bottom: 18px;
}

.notes-editor-modal {
    width: min(96vw, 980px);
    max-height: 90vh;
    height: min(90vh, 720px);
    border-radius: 18px;
    padding: 18px 20px 16px;
    background: linear-gradient(160deg, rgba(8, 20, 36, 0.98), rgba(6, 16, 28, 0.92));
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.notes-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.notes-editor-header h3 {
    margin: 0;
    font-size: 16px;
}
.notes-editor-done {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: linear-gradient(135deg, rgba(33, 142, 222, 0.95), rgba(20, 86, 168, 0.9));
    color: #eef6ff;
    font-size: 12px;
    cursor: pointer;
}
.notes-editor-done:hover {
    filter: brightness(1.08);
}

.notes-wysiwyg {
    --notes-bg: #0f1115;
    --notes-panel: #151824;
    --notes-panel2: #1b2030;
    --notes-text: #e7eaf3;
    --notes-muted: #a9b0c3;
    --notes-border: rgba(255,255,255,0.12);
    --notes-focus: rgba(120,170,255,0.45);
    --notes-btn: #232a40;
    --notes-btn-hover: #2d3653;
    --notes-radius: 12px;
    --notes-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
    --notes-sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--notes-text);
    font-family: var(--notes-sans);
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.notes-wysiwyg .editor {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--notes-border);
    border-radius: var(--notes-radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.notes-wysiwyg .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(180deg, var(--notes-panel), var(--notes-panel2));
    border-bottom: 1px solid var(--notes-border);
    align-items: center;
}

.notes-wysiwyg .group {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 10px;
    margin-right: 10px;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.notes-wysiwyg .group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}
.notes-wysiwyg .tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.notes-wysiwyg .tool-label {
    font-size: 10px;
    color: var(--notes-muted);
    line-height: 1;
    white-space: nowrap;
}

.notes-wysiwyg button,
.notes-wysiwyg select {
    background: var(--notes-btn);
    color: var(--notes-text);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    box-shadow: none;
}
.notes-wysiwyg button:hover,
.notes-wysiwyg select:hover {
    background: var(--notes-btn-hover);
}
.notes-wysiwyg button:active {
    transform: translateY(1px);
}
.notes-wysiwyg button[aria-pressed="true"] {
    outline: 2px solid var(--notes-focus);
    border-color: transparent;
}

.notes-wysiwyg .color-palette {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.notes-wysiwyg .swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2) inset;
    cursor: pointer;
    padding: 0;
    background: transparent;
}
.notes-wysiwyg .swatch:focus {
    outline: 2px solid var(--notes-focus);
    outline-offset: 2px;
}
.notes-wysiwyg .bucket {
    position: relative;
}
.notes-wysiwyg #notesFontColorBtn,
.notes-wysiwyg #notesHighlightBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    padding: 0;
}
.notes-wysiwyg #notesFontColorBtn svg,
.notes-wysiwyg #notesHighlightBtn svg {
    display: block;
}
.notes-wysiwyg .bucket-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    padding: 10px;
    background: rgba(20,24,32,0.98);
    border: 1px solid var(--notes-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    z-index: 20;
    display: none;
}
.notes-wysiwyg .bucket-menu[data-open="true"] {
    display: block;
}
.notes-wysiwyg .bucket-title {
    font-size: 12px;
    color: var(--notes-muted);
    margin: 6px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notes-wysiwyg .surface {
    padding: 16px;
    background: rgba(0,0,0,0.18);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.notes-wysiwyg .content {
    min-height: 0;
    height: 100%;
    padding: 14px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(15,17,21,0.55);
    outline: none;
    line-height: 1.55;
    font-size: 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.notes-wysiwyg .content:focus {
    box-shadow: 0 0 0 3px var(--notes-focus);
    border-color: transparent;
}

.notes-wysiwyg .content a {
    color: #7fb3ff;
    text-decoration: underline;
}
.notes-wysiwyg .content h1 {
    font-size: 1.7em;
    margin: 0.6em 0 0.35em;
}
.notes-wysiwyg .content h2 {
    font-size: 1.35em;
    margin: 0.7em 0 0.35em;
}
.notes-wysiwyg .content p {
    margin: 0.6em 0;
}

.notes-wysiwyg .statusbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--notes-border);
    color: var(--notes-muted);
    font-size: 12px;
    align-items: center;
}

.notes-wysiwyg .hint {
    opacity: 0.9;
}
.notes-wysiwyg .notes-status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.notes-wysiwyg .notes-status {
    display: flex;
    align-items: center;
    gap: 12px;
}
.notes-wysiwyg .notes-counter {
    font-family: var(--notes-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}
.notes-wysiwyg .notes-counter.is-limit {
    color: #ffb36b;
}
.notes-wysiwyg .notes-limit-notice {
    display: none;
    color: #ffd7b0;
    font-size: 12px;
    letter-spacing: 0.02em;
}
.notes-wysiwyg .statusbar.is-limit .hint {
    display: none;
}
.notes-wysiwyg .statusbar.is-limit .notes-limit-notice {
    display: block;
}
.notes-wysiwyg .kbd {
    font-family: var(--notes-mono);
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    color: var(--notes-text);
    white-space: nowrap;
}

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

#detailCompletion {
  flex: 1;
  accent-color: #23d3ff;
}

.completion-value {
  font-size: 12px;
  color: #e8f3ff;
  min-width: 36px;
  text-align: right;
}

/* Match Projects scrollbar styling exactly */
.detail-scroll::-webkit-scrollbar { width: 6px; }
.detail-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
}

/* ============================================================
   THEME OVERRIDES
============================================================ */

body[data-theme] {
    color: var(--theme-text);
}
body[data-theme] .background-gradient {
    background: var(--theme-bg-gradient);
}
body[data-theme] .sidebar {
    background: var(--theme-panel);
    border-color: var(--theme-border);
}
body[data-theme] .graph-wrapper {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}
body[data-theme] .detail-panel,
body[data-theme] .settings-modal {
    background: var(--theme-surface-2);
    border-color: var(--theme-border);
}
body[data-theme] .detail-dropdown {
    background: var(--theme-card);
    border-color: var(--theme-border);
}
body[data-theme] .detail-dropdown .dropdown-toggle {
    background: var(--theme-btn);
    border-color: var(--theme-border);
    color: var(--theme-text);
}
body[data-theme] .detail-dropdown .dropdown-menu {
    background: var(--theme-surface-2);
    border-color: var(--theme-border);
}
body[data-theme] .detail-panel h3,
body[data-theme] .settings-modal h3 {
    color: var(--theme-text);
}
body[data-theme] .detail-group label,
body[data-theme] .settings-label {
    color: var(--theme-text);
    color: color-mix(in srgb, var(--theme-text) 80%, transparent);
}
body[data-theme] .notes-preview,
body[data-theme] .detail-group input,
body[data-theme] .detail-group textarea,
body[data-theme] .settings-number,
body[data-theme] .settings-select {
    background: var(--theme-input);
    border-color: var(--theme-border);
    color: var(--theme-text);
}
body[data-theme] .attachments-list .attachment-item,
body[data-theme] .detail-dropdown .dropdown-menu button {
    background: var(--theme-card);
    border-color: var(--theme-border);
    color: var(--theme-text);
}
body[data-theme] .settings-drop {
    background: var(--theme-card);
    border-color: var(--theme-border);
}
body[data-theme] .project-row {
    background: var(--theme-row);
}
body[data-theme] .project-row:hover {
    background: var(--theme-row-hover);
}
body[data-theme] button {
    background: var(--theme-btn);
    border-color: var(--theme-border);
    color: var(--theme-text);
}
body[data-theme] button.danger {
    background: var(--theme-danger);
    border-color: var(--theme-border);
    color: #fff;
}
body[data-theme] input,
body[data-theme] textarea,
body[data-theme] select {
    background: var(--theme-input);
    border-color: var(--theme-border);
    color: var(--theme-text);
}
body[data-theme] .graph-toolbar {
    background: var(--theme-toolbar);
}
body[data-theme] .graph-toolbar input {
    background: var(--theme-input);
}
body[data-theme] .bubble-circle {
    fill: var(--theme-bubble);
    stroke: var(--theme-bubble-stroke);
}

body[data-theme="liquid"] {
    --theme-bg-gradient: radial-gradient(circle at 35% 20%, #1f8fb8 0%, #0b6290 40%, #06334d 80%, #021622 100%);
    --theme-panel: linear-gradient(145deg, rgba(10,18,30,0.92), rgba(10,18,30,0.80));
    --theme-surface: linear-gradient(145deg, rgba(8,34,60,0.82), rgba(3,19,40,0.96));
    --theme-surface-2: linear-gradient(165deg, rgba(10,20,34,0.95), rgba(6,14,26,0.88));
    --theme-card: rgba(8,32,64,0.95);
    --theme-row: rgba(10,35,63,0.82);
    --theme-row-hover: rgba(28,84,138,0.95);
    --theme-border: rgba(255,255,255,0.35);
    --theme-btn: linear-gradient(145deg, rgba(35,160,255,0.95), rgba(15,120,210,0.9));
    --theme-danger: linear-gradient(135deg, #ff5f6d, #c0392b);
    --theme-input: rgba(10,26,56,0.75);
    --theme-text: #e8f3ff;
    --theme-bubble: rgba(8,24,46,0.80);
    --theme-bubble-stroke: rgba(255,255,255,0.65);
    --theme-toolbar: linear-gradient(to top, rgba(2,16,32,0.95), rgba(6,26,48,0.9));
    --theme-glow: rgba(0,180,255,0.25);
}
body[data-theme="aurora"] {
    --theme-bg-gradient: radial-gradient(circle at 20% 15%, #3ddad7 0%, #1b7db8 40%, #0a3a55 75%, #02131e 100%);
    --theme-panel: linear-gradient(145deg, rgba(6,24,32,0.92), rgba(4,18,26,0.82));
    --theme-surface: linear-gradient(145deg, rgba(6,36,44,0.82), rgba(2,18,26,0.95));
    --theme-surface-2: linear-gradient(165deg, rgba(7,28,36,0.95), rgba(4,16,22,0.9));
    --theme-card: rgba(6,34,46,0.95);
    --theme-row: rgba(12,46,56,0.84);
    --theme-row-hover: rgba(18,70,86,0.95);
    --theme-border: rgba(120,255,240,0.3);
    --theme-btn: linear-gradient(135deg, #2be4d6, #1b6fe3);
    --theme-danger: linear-gradient(135deg, #ff7b7b, #d94a4a);
    --theme-input: rgba(8,30,40,0.8);
    --theme-text: #eafcff;
    --theme-bubble: rgba(6,28,36,0.82);
    --theme-bubble-stroke: rgba(160,255,248,0.65);
    --theme-toolbar: linear-gradient(to top, rgba(4,20,28,0.95), rgba(6,30,40,0.9));
    --theme-glow: rgba(61,218,215,0.35);
}
body[data-theme="sunset"] {
    --theme-bg-gradient: radial-gradient(circle at 20% 15%, #ffb36b 0%, #ff7a59 45%, #b3403b 75%, #2b0b0b 100%);
    --theme-panel: linear-gradient(145deg, rgba(40,16,12,0.92), rgba(30,12,10,0.82));
    --theme-surface: linear-gradient(145deg, rgba(48,18,14,0.86), rgba(20,10,10,0.96));
    --theme-surface-2: linear-gradient(165deg, rgba(44,16,12,0.95), rgba(18,10,10,0.9));
    --theme-card: rgba(44,18,14,0.95);
    --theme-row: rgba(52,22,16,0.86);
    --theme-row-hover: rgba(78,32,22,0.96);
    --theme-border: rgba(255,200,160,0.35);
    --theme-btn: linear-gradient(135deg, #ff9159, #e24b4b);
    --theme-danger: linear-gradient(135deg, #ff6b6b, #d4433c);
    --theme-input: rgba(50,20,16,0.8);
    --theme-text: #fff3ea;
    --theme-bubble: rgba(40,16,12,0.82);
    --theme-bubble-stroke: rgba(255,220,190,0.55);
    --theme-toolbar: linear-gradient(to top, rgba(28,12,10,0.95), rgba(40,16,12,0.9));
    --theme-glow: rgba(255,150,110,0.35);
}
body[data-theme="forest"] {
    --theme-bg-gradient: radial-gradient(circle at 25% 20%, #3f8f6b 0%, #1f5a4a 45%, #0b2f2a 75%, #07161a 100%);
    --theme-panel: linear-gradient(145deg, rgba(8,28,24,0.92), rgba(6,20,18,0.84));
    --theme-surface: linear-gradient(145deg, rgba(10,34,28,0.86), rgba(6,18,16,0.96));
    --theme-surface-2: linear-gradient(165deg, rgba(8,26,22,0.95), rgba(6,16,14,0.9));
    --theme-card: rgba(10,30,24,0.95);
    --theme-row: rgba(12,38,32,0.84);
    --theme-row-hover: rgba(18,58,46,0.95);
    --theme-border: rgba(140,220,190,0.3);
    --theme-btn: linear-gradient(135deg, #4bd38f, #1f8f6a);
    --theme-danger: linear-gradient(135deg, #ff7b7b, #c83a3a);
    --theme-input: rgba(10,26,22,0.8);
    --theme-text: #eafff3;
    --theme-bubble: rgba(8,26,22,0.85);
    --theme-bubble-stroke: rgba(170,235,210,0.55);
    --theme-toolbar: linear-gradient(to top, rgba(6,18,16,0.95), rgba(10,28,24,0.9));
    --theme-glow: rgba(95,210,155,0.3);
}
body[data-theme="desert"] {
    --theme-bg-gradient: radial-gradient(circle at 25% 20%, #f5d39a 0%, #d08c5a 45%, #6e3b2a 75%, #1c120c 100%);
    --theme-panel: linear-gradient(145deg, rgba(40,24,16,0.92), rgba(28,18,12,0.84));
    --theme-surface: linear-gradient(145deg, rgba(44,26,18,0.86), rgba(20,12,10,0.96));
    --theme-surface-2: linear-gradient(165deg, rgba(40,24,16,0.95), rgba(18,12,10,0.9));
    --theme-card: rgba(44,26,18,0.95);
    --theme-row: rgba(54,32,20,0.86);
    --theme-row-hover: rgba(86,48,30,0.96);
    --theme-border: rgba(255,215,170,0.35);
    --theme-btn: linear-gradient(135deg, #f0b66a, #c26b3a);
    --theme-danger: linear-gradient(135deg, #ff7b7b, #c54a3a);
    --theme-input: rgba(46,28,18,0.82);
    --theme-text: #fff4e6;
    --theme-bubble: rgba(42,24,16,0.82);
    --theme-bubble-stroke: rgba(255,220,180,0.55);
    --theme-toolbar: linear-gradient(to top, rgba(24,14,10,0.95), rgba(40,24,16,0.9));
    --theme-glow: rgba(240,182,106,0.35);
}
body[data-theme="noir"] {
    --theme-bg-gradient: radial-gradient(circle at 30% 20%, #3a3f45 0%, #1f242a 45%, #0e1116 75%, #050607 100%);
    --theme-panel: linear-gradient(145deg, rgba(12,14,18,0.94), rgba(10,12,16,0.86));
    --theme-surface: linear-gradient(145deg, rgba(16,18,22,0.88), rgba(8,10,12,0.96));
    --theme-surface-2: linear-gradient(165deg, rgba(14,16,20,0.95), rgba(8,10,12,0.9));
    --theme-card: rgba(16,18,22,0.95);
    --theme-row: rgba(20,24,30,0.85);
    --theme-row-hover: rgba(30,36,44,0.95);
    --theme-border: rgba(200,210,225,0.18);
    --theme-btn: linear-gradient(135deg, #5b6572, #2f3540);
    --theme-danger: linear-gradient(135deg, #d95c5c, #9e2f2f);
    --theme-input: rgba(18,22,28,0.85);
    --theme-text: #e7ecf3;
    --theme-bubble: rgba(18,22,28,0.9);
    --theme-bubble-stroke: rgba(200,210,225,0.4);
    --theme-toolbar: linear-gradient(to top, rgba(12,14,18,0.95), rgba(18,22,28,0.9));
    --theme-glow: rgba(170,190,210,0.22);
}
